diff --git a/bin/pax/Makefile b/bin/pax/Makefile index 9b2f6a6db..98945e296 100644 --- a/bin/pax/Makefile +++ b/bin/pax/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.39 2010/04/23 19:41:02 joerg Exp $ +# $NetBSD: Makefile,v 1.41 2019/10/13 07:28:04 mrg Exp $ # @(#)Makefile 8.1 (Berkeley) 5/31/93 .include @@ -23,7 +23,7 @@ LDADD+= -lutil .endif .endif -MAN= pax.1 tar.1 cpio.1 +MAN= pax.1 .if defined(HOSTPROG) CPPFLAGS+= -DHOSTPROG @@ -35,12 +35,14 @@ CPPFLAGS+= -DHAVE_SYS_MTIO_H .if ${MKBSDTAR} == "no" LINKS+= ${BINDIR}/pax ${BINDIR}/tar SYMLINKS+=${BINDIR}/tar /usr/bin/tar +MAN+=tar.1 .if defined(__MINIX) SYMLINKS+=${BINDIR}/tar /usr/bin/bsdtar .endif LINKS+= ${BINDIR}/pax ${BINDIR}/cpio SYMLINKS+=${BINDIR}/cpio /usr/bin/cpio +MAN+=cpio.1 .endif .endif # } ! HOSTPROG @@ -57,4 +59,6 @@ CPPFLAGS+= -DHOSTPROG MLINKS+= pax.1 bsdtar.1 .endif # defined(__MINIX) +COPTS.tar.c+= ${GCC_NO_STRINGOP_TRUNCATION} + .include diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index f5ad892be..a7c5cb855 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $ */ +/* $NetBSD: ar_io.c,v 1.59 2019/02/04 04:36:41 mrg Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,27 +42,27 @@ #if 0 static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $"); +__RCSID("$NetBSD: ar_io.c,v 1.59 2019/02/04 04:36:41 mrg Exp $"); #endif #endif /* not lint */ -#include #include -#include -#include #include #ifdef HAVE_SYS_MTIO_H #include #endif +#include +#include #include -#include -#include -#include -#include -#include #include #include +#include +#include +#include #include +#include +#include +#include #ifdef SUPPORT_RMT #define __RMTLIB_PRIVATE #include @@ -1631,8 +1631,7 @@ void ar_summary(int n) { time_t secs; - int len; - char buf[BUFSIZ]; + char buf[4096]; char tbuf[MAXPATHLEN/4]; /* XXX silly size! */ char s1buf[MAXPATHLEN/8]; /* XXX very silly size! */ char s2buf[MAXPATHLEN/8]; /* XXX very silly size! */ @@ -1657,33 +1656,32 @@ ar_summary(int n) * could have written anything yet. */ if (frmt == NULL && act != COPY) { - len = snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), "unknown format, %s skipped in %s\n", sizefmt(s1buf, sizeof(s1buf), rdcnt), timefmt(tbuf, sizeof(tbuf), rdcnt, secs, "bytes")); if (n == 0) (void)fprintf(outf, "%s: %s", argv0, buf); else - (void)write(STDERR_FILENO, buf, len); + (void)write(STDERR_FILENO, buf, strlen(buf)); return; } if (n != 0 && *archd.name) { - len = snprintf(buf, sizeof(buf), "Working on `%s' (%s)\n", + snprintf(buf, sizeof(buf), "Working on `%s' (%s)\n", archd.name, sizefmt(s1buf, sizeof(s1buf), archd.sb.st_size)); - (void)write(STDERR_FILENO, buf, len); - len = 0; + (void)write(STDERR_FILENO, buf, strlen(buf)); } if (act == COPY) { - len = snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), "%lu files in %s\n", (unsigned long)flcnt, timefmt(tbuf, sizeof(tbuf), flcnt, secs, "files")); } else { - len = snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), "%s vol %d, %lu files, %s read, %s written in %s\n", frmt->name, arvol-1, (unsigned long)flcnt, sizefmt(s1buf, sizeof(s1buf), rdcnt), diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index d4c27514d..e4b97afb2 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -1,4 +1,4 @@ -/* $NetBSD: buf_subs.c,v 1.28 2007/04/29 20:23:34 msaitoh Exp $ */ +/* $NetBSD: buf_subs.c,v 1.29 2018/03/19 03:11:39 msaitoh Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: buf_subs.c,v 1.28 2007/04/29 20:23:34 msaitoh Exp $"); +__RCSID("$NetBSD: buf_subs.c,v 1.29 2018/03/19 03:11:39 msaitoh Exp $"); #endif #endif /* not lint */ @@ -493,7 +493,7 @@ wr_rdbuf(char *out, int outcnt) int cnt; /* - * while there is data to copy copy into the write buffer. when the + * while there is data to copy into the write buffer. when the * write buffer fills, flush it to the archive and continue */ while (outcnt > 0) { diff --git a/bin/pax/cpio.1 b/bin/pax/cpio.1 index 6ecff6466..45f58541c 100644 --- a/bin/pax/cpio.1 +++ b/bin/pax/cpio.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: cpio.1,v 1.14 2015/12/19 18:48:33 wiz Exp $ +.\" $NetBSD: cpio.1,v 1.15 2017/07/03 21:33:23 wiz Exp $ .\" .\" Copyright (c) 1997 SigmaSoft, Th. Lockert .\" All rights reserved. @@ -39,8 +39,8 @@ .Op Fl F Ar archive .Op Fl H Ar format .Op Fl O Ar archive -.Ar "\*[Lt] name-list" -.Op Ar "\*[Gt] archive" +.Ar "< name-list" +.Op Ar "> archive" .Nm cpio .Fl i .Op Fl 6BbcdfmrSstuvZz @@ -50,12 +50,12 @@ .Op Fl H Ar format .Op Fl I Ar archive .Op Ar "pattern ..." -.Op Ar "\*[Lt] archive" +.Op Ar "< archive" .Nm cpio .Fl p .Op Fl adLlmuv .Ar destination-directory -.Ar "\*[Lt] name-list" +.Ar "< name-list" .Sh DESCRIPTION The .Nm diff --git a/bin/pax/dumptar.c b/bin/pax/dumptar.c index 0af32fbba..553870202 100644 --- a/bin/pax/dumptar.c +++ b/bin/pax/dumptar.c @@ -1,4 +1,4 @@ -/* $NetBSD: dumptar.c,v 1.2 2008/04/28 20:22:51 martin Exp $ */ +/* $NetBSD: dumptar.c,v 1.3 2016/05/30 17:34:35 dholland Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,8 +30,12 @@ */ #include -#include +#include +#include +#include #include +#include +#include #include #include @@ -39,20 +43,25 @@ #define ussum(a) 1 +/* + * Ensure null termination. + */ static char * buf(const char *p, size_t s) { static char buf[1024]; - (void)snprintf(buf, sizeof(buf), "%s", p); + + assert(s < sizeof(buf)); + memcpy(buf, p, s); buf[s] = '\0'; return buf; } -int +static int intarg(const char *p, size_t s) { char *ep, *b = buf(p, s); - int r = (int)strtol(p, &ep, 8); + int r = (int)strtol(b, &ep, 8); return r; } diff --git a/bin/pax/extern.h b/bin/pax/extern.h index 298600c2d..254177c50 100644 --- a/bin/pax/extern.h +++ b/bin/pax/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.59 2012/08/09 08:09:21 christos Exp $ */ +/* $NetBSD: extern.h,v 1.60 2020/04/03 16:13:32 joerg Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -204,9 +204,8 @@ void options(int, char **); OPLIST * opt_next(void); int bad_opt(void); int mkpath(char *); -char *chdname; #if !HAVE_NBTOOL_CONFIG_H -int do_chroot; +extern int do_chroot; #endif /* diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index 840bf4980..176a95295 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -1,4 +1,4 @@ -/* $NetBSD: file_subs.c,v 1.63 2013/07/29 17:46:36 christos Exp $ */ +/* $NetBSD: file_subs.c,v 1.64 2019/03/20 03:13:39 gutteridge Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: file_subs.c,v 1.63 2013/07/29 17:46:36 christos Exp $"); +__RCSID("$NetBSD: file_subs.c,v 1.64 2019/03/20 03:13:39 gutteridge Exp $"); #endif #endif /* not lint */ @@ -913,7 +913,7 @@ set_chflags(char *fnm, u_int32_t flags) * actual storage is quite small (the files are sparse). The problem is * the holes read as all zeros so are probably stored on the archive that * way (there is no way to determine if the file block is really a hole, - * we only know that a file block of all zero's can be a hole). + * we only know that a file block of all zeros can be a hole). * At this writing, no major archive format knows how to archive files * with holes. However, on extraction (or during copy, -rw) we have to * deal with these files. Without detecting the holes, the files can @@ -986,7 +986,7 @@ file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz, if (*isempt) { /* * have not written to this block yet, so we keep - * looking for zero's + * looking for zeros */ pt = st; end = st + wcnt; diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c index 1ffa95a36..9228c695f 100644 --- a/bin/pax/gen_subs.c +++ b/bin/pax/gen_subs.c @@ -1,4 +1,4 @@ -/* $NetBSD: gen_subs.c,v 1.36 2012/08/09 08:09:21 christos Exp $ */ +/* $NetBSD: gen_subs.c,v 1.37 2018/11/30 00:53:11 christos Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: gen_subs.c,v 1.36 2012/08/09 08:09:21 christos Exp $"); +__RCSID("$NetBSD: gen_subs.c,v 1.37 2018/11/30 00:53:11 christos Exp $"); #endif #endif /* not lint */ @@ -306,12 +306,10 @@ u32_asc(uintmax_t val, char *str, int len, int base) /* * asc_umax() - * convert hex/octal character string into a uintmax. We do - * not have to to check for overflow! (the headers in all supported - * formats are not large enough to create an overflow). + * convert hex/octal/base-256 value into a uintmax. * NOTE: strings passed to us are NOT TERMINATED. * Return: - * uintmax_t value + * uintmax_t value; UINTMAX_MAX for overflow/negative */ uintmax_t @@ -322,6 +320,30 @@ asc_umax(char *str, int len, int base) stop = str + len; + /* + * if the highest bit of first byte is set, it's base-256 encoded + * (base-256 is basically (n-1)-bit big endian signed + */ + if (str < stop && (*str & 0x80)) { + /* + * uintmax_t can't be negative, so fail on negative numbers + */ + if (*str & 0x40) + return UINTMAX_MAX; + + tval = *str++ & 0x3f; + while (str < stop) { + /* + * check for overflow + */ + if (tval > (UINTMAX_MAX/256)) + return UINTMAX_MAX; + tval = (tval << 8) | ((*str++) & 0xFF); + } + + return tval; + } + /* * skip over leading blanks and zeros */ diff --git a/bin/pax/options.c b/bin/pax/options.c index 1af5fe4b7..8d5bcfcb1 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -1,4 +1,4 @@ -/* $NetBSD: options.c,v 1.116 2015/04/11 15:41:33 christos Exp $ */ +/* $NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: options.c,v 1.116 2015/04/11 15:41:33 christos Exp $"); +__RCSID("$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $"); #endif #endif /* not lint */ @@ -64,6 +64,7 @@ __RCSID("$NetBSD: options.c,v 1.116 2015/04/11 15:41:33 christos Exp $"); #include #include #include +#include #include "pax.h" #include "options.h" #include "cpio.h" @@ -73,9 +74,15 @@ __RCSID("$NetBSD: options.c,v 1.116 2015/04/11 15:41:33 christos Exp $"); #include "mtree.h" #endif /* SMALL */ +char *chdname; +#if !HAVE_NBTOOL_CONFIG_H +int do_chroot; +#endif + /* * Routines which handle command line options */ +struct stat tst; /* Timestamp to set if non-0 */ static int nopids; /* tar mode: suppress "pids" for -p option */ static char flgch[] = FLGCH; /* list of all possible flags (pax) */ @@ -88,6 +95,9 @@ static void printflg(unsigned int); static int c_frmt(const void *, const void *); static off_t str_offt(char *); static char *get_line(FILE *fp); +#ifndef SMALL +static int set_tstamp(const char *, struct stat *); +#endif static void pax_options(int, char **); __dead static void pax_usage(void); static void tar_options(int, char **); @@ -129,8 +139,9 @@ static int get_line_error; #define OPT_SPARSE 16 #define OPT_XZ 17 #define OPT_GNU 18 +#define OPT_TIMESTAMP 19 #if !HAVE_NBTOOL_CONFIG_H -#define OPT_CHROOT 19 +#define OPT_CHROOT 20 #endif /* @@ -251,6 +262,8 @@ struct option pax_longopts[] = { OPT_XZ }, { "gnu", no_argument, 0, OPT_GNU }, + { "timestamp", required_argument, 0, + OPT_TIMESTAMP }, { 0, 0, 0, 0 }, }; @@ -661,6 +674,14 @@ pax_options(int argc, char **argv) case OPT_GNU: is_gnutar = 1; break; +#ifndef SMALL + case OPT_TIMESTAMP: + if (set_tstamp(optarg, &tst) == -1) { + tty_warn(1, "Invalid timestamp `%s'", optarg); + tar_usage(); + } + break; +#endif case '?': default: pax_usage(); @@ -803,6 +824,8 @@ struct option tar_longopts[] = { { "chroot", no_argument, 0, OPT_CHROOT }, #endif + { "timestamp", required_argument, 0, + OPT_TIMESTAMP }, #if 0 /* Not implemented */ { "catenate", no_argument, 0, 'A' }, /* F */ { "concatenate", no_argument, 0, 'A' }, /* F */ @@ -1143,6 +1166,14 @@ tar_options(int argc, char **argv) case OPT_CHROOT: do_chroot = 1; break; +#endif +#ifndef SMALL + case OPT_TIMESTAMP: + if (set_tstamp(optarg, &tst) == -1) { + tty_warn(1, "Invalid timestamp `%s'", optarg); + tar_usage(); + } + break; #endif default: tar_usage(); @@ -2083,6 +2114,43 @@ get_line(FILE *f) return temp; } +#ifndef SMALL +/* + * set_tstamp() + * Use a specific timestamp for all individual files created in the + * archive + */ +static int +set_tstamp(const char *b, struct stat *st) +{ + time_t when; + char *eb; + long long l; + + if (stat(b, st) != -1) + return 0; + +#ifndef HAVE_NBTOOL_CONFIG_H + errno = 0; + if ((when = parsedate(b, NULL, NULL)) == -1 && errno != 0) +#endif + { + errno = 0; + l = strtoll(b, &eb, 0); + if (b == eb || *eb || errno) + return -1; + when = (time_t)l; + } + + st->st_ino = 1; +#if HAVE_STRUCT_STAT_BIRTHTIME + st->st_birthtime = +#endif + st->st_mtime = st->st_ctime = st->st_atime = when; + return 0; +} +#endif + /* * no_op() * for those option functions where the archive format has nothing to do. diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c index fd402e292..05f4874e4 100644 --- a/bin/pax/pat_rep.c +++ b/bin/pax/pat_rep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pat_rep.c,v 1.29 2009/04/07 19:52:35 perry Exp $ */ +/* $NetBSD: pat_rep.c,v 1.31 2019/03/20 02:50:50 gutteridge Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: pat_rep.c,v 1.29 2009/04/07 19:52:35 perry Exp $"); +__RCSID("$NetBSD: pat_rep.c,v 1.31 2019/03/20 02:50:50 gutteridge Exp $"); #endif #endif /* not lint */ @@ -85,12 +85,13 @@ static int resub(regex_t *, regmatch_t *, char *, char *, char *, char *); * parses the -s replacement string; compiles the regular expression * and stores the compiled value and its replacement string together in * replacement string list. Input to this function is of the form: - * /old/new/pg + * /old/new/gps * The first char in the string specifies the delimiter used by this * replacement string. "Old" is a regular expression in "ed" format which * is compiled by regcomp() and is applied to filenames. "new" is the - * substitution string; p and g are options flags for printing and global - * replacement (over the single filename) + * substitution string; g, p, and s are options flags for global + * replacement (over the single filename), printing, and preventing + * substitutions on symbolic link destinations. * Return: * 0 if a proper replacement string and regular expression was added to * the list of replacement patterns; -1 otherwise. @@ -895,7 +896,7 @@ fix_path( char *or_name, int *or_len, char *dir_name, int dir_len) * namelen the size of the name buffer. * nlen is the length of this name (and is modified to hold the length of * the final string). - * prnt is a flag that says whether to print the final result. + * flags contains various options to control behavior. * Return: * 0 if substitution was successful, 1 if we are to skip the file (the name * ended up empty) @@ -924,7 +925,7 @@ rep_name(char *name, size_t namelen, int *nlen, int flags) * (the user already saw that substitution go by) */ pt = rephead; - (void)strcpy(buf1, name); + (void)strlcpy(buf1, name, sizeof(buf1)); inpt = buf1; outpt = nname; endpt = outpt + PAXPATHLEN; diff --git a/bin/pax/pax.1 b/bin/pax/pax.1 index 41f388444..41b9009d9 100644 --- a/bin/pax/pax.1 +++ b/bin/pax/pax.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: pax.1,v 1.63 2013/11/14 07:45:05 wiz Exp $ +.\" $NetBSD: pax.1,v 1.71 2019/03/19 00:36:14 gutteridge Exp $ .\" .\" Copyright (c) 1992 Keith Muller. .\" Copyright (c) 1992, 1993 @@ -33,7 +33,7 @@ .\" .\" @(#)pax.1 8.4 (Berkeley) 4/18/94 .\" -.Dd November 13, 2013 +.Dd March 19, 2019 .Dt PAX 1 .Os .Sh NAME @@ -572,20 +572,21 @@ using the syntax of the .Xr ed 1 utility regular expressions. The format of these regular expressions are: -.Dl /old/new/[gp] +.Dl /old/new/[gps] As in .Xr ed 1 , .Cm old is a basic regular expression and .Cm new -can contain an ampersand (\*[Am]), \en (where n is a digit) back-references, +can contain an ampersand (&), \en (where n is a digit) back-references, or subexpression matching. The .Cm old string may also contain .Aq Dv newline characters. -Any non-null character can be used as a delimiter (/ is shown here). +Any non-null character except a backslash (\\) can be used as a delimiter +(/ is shown here). Multiple .Fl s expressions can be specified. @@ -604,9 +605,14 @@ The optional trailing will cause the final result of a successful substitution to be written to .Dv standard error in the following format: -.Dl Ao "original pathname" Ac \*[Gt]\*[Gt] Ao "new pathname" Ac +.Dl Ao "original pathname" Ac >> Ao "new pathname" Ac File or archive member names that substitute to the empty string are not selected and will be skipped. +The substitutions are applied by default to the destination hard and symbolic +links. +The optional trailing +.Cm s +prevents the substitutions from being performed on symbolic link destinations. .It Fl t Reset the access times of any file or directory read or accessed by .Nm @@ -742,6 +748,19 @@ Typical archive format restrictions include (but are not limited to): file pathname length, file size, link pathname length and the type of the file. .It Fl Fl gnu Recognize GNU tar extensions. +.It Fl Fl timestamp Ar timestamp +Store all modification times in the archive with the +.Ar timestamp +given instead of the actual modification time of the individual archive member +so that repeatable builds are possible. +The +.Ar timestamp +can be a +.Pa pathname , +where the timestamps are derived from that file, a parseable date for +.Xr parsedate 3 +(this option is not yet available in the tools build), or an integer value +interpreted as the number of seconds from the Epoch. .It Fl Fl xz Use .Xr xz 1 @@ -958,11 +977,11 @@ Time comparisons using both file times is useful when is used to create a time based incremental archive (only files that were changed during a specified time range will be archived). .Pp -A time range is made up of six different fields and each field must contain two -digits. +A time range is made up of seven different fields and each field must contain +two digits. The format is: .Dl [[[[[cc]yy]mm]dd]hh]mm[\&.ss] -Where +where .Cm cc is the first two digits of the year (the century), .Cm yy @@ -1277,7 +1296,15 @@ and operations are extensions to the .Tn POSIX standard. +.Sh HISTORY +A +.Nm +utility appeared in +.Bx 4.4 . .Sh AUTHORS -Keith Muller at the University of California, San Diego. -Luke Mewburn implemented +.An -nosplit +.An Keith Muller +at the University of California, San Diego. +.An Luke Mewburn +implemented .Fl M . diff --git a/bin/pax/pax.c b/bin/pax/pax.c index 253d5fc94..5aefef05b 100644 --- a/bin/pax/pax.c +++ b/bin/pax/pax.c @@ -1,4 +1,4 @@ -/* $NetBSD: pax.c,v 1.47 2011/08/29 14:47:48 joerg Exp $ */ +/* $NetBSD: pax.c,v 1.49 2019/04/24 17:27:08 cheusov Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -44,23 +44,23 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\ #if 0 static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: pax.c,v 1.47 2011/08/29 14:47:48 joerg Exp $"); +__RCSID("$NetBSD: pax.c,v 1.49 2019/04/24 17:27:08 cheusov Exp $"); #endif #endif /* not lint */ -#include #include +#include #include #include -#include -#include +#include #include +#include #include -#include +#include #include #include -#include -#include +#include +#include #include #include "pax.h" #include "extern.h" @@ -453,28 +453,28 @@ gen_init(void) if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGHUP, &o_hand, &o_hand) < 0)) + (sigaction(SIGHUP, &o_hand, NULL) < 0)) goto out; if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGTERM, &o_hand, &o_hand) < 0)) + (sigaction(SIGTERM, &o_hand, NULL) < 0)) goto out; if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGINT, &o_hand, &o_hand) < 0)) + (sigaction(SIGINT, &o_hand, NULL) < 0)) goto out; if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGQUIT, &o_hand, &o_hand) < 0)) + (sigaction(SIGQUIT, &o_hand, NULL) < 0)) goto out; #ifdef SIGXCPU if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) && (o_hand.sa_handler == SIG_IGN) && - (sigaction(SIGXCPU, &o_hand, &o_hand) < 0)) + (sigaction(SIGXCPU, &o_hand, NULL) < 0)) goto out; #endif n_hand.sa_handler = SIG_IGN; diff --git a/bin/pax/tar.1 b/bin/pax/tar.1 index 97ac36f43..de735e9a9 100644 --- a/bin/pax/tar.1 +++ b/bin/pax/tar.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: tar.1,v 1.35 2015/04/11 16:22:07 wiz Exp $ +.\" $NetBSD: tar.1,v 1.39 2019/03/19 10:14:46 wiz Exp $ .\" .\" Copyright (c) 1996 SigmaSoft, Th. Lockert .\" All rights reserved. @@ -25,7 +25,7 @@ .\" .\" OpenBSD: tar.1,v 1.28 2000/11/09 23:58:56 aaron Exp .\" -.Dd April 11, 2015 +.Dd March 19, 2019 .Dt TAR 1 .Os .Sh NAME @@ -107,10 +107,10 @@ then the archive will be processed using .It Fl h , Fl Fl dereference Follow symbolic links as if they were normal files or directories. -.It Fl J, Fl Fl xz +.It Fl J , Fl Fl xz Compress/decompress archive using .Xr xz 1 . -.It Fl j, Fl Fl bzip2, Fl Fl bunzip2 +.It Fl j , Fl Fl bzip2 , Fl Fl bunzip2 Use .Xr bzip2 1 for compression of the archive. @@ -170,14 +170,15 @@ As in .Cm old is a basic regular expression and .Cm new -can contain an ampersand (\*[Am]), \en (where n is a digit) back-references, +can contain an ampersand (&), \en (where n is a digit) back-references, or subexpression matching. The .Cm old string may also contain .Aq Dv newline characters. -Any non-null character can be used as a delimiter (/ is shown here). +Any non-null character except a backslash (\\) can be used as a delimiter +(/ is shown here). Multiple .Fl s expressions can be specified. @@ -196,7 +197,7 @@ The optional trailing will cause the final result of a successful substitution to be written to .Dv standard error in the following format: -.Dl \*[Lt]original pathname\*[Gt] \*[Gt]\*[Gt] \*[Lt]new pathname\*[Gt] +.Dl Ao "original pathname" Ac >> Ao "new pathname" Ac File or archive member names that substitute to the empty string are not selected and will be skipped. The substitutions are applied by default to the destination hard and symbolic @@ -297,6 +298,19 @@ can be processed. Cause files of type directory being copied or archived, or archive members of type directory being extracted, to match only the directory file or archive member and not the file hierarchy rooted at the directory. +.It Fl Fl timestamp Ar timestamp +Store all modification times in the archive with the +.Ar timestamp +given instead of the actual modification time of the individual archive member +so that repeatable builds are possible. +The +.Ar timestamp +can be a +.Pa pathname , +where the timestamps are derived from that file, a parseable date for +.Xr parsedate 3 +(this option is not yet available in the tools build), or an integer value +interpreted as the number of seconds from the Epoch. .El .Pp The options diff --git a/bin/pax/tar.c b/bin/pax/tar.c index f4d57d41f..513846f4e 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -1,4 +1,4 @@ -/* $NetBSD: tar.c,v 1.72 2015/06/16 22:31:08 christos Exp $ */ +/* $NetBSD: tar.c,v 1.75 2019/03/20 03:13:39 gutteridge Exp $ */ /*- * Copyright (c) 1992 Keith Muller. @@ -42,7 +42,7 @@ #if 0 static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94"; #else -__RCSID("$NetBSD: tar.c,v 1.72 2015/06/16 22:31:08 christos Exp $"); +__RCSID("$NetBSD: tar.c,v 1.75 2019/03/20 03:13:39 gutteridge Exp $"); #endif #endif /* not lint */ @@ -64,6 +64,8 @@ __RCSID("$NetBSD: tar.c,v 1.72 2015/06/16 22:31:08 christos Exp $"); #include "extern.h" #include "tar.h" +extern struct stat tst; + /* * Routines for reading, writing and header identify of various versions of tar */ @@ -349,7 +351,7 @@ tar_chksm(char *blk, int len) * checksum field as the sum of 8 blanks (which is pre-computed as * BLNKSUM). * ASSUMED: len is greater than CHK_OFFSET. (len is where our 0 padding - * starts, no point in summing zero's) + * starts, no point in summing zeros) */ pt += CHK_LEN; stop = blk + len; @@ -366,7 +368,7 @@ tar_chksm(char *blk, int len) * tar_id() * determine if a block given to us is a valid tar header (and not a USTAR * header). We have to be on the lookout for those pesky blocks of all - * zero's. + * zeros. * Return: * 0 if a tar header, -1 otherwise */ @@ -384,7 +386,7 @@ tar_id(char *blk, int size) uhd = (HD_USTAR *)blk; /* - * check for block of zero's first, a simple and fast test, then make + * check for block of zeros first, a simple and fast test, then make * sure this is not a ustar header by looking for the ustar magic * cookie. We should use TMAGLEN, but some USTAR archive programs are * wrong and create archives missing the \0. Last we check the @@ -484,6 +486,8 @@ tar_rd(ARCHD *arcn, char *buf) arcn->sb.st_uid = (uid_t)asc_u32(hd->uid, sizeof(hd->uid), OCT); arcn->sb.st_gid = (gid_t)asc_u32(hd->gid, sizeof(hd->gid), OCT); arcn->sb.st_size = (off_t)ASC_OFFT(hd->size, sizeof(hd->size), OCT); + if (arcn->sb.st_size == -1) + return -1; arcn->sb.st_mtime = (time_t)(int32_t)asc_u32(hd->mtime, sizeof(hd->mtime), OCT); arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime; @@ -587,6 +591,7 @@ tar_wr(ARCHD *arcn) { HD_TAR *hd; int len; + uintmax_t mtime; char hdblk[sizeof(HD_TAR)]; /* @@ -695,10 +700,11 @@ tar_wr(ARCHD *arcn) /* * copy those fields that are independent of the type */ + mtime = tst.st_ino ? tst.st_mtime : arcn->sb.st_mtime; if (u32_oct((uintmax_t)arcn->sb.st_mode, hd->mode, sizeof(hd->mode), 0) || u32_oct((uintmax_t)arcn->sb.st_uid, hd->uid, sizeof(hd->uid), 0) || u32_oct((uintmax_t)arcn->sb.st_gid, hd->gid, sizeof(hd->gid), 0) || - u32_oct((uintmax_t)arcn->sb.st_mtime, hd->mtime, sizeof(hd->mtime), 1)) + u32_oct(mtime, hd->mtime, sizeof(hd->mtime), 1)) goto out; /* @@ -763,7 +769,7 @@ ustar_stwr(void) /* * ustar_id() * determine if a block given to us is a valid ustar header. We have to - * be on the lookout for those pesky blocks of all zero's + * be on the lookout for those pesky blocks of all zeros * Return: * 0 if a ustar header, -1 otherwise */ @@ -778,7 +784,7 @@ ustar_id(char *blk, int size) hd = (HD_USTAR *)blk; /* - * check for block of zero's first, a simple and fast test then check + * check for block of zeros first, a simple and fast test then check * ustar magic cookie. We should use TMAGLEN, but some USTAR archive * programs are fouled up and create archives missing the \0. Last we * check the checksum. If ok we have to assume it is a valid header. @@ -856,6 +862,8 @@ ustar_rd(ARCHD *arcn, char *buf) arcn->sb.st_mode = (mode_t)(asc_u32(hd->mode, sizeof(hd->mode), OCT) & 0xfff); arcn->sb.st_size = (off_t)ASC_OFFT(hd->size, sizeof(hd->size), OCT); + if (arcn->sb.st_size == -1) + return -1; arcn->sb.st_mtime = (time_t)(int32_t)asc_u32(hd->mtime, sizeof(hd->mtime), OCT); arcn->sb.st_ctime = arcn->sb.st_atime = arcn->sb.st_mtime; @@ -1046,6 +1054,7 @@ ustar_wr(ARCHD *arcn) { HD_USTAR *hd; char *pt; + uintmax_t mtime; char hdblk[sizeof(HD_USTAR)]; const char *user, *group; @@ -1210,7 +1219,8 @@ ustar_wr(ARCHD *arcn) return size_err("UID", arcn); if (u32_oct((uintmax_t)arcn->sb.st_gid, hd->gid, sizeof(hd->gid), 3)) return size_err("GID", arcn); - if (u32_oct((uintmax_t)arcn->sb.st_mtime,hd->mtime,sizeof(hd->mtime),3)) + mtime = tst.st_ino ? tst.st_mtime : arcn->sb.st_mtime; + if (u32_oct(mtime, hd->mtime, sizeof(hd->mtime), 3)) return size_err("MTIME", arcn); user = user_from_uid(arcn->sb.st_uid, 1); group = group_from_gid(arcn->sb.st_gid, 1); @@ -1369,7 +1379,7 @@ tar_gnutar_exclude_one(const char *line, size_t len) } /* - * deal with GNU tar -X/--exclude-from & --exclude switchs. basically, + * deal with GNU tar -X/--exclude-from & --exclude switches. basically, * we go through each line of the file, building a string from the "glob" * lines in the file into RE lines, of the form `/^RE$//', which we pass * to rep_add(), which will add a empty replacement (exclusion), for the diff --git a/distrib/sets/lists/base/mi b/distrib/sets/lists/base/mi index 973d93021..707c80f05 100644 --- a/distrib/sets/lists/base/mi +++ b/distrib/sets/lists/base/mi @@ -2956,6 +2956,11 @@ ./usr/share/i18n/iconv base-sysutil-share ./usr/share/i18n/iconv/iconv.dir base-sysutil-share nls ./usr/share/info base-texinfo-share +./usr/share/installboot base-sysutil-share +./usr/share/installboot/evbarm base-sysutil-share +./usr/share/installboot/evbarm/boards.plist base-sysutil-share +./usr/share/installboot/evbmips base-sysutil-share +./usr/share/installboot/evbmips/boards.plist base-sysutil-share ./usr/share/keymaps base-sys-share ./usr/share/keymaps/amiga base-sys-share ./usr/share/keymaps/atari base-sys-share diff --git a/distrib/sets/lists/base/shl.mi b/distrib/sets/lists/base/shl.mi index 1bbb78c86..8b02437f0 100644 --- a/distrib/sets/lists/base/shl.mi +++ b/distrib/sets/lists/base/shl.mi @@ -187,8 +187,8 @@ ./usr/lib/libavl.so base-zfs-shlib compatfile,zfs ./usr/lib/libavl.so.0 base-zfs-shlib compatfile,zfs ./usr/lib/libavl.so.0.0 base-zfs-shlib compatfile,zfs -./usr/lib/libbfd.so.13 base-sys-shlib compatfile,binutils -./usr/lib/libbfd.so.13.0 base-sys-shlib compatfile,binutils +./usr/lib/libbfd.so.17 base-sys-shlib compatfile,binutils +./usr/lib/libbfd.so.17.0 base-sys-shlib compatfile,binutils ./usr/lib/libbind9.so base-bind-shlib compatfile ./usr/lib/libbind9.so.8 base-bind-shlib compatfile ./usr/lib/libbind9.so.8.2 base-bind-shlib compatfile diff --git a/distrib/sets/lists/comp/ad.arm b/distrib/sets/lists/comp/ad.arm index 55c27b586..726b72164 100644 --- a/distrib/sets/lists/comp/ad.arm +++ b/distrib/sets/lists/comp/ad.arm @@ -663,6 +663,32 @@ ./usr/lib/oabi/libc_vfp.a comp-c-lib compat ./usr/lib/oabi/libc_vfp.so base-sys-shlib compat,pic ./usr/lib/oabi/libc_vfp_p.a comp-c-proflib compat,profile +./usr/libdata/ldscripts/armelf.x comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xbn comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xc comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xd comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xdc comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xdw comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xn comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xr comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xs comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xsc comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xsw comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xu comp-util-bin binutils +./usr/libdata/ldscripts/armelf.xw comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.x comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xbn comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xc comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xd comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xdc comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xdw comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xn comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xr comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xs comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xsc comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xsw comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xu comp-util-bin binutils +./usr/libdata/ldscripts/armelf_minix.xw comp-util-bin binutils ./usr/libdata/lint/llib-larm.ln comp-c-lintlib lint ./usr/libdata/lint/llib-larm32.ln comp-obsolete obsolete ./usr/libdata/lint/llib-lpmc.ln comp-c-lintlib lint diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index d976c05da..b7ccef7d9 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -804,8 +804,8 @@ ./usr/lib/libatf-c.so.0 minix-base atf ./usr/lib/libatf-c.so minix-base atf ./usr/lib/libatf-c_pic.a minix-base atf -./usr/lib/libbfd.so.13.0 minix-base binutils -./usr/lib/libbfd.so.13 minix-base binutils +./usr/lib/libbfd.so.17.0 minix-base binutils +./usr/lib/libbfd.so.17 minix-base binutils ./usr/lib/libbind9.so minix-base ./usr/lib/libbind9.so.8 minix-base ./usr/lib/libbind9.so.8.2 minix-base @@ -882,6 +882,8 @@ ./usr/lib/libgcc_s.so minix-base ./usr/lib/libgcc_s.so.1 minix-base ./usr/lib/libgcc_s.so.1.0 minix-base +./usr/lib/libgnuctf.so.0 minix-base binutils +./usr/lib/libgnuctf.so.0.0 minix-base binutils ./usr/lib/libintl.so minix-base ./usr/lib/libintl.so.1 minix-base ./usr/lib/libintl.so.1.1 minix-base @@ -957,8 +959,8 @@ ./usr/lib/libobjc.so.4 minix-base gcc=5 ./usr/lib/libobjc.so minix-base gcc ./usr/lib/libobjc_pic.a minix-base gcc=5 -./usr/lib/libopcodes.so.6.0 minix-base binutils -./usr/lib/libopcodes.so.6 minix-base binutils +./usr/lib/libopcodes.so.10.0 minix-base binutils +./usr/lib/libopcodes.so.10 minix-base binutils ./usr/lib/libpcap.so minix-base ./usr/lib/libpcap.so.5 minix-base ./usr/lib/libpcap.so.5.1 minix-base @@ -1058,6 +1060,7 @@ ./usr/libdata/debug/usr/tests/minix-posix/blocktest minix-base ./usr/libdata/debug/usr/tests/minix-posix/ddekit minix-base ./usr/libdata/debug/usr/tests/minix-posix/rmibtest minix-base +./usr/libdata/ldscripts minix-base binutils ./usr/libexec minix-base ./usr/libexec/atf-check minix-base atf ./usr/libexec/blacklistd-helper minix-base @@ -1112,7 +1115,7 @@ ./usr/sbin/groupmod minix-base ./usr/sbin/i2cscan minix-base ./usr/sbin/inetd minix-base -./usr/sbin/installboot_nbsd minix-base +./usr/sbin/installboot minix-base ./usr/sbin/kernel minix-base ./usr/sbin/link minix-base ./usr/sbin/lwresd minix-base @@ -2008,6 +2011,11 @@ ./usr/share/info/ld.info minix-base binutils ./usr/share/info/texinfo.info minix-base ./usr/share/info/vi.info minix-base +./usr/share/installboot minix-base +./usr/share/installboot/evbarm minix-base +./usr/share/installboot/evbarm/boards.plist minix-base +./usr/share/installboot/evbmips minix-base +./usr/share/installboot/evbmips/boards.plist minix-base ./usr/share/keymaps minix-base ./usr/share/legal minix-base ./usr/share/legal/COPYRIGHT minix-base diff --git a/distrib/sets/lists/minix-comp/md.evbarm b/distrib/sets/lists/minix-comp/md.evbarm index 8be3b6706..21fa2ef31 100644 --- a/distrib/sets/lists/minix-comp/md.evbarm +++ b/distrib/sets/lists/minix-comp/md.evbarm @@ -88,3 +88,29 @@ ./usr/include/gcc-4.5/arm_neon.h minix-comp gcc=45,gcccmds,obsolete ./usr/include/gcc-4.8/arm_neon.h minix-comp gcc=5,gcccmds ./usr/include/gcc-4.8/unwind-arm-common.h minix-comp gcc=5,gcccmds +./usr/libdata/ldscripts/armelf.x minix-comp binutils +./usr/libdata/ldscripts/armelf.xbn minix-comp binutils +./usr/libdata/ldscripts/armelf.xc minix-comp binutils +./usr/libdata/ldscripts/armelf.xd minix-comp binutils +./usr/libdata/ldscripts/armelf.xdc minix-comp binutils +./usr/libdata/ldscripts/armelf.xdw minix-comp binutils +./usr/libdata/ldscripts/armelf.xn minix-comp binutils +./usr/libdata/ldscripts/armelf.xr minix-comp binutils +./usr/libdata/ldscripts/armelf.xs minix-comp binutils +./usr/libdata/ldscripts/armelf.xsc minix-comp binutils +./usr/libdata/ldscripts/armelf.xsw minix-comp binutils +./usr/libdata/ldscripts/armelf.xu minix-comp binutils +./usr/libdata/ldscripts/armelf.xw minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.x minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xbn minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xc minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xd minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xdc minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xdw minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xn minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xr minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xs minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xsc minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xsw minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xu minix-comp binutils +./usr/libdata/ldscripts/armelf_minix.xw minix-comp binutils diff --git a/distrib/sets/lists/minix-debug/mi b/distrib/sets/lists/minix-debug/mi index fbf022a39..c0c17b287 100644 --- a/distrib/sets/lists/minix-debug/mi +++ b/distrib/sets/lists/minix-debug/mi @@ -637,7 +637,7 @@ ./usr/libdata/debug/usr/sbin/fbdctl.debug minix-debug debug ./usr/libdata/debug/usr/sbin/i2cscan.debug minix-debug debug ./usr/libdata/debug/usr/sbin/inetd.debug minix-debug debug -./usr/libdata/debug/usr/sbin/installboot_nbsd.debug minix-debug debug +./usr/libdata/debug/usr/sbin/installboot.debug minix-debug debug ./usr/libdata/debug/usr/sbin/kernel.debug minix-debug debug ./usr/libdata/debug/usr/sbin/link.debug minix-debug debug ./usr/libdata/debug/usr/sbin/makefs.debug minix-debug debug diff --git a/distrib/sets/lists/minix-man/mi b/distrib/sets/lists/minix-man/mi index 58ac5bd6e..e0dbc82f0 100644 --- a/distrib/sets/lists/minix-man/mi +++ b/distrib/sets/lists/minix-man/mi @@ -3514,7 +3514,7 @@ ./usr/man/man8/inet.8 minix-man obsolete ./usr/man/man8/inetd.8 minix-man ./usr/man/man8/init.8 minix-man -./usr/man/man8/installboot_nbsd.8 minix-man +./usr/man/man8/installboot.8 minix-man ./usr/man/man8/intr.8 minix-man ./usr/man/man8/irdpd.8 minix-man obsolete ./usr/man/man8/link.8 minix-man diff --git a/distrib/sets/lists/tests/mi b/distrib/sets/lists/tests/mi index 42c654bd2..fa7c8c8d4 100644 --- a/distrib/sets/lists/tests/mi +++ b/distrib/sets/lists/tests/mi @@ -3544,114 +3544,828 @@ ./usr/tests/usr.bin/m4/d_m4wrap.m4 tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/m4/d_m4wrap.out tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/m4/t_m4 tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/Atffile tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua -./usr/tests/usr.bin/make/d_comment.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_comment.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_cond1.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_cond1.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_dotwait.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_dotwait.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_export.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_export.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_export_all.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_export_all.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_moderrs.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_moderrs.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modmatch.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modmatch.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modmisc.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modmisc.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modorder.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modorder.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modts.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modts.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modword.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_modword.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_posix.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_posix.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_qequals.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_qequals.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_ternary.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_ternary.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_unmatchedvarparen.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_unmatchedvarparen.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_varcmd.mk tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/d_varcmd.out tests-obsolete obsolete,atf -./usr/tests/usr.bin/make/t_make tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/Makefile tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/comment.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/comment.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/cond1.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/cond1.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/cond2.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/cond2.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/doterror.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/doterror.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/dotwait.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/dotwait.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/error.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/error.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/escape.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/escape.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/export-all.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/export-all.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/export-env.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/export-env.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/export.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/export.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/forloop.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/forloop.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/forsubst.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/forsubst.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/hash.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/hash.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/impsrc.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/impsrc.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/misc.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/misc.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/moderrs.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/moderrs.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modmatch.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modmatch.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modmisc.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modmisc.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modorder.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modorder.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modts.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modts.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modword.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/modword.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/order.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/order.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/phony-end.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/phony-end.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/posix.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/posix.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/posix1.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/posix1.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/qequals.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/qequals.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/suffixes.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/suffixes.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/sunshcmd.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/sunshcmd.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/sysv.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/sysv.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/ternary.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/ternary.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/unexport-env.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/unexport-env.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/unexport.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/unexport.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/varcmd.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/varcmd.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/varmisc.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/varmisc.mk tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/varshell.exp tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/make/unit-tests/varshell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/Atffile tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua +./usr/tests/usr.bin/make/d_comment.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_comment.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_cond1.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_cond1.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_dotwait.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_dotwait.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_export.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_export.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_export_all.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_export_all.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_moderrs.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_moderrs.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modmatch.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modmatch.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modmisc.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modmisc.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modorder.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modorder.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modts.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modts.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modword.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_modword.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_posix.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_posix.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_qequals.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_qequals.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_ternary.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_ternary.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_unmatchedvarparen.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_unmatchedvarparen.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_varcmd.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/d_varcmd.out tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/t_make tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/Makefile tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/archive-suffix.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/archive-suffix.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/archive.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/archive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors-lint.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors-lint.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-errors.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-interrupt.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmd-interrupt.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmdline-redirect-stdin.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmdline-redirect-stdin.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmdline-undefined.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmdline-undefined.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmdline.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cmdline.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/comment.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/comment.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/compat-error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/compat-error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-ge.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-ge.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-gt.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-gt.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-le.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-le.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-lt.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-lt.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-ne.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-ne.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-string.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-string.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-unary.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-cmp-unary.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-eof.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-eof.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-commands.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-commands.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-defined.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-defined.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-empty.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-empty.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-exists.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-exists.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-make-main.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-make-main.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-make.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-make.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-target.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func-target.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-func.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-late.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-late.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-and-lint.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-and-lint.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-and.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-and.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-not.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-not.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-or-lint.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-or-lint.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-or.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-or.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-parentheses.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op-parentheses.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-op.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-short.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-short.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-number.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-number.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-plain.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-plain.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-string.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-string.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-var.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-token-var.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-undef-lint.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond-undef-lint.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond1.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond1.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/cond2.exp obsolete-tests obsolete +./usr/tests/usr.bin/make/unit-tests/cond2.mk obsolete-tests obsolete +./usr/tests/usr.bin/make/unit-tests/counter-append.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/counter-append.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/counter.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/counter.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-colon.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-colon.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-double-colon-indep.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-double-colon-indep.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-double-colon.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-double-colon.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-exclam.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-exclam.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-none.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-none.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-percent.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-percent.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-var.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-var.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-wildcards.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep-wildcards.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dep.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-end.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-end.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-exec.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-exec.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-ignore.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-ignore.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-made.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-made.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-make.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-make.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-meta.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-meta.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-nometa.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-nometa.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-nometa_cmp.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-nometa_cmp.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-nopath.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-nopath.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-notmain.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-notmain.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-optional.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-optional.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-phony.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-phony.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-precious.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-precious.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-recursive.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-recursive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-silent.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-silent.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-use.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-use.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-wait.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc-wait.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/depsrc.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-begin.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-begin.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-default.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-default.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-delete_on_error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-delete_on_error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-all.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-all.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-indirect.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-end.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-ignore.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-ignore.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-interrupt.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-interrupt.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-main.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-main.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-makeflags.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-makeflags.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-no_parallel.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-no_parallel.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-nopath.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-nopath.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-notparallel.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-notparallel.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-objdir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-objdir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-order.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-order.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-path-suffix.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-path-suffix.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-path.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-path.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-phony.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-phony.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-precious.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-precious.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-shell.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-shell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-silent.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-silent.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-stale.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-stale.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-suffixes.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt-suffixes.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/deptgt.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dir-expand-path.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dir-expand-path.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-dinclude.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-dinclude.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elif.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elif.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifdef.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifdef.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifmake.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifmake.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifndef.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifndef.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifnmake.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-elifnmake.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-else.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-else.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-endfor.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-endfor.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-endif.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-endif.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-env.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-env.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-gmake.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-gmake.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-impl.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-impl.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-literal.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export-literal.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-export.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-errors.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-errors.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-escape.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-escape.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-generating-endif.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-generating-endif.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-lines.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-lines.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-null.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for-null.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-for.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-hyphen-include.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-hyphen-include.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-if-nested.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-if-nested.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-if.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-if.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifdef.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifdef.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifmake.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifmake.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifndef.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifndef.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifnmake.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-ifnmake.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-include-fatal.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-include-fatal.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-include.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-include.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-info.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-info.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-misspellings.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-misspellings.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-sinclude.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-sinclude.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-undef.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-undef.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-unexport-env.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-unexport-env.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-unexport.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-unexport.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-warning.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive-warning.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/directives.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/directives.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/dollar.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dollar.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/doterror.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/doterror.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dotwait.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/dotwait.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/envfirst.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/envfirst.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/escape.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/escape.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export-all.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export-all.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export-env.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export-env.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export-variants.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export-variants.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/export.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/forloop.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/forloop.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/forsubst.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/forsubst.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/gnode-submake.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/gnode-submake.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/hanoi-include.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/hanoi-include.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/hash.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/hash.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/impsrc.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/impsrc.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/include-main.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/include-main.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/include-sub.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/include-subsub.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/job-flags.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/job-flags.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-error-indirect.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-error-indirect.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-error-nested-make.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-error-nested-make.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-error-nested.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/jobs-error-nested.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/lint.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/lint.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/make-exported.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/make-exported.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/meta-cmd-cmp.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/meta-cmd-cmp.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/misc.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/misc.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/moderrs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/moderrs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modmatch.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modmatch.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modmisc.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modmisc.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modorder.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/modorder.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/modts.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modts.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modword.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/modword.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/objdir-writable.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/objdir-writable.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-backwards.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-backwards.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-chdir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-chdir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-all.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-all.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-archive.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-archive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-cond.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-cond.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-curdir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-curdir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-dir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-dir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-errors.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-errors.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-file.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-file.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-for.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-for.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-g1.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/opt-debug-g1.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/opt-debug-graph1.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-graph1.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-graph2.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-graph2.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-graph3.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-graph3.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-hash.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-hash.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-lint.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-lint.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-loud.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-loud.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-making.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-making.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-meta.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-meta.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-no-rm.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-no-rm.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-parse.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-parse.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-suff.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-suff.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-targets.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-targets.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-var.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-var.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-varraw.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-varraw.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-x-trace.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug-x-trace.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-debug.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-define.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-define.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-env.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-env.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-file.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-file.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-ignore.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-ignore.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-include-dir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-include-dir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-jobs-internal.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-jobs-internal.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-jobs-no-action.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-jobs-no-action.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-keep-going-multiple.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-keep-going-multiple.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-keep-going.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-keep-going.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-m-include-dir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-m-include-dir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action-at-all.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action-at-all.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action-runflags.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action-runflags.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action-touch.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action-touch.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-no-action.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-query.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-query.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-raw.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-raw.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-silent.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-silent.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-touch-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-touch-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-touch.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-touch.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-tracefile.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-tracefile.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-var-expanded.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-var-expanded.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-var-literal.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-var-literal.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-warnings-as-errors.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-warnings-as-errors.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-where-am-i.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-where-am-i.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-x-reduce-exported.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt-x-reduce-exported.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/opt.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/order.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/order.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/parse-var.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/parse-var.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/phony-end.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/phony-end.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/posix.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/posix.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/posix1.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/posix1.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/qequals.exp tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/unit-tests/qequals.mk tests-obsolete obsolete,atf +./usr/tests/usr.bin/make/unit-tests/recursive.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/recursive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-dots.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-dots.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-errctl.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-errctl.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-flags.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-flags.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-jobs-error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-jobs-error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-leading-at.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-leading-at.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-leading-hyphen.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-leading-hyphen.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-leading-plus.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-leading-plus.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-meta-chars.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-meta-chars.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-multi-line.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-multi-line.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-single-line.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh-single-line.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sh.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-csh.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-csh.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-custom.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-custom.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-ksh.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-ksh.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-sh.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/shell-sh.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-add-later.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-add-later.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-clear-regular.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-clear-regular.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-clear-single.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-clear-single.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-incomplete.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-incomplete.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-lookup.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-lookup.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-main-several.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-main-several.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-main.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-main.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-phony.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-phony.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-rebuild.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-rebuild.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-self.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-self.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-debug.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-debug.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-endless.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-endless.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-expand.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-expand.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-select.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suff-transform-select.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/suffixes.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/suffixes.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/sunshcmd.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sunshcmd.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/sysv.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/sysv.mk tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/ternary.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/ternary.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/unexport-env.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/unexport-env.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/unexport.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/unexport.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/use-inference.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/use-inference.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-cmdline.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-cmdline.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-env.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-env.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-global.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-global.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-local-legacy.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-local-legacy.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-local.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class-local.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-class.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-eval-short.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-eval-short.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-append.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-append.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-assign.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-assign.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-default.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-default.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-expand.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-expand.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-shell.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-shell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-sunsh.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op-sunsh.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-op.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-recursive.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/var-recursive.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varcmd.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varcmd.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/vardebug.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/vardebug.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varfind.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varfind.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmisc.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmisc.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-assign.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-assign.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-defined.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-defined.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-edge.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-edge.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-exclam-shell.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-exclam-shell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-extension.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-extension.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-gmtime.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-gmtime.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-hash.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-hash.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-head.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-head.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-ifelse.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-ifelse.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-indirect.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-indirect.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-l-name-to-value.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-l-name-to-value.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-localtime.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-localtime.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-loop.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-loop.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-match-escape.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-match-escape.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-match.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-match.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-no-match.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-no-match.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-order-reverse.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-order-reverse.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-order-shuffle.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-order-shuffle.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-order.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-order.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-path.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-path.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-quote-dollar.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-quote-dollar.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-quote.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-quote.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-range.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-range.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-remember.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-remember.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-root.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-root.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-select-words.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-select-words.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-shell.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-shell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-subst-regex.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-subst-regex.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-subst.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-subst.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-sun-shell.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-sun-shell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-sysv.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-sysv.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-tail.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-tail.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-abs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-abs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-lower.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-lower.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-many-words.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-many-words.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-one-word.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-one-word.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-separator.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-separator.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-upper.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-to-upper.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-undefined.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-undefined.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-unique.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod-unique.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varmod.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dollar.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dollar.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-alltargets.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-alltargets.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-curdir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-curdir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromdir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromdir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromfile.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-includedfromfile.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-includes.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-includes.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-libs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-libs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-dependfile.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-dependfile.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-expand_variables.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-expand_variables.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-exported.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-exported.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-jobs-prefix.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-jobs-prefix.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-level.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-level.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-makefile_preference.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-makefile_preference.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-makefiles.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-makefiles.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-bailiwick.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-bailiwick.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-created.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-created.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-files.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-files.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-ignore_filter.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-ignore_filter.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-ignore_paths.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-ignore_paths.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-ignore_patterns.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-ignore_patterns.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-prefix.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-meta-prefix.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-mode.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-mode.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-path_filemon.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-path_filemon.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-pid.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-pid.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-ppid.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-ppid.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-save_dollars.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-make-save_dollars.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-makeflags.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-makeflags.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-newline.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-newline.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-objdir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-objdir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-parsedir.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-parsedir.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-parsefile.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-parsefile.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-path.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-path.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-shell.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-shell.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-targets.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-dot-targets.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-empty.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-empty.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-make.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-make.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-make_print_var_on_error-jobs.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-make_print_var_on_error-jobs.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-make_print_var_on_error.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-make_print_var_on_error.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-makefile.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-makefile.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-makeflags.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-makeflags.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-pwd.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-pwd.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-vpath.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname-vpath.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varname.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-dynamic.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-dynamic.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-errors.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-errors.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-mod.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-mod.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-undef-partial.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varparse-undef-partial.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varquote.exp tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varquote.mk tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/make/unit-tests/varshell.exp tests-obsolete obsolete +./usr/tests/usr.bin/make/unit-tests/varshell.mk tests-obsolete obsolete ./usr/tests/usr.bin/mkdep tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/mkdep/Atffile tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/mkdep/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua diff --git a/etc/mtree/NetBSD.dist.base b/etc/mtree/NetBSD.dist.base index 074ce2097..a4d7615ff 100644 --- a/etc/mtree/NetBSD.dist.base +++ b/etc/mtree/NetBSD.dist.base @@ -153,6 +153,7 @@ ./usr/libdata/debug/usr/tests/minix-posix/blocktest ./usr/libdata/debug/usr/tests/minix-posix/ddekit ./usr/libdata/debug/usr/tests/minix-posix/rmibtest +./usr/libdata/ldscripts ./usr/libexec ./usr/log ./usr/man @@ -249,6 +250,9 @@ ./usr/share/i18n/esdb/UTF ./usr/share/i18n/iconv ./usr/share/info +./usr/share/installboot +./usr/share/installboot/evbarm +./usr/share/installboot/evbmips ./usr/share/keymaps ./usr/share/kyua-atf-compat ./usr/share/kyua-cli diff --git a/external/gpl3/binutils/Makefile.inc b/external/gpl3/binutils/Makefile.inc new file mode 100644 index 000000000..31088f147 --- /dev/null +++ b/external/gpl3/binutils/Makefile.inc @@ -0,0 +1,4 @@ +# $NetBSD: Makefile.inc,v 1.2 2016/10/26 18:00:46 christos Exp $ +.include +TOP:= ${.PARSEDIR} +DIST:= ${TOP}/dist diff --git a/external/gpl3/binutils/fetch.sh b/external/gpl3/binutils/fetch.sh index 89100de5c..d11af6aa6 100755 --- a/external/gpl3/binutils/fetch.sh +++ b/external/gpl3/binutils/fetch.sh @@ -5,8 +5,8 @@ echo $0 cd `dirname $0` # Configure fetch method -URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.4.0/binutils-2.23.2.tar.bz2" -BACKUP_URL="http://ftp.gnu.org/gnu/binutils/binutils-2.23.2.tar.bz2" +URL="http://www.minix3.org/pkgsrc/distfiles/minix/3.4.0/binutils-2.34.tar.bz2" +BACKUP_URL="http://ftp.gnu.org/gnu/binutils/binutils-2.34.tar.bz2" FETCH=ftp which curl >/dev/null if [ $? -eq 0 ]; then @@ -16,19 +16,18 @@ fi # Fetch sources if not available if [ ! -d dist ]; then - if [ ! -f binutils-2.23.2.tar.bz2 ]; then + if [ ! -f binutils-2.34.tar.bz2 ]; then $FETCH $URL if [ $? -ne 0 ]; then $FETCH $BACKUP_URL fi fi - tar -oxjf binutils-2.23.2.tar.bz2 && \ - mv binutils-2.23.2 dist && \ + tar -oxjf binutils-2.34.tar.bz2 && \ + mv binutils-2.34 dist && \ cd dist && \ + find . -name testsuite -exec rm -fr {} + && \ + find . -name .gitignore -delete && \ cat ../patches/* | patch -p1 - cp ../files/yyscript.h gold && \ - cp ../files/yyscript.c gold && \ - rm -f ld/configdoc.texi fi diff --git a/external/gpl3/binutils/files/yyscript.c b/external/gpl3/binutils/files/yyscript.c deleted file mode 100644 index cc26466a9..000000000 --- a/external/gpl3/binutils/files/yyscript.c +++ /dev/null @@ -1,3540 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.2" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - - - -/* Copy the first part of user declarations. */ -#line 26 "yyscript.y" /* yacc.c:339 */ - - -#include "config.h" - -#include -#include -#include -#include - -#include "script-c.h" - - -#line 79 "yyscript.c" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "y.tab.h". */ -#ifndef YY_YY_Y_TAB_H_INCLUDED -# define YY_YY_Y_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - PLUSEQ = 258, - MINUSEQ = 259, - MULTEQ = 260, - DIVEQ = 261, - LSHIFTEQ = 262, - RSHIFTEQ = 263, - ANDEQ = 264, - OREQ = 265, - OROR = 266, - ANDAND = 267, - EQ = 268, - NE = 269, - LE = 270, - GE = 271, - LSHIFT = 272, - RSHIFT = 273, - UNARY = 274, - STRING = 275, - QUOTED_STRING = 276, - INTEGER = 277, - ABSOLUTE = 278, - ADDR = 279, - ALIGN_K = 280, - ALIGNOF = 281, - ASSERT_K = 282, - AS_NEEDED = 283, - AT = 284, - BIND = 285, - BLOCK = 286, - BYTE = 287, - CONSTANT = 288, - CONSTRUCTORS = 289, - COPY = 290, - CREATE_OBJECT_SYMBOLS = 291, - DATA_SEGMENT_ALIGN = 292, - DATA_SEGMENT_END = 293, - DATA_SEGMENT_RELRO_END = 294, - DEFINED = 295, - DSECT = 296, - ENTRY = 297, - EXCLUDE_FILE = 298, - EXTERN = 299, - FILL = 300, - FLOAT = 301, - FORCE_COMMON_ALLOCATION = 302, - GLOBAL = 303, - GROUP = 304, - HLL = 305, - INCLUDE = 306, - INHIBIT_COMMON_ALLOCATION = 307, - INFO = 308, - INPUT = 309, - KEEP = 310, - LEN = 311, - LENGTH = 312, - LOADADDR = 313, - LOCAL = 314, - LONG = 315, - MAP = 316, - MAX_K = 317, - MEMORY = 318, - MIN_K = 319, - NEXT = 320, - NOCROSSREFS = 321, - NOFLOAT = 322, - NOLOAD = 323, - ONLY_IF_RO = 324, - ONLY_IF_RW = 325, - ORG = 326, - ORIGIN = 327, - OUTPUT = 328, - OUTPUT_ARCH = 329, - OUTPUT_FORMAT = 330, - OVERLAY = 331, - PHDRS = 332, - PROVIDE = 333, - PROVIDE_HIDDEN = 334, - QUAD = 335, - SEARCH_DIR = 336, - SECTIONS = 337, - SEGMENT_START = 338, - SHORT = 339, - SIZEOF = 340, - SIZEOF_HEADERS = 341, - SORT_BY_ALIGNMENT = 342, - SORT_BY_NAME = 343, - SPECIAL = 344, - SQUAD = 345, - STARTUP = 346, - SUBALIGN = 347, - SYSLIB = 348, - TARGET_K = 349, - TRUNCATE = 350, - VERSIONK = 351, - OPTION = 352, - PARSING_LINKER_SCRIPT = 353, - PARSING_VERSION_SCRIPT = 354, - PARSING_DEFSYM = 355, - PARSING_DYNAMIC_LIST = 356 - }; -#endif -/* Tokens. */ -#define PLUSEQ 258 -#define MINUSEQ 259 -#define MULTEQ 260 -#define DIVEQ 261 -#define LSHIFTEQ 262 -#define RSHIFTEQ 263 -#define ANDEQ 264 -#define OREQ 265 -#define OROR 266 -#define ANDAND 267 -#define EQ 268 -#define NE 269 -#define LE 270 -#define GE 271 -#define LSHIFT 272 -#define RSHIFT 273 -#define UNARY 274 -#define STRING 275 -#define QUOTED_STRING 276 -#define INTEGER 277 -#define ABSOLUTE 278 -#define ADDR 279 -#define ALIGN_K 280 -#define ALIGNOF 281 -#define ASSERT_K 282 -#define AS_NEEDED 283 -#define AT 284 -#define BIND 285 -#define BLOCK 286 -#define BYTE 287 -#define CONSTANT 288 -#define CONSTRUCTORS 289 -#define COPY 290 -#define CREATE_OBJECT_SYMBOLS 291 -#define DATA_SEGMENT_ALIGN 292 -#define DATA_SEGMENT_END 293 -#define DATA_SEGMENT_RELRO_END 294 -#define DEFINED 295 -#define DSECT 296 -#define ENTRY 297 -#define EXCLUDE_FILE 298 -#define EXTERN 299 -#define FILL 300 -#define FLOAT 301 -#define FORCE_COMMON_ALLOCATION 302 -#define GLOBAL 303 -#define GROUP 304 -#define HLL 305 -#define INCLUDE 306 -#define INHIBIT_COMMON_ALLOCATION 307 -#define INFO 308 -#define INPUT 309 -#define KEEP 310 -#define LEN 311 -#define LENGTH 312 -#define LOADADDR 313 -#define LOCAL 314 -#define LONG 315 -#define MAP 316 -#define MAX_K 317 -#define MEMORY 318 -#define MIN_K 319 -#define NEXT 320 -#define NOCROSSREFS 321 -#define NOFLOAT 322 -#define NOLOAD 323 -#define ONLY_IF_RO 324 -#define ONLY_IF_RW 325 -#define ORG 326 -#define ORIGIN 327 -#define OUTPUT 328 -#define OUTPUT_ARCH 329 -#define OUTPUT_FORMAT 330 -#define OVERLAY 331 -#define PHDRS 332 -#define PROVIDE 333 -#define PROVIDE_HIDDEN 334 -#define QUAD 335 -#define SEARCH_DIR 336 -#define SECTIONS 337 -#define SEGMENT_START 338 -#define SHORT 339 -#define SIZEOF 340 -#define SIZEOF_HEADERS 341 -#define SORT_BY_ALIGNMENT 342 -#define SORT_BY_NAME 343 -#define SPECIAL 344 -#define SQUAD 345 -#define STARTUP 346 -#define SUBALIGN 347 -#define SYSLIB 348 -#define TARGET_K 349 -#define TRUNCATE 350 -#define VERSIONK 351 -#define OPTION 352 -#define PARSING_LINKER_SCRIPT 353 -#define PARSING_VERSION_SCRIPT 354 -#define PARSING_DEFSYM 355 -#define PARSING_DYNAMIC_LIST 356 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE -{ -#line 53 "yyscript.y" /* yacc.c:355 */ - - /* A string. */ - struct Parser_string string; - /* A number. */ - uint64_t integer; - /* An expression. */ - Expression_ptr expr; - /* An output section header. */ - struct Parser_output_section_header output_section_header; - /* An output section trailer. */ - struct Parser_output_section_trailer output_section_trailer; - /* A section constraint. */ - enum Section_constraint constraint; - /* A complete input section specification. */ - struct Input_section_spec input_section_spec; - /* A list of wildcard specifications, with exclusions. */ - struct Wildcard_sections wildcard_sections; - /* A single wildcard specification. */ - struct Wildcard_section wildcard_section; - /* A list of strings. */ - String_list_ptr string_list; - /* Information for a program header. */ - struct Phdr_info phdr_info; - /* Used for version scripts and within VERSION {}. */ - struct Version_dependency_list* deplist; - struct Version_expression_list* versyms; - struct Version_tree* versnode; - enum Script_section_type section_type; - -#line 351 "yyscript.c" /* yacc.c:355 */ -}; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int yyparse (void* closure); - -#endif /* !YY_YY_Y_TAB_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 365 "yyscript.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 20 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1329 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 125 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 71 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 234 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 527 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 356 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 121, 2, 2, 2, 31, 18, 2, - 115, 116, 29, 27, 119, 28, 2, 30, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 13, 120, - 21, 7, 22, 12, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 17, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 123, 2, - 2, 122, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 117, 16, 118, 124, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 8, 9, 10, 11, 14, 15, 19, 20, - 23, 24, 25, 26, 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 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 231, 231, 232, 233, 234, 239, 240, 245, 246, - 249, 248, 252, 254, 255, 256, 258, 264, 271, 272, - 275, 274, 278, 281, 280, 284, 285, 286, 294, 302, - 302, 308, 310, 312, 318, 319, 324, 326, 329, 328, - 336, 337, 342, 344, 343, 352, 354, 352, 371, 376, - 381, 386, 391, 396, 405, 407, 412, 417, 422, 432, - 433, 440, 441, 448, 449, 456, 457, 459, 461, 467, - 476, 478, 483, 485, 490, 493, 499, 502, 507, 509, - 515, 516, 517, 519, 521, 523, 530, 531, 533, 539, - 541, 543, 545, 547, 554, 556, 562, 569, 578, 583, - 592, 597, 602, 607, 616, 621, 640, 663, 665, 672, - 674, 679, 689, 691, 692, 694, 700, 701, 706, 710, - 712, 717, 720, 723, 727, 729, 731, 735, 737, 739, - 744, 745, 750, 759, 761, 768, 769, 777, 782, 793, - 802, 804, 810, 816, 822, 828, 834, 840, 846, 852, - 854, 860, 860, 870, 872, 874, 876, 878, 880, 882, - 884, 886, 888, 890, 892, 894, 896, 898, 900, 902, - 904, 906, 908, 910, 912, 914, 916, 918, 920, 922, - 924, 926, 928, 930, 932, 934, 936, 938, 940, 942, - 944, 946, 948, 950, 952, 957, 962, 964, 972, 978, - 988, 991, 992, 996, 1002, 1006, 1007, 1011, 1015, 1020, - 1027, 1031, 1039, 1040, 1042, 1044, 1046, 1055, 1060, 1065, - 1070, 1077, 1076, 1087, 1086, 1093, 1098, 1108, 1110, 1117, - 1118, 1123, 1124, 1129, 1130 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "PLUSEQ", "MINUSEQ", "MULTEQ", "DIVEQ", - "'='", "LSHIFTEQ", "RSHIFTEQ", "ANDEQ", "OREQ", "'?'", "':'", "OROR", - "ANDAND", "'|'", "'^'", "'&'", "EQ", "NE", "'<'", "'>'", "LE", "GE", - "LSHIFT", "RSHIFT", "'+'", "'-'", "'*'", "'/'", "'%'", "UNARY", "STRING", - "QUOTED_STRING", "INTEGER", "ABSOLUTE", "ADDR", "ALIGN_K", "ALIGNOF", - "ASSERT_K", "AS_NEEDED", "AT", "BIND", "BLOCK", "BYTE", "CONSTANT", - "CONSTRUCTORS", "COPY", "CREATE_OBJECT_SYMBOLS", "DATA_SEGMENT_ALIGN", - "DATA_SEGMENT_END", "DATA_SEGMENT_RELRO_END", "DEFINED", "DSECT", - "ENTRY", "EXCLUDE_FILE", "EXTERN", "FILL", "FLOAT", - "FORCE_COMMON_ALLOCATION", "GLOBAL", "GROUP", "HLL", "INCLUDE", - "INHIBIT_COMMON_ALLOCATION", "INFO", "INPUT", "KEEP", "LEN", "LENGTH", - "LOADADDR", "LOCAL", "LONG", "MAP", "MAX_K", "MEMORY", "MIN_K", "NEXT", - "NOCROSSREFS", "NOFLOAT", "NOLOAD", "ONLY_IF_RO", "ONLY_IF_RW", "ORG", - "ORIGIN", "OUTPUT", "OUTPUT_ARCH", "OUTPUT_FORMAT", "OVERLAY", "PHDRS", - "PROVIDE", "PROVIDE_HIDDEN", "QUAD", "SEARCH_DIR", "SECTIONS", - "SEGMENT_START", "SHORT", "SIZEOF", "SIZEOF_HEADERS", - "SORT_BY_ALIGNMENT", "SORT_BY_NAME", "SPECIAL", "SQUAD", "STARTUP", - "SUBALIGN", "SYSLIB", "TARGET_K", "TRUNCATE", "VERSIONK", "OPTION", - "PARSING_LINKER_SCRIPT", "PARSING_VERSION_SCRIPT", "PARSING_DEFSYM", - "PARSING_DYNAMIC_LIST", "'('", "')'", "'{'", "'}'", "','", "';'", "'!'", - "'o'", "'l'", "'~'", "$accept", "top", "linker_script", "file_cmd", - "$@1", "$@2", "$@3", "ignore_cmd", "extern_name_list", "$@4", - "extern_name_list_body", "input_list", "input_list_element", "$@5", - "sections_block", "section_block_cmd", "$@6", "section_header", "$@7", - "$@8", "opt_address_and_section_type", "section_type", "opt_at", - "opt_align", "opt_subalign", "opt_constraint", "section_trailer", - "opt_memspec", "opt_at_memspec", "opt_phdr", "opt_fill", "section_cmds", - "section_cmd", "data_length", "input_section_spec", - "input_section_no_keep", "wildcard_file", "wildcard_sections", - "wildcard_section", "exclude_names", "wildcard_name", - "file_or_sections_cmd", "memory_defs", "memory_def", "memory_attr", - "memory_origin", "memory_length", "phdrs_defs", "phdr_def", "phdr_type", - "phdr_info", "assignment", "parse_exp", "$@9", "exp", "defsym_expr", - "dynamic_list_expr", "dynamic_list_nodes", "dynamic_list_node", - "version_script", "vers_nodes", "vers_node", "verdep", "vers_tag", - "vers_defns", "$@10", "$@11", "string", "end", "opt_semicolon", - "opt_comma", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 61, 262, 263, - 264, 265, 63, 58, 266, 267, 124, 94, 38, 268, - 269, 60, 62, 270, 271, 272, 273, 43, 45, 42, - 47, 37, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 40, 41, 123, 125, 44, - 59, 33, 111, 108, 126 -}; -# endif - -#define YYPACT_NINF -396 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-396))) - -#define YYTABLE_NINF -110 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 155, -396, 42, 90, -106, 13, 1169, -396, -396, 122, - -396, 42, -396, -85, -396, 36, 135, -396, -106, -396, - -396, -68, -55, -46, -396, -396, 90, -396, -37, -29, - 4, 19, 29, 46, 52, 69, 35, 78, 54, 82, - -396, -396, -396, -396, 20, 321, -396, -396, 90, 144, - 202, -6, 103, -396, 122, -396, 105, -396, -396, 90, - -396, 102, -396, 185, -396, 90, 90, -396, 90, 90, - 90, -396, 90, -396, 90, -396, -396, -396, -396, -396, - -396, -396, -396, -396, -396, -396, -396, 111, 135, 135, - 118, 143, 127, -396, 1129, 72, 110, 157, 182, 90, - 185, 210, -396, -63, -396, -396, 84, 186, 108, 40, - 297, 301, 218, -396, 220, 42, 232, -396, -396, -396, - -396, -396, -396, -396, -396, -396, -396, 229, 231, -396, - -396, -396, 90, -3, 1129, 1129, -396, 237, 258, 259, - 262, 263, 289, 300, 302, 303, 304, 305, 306, 309, - 332, 333, 334, 337, 338, -396, 1129, 1129, 1129, 1298, - -396, 335, 90, -396, -396, -5, -396, 120, -396, 339, - -396, -396, 185, -396, 131, -396, -396, 90, -396, -396, - 310, -396, -396, -396, 56, -396, 340, -396, 135, 109, - 143, 343, -396, 25, -396, -396, -396, 1129, 90, 1129, - 90, 1129, 1129, 90, 1129, 1129, 1129, 90, 90, 90, - 1129, 1129, 90, 90, 90, 234, -396, -396, 1129, 1129, - 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, - 1129, 1129, 1129, 1129, 1129, 1129, 1129, -396, 341, 90, - -396, -396, 185, -396, 90, -396, 346, 344, -396, 59, - -396, 349, 351, -396, -396, -396, 321, -396, 336, 455, - -396, -396, -396, 718, 353, 260, 356, 411, 744, 358, - 638, 764, 658, 360, 361, 362, 678, 698, 363, 365, - 366, -396, 1278, 590, 364, 801, 617, 900, 291, 291, - 383, 383, 383, 383, 204, 204, 372, 372, -396, -396, - -396, -396, -396, 125, -396, -27, 467, 90, 368, 59, - 367, 99, -396, -396, -396, 476, 143, 373, 135, 135, - -396, -396, -396, 1129, -396, 90, -396, -396, 1129, -396, - 1129, -396, -396, -396, 1129, 1129, -396, 1129, -396, 1129, - -396, 90, 369, 51, 374, -396, -396, -396, 446, -396, - 376, -396, 1037, 452, 1029, -396, 378, 336, 784, 384, - 821, 847, 867, 887, 924, 1298, 385, -396, -396, -396, - -396, 495, -396, 390, 391, -396, -396, -396, -396, -396, - -396, 504, 392, 404, 485, -396, 37, 143, 406, -396, - -396, -396, -396, -396, -396, -396, -396, -396, 59, 59, - 531, -396, 512, 1129, 416, 427, 520, 418, -396, 417, - -396, -396, -396, -396, 420, -396, -396, 422, 90, 423, - -396, -396, -396, 425, -396, 519, -396, -396, 429, -396, - -396, 430, -396, 20, 12, -396, 950, 1129, 433, -396, - -396, 529, 39, -396, -396, -396, 53, 175, 90, -396, - 507, -396, 15, -396, -396, 970, 1129, -57, -396, -396, - -396, -396, 543, 435, 436, 440, 441, 443, 447, 450, - -396, -396, 534, -396, 451, 444, 453, 454, 176, -396, - -396, -396, 990, -396, -396, -396, -396, -396, 90, -396, - 187, -396, -396, -396, 90, 97, -396, 187, 50, 50, - -396, 21, -396, -396, 461, -396, -396, 90, 417, 180, - -396, 463, 464, 466, -396, -396, -396, -396, -396, -396, - 187, -396, -396, 187, -396, 181, -396 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 7, 0, 0, 0, 0, 2, 227, 228, 212, - 3, 204, 205, 0, 4, 0, 0, 5, 200, 201, - 1, 0, 0, 0, 9, 10, 0, 12, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 27, 6, 26, 25, 0, 0, 217, 218, 225, 0, - 0, 0, 0, 206, 212, 151, 0, 202, 151, 0, - 29, 0, 115, 0, 117, 0, 0, 131, 0, 0, - 0, 20, 0, 23, 0, 230, 229, 113, 151, 151, - 151, 151, 151, 151, 151, 151, 151, 0, 0, 0, - 0, 213, 0, 199, 0, 0, 0, 0, 0, 0, - 0, 0, 38, 234, 34, 36, 234, 0, 0, 0, - 0, 0, 0, 41, 0, 0, 0, 141, 142, 143, - 144, 140, 145, 146, 147, 148, 221, 0, 0, 207, - 219, 220, 226, 0, 0, 0, 177, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 182, 0, 0, 0, 152, - 178, 0, 0, 112, 8, 30, 31, 234, 37, 0, - 13, 233, 0, 14, 120, 28, 16, 0, 18, 130, - 0, 151, 151, 19, 0, 22, 0, 15, 0, 214, - 215, 0, 208, 0, 210, 157, 154, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 156, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 203, 0, 0, - 32, 11, 0, 35, 0, 116, 123, 0, 134, 135, - 133, 0, 0, 21, 40, 42, 45, 24, 232, 0, - 223, 209, 211, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 153, 0, 175, 174, 173, 172, 171, 165, 166, - 169, 170, 167, 168, 163, 164, 161, 162, 158, 159, - 160, 114, 33, 234, 119, 0, 0, 0, 0, 135, - 0, 135, 149, 150, 43, 0, 231, 0, 0, 0, - 190, 185, 191, 0, 183, 0, 193, 189, 0, 196, - 0, 181, 188, 186, 0, 0, 187, 0, 184, 0, - 39, 0, 0, 0, 0, 151, 137, 132, 0, 136, - 0, 48, 0, 59, 0, 222, 0, 232, 0, 0, - 0, 0, 0, 0, 0, 176, 0, 121, 125, 124, - 126, 0, 17, 0, 0, 78, 56, 55, 57, 54, - 58, 0, 0, 0, 61, 50, 0, 216, 0, 192, - 198, 194, 195, 179, 180, 197, 122, 151, 135, 135, - 0, 49, 0, 0, 0, 63, 0, 0, 224, 234, - 139, 138, 111, 110, 0, 93, 85, 0, 0, 0, - 91, 89, 92, 0, 90, 71, 88, 79, 0, 81, - 94, 0, 98, 0, 96, 52, 0, 0, 0, 46, - 51, 0, 0, 151, 151, 87, 0, 0, 0, 44, - 73, 151, 0, 80, 60, 0, 0, 65, 53, 128, - 127, 129, 0, 0, 0, 0, 0, 96, 0, 0, - 109, 70, 0, 75, 0, 0, 0, 0, 234, 101, - 104, 62, 0, 66, 67, 68, 47, 151, 0, 84, - 0, 95, 86, 99, 0, 77, 82, 0, 0, 0, - 97, 0, 64, 118, 0, 72, 151, 0, 234, 234, - 108, 0, 0, 0, 100, 83, 76, 74, 69, 103, - 0, 106, 105, 0, 107, 234, 102 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, - -396, -98, 398, -396, -396, -396, -396, -396, -396, -396, - -396, 196, -396, -396, -396, -396, -396, -396, -396, -396, - -396, -396, -396, -396, -396, 116, -396, -396, -313, 60, - -395, 400, -396, -396, -396, -396, -396, -396, -396, -396, - -299, 188, -44, -396, 136, -396, -396, -396, 567, 471, - -396, 576, -396, 536, -8, -396, -396, -2, 160, 239, - -103 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 5, 6, 41, 61, 113, 115, 42, 98, 99, - 165, 103, 104, 169, 184, 254, 350, 314, 315, 457, - 353, 382, 384, 405, 439, 486, 449, 450, 473, 495, - 508, 400, 427, 428, 429, 430, 431, 478, 479, 509, - 480, 43, 106, 245, 306, 371, 462, 109, 179, 249, - 310, 44, 93, 94, 215, 14, 17, 18, 19, 10, - 11, 12, 193, 51, 52, 188, 319, 160, 77, 317, - 172 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 13, 15, 167, 174, 45, 432, 7, 8, 56, 13, - 346, 16, 349, 20, 96, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 62, 483, 484, 412, 7, 8, - 7, 8, 54, 412, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 55, 413, 485, 87, 58, 7, 8, - 413, 432, 469, 170, 7, 8, 171, 97, 7, 8, - 59, 105, 412, 107, 108, 412, 110, 111, 112, 60, - 114, 475, 116, 7, 8, 7, 8, 513, 63, 413, - 127, 128, 413, 7, 8, 376, 7, 8, 64, 7, - 8, 377, 7, 8, 341, 469, 21, 166, 105, 410, - 411, 308, 510, 378, 506, 130, 131, 180, 459, 460, - 507, 22, 90, 13, 239, 476, 477, 192, 379, 65, - 26, 476, 477, 7, 8, 524, 380, -109, 510, 132, - 191, 194, 7, 8, 66, 368, 369, 251, 252, 75, - 76, 308, 130, 131, 303, 261, 67, 33, 34, 309, - 476, 477, 71, 406, 465, 46, 47, 88, 178, 9, - 238, 68, 461, 240, 7, 8, 132, 69, 46, 47, - 105, 73, 246, 370, 253, 247, 130, 131, 250, 48, - 258, 259, 256, 49, 70, 511, 512, 412, 514, 309, - 161, 262, 48, 72, 50, 244, 264, 74, 266, 412, - 132, 269, 173, 171, 413, 273, 274, 275, 7, 8, - 278, 279, 280, 101, 348, 89, 413, 100, 7, 8, - 7, 8, 468, 91, 176, 95, 102, 177, 126, 162, - 159, 232, 233, 234, 235, 236, 241, 302, 129, 171, - 105, 340, 304, 168, 171, 133, 218, 311, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 1, 2, 3, 4, - 195, 196, 218, 163, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 500, 216, 217, 171, 519, 526, 164, 171, - 171, 373, 175, 342, 181, 344, 442, 311, 182, 311, - 356, 357, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 359, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 263, 183, 265, 185, 267, 268, 366, - 270, 271, 272, 7, 8, 248, 276, 277, 187, 189, - 281, 190, 197, 409, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 198, 199, 501, 322, 200, 201, 323, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 311, 311, 434, 463, - 464, 234, 235, 236, 202, 518, 520, 474, 230, 231, - 232, 233, 234, 235, 236, 203, 445, 204, 205, 206, - 207, 208, 520, 218, 209, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 503, 467, 470, 471, 210, 211, 212, - 470, 354, 213, 214, 242, 237, 316, 301, 257, 358, - 260, 305, 516, 307, 360, 312, 361, 313, 318, 321, - 362, 363, 324, 364, 327, 365, 331, 332, 333, 336, - 343, 374, 338, 345, 337, 367, 504, 347, 470, 351, - 372, 355, 505, 375, 383, 470, 470, 470, 387, 470, - 390, 396, 397, 134, 135, 517, 398, 399, 402, 7, - 8, 136, 137, 138, 139, 140, 141, 401, 470, 403, - 142, 470, 143, 404, 408, 435, 144, 145, 146, 147, - 325, 437, 438, 440, 441, 443, 171, 444, 446, 436, - 447, 448, 458, 412, 451, 452, 148, 149, 456, 472, - 487, 150, 489, 151, 488, 490, 494, 491, -109, 497, - 413, 152, 466, 492, 7, 8, 493, 496, 498, 499, - 243, 414, 153, 455, 154, 155, 415, 515, 416, 521, - 522, 523, 407, 525, 255, 57, 186, 53, 433, 417, - 92, 352, 482, 453, 0, 418, 388, 157, 0, 419, - 158, 0, 0, 0, 420, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 33, 34, 421, 0, 0, 0, 422, 0, - 0, 0, 423, 0, 424, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 425, - 218, 426, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 218, 0, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 218, 0, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 218, 0, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 218, 0, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 0, 0, 0, 0, 0, 0, 218, 328, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 218, 330, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 218, 334, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 0, 335, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 218, 320, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 0, 0, 0, 0, 0, 0, 218, - 326, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 218, - 329, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 218, - 389, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 0, 0, 0, 0, 218, 391, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 0, 0, 0, 0, - 0, 0, 218, 392, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 218, 393, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 218, 394, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 395, 218, 385, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 0, 0, 0, 134, 135, 454, 0, 0, 0, - 7, 8, 136, 137, 138, 139, 140, 141, 0, 0, - 0, 142, 0, 143, 0, 376, 481, 144, 145, 146, - 147, 377, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 378, 0, 0, 502, 148, 149, 0, - 0, 0, 150, 0, 151, 0, 0, 0, 379, 0, - 0, 0, 152, 0, 0, 0, 380, 0, 0, 0, - 0, 0, 0, 153, 0, 154, 155, 0, 0, 0, - 0, 0, 0, 0, 386, 0, 0, 0, 0, 0, - 0, 0, 156, 381, 0, 0, 134, 135, 157, 0, - 0, 158, 7, 8, 136, 137, 138, 139, 140, 141, - 0, 0, 0, 142, 0, 143, 0, 0, 0, 144, - 145, 146, 147, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, - 149, 0, 7, 8, 150, 0, 151, 0, 0, 21, - 0, 0, 0, 0, 152, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 22, 153, 23, 154, 155, 24, - 0, 25, 0, 26, 27, 0, 28, 0, 0, 0, - 0, 0, 0, 0, 156, 29, 0, 0, 0, 0, - 157, 0, 0, 158, 0, 0, 30, 31, 0, 32, - 33, 34, 0, 35, 36, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 0, 38, 39, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, - 218, 339, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 218, 0, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236 -}; - -static const yytype_int16 yycheck[] = -{ - 2, 3, 100, 106, 6, 400, 33, 34, 16, 11, - 309, 117, 311, 0, 58, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 26, 82, 83, 12, 33, 34, - 33, 34, 117, 12, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 7, 29, 102, 48, 115, 33, 34, - 29, 446, 447, 116, 33, 34, 119, 59, 33, 34, - 115, 63, 12, 65, 66, 12, 68, 69, 70, 115, - 72, 56, 74, 33, 34, 33, 34, 56, 115, 29, - 88, 89, 29, 33, 34, 48, 33, 34, 117, 33, - 34, 54, 33, 34, 121, 490, 40, 99, 100, 398, - 399, 42, 497, 66, 7, 33, 34, 109, 69, 70, - 13, 55, 118, 115, 119, 100, 101, 120, 81, 115, - 64, 100, 101, 33, 34, 520, 89, 115, 523, 57, - 132, 133, 33, 34, 115, 84, 85, 181, 182, 119, - 120, 42, 33, 34, 242, 120, 117, 91, 92, 90, - 100, 101, 117, 116, 101, 33, 34, 13, 118, 117, - 162, 115, 123, 165, 33, 34, 57, 115, 33, 34, - 172, 117, 174, 122, 118, 177, 33, 34, 180, 57, - 188, 72, 184, 61, 115, 498, 499, 12, 501, 90, - 118, 193, 57, 115, 72, 64, 198, 115, 200, 12, - 57, 203, 118, 119, 29, 207, 208, 209, 33, 34, - 212, 213, 214, 28, 115, 13, 29, 115, 33, 34, - 33, 34, 47, 120, 116, 120, 41, 119, 117, 119, - 94, 27, 28, 29, 30, 31, 116, 239, 120, 119, - 242, 116, 244, 33, 119, 118, 12, 249, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 111, 112, 113, 114, - 134, 135, 12, 116, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 116, 157, 158, 119, 116, 116, 116, 119, - 119, 345, 116, 305, 7, 307, 409, 309, 7, 311, - 318, 319, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 325, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 197, 116, 199, 116, 201, 202, 341, - 204, 205, 206, 33, 34, 35, 210, 211, 116, 120, - 116, 120, 115, 397, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 115, 115, 478, 116, 115, 115, 119, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 398, 399, 400, 443, - 444, 29, 30, 31, 115, 508, 509, 451, 25, 26, - 27, 28, 29, 30, 31, 115, 418, 115, 115, 115, - 115, 115, 525, 12, 115, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 487, 446, 447, 448, 115, 115, 115, - 452, 315, 115, 115, 115, 120, 120, 116, 118, 323, - 117, 115, 506, 119, 328, 116, 330, 116, 13, 116, - 334, 335, 116, 337, 116, 339, 116, 116, 116, 116, - 13, 35, 116, 115, 119, 116, 488, 120, 490, 13, - 116, 118, 494, 117, 42, 497, 498, 499, 120, 501, - 116, 116, 7, 27, 28, 507, 116, 116, 116, 33, - 34, 35, 36, 37, 38, 39, 40, 13, 520, 115, - 44, 523, 46, 38, 118, 13, 50, 51, 52, 53, - 119, 115, 105, 13, 116, 115, 119, 115, 115, 403, - 115, 22, 13, 12, 115, 115, 70, 71, 115, 42, - 7, 75, 116, 77, 119, 115, 22, 116, 115, 115, - 29, 85, 446, 116, 33, 34, 116, 116, 115, 115, - 172, 40, 96, 437, 98, 99, 45, 116, 47, 116, - 116, 115, 386, 523, 184, 18, 115, 11, 400, 58, - 54, 115, 456, 433, -1, 64, 357, 121, -1, 68, - 124, -1, -1, -1, 73, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 91, 92, 93, -1, -1, -1, 97, -1, - -1, -1, 101, -1, 103, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 118, - 12, 120, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 12, -1, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 12, -1, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 12, -1, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 12, -1, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - -1, -1, -1, -1, -1, -1, 12, 119, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 12, 119, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 12, 119, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, -1, 119, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 12, 116, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, -1, -1, -1, -1, -1, -1, 12, - 116, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 12, - 116, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 12, - 116, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, -1, -1, -1, -1, 12, 116, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, - -1, -1, 12, 116, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 12, 116, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 12, 116, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 116, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, -1, -1, -1, 27, 28, 116, -1, -1, -1, - 33, 34, 35, 36, 37, 38, 39, 40, -1, -1, - -1, 44, -1, 46, -1, 48, 116, 50, 51, 52, - 53, 54, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 66, -1, -1, 116, 70, 71, -1, - -1, -1, 75, -1, 77, -1, -1, -1, 81, -1, - -1, -1, 85, -1, -1, -1, 89, -1, -1, -1, - -1, -1, -1, 96, -1, 98, 99, -1, -1, -1, - -1, -1, -1, -1, 115, -1, -1, -1, -1, -1, - -1, -1, 115, 116, -1, -1, 27, 28, 121, -1, - -1, 124, 33, 34, 35, 36, 37, 38, 39, 40, - -1, -1, -1, 44, -1, 46, -1, -1, -1, 50, - 51, 52, 53, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, - 71, -1, 33, 34, 75, -1, 77, -1, -1, 40, - -1, -1, -1, -1, 85, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 55, 96, 57, 98, 99, 60, - -1, 62, -1, 64, 65, -1, 67, -1, -1, -1, - -1, -1, -1, -1, 115, 76, -1, -1, -1, -1, - 121, -1, -1, 124, -1, -1, 87, 88, -1, 90, - 91, 92, -1, 94, 95, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 107, -1, 109, 110, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 120, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 12, -1, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 111, 112, 113, 114, 126, 127, 33, 34, 117, - 184, 185, 186, 192, 180, 192, 117, 181, 182, 183, - 0, 40, 55, 57, 60, 62, 64, 65, 67, 76, - 87, 88, 90, 91, 92, 94, 95, 107, 109, 110, - 120, 128, 132, 166, 176, 192, 33, 34, 57, 61, - 72, 188, 189, 186, 117, 7, 189, 183, 115, 115, - 115, 129, 192, 115, 117, 115, 115, 117, 115, 115, - 115, 117, 115, 117, 115, 119, 120, 193, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 192, 13, 13, - 118, 120, 188, 177, 178, 120, 177, 192, 133, 134, - 115, 28, 41, 136, 137, 192, 167, 192, 192, 172, - 192, 192, 192, 130, 192, 131, 192, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 117, 189, 189, 120, - 33, 34, 57, 118, 27, 28, 35, 36, 37, 38, - 39, 40, 44, 46, 50, 51, 52, 53, 70, 71, - 75, 77, 85, 96, 98, 99, 115, 121, 124, 179, - 192, 118, 119, 116, 116, 135, 192, 136, 33, 138, - 116, 119, 195, 118, 195, 116, 116, 119, 118, 173, - 192, 7, 7, 116, 139, 116, 184, 116, 190, 120, - 120, 192, 120, 187, 192, 179, 179, 115, 115, 115, - 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, - 115, 115, 115, 115, 115, 179, 179, 179, 12, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 120, 192, 119, - 192, 116, 115, 137, 64, 168, 192, 192, 35, 174, - 192, 177, 177, 118, 140, 166, 192, 118, 189, 72, - 117, 120, 192, 179, 192, 179, 192, 179, 179, 192, - 179, 179, 179, 192, 192, 192, 179, 179, 192, 192, - 192, 116, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 116, 192, 136, 192, 115, 169, 119, 42, 90, - 175, 192, 116, 116, 142, 143, 120, 194, 13, 191, - 116, 116, 116, 119, 116, 119, 116, 116, 119, 116, - 119, 116, 116, 116, 119, 119, 116, 119, 116, 13, - 116, 121, 192, 13, 192, 115, 175, 120, 115, 175, - 141, 13, 115, 145, 179, 118, 189, 189, 179, 192, - 179, 179, 179, 179, 179, 179, 192, 116, 84, 85, - 122, 170, 116, 177, 35, 117, 48, 54, 66, 81, - 89, 116, 146, 42, 147, 13, 115, 120, 194, 116, - 116, 116, 116, 116, 116, 116, 116, 7, 116, 116, - 156, 13, 116, 115, 38, 148, 116, 146, 118, 177, - 175, 175, 12, 29, 40, 45, 47, 58, 64, 68, - 73, 93, 97, 101, 103, 118, 120, 157, 158, 159, - 160, 161, 165, 176, 192, 13, 179, 115, 105, 149, - 13, 116, 195, 115, 115, 192, 115, 115, 22, 151, - 152, 115, 115, 193, 116, 179, 115, 144, 13, 69, - 70, 123, 171, 177, 177, 101, 160, 192, 47, 165, - 192, 192, 42, 153, 177, 56, 100, 101, 162, 163, - 165, 116, 179, 82, 83, 102, 150, 7, 119, 116, - 115, 116, 116, 116, 22, 154, 116, 115, 115, 115, - 116, 195, 116, 177, 192, 192, 7, 13, 155, 164, - 165, 163, 163, 56, 163, 116, 177, 192, 195, 116, - 195, 116, 116, 115, 165, 164, 116 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 125, 126, 126, 126, 126, 127, 127, 128, 128, - 129, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 130, 128, 128, 131, 128, 128, 128, 128, 132, 134, - 133, 135, 135, 135, 136, 136, 137, 137, 138, 137, - 139, 139, 140, 141, 140, 143, 144, 142, 145, 145, - 145, 145, 145, 145, 146, 146, 146, 146, 146, 147, - 147, 148, 148, 149, 149, 150, 150, 150, 150, 151, - 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, - 158, 158, 158, 158, 159, 159, 160, 160, 161, 161, - 162, 162, 162, 162, 163, 163, 163, 164, 164, 165, - 165, 165, 166, 166, 166, 166, 167, 167, 168, 168, - 168, 169, 169, 169, 170, 170, 170, 171, 171, 171, - 172, 172, 173, 174, 174, 175, 175, 175, 175, 175, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 178, 177, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 180, - 181, 182, 182, 183, 184, 185, 185, 186, 186, 186, - 187, 187, 188, 188, 188, 188, 188, 189, 189, 189, - 189, 190, 189, 191, 189, 189, 189, 192, 192, 193, - 193, 194, 194, 195, 195 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 2, 2, 2, 2, 2, 0, 4, 1, - 0, 5, 1, 4, 4, 4, 4, 8, 4, 4, - 0, 5, 4, 0, 5, 1, 1, 1, 4, 0, - 2, 1, 2, 3, 1, 3, 1, 2, 0, 5, - 2, 0, 1, 0, 7, 0, 0, 7, 1, 3, - 2, 4, 4, 5, 1, 1, 1, 1, 1, 0, - 4, 0, 4, 0, 4, 0, 1, 1, 1, 5, - 2, 0, 3, 0, 3, 0, 2, 0, 0, 2, - 2, 1, 4, 6, 4, 1, 4, 2, 1, 1, - 1, 1, 1, 1, 1, 4, 1, 4, 1, 4, - 3, 1, 6, 4, 1, 4, 4, 3, 1, 1, - 1, 1, 4, 2, 6, 2, 3, 0, 10, 2, - 0, 3, 4, 0, 1, 1, 1, 1, 1, 1, - 2, 0, 4, 1, 1, 0, 2, 2, 5, 5, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, - 6, 0, 2, 3, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 5, 1, 1, 6, - 6, 4, 1, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 6, 4, 6, 6, 4, 6, 6, 3, - 1, 1, 2, 5, 1, 1, 2, 4, 5, 6, - 1, 2, 0, 2, 4, 4, 8, 1, 1, 3, - 3, 0, 7, 0, 9, 1, 3, 1, 1, 1, - 1, 1, 0, 1, 0 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (closure, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, closure); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void* closure) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (closure); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void* closure) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, closure); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void* closure) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , closure); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, closure); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void* closure) -{ - YYUSE (yyvaluep); - YYUSE (closure); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void* closure) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, closure); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 9: -#line 247 "yyscript.y" /* yacc.c:1646 */ - { script_set_common_allocation(closure, 1); } -#line 1996 "yyscript.c" /* yacc.c:1646 */ - break; - - case 10: -#line 249 "yyscript.y" /* yacc.c:1646 */ - { script_start_group(closure); } -#line 2002 "yyscript.c" /* yacc.c:1646 */ - break; - - case 11: -#line 251 "yyscript.y" /* yacc.c:1646 */ - { script_end_group(closure); } -#line 2008 "yyscript.c" /* yacc.c:1646 */ - break; - - case 12: -#line 253 "yyscript.y" /* yacc.c:1646 */ - { script_set_common_allocation(closure, 0); } -#line 2014 "yyscript.c" /* yacc.c:1646 */ - break; - - case 15: -#line 257 "yyscript.y" /* yacc.c:1646 */ - { script_parse_option(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 2020 "yyscript.c" /* yacc.c:1646 */ - break; - - case 16: -#line 259 "yyscript.y" /* yacc.c:1646 */ - { - if (!script_check_output_format(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length, - NULL, 0, NULL, 0)) - YYABORT; - } -#line 2030 "yyscript.c" /* yacc.c:1646 */ - break; - - case 17: -#line 265 "yyscript.y" /* yacc.c:1646 */ - { - if (!script_check_output_format(closure, (yyvsp[-5].string).value, (yyvsp[-5].string).length, - (yyvsp[-3].string).value, (yyvsp[-3].string).length, - (yyvsp[-1].string).value, (yyvsp[-1].string).length)) - YYABORT; - } -#line 2041 "yyscript.c" /* yacc.c:1646 */ - break; - - case 19: -#line 273 "yyscript.y" /* yacc.c:1646 */ - { script_add_search_dir(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 2047 "yyscript.c" /* yacc.c:1646 */ - break; - - case 20: -#line 275 "yyscript.y" /* yacc.c:1646 */ - { script_start_sections(closure); } -#line 2053 "yyscript.c" /* yacc.c:1646 */ - break; - - case 21: -#line 277 "yyscript.y" /* yacc.c:1646 */ - { script_finish_sections(closure); } -#line 2059 "yyscript.c" /* yacc.c:1646 */ - break; - - case 22: -#line 279 "yyscript.y" /* yacc.c:1646 */ - { script_set_target(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 2065 "yyscript.c" /* yacc.c:1646 */ - break; - - case 23: -#line 281 "yyscript.y" /* yacc.c:1646 */ - { script_push_lex_into_version_mode(closure); } -#line 2071 "yyscript.c" /* yacc.c:1646 */ - break; - - case 24: -#line 283 "yyscript.y" /* yacc.c:1646 */ - { script_pop_lex_mode(closure); } -#line 2077 "yyscript.c" /* yacc.c:1646 */ - break; - - case 29: -#line 302 "yyscript.y" /* yacc.c:1646 */ - { script_push_lex_into_expression_mode(closure); } -#line 2083 "yyscript.c" /* yacc.c:1646 */ - break; - - case 30: -#line 304 "yyscript.y" /* yacc.c:1646 */ - { script_pop_lex_mode(closure); } -#line 2089 "yyscript.c" /* yacc.c:1646 */ - break; - - case 31: -#line 309 "yyscript.y" /* yacc.c:1646 */ - { script_add_extern(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2095 "yyscript.c" /* yacc.c:1646 */ - break; - - case 32: -#line 311 "yyscript.y" /* yacc.c:1646 */ - { script_add_extern(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2101 "yyscript.c" /* yacc.c:1646 */ - break; - - case 33: -#line 313 "yyscript.y" /* yacc.c:1646 */ - { script_add_extern(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2107 "yyscript.c" /* yacc.c:1646 */ - break; - - case 36: -#line 325 "yyscript.y" /* yacc.c:1646 */ - { script_add_file(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2113 "yyscript.c" /* yacc.c:1646 */ - break; - - case 37: -#line 327 "yyscript.y" /* yacc.c:1646 */ - { script_add_library(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2119 "yyscript.c" /* yacc.c:1646 */ - break; - - case 38: -#line 329 "yyscript.y" /* yacc.c:1646 */ - { script_start_as_needed(closure); } -#line 2125 "yyscript.c" /* yacc.c:1646 */ - break; - - case 39: -#line 331 "yyscript.y" /* yacc.c:1646 */ - { script_end_as_needed(closure); } -#line 2131 "yyscript.c" /* yacc.c:1646 */ - break; - - case 43: -#line 344 "yyscript.y" /* yacc.c:1646 */ - { script_start_output_section(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length, &(yyvsp[0].output_section_header)); } -#line 2137 "yyscript.c" /* yacc.c:1646 */ - break; - - case 44: -#line 346 "yyscript.y" /* yacc.c:1646 */ - { script_finish_output_section(closure, &(yyvsp[0].output_section_trailer)); } -#line 2143 "yyscript.c" /* yacc.c:1646 */ - break; - - case 45: -#line 352 "yyscript.y" /* yacc.c:1646 */ - { script_push_lex_into_expression_mode(closure); } -#line 2149 "yyscript.c" /* yacc.c:1646 */ - break; - - case 46: -#line 354 "yyscript.y" /* yacc.c:1646 */ - { script_pop_lex_mode(closure); } -#line 2155 "yyscript.c" /* yacc.c:1646 */ - break; - - case 47: -#line 356 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = (yyvsp[-5].output_section_header).address; - (yyval.output_section_header).section_type = (yyvsp[-5].output_section_header).section_type; - (yyval.output_section_header).load_address = (yyvsp[-4].expr); - (yyval.output_section_header).align = (yyvsp[-3].expr); - (yyval.output_section_header).subalign = (yyvsp[-2].expr); - (yyval.output_section_header).constraint = (yyvsp[0].constraint); - } -#line 2168 "yyscript.c" /* yacc.c:1646 */ - break; - - case 48: -#line 372 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = NULL; - (yyval.output_section_header).section_type = SCRIPT_SECTION_TYPE_NONE; - } -#line 2177 "yyscript.c" /* yacc.c:1646 */ - break; - - case 49: -#line 377 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = NULL; - (yyval.output_section_header).section_type = SCRIPT_SECTION_TYPE_NONE; - } -#line 2186 "yyscript.c" /* yacc.c:1646 */ - break; - - case 50: -#line 382 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = (yyvsp[-1].expr); - (yyval.output_section_header).section_type = SCRIPT_SECTION_TYPE_NONE; - } -#line 2195 "yyscript.c" /* yacc.c:1646 */ - break; - - case 51: -#line 387 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = (yyvsp[-3].expr); - (yyval.output_section_header).section_type = SCRIPT_SECTION_TYPE_NONE; - } -#line 2204 "yyscript.c" /* yacc.c:1646 */ - break; - - case 52: -#line 392 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = NULL; - (yyval.output_section_header).section_type = (yyvsp[-2].section_type); - } -#line 2213 "yyscript.c" /* yacc.c:1646 */ - break; - - case 53: -#line 397 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_header).address = (yyvsp[-4].expr); - (yyval.output_section_header).section_type = (yyvsp[-2].section_type); - } -#line 2222 "yyscript.c" /* yacc.c:1646 */ - break; - - case 54: -#line 406 "yyscript.y" /* yacc.c:1646 */ - { (yyval.section_type) = SCRIPT_SECTION_TYPE_NOLOAD; } -#line 2228 "yyscript.c" /* yacc.c:1646 */ - break; - - case 55: -#line 408 "yyscript.y" /* yacc.c:1646 */ - { - yyerror(closure, "DSECT section type is unsupported"); - (yyval.section_type) = SCRIPT_SECTION_TYPE_DSECT; - } -#line 2237 "yyscript.c" /* yacc.c:1646 */ - break; - - case 56: -#line 413 "yyscript.y" /* yacc.c:1646 */ - { - yyerror(closure, "COPY section type is unsupported"); - (yyval.section_type) = SCRIPT_SECTION_TYPE_COPY; - } -#line 2246 "yyscript.c" /* yacc.c:1646 */ - break; - - case 57: -#line 418 "yyscript.y" /* yacc.c:1646 */ - { - yyerror(closure, "INFO section type is unsupported"); - (yyval.section_type) = SCRIPT_SECTION_TYPE_INFO; - } -#line 2255 "yyscript.c" /* yacc.c:1646 */ - break; - - case 58: -#line 423 "yyscript.y" /* yacc.c:1646 */ - { - yyerror(closure, "OVERLAY section type is unsupported"); - (yyval.section_type) = SCRIPT_SECTION_TYPE_OVERLAY; - } -#line 2264 "yyscript.c" /* yacc.c:1646 */ - break; - - case 59: -#line 432 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = NULL; } -#line 2270 "yyscript.c" /* yacc.c:1646 */ - break; - - case 60: -#line 434 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[-1].expr); } -#line 2276 "yyscript.c" /* yacc.c:1646 */ - break; - - case 61: -#line 440 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = NULL; } -#line 2282 "yyscript.c" /* yacc.c:1646 */ - break; - - case 62: -#line 442 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[-1].expr); } -#line 2288 "yyscript.c" /* yacc.c:1646 */ - break; - - case 63: -#line 448 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = NULL; } -#line 2294 "yyscript.c" /* yacc.c:1646 */ - break; - - case 64: -#line 450 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[-1].expr); } -#line 2300 "yyscript.c" /* yacc.c:1646 */ - break; - - case 65: -#line 456 "yyscript.y" /* yacc.c:1646 */ - { (yyval.constraint) = CONSTRAINT_NONE; } -#line 2306 "yyscript.c" /* yacc.c:1646 */ - break; - - case 66: -#line 458 "yyscript.y" /* yacc.c:1646 */ - { (yyval.constraint) = CONSTRAINT_ONLY_IF_RO; } -#line 2312 "yyscript.c" /* yacc.c:1646 */ - break; - - case 67: -#line 460 "yyscript.y" /* yacc.c:1646 */ - { (yyval.constraint) = CONSTRAINT_ONLY_IF_RW; } -#line 2318 "yyscript.c" /* yacc.c:1646 */ - break; - - case 68: -#line 462 "yyscript.y" /* yacc.c:1646 */ - { (yyval.constraint) = CONSTRAINT_SPECIAL; } -#line 2324 "yyscript.c" /* yacc.c:1646 */ - break; - - case 69: -#line 468 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.output_section_trailer).fill = (yyvsp[-1].expr); - (yyval.output_section_trailer).phdrs = (yyvsp[-2].string_list); - } -#line 2333 "yyscript.c" /* yacc.c:1646 */ - break; - - case 70: -#line 477 "yyscript.y" /* yacc.c:1646 */ - { script_set_section_region(closure, (yyvsp[0].string).value, (yyvsp[0].string).length, 1); } -#line 2339 "yyscript.c" /* yacc.c:1646 */ - break; - - case 72: -#line 484 "yyscript.y" /* yacc.c:1646 */ - { script_set_section_region(closure, (yyvsp[0].string).value, (yyvsp[0].string).length, 0); } -#line 2345 "yyscript.c" /* yacc.c:1646 */ - break; - - case 74: -#line 491 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string_list) = script_string_list_push_back((yyvsp[-2].string_list), (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2351 "yyscript.c" /* yacc.c:1646 */ - break; - - case 75: -#line 493 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string_list) = NULL; } -#line 2357 "yyscript.c" /* yacc.c:1646 */ - break; - - case 76: -#line 500 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[0].expr); } -#line 2363 "yyscript.c" /* yacc.c:1646 */ - break; - - case 77: -#line 502 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = NULL; } -#line 2369 "yyscript.c" /* yacc.c:1646 */ - break; - - case 82: -#line 518 "yyscript.y" /* yacc.c:1646 */ - { script_add_data(closure, (yyvsp[-3].integer), (yyvsp[-1].expr)); } -#line 2375 "yyscript.c" /* yacc.c:1646 */ - break; - - case 83: -#line 520 "yyscript.y" /* yacc.c:1646 */ - { script_add_assertion(closure, (yyvsp[-3].expr), (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 2381 "yyscript.c" /* yacc.c:1646 */ - break; - - case 84: -#line 522 "yyscript.y" /* yacc.c:1646 */ - { script_add_fill(closure, (yyvsp[-1].expr)); } -#line 2387 "yyscript.c" /* yacc.c:1646 */ - break; - - case 85: -#line 524 "yyscript.y" /* yacc.c:1646 */ - { - /* The GNU linker uses CONSTRUCTORS for the a.out object - file format. It does nothing when using ELF. Since - some ELF linker scripts use it although it does - nothing, we accept it and ignore it. */ - } -#line 2398 "yyscript.c" /* yacc.c:1646 */ - break; - - case 87: -#line 532 "yyscript.y" /* yacc.c:1646 */ - { script_include_directive(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2404 "yyscript.c" /* yacc.c:1646 */ - break; - - case 89: -#line 540 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = QUAD; } -#line 2410 "yyscript.c" /* yacc.c:1646 */ - break; - - case 90: -#line 542 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = SQUAD; } -#line 2416 "yyscript.c" /* yacc.c:1646 */ - break; - - case 91: -#line 544 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = LONG; } -#line 2422 "yyscript.c" /* yacc.c:1646 */ - break; - - case 92: -#line 546 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = SHORT; } -#line 2428 "yyscript.c" /* yacc.c:1646 */ - break; - - case 93: -#line 548 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = BYTE; } -#line 2434 "yyscript.c" /* yacc.c:1646 */ - break; - - case 94: -#line 555 "yyscript.y" /* yacc.c:1646 */ - { script_add_input_section(closure, &(yyvsp[0].input_section_spec), 0); } -#line 2440 "yyscript.c" /* yacc.c:1646 */ - break; - - case 95: -#line 557 "yyscript.y" /* yacc.c:1646 */ - { script_add_input_section(closure, &(yyvsp[-1].input_section_spec), 1); } -#line 2446 "yyscript.c" /* yacc.c:1646 */ - break; - - case 96: -#line 563 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.input_section_spec).file.name = (yyvsp[0].string); - (yyval.input_section_spec).file.sort = SORT_WILDCARD_NONE; - (yyval.input_section_spec).input_sections.sections = NULL; - (yyval.input_section_spec).input_sections.exclude = NULL; - } -#line 2457 "yyscript.c" /* yacc.c:1646 */ - break; - - case 97: -#line 570 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.input_section_spec).file = (yyvsp[-3].wildcard_section); - (yyval.input_section_spec).input_sections = (yyvsp[-1].wildcard_sections); - } -#line 2466 "yyscript.c" /* yacc.c:1646 */ - break; - - case 98: -#line 579 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_section).name = (yyvsp[0].string); - (yyval.wildcard_section).sort = SORT_WILDCARD_NONE; - } -#line 2475 "yyscript.c" /* yacc.c:1646 */ - break; - - case 99: -#line 584 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_section).name = (yyvsp[-1].string); - (yyval.wildcard_section).sort = SORT_WILDCARD_BY_NAME; - } -#line 2484 "yyscript.c" /* yacc.c:1646 */ - break; - - case 100: -#line 593 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_sections).sections = script_string_sort_list_add((yyvsp[-2].wildcard_sections).sections, &(yyvsp[0].wildcard_section)); - (yyval.wildcard_sections).exclude = (yyvsp[-2].wildcard_sections).exclude; - } -#line 2493 "yyscript.c" /* yacc.c:1646 */ - break; - - case 101: -#line 598 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_sections).sections = script_new_string_sort_list(&(yyvsp[0].wildcard_section)); - (yyval.wildcard_sections).exclude = NULL; - } -#line 2502 "yyscript.c" /* yacc.c:1646 */ - break; - - case 102: -#line 603 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_sections).sections = (yyvsp[-5].wildcard_sections).sections; - (yyval.wildcard_sections).exclude = script_string_list_append((yyvsp[-5].wildcard_sections).exclude, (yyvsp[-1].string_list)); - } -#line 2511 "yyscript.c" /* yacc.c:1646 */ - break; - - case 103: -#line 608 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_sections).sections = NULL; - (yyval.wildcard_sections).exclude = (yyvsp[-1].string_list); - } -#line 2520 "yyscript.c" /* yacc.c:1646 */ - break; - - case 104: -#line 617 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_section).name = (yyvsp[0].string); - (yyval.wildcard_section).sort = SORT_WILDCARD_NONE; - } -#line 2529 "yyscript.c" /* yacc.c:1646 */ - break; - - case 105: -#line 622 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_section).name = (yyvsp[-1].wildcard_section).name; - switch ((yyvsp[-1].wildcard_section).sort) - { - case SORT_WILDCARD_NONE: - (yyval.wildcard_section).sort = SORT_WILDCARD_BY_NAME; - break; - case SORT_WILDCARD_BY_NAME: - case SORT_WILDCARD_BY_NAME_BY_ALIGNMENT: - break; - case SORT_WILDCARD_BY_ALIGNMENT: - case SORT_WILDCARD_BY_ALIGNMENT_BY_NAME: - (yyval.wildcard_section).sort = SORT_WILDCARD_BY_NAME_BY_ALIGNMENT; - break; - default: - abort(); - } - } -#line 2552 "yyscript.c" /* yacc.c:1646 */ - break; - - case 106: -#line 641 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.wildcard_section).name = (yyvsp[-1].wildcard_section).name; - switch ((yyvsp[-1].wildcard_section).sort) - { - case SORT_WILDCARD_NONE: - (yyval.wildcard_section).sort = SORT_WILDCARD_BY_ALIGNMENT; - break; - case SORT_WILDCARD_BY_ALIGNMENT: - case SORT_WILDCARD_BY_ALIGNMENT_BY_NAME: - break; - case SORT_WILDCARD_BY_NAME: - case SORT_WILDCARD_BY_NAME_BY_ALIGNMENT: - (yyval.wildcard_section).sort = SORT_WILDCARD_BY_ALIGNMENT_BY_NAME; - break; - default: - abort(); - } - } -#line 2575 "yyscript.c" /* yacc.c:1646 */ - break; - - case 107: -#line 664 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string_list) = script_string_list_push_back((yyvsp[-2].string_list), (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2581 "yyscript.c" /* yacc.c:1646 */ - break; - - case 108: -#line 666 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string_list) = script_new_string_list((yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2587 "yyscript.c" /* yacc.c:1646 */ - break; - - case 109: -#line 673 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string) = (yyvsp[0].string); } -#line 2593 "yyscript.c" /* yacc.c:1646 */ - break; - - case 110: -#line 675 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.string).value = "*"; - (yyval.string).length = 1; - } -#line 2602 "yyscript.c" /* yacc.c:1646 */ - break; - - case 111: -#line 680 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.string).value = "?"; - (yyval.string).length = 1; - } -#line 2611 "yyscript.c" /* yacc.c:1646 */ - break; - - case 112: -#line 690 "yyscript.y" /* yacc.c:1646 */ - { script_set_entry(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 2617 "yyscript.c" /* yacc.c:1646 */ - break; - - case 114: -#line 693 "yyscript.y" /* yacc.c:1646 */ - { script_add_assertion(closure, (yyvsp[-3].expr), (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 2623 "yyscript.c" /* yacc.c:1646 */ - break; - - case 115: -#line 695 "yyscript.y" /* yacc.c:1646 */ - { script_include_directive(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2629 "yyscript.c" /* yacc.c:1646 */ - break; - - case 118: -#line 707 "yyscript.y" /* yacc.c:1646 */ - { script_add_memory(closure, (yyvsp[-9].string).value, (yyvsp[-9].string).length, (yyvsp[-8].integer), (yyvsp[-4].expr), (yyvsp[0].expr)); } -#line 2635 "yyscript.c" /* yacc.c:1646 */ - break; - - case 119: -#line 711 "yyscript.y" /* yacc.c:1646 */ - { script_include_directive(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2641 "yyscript.c" /* yacc.c:1646 */ - break; - - case 121: -#line 718 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = script_parse_memory_attr(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length, 0); } -#line 2647 "yyscript.c" /* yacc.c:1646 */ - break; - - case 122: -#line 721 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = script_parse_memory_attr(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length, 1); } -#line 2653 "yyscript.c" /* yacc.c:1646 */ - break; - - case 123: -#line 723 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = 0; } -#line 2659 "yyscript.c" /* yacc.c:1646 */ - break; - - case 132: -#line 751 "yyscript.y" /* yacc.c:1646 */ - { script_add_phdr(closure, (yyvsp[-3].string).value, (yyvsp[-3].string).length, (yyvsp[-2].integer), &(yyvsp[-1].phdr_info)); } -#line 2665 "yyscript.c" /* yacc.c:1646 */ - break; - - case 133: -#line 760 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = script_phdr_string_to_type(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2671 "yyscript.c" /* yacc.c:1646 */ - break; - - case 134: -#line 762 "yyscript.y" /* yacc.c:1646 */ - { (yyval.integer) = (yyvsp[0].integer); } -#line 2677 "yyscript.c" /* yacc.c:1646 */ - break; - - case 135: -#line 768 "yyscript.y" /* yacc.c:1646 */ - { memset(&(yyval.phdr_info), 0, sizeof(struct Phdr_info)); } -#line 2683 "yyscript.c" /* yacc.c:1646 */ - break; - - case 136: -#line 770 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.phdr_info) = (yyvsp[0].phdr_info); - if ((yyvsp[-1].string).length == 7 && strncmp((yyvsp[-1].string).value, "FILEHDR", 7) == 0) - (yyval.phdr_info).includes_filehdr = 1; - else - yyerror(closure, "PHDRS syntax error"); - } -#line 2695 "yyscript.c" /* yacc.c:1646 */ - break; - - case 137: -#line 778 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.phdr_info) = (yyvsp[0].phdr_info); - (yyval.phdr_info).includes_phdrs = 1; - } -#line 2704 "yyscript.c" /* yacc.c:1646 */ - break; - - case 138: -#line 783 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.phdr_info) = (yyvsp[0].phdr_info); - if ((yyvsp[-4].string).length == 5 && strncmp((yyvsp[-4].string).value, "FLAGS", 5) == 0) - { - (yyval.phdr_info).is_flags_valid = 1; - (yyval.phdr_info).flags = (yyvsp[-2].integer); - } - else - yyerror(closure, "PHDRS syntax error"); - } -#line 2719 "yyscript.c" /* yacc.c:1646 */ - break; - - case 139: -#line 794 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.phdr_info) = (yyvsp[0].phdr_info); - (yyval.phdr_info).load_address = (yyvsp[-2].expr); - } -#line 2728 "yyscript.c" /* yacc.c:1646 */ - break; - - case 140: -#line 803 "yyscript.y" /* yacc.c:1646 */ - { script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, (yyvsp[0].expr), 0, 0); } -#line 2734 "yyscript.c" /* yacc.c:1646 */ - break; - - case 141: -#line 805 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_add(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2744 "yyscript.c" /* yacc.c:1646 */ - break; - - case 142: -#line 811 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_sub(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2754 "yyscript.c" /* yacc.c:1646 */ - break; - - case 143: -#line 817 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_mult(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2764 "yyscript.c" /* yacc.c:1646 */ - break; - - case 144: -#line 823 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_div(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2774 "yyscript.c" /* yacc.c:1646 */ - break; - - case 145: -#line 829 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_lshift(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2784 "yyscript.c" /* yacc.c:1646 */ - break; - - case 146: -#line 835 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_rshift(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2794 "yyscript.c" /* yacc.c:1646 */ - break; - - case 147: -#line 841 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_bitwise_and(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2804 "yyscript.c" /* yacc.c:1646 */ - break; - - case 148: -#line 847 "yyscript.y" /* yacc.c:1646 */ - { - Expression_ptr s = script_exp_string((yyvsp[-2].string).value, (yyvsp[-2].string).length); - Expression_ptr e = script_exp_binary_bitwise_or(s, (yyvsp[0].expr)); - script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, e, 0, 0); - } -#line 2814 "yyscript.c" /* yacc.c:1646 */ - break; - - case 149: -#line 853 "yyscript.y" /* yacc.c:1646 */ - { script_set_symbol(closure, (yyvsp[-3].string).value, (yyvsp[-3].string).length, (yyvsp[-1].expr), 1, 0); } -#line 2820 "yyscript.c" /* yacc.c:1646 */ - break; - - case 150: -#line 855 "yyscript.y" /* yacc.c:1646 */ - { script_set_symbol(closure, (yyvsp[-3].string).value, (yyvsp[-3].string).length, (yyvsp[-1].expr), 1, 1); } -#line 2826 "yyscript.c" /* yacc.c:1646 */ - break; - - case 151: -#line 860 "yyscript.y" /* yacc.c:1646 */ - { script_push_lex_into_expression_mode(closure); } -#line 2832 "yyscript.c" /* yacc.c:1646 */ - break; - - case 152: -#line 862 "yyscript.y" /* yacc.c:1646 */ - { - script_pop_lex_mode(closure); - (yyval.expr) = (yyvsp[0].expr); - } -#line 2841 "yyscript.c" /* yacc.c:1646 */ - break; - - case 153: -#line 871 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[-1].expr); } -#line 2847 "yyscript.c" /* yacc.c:1646 */ - break; - - case 154: -#line 873 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_unary_minus((yyvsp[0].expr)); } -#line 2853 "yyscript.c" /* yacc.c:1646 */ - break; - - case 155: -#line 875 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_unary_logical_not((yyvsp[0].expr)); } -#line 2859 "yyscript.c" /* yacc.c:1646 */ - break; - - case 156: -#line 877 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_unary_bitwise_not((yyvsp[0].expr)); } -#line 2865 "yyscript.c" /* yacc.c:1646 */ - break; - - case 157: -#line 879 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = (yyvsp[0].expr); } -#line 2871 "yyscript.c" /* yacc.c:1646 */ - break; - - case 158: -#line 881 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_mult((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2877 "yyscript.c" /* yacc.c:1646 */ - break; - - case 159: -#line 883 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_div((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2883 "yyscript.c" /* yacc.c:1646 */ - break; - - case 160: -#line 885 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_mod((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2889 "yyscript.c" /* yacc.c:1646 */ - break; - - case 161: -#line 887 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_add((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2895 "yyscript.c" /* yacc.c:1646 */ - break; - - case 162: -#line 889 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_sub((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2901 "yyscript.c" /* yacc.c:1646 */ - break; - - case 163: -#line 891 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_lshift((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2907 "yyscript.c" /* yacc.c:1646 */ - break; - - case 164: -#line 893 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_rshift((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2913 "yyscript.c" /* yacc.c:1646 */ - break; - - case 165: -#line 895 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_eq((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2919 "yyscript.c" /* yacc.c:1646 */ - break; - - case 166: -#line 897 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_ne((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2925 "yyscript.c" /* yacc.c:1646 */ - break; - - case 167: -#line 899 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_le((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2931 "yyscript.c" /* yacc.c:1646 */ - break; - - case 168: -#line 901 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_ge((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2937 "yyscript.c" /* yacc.c:1646 */ - break; - - case 169: -#line 903 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_lt((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2943 "yyscript.c" /* yacc.c:1646 */ - break; - - case 170: -#line 905 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_gt((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2949 "yyscript.c" /* yacc.c:1646 */ - break; - - case 171: -#line 907 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_bitwise_and((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2955 "yyscript.c" /* yacc.c:1646 */ - break; - - case 172: -#line 909 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_bitwise_xor((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2961 "yyscript.c" /* yacc.c:1646 */ - break; - - case 173: -#line 911 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_bitwise_or((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2967 "yyscript.c" /* yacc.c:1646 */ - break; - - case 174: -#line 913 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_logical_and((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2973 "yyscript.c" /* yacc.c:1646 */ - break; - - case 175: -#line 915 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_binary_logical_or((yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2979 "yyscript.c" /* yacc.c:1646 */ - break; - - case 176: -#line 917 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_trinary_cond((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2985 "yyscript.c" /* yacc.c:1646 */ - break; - - case 177: -#line 919 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_integer((yyvsp[0].integer)); } -#line 2991 "yyscript.c" /* yacc.c:1646 */ - break; - - case 178: -#line 921 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_symbol(closure, (yyvsp[0].string).value, (yyvsp[0].string).length); } -#line 2997 "yyscript.c" /* yacc.c:1646 */ - break; - - case 179: -#line 923 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_max((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3003 "yyscript.c" /* yacc.c:1646 */ - break; - - case 180: -#line 925 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_min((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3009 "yyscript.c" /* yacc.c:1646 */ - break; - - case 181: -#line 927 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_defined((yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3015 "yyscript.c" /* yacc.c:1646 */ - break; - - case 182: -#line 929 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_sizeof_headers(); } -#line 3021 "yyscript.c" /* yacc.c:1646 */ - break; - - case 183: -#line 931 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_alignof((yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3027 "yyscript.c" /* yacc.c:1646 */ - break; - - case 184: -#line 933 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_sizeof((yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3033 "yyscript.c" /* yacc.c:1646 */ - break; - - case 185: -#line 935 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_addr((yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3039 "yyscript.c" /* yacc.c:1646 */ - break; - - case 186: -#line 937 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_loadaddr((yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3045 "yyscript.c" /* yacc.c:1646 */ - break; - - case 187: -#line 939 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_origin(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3051 "yyscript.c" /* yacc.c:1646 */ - break; - - case 188: -#line 941 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_length(closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3057 "yyscript.c" /* yacc.c:1646 */ - break; - - case 189: -#line 943 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_constant((yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3063 "yyscript.c" /* yacc.c:1646 */ - break; - - case 190: -#line 945 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_absolute((yyvsp[-1].expr)); } -#line 3069 "yyscript.c" /* yacc.c:1646 */ - break; - - case 191: -#line 947 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_align(script_exp_string(".", 1), (yyvsp[-1].expr)); } -#line 3075 "yyscript.c" /* yacc.c:1646 */ - break; - - case 192: -#line 949 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_align((yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 3081 "yyscript.c" /* yacc.c:1646 */ - break; - - case 193: -#line 951 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_align(script_exp_string(".", 1), (yyvsp[-1].expr)); } -#line 3087 "yyscript.c" /* yacc.c:1646 */ - break; - - case 194: -#line 953 "yyscript.y" /* yacc.c:1646 */ - { - script_data_segment_align(closure); - (yyval.expr) = script_exp_function_data_segment_align((yyvsp[-3].expr), (yyvsp[-1].expr)); - } -#line 3096 "yyscript.c" /* yacc.c:1646 */ - break; - - case 195: -#line 958 "yyscript.y" /* yacc.c:1646 */ - { - script_data_segment_relro_end(closure); - (yyval.expr) = script_exp_function_data_segment_relro_end((yyvsp[-3].expr), (yyvsp[-1].expr)); - } -#line 3105 "yyscript.c" /* yacc.c:1646 */ - break; - - case 196: -#line 963 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_data_segment_end((yyvsp[-1].expr)); } -#line 3111 "yyscript.c" /* yacc.c:1646 */ - break; - - case 197: -#line 965 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.expr) = script_exp_function_segment_start((yyvsp[-3].string).value, (yyvsp[-3].string).length, (yyvsp[-1].expr)); - /* We need to take note of any SEGMENT_START expressions - because they change the behaviour of -Ttext, -Tdata and - -Tbss options. */ - script_saw_segment_start_expression(closure); - } -#line 3123 "yyscript.c" /* yacc.c:1646 */ - break; - - case 198: -#line 973 "yyscript.y" /* yacc.c:1646 */ - { (yyval.expr) = script_exp_function_assert((yyvsp[-3].expr), (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3129 "yyscript.c" /* yacc.c:1646 */ - break; - - case 199: -#line 979 "yyscript.y" /* yacc.c:1646 */ - { script_set_symbol(closure, (yyvsp[-2].string).value, (yyvsp[-2].string).length, (yyvsp[0].expr), 0, 0); } -#line 3135 "yyscript.c" /* yacc.c:1646 */ - break; - - case 203: -#line 997 "yyscript.y" /* yacc.c:1646 */ - { script_new_vers_node (closure, NULL, (yyvsp[-3].versyms)); } -#line 3141 "yyscript.c" /* yacc.c:1646 */ - break; - - case 207: -#line 1012 "yyscript.y" /* yacc.c:1646 */ - { - script_register_vers_node (closure, NULL, 0, (yyvsp[-2].versnode), NULL); - } -#line 3149 "yyscript.c" /* yacc.c:1646 */ - break; - - case 208: -#line 1016 "yyscript.y" /* yacc.c:1646 */ - { - script_register_vers_node (closure, (yyvsp[-4].string).value, (yyvsp[-4].string).length, (yyvsp[-2].versnode), - NULL); - } -#line 3158 "yyscript.c" /* yacc.c:1646 */ - break; - - case 209: -#line 1021 "yyscript.y" /* yacc.c:1646 */ - { - script_register_vers_node (closure, (yyvsp[-5].string).value, (yyvsp[-5].string).length, (yyvsp[-3].versnode), (yyvsp[-1].deplist)); - } -#line 3166 "yyscript.c" /* yacc.c:1646 */ - break; - - case 210: -#line 1028 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.deplist) = script_add_vers_depend (closure, NULL, (yyvsp[0].string).value, (yyvsp[0].string).length); - } -#line 3174 "yyscript.c" /* yacc.c:1646 */ - break; - - case 211: -#line 1032 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.deplist) = script_add_vers_depend (closure, (yyvsp[-1].deplist), (yyvsp[0].string).value, (yyvsp[0].string).length); - } -#line 3182 "yyscript.c" /* yacc.c:1646 */ - break; - - case 212: -#line 1039 "yyscript.y" /* yacc.c:1646 */ - { (yyval.versnode) = script_new_vers_node (closure, NULL, NULL); } -#line 3188 "yyscript.c" /* yacc.c:1646 */ - break; - - case 213: -#line 1041 "yyscript.y" /* yacc.c:1646 */ - { (yyval.versnode) = script_new_vers_node (closure, (yyvsp[-1].versyms), NULL); } -#line 3194 "yyscript.c" /* yacc.c:1646 */ - break; - - case 214: -#line 1043 "yyscript.y" /* yacc.c:1646 */ - { (yyval.versnode) = script_new_vers_node (closure, (yyvsp[-1].versyms), NULL); } -#line 3200 "yyscript.c" /* yacc.c:1646 */ - break; - - case 215: -#line 1045 "yyscript.y" /* yacc.c:1646 */ - { (yyval.versnode) = script_new_vers_node (closure, NULL, (yyvsp[-1].versyms)); } -#line 3206 "yyscript.c" /* yacc.c:1646 */ - break; - - case 216: -#line 1047 "yyscript.y" /* yacc.c:1646 */ - { (yyval.versnode) = script_new_vers_node (closure, (yyvsp[-5].versyms), (yyvsp[-1].versyms)); } -#line 3212 "yyscript.c" /* yacc.c:1646 */ - break; - - case 217: -#line 1056 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_new_vers_pattern (closure, NULL, (yyvsp[0].string).value, - (yyvsp[0].string).length, 0); - } -#line 3221 "yyscript.c" /* yacc.c:1646 */ - break; - - case 218: -#line 1061 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_new_vers_pattern (closure, NULL, (yyvsp[0].string).value, - (yyvsp[0].string).length, 1); - } -#line 3230 "yyscript.c" /* yacc.c:1646 */ - break; - - case 219: -#line 1066 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_new_vers_pattern (closure, (yyvsp[-2].versyms), (yyvsp[0].string).value, - (yyvsp[0].string).length, 0); - } -#line 3239 "yyscript.c" /* yacc.c:1646 */ - break; - - case 220: -#line 1071 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_new_vers_pattern (closure, (yyvsp[-2].versyms), (yyvsp[0].string).value, - (yyvsp[0].string).length, 1); - } -#line 3248 "yyscript.c" /* yacc.c:1646 */ - break; - - case 221: -#line 1077 "yyscript.y" /* yacc.c:1646 */ - { version_script_push_lang (closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3254 "yyscript.c" /* yacc.c:1646 */ - break; - - case 222: -#line 1079 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = (yyvsp[-2].versyms); - version_script_pop_lang(closure); - } -#line 3263 "yyscript.c" /* yacc.c:1646 */ - break; - - case 223: -#line 1087 "yyscript.y" /* yacc.c:1646 */ - { version_script_push_lang (closure, (yyvsp[-1].string).value, (yyvsp[-1].string).length); } -#line 3269 "yyscript.c" /* yacc.c:1646 */ - break; - - case 224: -#line 1089 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_merge_expressions ((yyvsp[-8].versyms), (yyvsp[-2].versyms)); - version_script_pop_lang(closure); - } -#line 3278 "yyscript.c" /* yacc.c:1646 */ - break; - - case 225: -#line 1094 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_new_vers_pattern (closure, NULL, "extern", - sizeof("extern") - 1, 1); - } -#line 3287 "yyscript.c" /* yacc.c:1646 */ - break; - - case 226: -#line 1099 "yyscript.y" /* yacc.c:1646 */ - { - (yyval.versyms) = script_new_vers_pattern (closure, (yyvsp[-2].versyms), "extern", - sizeof("extern") - 1, 1); - } -#line 3296 "yyscript.c" /* yacc.c:1646 */ - break; - - case 227: -#line 1109 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string) = (yyvsp[0].string); } -#line 3302 "yyscript.c" /* yacc.c:1646 */ - break; - - case 228: -#line 1111 "yyscript.y" /* yacc.c:1646 */ - { (yyval.string) = (yyvsp[0].string); } -#line 3308 "yyscript.c" /* yacc.c:1646 */ - break; - - -#line 3312 "yyscript.c" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (closure, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (closure, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, closure); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, closure); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (closure, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, closure); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, closure); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 1133 "yyscript.y" /* yacc.c:1906 */ - diff --git a/external/gpl3/binutils/files/yyscript.h b/external/gpl3/binutils/files/yyscript.h deleted file mode 100644 index 945d59da7..000000000 --- a/external/gpl3/binutils/files/yyscript.h +++ /dev/null @@ -1,295 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_YY_YYSCRIPT_H_INCLUDED -# define YY_YY_YYSCRIPT_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int yydebug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - PLUSEQ = 258, - MINUSEQ = 259, - MULTEQ = 260, - DIVEQ = 261, - LSHIFTEQ = 262, - RSHIFTEQ = 263, - ANDEQ = 264, - OREQ = 265, - OROR = 266, - ANDAND = 267, - EQ = 268, - NE = 269, - LE = 270, - GE = 271, - LSHIFT = 272, - RSHIFT = 273, - UNARY = 274, - STRING = 275, - QUOTED_STRING = 276, - INTEGER = 277, - ABSOLUTE = 278, - ADDR = 279, - ALIGN_K = 280, - ALIGNOF = 281, - ASSERT_K = 282, - AS_NEEDED = 283, - AT = 284, - BIND = 285, - BLOCK = 286, - BYTE = 287, - CONSTANT = 288, - CONSTRUCTORS = 289, - COPY = 290, - CREATE_OBJECT_SYMBOLS = 291, - DATA_SEGMENT_ALIGN = 292, - DATA_SEGMENT_END = 293, - DATA_SEGMENT_RELRO_END = 294, - DEFINED = 295, - DSECT = 296, - ENTRY = 297, - EXCLUDE_FILE = 298, - EXTERN = 299, - FILL = 300, - FLOAT = 301, - FORCE_COMMON_ALLOCATION = 302, - GLOBAL = 303, - GROUP = 304, - HLL = 305, - INCLUDE = 306, - INHIBIT_COMMON_ALLOCATION = 307, - INFO = 308, - INPUT = 309, - KEEP = 310, - LEN = 311, - LENGTH = 312, - LOADADDR = 313, - LOCAL = 314, - LONG = 315, - MAP = 316, - MAX_K = 317, - MEMORY = 318, - MIN_K = 319, - NEXT = 320, - NOCROSSREFS = 321, - NOFLOAT = 322, - NOLOAD = 323, - ONLY_IF_RO = 324, - ONLY_IF_RW = 325, - ORG = 326, - ORIGIN = 327, - OUTPUT = 328, - OUTPUT_ARCH = 329, - OUTPUT_FORMAT = 330, - OVERLAY = 331, - PHDRS = 332, - PROVIDE = 333, - PROVIDE_HIDDEN = 334, - QUAD = 335, - SEARCH_DIR = 336, - SECTIONS = 337, - SEGMENT_START = 338, - SHORT = 339, - SIZEOF = 340, - SIZEOF_HEADERS = 341, - SORT_BY_ALIGNMENT = 342, - SORT_BY_NAME = 343, - SPECIAL = 344, - SQUAD = 345, - STARTUP = 346, - SUBALIGN = 347, - SYSLIB = 348, - TARGET_K = 349, - TRUNCATE = 350, - VERSIONK = 351, - OPTION = 352, - PARSING_LINKER_SCRIPT = 353, - PARSING_VERSION_SCRIPT = 354, - PARSING_DEFSYM = 355, - PARSING_DYNAMIC_LIST = 356 - }; -#endif -/* Tokens. */ -#define PLUSEQ 258 -#define MINUSEQ 259 -#define MULTEQ 260 -#define DIVEQ 261 -#define LSHIFTEQ 262 -#define RSHIFTEQ 263 -#define ANDEQ 264 -#define OREQ 265 -#define OROR 266 -#define ANDAND 267 -#define EQ 268 -#define NE 269 -#define LE 270 -#define GE 271 -#define LSHIFT 272 -#define RSHIFT 273 -#define UNARY 274 -#define STRING 275 -#define QUOTED_STRING 276 -#define INTEGER 277 -#define ABSOLUTE 278 -#define ADDR 279 -#define ALIGN_K 280 -#define ALIGNOF 281 -#define ASSERT_K 282 -#define AS_NEEDED 283 -#define AT 284 -#define BIND 285 -#define BLOCK 286 -#define BYTE 287 -#define CONSTANT 288 -#define CONSTRUCTORS 289 -#define COPY 290 -#define CREATE_OBJECT_SYMBOLS 291 -#define DATA_SEGMENT_ALIGN 292 -#define DATA_SEGMENT_END 293 -#define DATA_SEGMENT_RELRO_END 294 -#define DEFINED 295 -#define DSECT 296 -#define ENTRY 297 -#define EXCLUDE_FILE 298 -#define EXTERN 299 -#define FILL 300 -#define FLOAT 301 -#define FORCE_COMMON_ALLOCATION 302 -#define GLOBAL 303 -#define GROUP 304 -#define HLL 305 -#define INCLUDE 306 -#define INHIBIT_COMMON_ALLOCATION 307 -#define INFO 308 -#define INPUT 309 -#define KEEP 310 -#define LEN 311 -#define LENGTH 312 -#define LOADADDR 313 -#define LOCAL 314 -#define LONG 315 -#define MAP 316 -#define MAX_K 317 -#define MEMORY 318 -#define MIN_K 319 -#define NEXT 320 -#define NOCROSSREFS 321 -#define NOFLOAT 322 -#define NOLOAD 323 -#define ONLY_IF_RO 324 -#define ONLY_IF_RW 325 -#define ORG 326 -#define ORIGIN 327 -#define OUTPUT 328 -#define OUTPUT_ARCH 329 -#define OUTPUT_FORMAT 330 -#define OVERLAY 331 -#define PHDRS 332 -#define PROVIDE 333 -#define PROVIDE_HIDDEN 334 -#define QUAD 335 -#define SEARCH_DIR 336 -#define SECTIONS 337 -#define SEGMENT_START 338 -#define SHORT 339 -#define SIZEOF 340 -#define SIZEOF_HEADERS 341 -#define SORT_BY_ALIGNMENT 342 -#define SORT_BY_NAME 343 -#define SPECIAL 344 -#define SQUAD 345 -#define STARTUP 346 -#define SUBALIGN 347 -#define SYSLIB 348 -#define TARGET_K 349 -#define TRUNCATE 350 -#define VERSIONK 351 -#define OPTION 352 -#define PARSING_LINKER_SCRIPT 353 -#define PARSING_VERSION_SCRIPT 354 -#define PARSING_DEFSYM 355 -#define PARSING_DYNAMIC_LIST 356 - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE -{ -#line 53 "yyscript.y" /* yacc.c:1909 */ - - /* A string. */ - struct Parser_string string; - /* A number. */ - uint64_t integer; - /* An expression. */ - Expression_ptr expr; - /* An output section header. */ - struct Parser_output_section_header output_section_header; - /* An output section trailer. */ - struct Parser_output_section_trailer output_section_trailer; - /* A section constraint. */ - enum Section_constraint constraint; - /* A complete input section specification. */ - struct Input_section_spec input_section_spec; - /* A list of wildcard specifications, with exclusions. */ - struct Wildcard_sections wildcard_sections; - /* A single wildcard specification. */ - struct Wildcard_section wildcard_section; - /* A list of strings. */ - String_list_ptr string_list; - /* Information for a program header. */ - struct Phdr_info phdr_info; - /* Used for version scripts and within VERSION {}. */ - struct Version_dependency_list* deplist; - struct Version_expression_list* versyms; - struct Version_tree* versnode; - enum Script_section_type section_type; - -#line 286 "yyscript.h" /* yacc.c:1909 */ -}; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int yyparse (void* closure); - -#endif /* !YY_YY_YYSCRIPT_H_INCLUDED */ diff --git a/external/gpl3/binutils/lib/Makefile b/external/gpl3/binutils/lib/Makefile index 25878c1ab..b8357d305 100644 --- a/external/gpl3/binutils/lib/Makefile +++ b/external/gpl3/binutils/lib/Makefile @@ -1,5 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:21:59 skrll Exp $ +# $NetBSD: Makefile,v 1.3 2020/04/04 01:34:28 christos Exp $ -SUBDIR+= libopcodes libbfd libiberty +SUBDIR+= libgnuctf libopcodes libbfd libiberty .include diff --git a/external/gpl3/binutils/lib/Makefile.inc b/external/gpl3/binutils/lib/Makefile.inc new file mode 100644 index 000000000..c5434b205 --- /dev/null +++ b/external/gpl3/binutils/lib/Makefile.inc @@ -0,0 +1,2 @@ +# $NetBSD: Makefile.inc,v 1.1 2016/01/26 19:37:47 christos Exp $ +.include "${.PARSEDIR}/../Makefile.inc" diff --git a/external/gpl3/binutils/lib/libbfd/Makefile b/external/gpl3/binutils/lib/libbfd/Makefile index 616122a3e..f0e60ad9a 100644 --- a/external/gpl3/binutils/lib/libbfd/Makefile +++ b/external/gpl3/binutils/lib/libbfd/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2015/03/28 07:03:23 matt Exp $ +# $NetBSD: Makefile,v 1.22 2020/04/04 00:46:53 christos Exp $ NOLINKLIB= # defined NOLINT= # defined @@ -6,7 +6,7 @@ NOMAN= # defined NOPROFILE= # defined NOCLANGERROR= # defined -.include +.include # If the platform does not support shared libraries, we need to supply # *something* for BFD-using programs to link against. Also provide an @@ -21,41 +21,50 @@ LIB= bfd BFD_MACHINE_ARCH?= ${MACHINE_ARCH:C/armv[4-7]/arm/} DEFS_MK=${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk +# XXX: Fix me +BINDIR=/usr/bin +BINDIR=/usr/lib .if exists(${DEFS_MK}) .include "${DEFS_MK}" -DIST= ${NETBSDSRCDIR}/external/gpl3/binutils/dist - .if defined(__MINIX) # MINIX: make sure sources are fetched, even when tools not built earlier GNUHOSTDIST= ${DIST} .include "${.CURDIR}/../../../../../minix/Makefile.fetchgnu" .endif # defined(__MINIX) -SHLIB_MAJOR= 13 +SHLIB_MAJOR= 17 SHLIB_MINOR= 0 LIBDPLIBS+= z ${.CURDIR}/../../../../../lib/libz GCPPFLAGS= ${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS} +GCPPFLAGS+= ${G_HAVEVECS} + CPPFLAGS+= -I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \ -I${DIST}/bfd ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \ - -DDEBUGDIR=\"${DEBUGDIR}\" + -DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \ + -DBINDIR=\"${BINDIR}\" .if (${BFD_MACHINE_ARCH} == "vax") CPPFLAGS.elf.c += -O0 .endif +COPTS.pei-x86_64.c += -Wno-stack-protector +COPTS.elfxx-mips.c += -Wno-stack-protector + GSRCS= ${G_libbfd_la_OBJECTS:libbfd.lo=lib_bfd.lo} \ ${G_libbfd_la_DEPENDENCIES:M*.lo} SRCS= ${GSRCS:.lo=.c} DPSRCS+= elf32-target.h elf64-target.h targmatch.h \ elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \ + elf32-riscv.c elf64-riscv.c elf32-aarch64.c elf64-aarch64.c \ pex64igen.c CLEANFILES+= elf32-target.h elf64-target.h targmatch.h \ elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \ + elf32-riscv.c elf64-riscv.c elf32-aarch64.c elf64-aarch64.c \ pex64igen.c TEXINFO= bfd.texinfo @@ -100,6 +109,14 @@ elf64-riscv.c: elfnn-riscv.c ${_MKTARGET_CREATE} ${TOOL_SED} -e s/NN/64/g < $> > $@ +elf32-aarch64.c: elfnn-aarch64.c + ${_MKTARGET_CREATE} + ${TOOL_SED} -e s/NN/32/g < $> > $@ + +elf64-aarch64.c: elfnn-aarch64.c + ${_MKTARGET_CREATE} + ${TOOL_SED} -e s/NN/64/g < $> > $@ + peigen.c: peXXigen.c ${_MKTARGET_CREATE} ${TOOL_SED} -e s/XX/pe/g < $> > $@ diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h index d0cf7b3d1..ef0fdff8b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd_stdint.h index 59a75dab2..8a5b3199d 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for clang version 3.5 (trunk 199312) */ +/* generated for aarch64--netbsd-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfdver.h index ca6b8db14..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64/config.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64/config.h index f81272436..588e281a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/aarch64/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/aarch64/defs.mk index 0f4322916..ddd25d446 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/aarch64/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-aarch64.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf64-gen.lo elf32-gen.lo cpu-aarch64.lo cpu-arm.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-aarch64.lo elf32.lo elf32-arm.lo elf-nacl.lo elf-vxworks.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-aarch64.lo cpu-arm.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_littleaarch64_vec -DHAVE_bfd_elf64_bigaarch64_vec -DHAVE_bfd_elf32_littlearm_vec -DHAVE_bfd_elf32_bigarm_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_littleaarch64_vec -DSELECT_VECS='&bfd_elf64_littleaarch64_vec,&bfd_elf64_bigaarch64_vec,&bfd_elf32_littlearm_vec,&bfd_elf32_bigarm_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_aarch64_arch,&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=aarch64_elf64_le_vec -DSELECT_VECS='&aarch64_elf64_le_vec,&aarch64_elf64_be_vec,&aarch64_elf32_le_vec,&aarch64_elf32_be_vec,&arm_elf32_le_vec,&arm_elf32_be_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_aarch64_arch,&bfd_arm_arch' +G_HAVEVECS=-DHAVE_aarch64_elf64_le_vec -DHAVE_aarch64_elf64_be_vec -DHAVE_aarch64_elf32_le_vec -DHAVE_aarch64_elf32_be_vec -DHAVE_arm_elf32_le_vec -DHAVE_arm_elf32_be_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfd.h new file mode 100644 index 000000000..ef0fdff8b --- /dev/null +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfd.h @@ -0,0 +1,7862 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", + "linker.c", "simple.c" and "compress.c". + Run "make headers" in your build bfd/ to regenerate. */ + +/* Main header file for the bfd library -- portable access to object files. + + Copyright (C) 1990-2020 Free Software Foundation, Inc. + + Contributed by Cygnus Support. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef __BFD_H_SEEN__ +#define __BFD_H_SEEN__ + +/* PR 14072: Ensure that config.h is included first. */ +#if !defined PACKAGE && !defined PACKAGE_VERSION +#error config.h must be included before this header +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ansidecl.h" +#include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include +#include + +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) +#ifndef SABER +/* This hack is to avoid a problem with some strict ANSI C preprocessors. + The problem is, "32_" is not a valid preprocessing token, and we don't + want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will + cause the inner CONCAT2 macros to be evaluated first, producing + still-valid pp-tokens. Then the final concatenation can be done. */ +#undef CONCAT4 +#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d)) +#endif +#endif + +/* This is a utility macro to handle the situation where the code + wants to place a constant string into the code, followed by a + comma and then the length of the string. Doing this by hand + is error prone, so using this macro is safer. */ +#define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1) +/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro + to create the arguments to another macro, since the preprocessor + will mis-count the number of arguments to the outer macro (by not + evaluating STRING_COMMA_LEN and so missing the comma). This is a + problem for example when trying to use STRING_COMMA_LEN to build + the arguments to the strncmp() macro. Hence this alternative + definition of strncmp is provided here. + + Note - these macros do NOT work if STR2 is not a constant string. */ +#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) + /* strcpy() can have a similar problem, but since we know we are + copying a constant string, we can use memcpy which will be faster + since there is no need to check for a NUL byte inside STR. We + can also save time if we do not need to copy the terminating NUL. */ +#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) +#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) + + +#define BFD_SUPPORTS_PLUGINS 1 + +/* The word size used by BFD on the host. This may be 64 with a 32 + bit target if the host is 64 bit, or if other 64 bit targets have + been selected with --enable-targets, or if --enable-64-bit-bfd. */ +#define BFD_ARCH_SIZE 64 + +/* The word size of the default bfd target. */ +#define BFD_DEFAULT_TARGET_SIZE 64 + +#define BFD_HOST_64BIT_LONG 1 +#define BFD_HOST_64BIT_LONG_LONG 0 +#if 1 +#define BFD_HOST_64_BIT long +#define BFD_HOST_U_64_BIT unsigned long +typedef BFD_HOST_64_BIT bfd_int64_t; +typedef BFD_HOST_U_64_BIT bfd_uint64_t; +#endif + +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + +#if BFD_ARCH_SIZE >= 64 +#define BFD64 +#endif + +#ifndef INLINE +#if __GNUC__ >= 2 +#define INLINE __inline__ +#else +#define INLINE +#endif +#endif + +/* Declaring a type wide enough to hold a host long and a host pointer. */ +#define BFD_HOSTPTR_T unsigned long +typedef BFD_HOSTPTR_T bfd_hostptr_t; + +/* Forward declaration. */ +typedef struct bfd bfd; + +/* Boolean type used in bfd. Too many systems define their own + versions of "boolean" for us to safely typedef a "boolean" of + our own. Using an enum for "bfd_boolean" has its own set of + problems, with strange looking casts required to avoid warnings + on some older compilers. Thus we just use an int. + + General rule: Functions which are bfd_boolean return TRUE on + success and FALSE on failure (unless they're a predicate). */ + +typedef int bfd_boolean; +#undef FALSE +#undef TRUE +#define FALSE 0 +#define TRUE 1 + +#ifdef BFD64 + +#ifndef BFD_HOST_64_BIT + #error No 64 bit integer type available +#endif /* ! defined (BFD_HOST_64_BIT) */ + +typedef BFD_HOST_U_64_BIT bfd_vma; +typedef BFD_HOST_64_BIT bfd_signed_vma; +typedef BFD_HOST_U_64_BIT bfd_size_type; +typedef BFD_HOST_U_64_BIT symvalue; + +#if BFD_HOST_64BIT_LONG +#define BFD_VMA_FMT "l" +#elif defined (__MSVCRT__) +#define BFD_VMA_FMT "I64" +#else +#define BFD_VMA_FMT "ll" +#endif + +#ifndef fprintf_vma +#define sprintf_vma(s,x) sprintf (s, "%016" BFD_VMA_FMT "x", x) +#define fprintf_vma(f,x) fprintf (f, "%016" BFD_VMA_FMT "x", x) +#endif + +#else /* not BFD64 */ + +/* Represent a target address. Also used as a generic unsigned type + which is guaranteed to be big enough to hold any arithmetic types + we need to deal with. */ +typedef unsigned long bfd_vma; + +/* A generic signed type which is guaranteed to be big enough to hold any + arithmetic types we need to deal with. Can be assumed to be compatible + with bfd_vma in the same way that signed and unsigned ints are compatible + (as parameters, in assignment, etc). */ +typedef long bfd_signed_vma; + +typedef unsigned long symvalue; +typedef unsigned long bfd_size_type; + +/* Print a bfd_vma x on stream s. */ +#define BFD_VMA_FMT "l" +#define fprintf_vma(s,x) fprintf (s, "%08" BFD_VMA_FMT "x", x) +#define sprintf_vma(s,x) sprintf (s, "%08" BFD_VMA_FMT "x", x) + +#endif /* not BFD64 */ + +#define HALF_BFD_SIZE_TYPE \ + (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2)) + +#ifndef BFD_HOST_64_BIT +/* Fall back on a 32 bit type. The idea is to make these types always + available for function return types, but in the case that + BFD_HOST_64_BIT is undefined such a function should abort or + otherwise signal an error. */ +typedef bfd_signed_vma bfd_int64_t; +typedef bfd_vma bfd_uint64_t; +#endif + +/* An offset into a file. BFD always uses the largest possible offset + based on the build time availability of fseek, fseeko, or fseeko64. */ +typedef BFD_HOST_64_BIT file_ptr; +typedef unsigned BFD_HOST_64_BIT ufile_ptr; + +extern void bfd_sprintf_vma (bfd *, char *, bfd_vma); +extern void bfd_fprintf_vma (bfd *, void *, bfd_vma); + +#define printf_vma(x) fprintf_vma(stdout,x) +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) + +typedef unsigned int flagword; /* 32 bits of flags */ +typedef unsigned char bfd_byte; + +/* File formats. */ + +typedef enum bfd_format +{ + bfd_unknown = 0, /* File format is unknown. */ + bfd_object, /* Linker/assembler/compiler output. */ + bfd_archive, /* Object archive file. */ + bfd_core, /* Core dump. */ + bfd_type_end /* Marks the end; don't use it! */ +} +bfd_format; + +/* Symbols and relocation. */ + +/* A count of carsyms (canonical archive symbols). */ +typedef unsigned long symindex; + +#define BFD_NO_MORE_SYMBOLS ((symindex) ~0) + +/* A canonical archive symbol. */ +/* This is a type pun with struct ranlib on purpose! */ +typedef struct carsym +{ + const char *name; + file_ptr file_offset; /* Look here to find the file. */ +} +carsym; /* To make these you call a carsymogen. */ + +/* Used in generating armaps (archive tables of contents). + Perhaps just a forward definition would do? */ +struct orl /* Output ranlib. */ +{ + char **name; /* Symbol name. */ + union + { + file_ptr pos; + bfd *abfd; + } u; /* bfd* or file position. */ + int namidx; /* Index into string table. */ +}; + +/* Linenumber stuff. */ +typedef struct lineno_cache_entry +{ + unsigned int line_number; /* Linenumber from start of function. */ + union + { + struct bfd_symbol *sym; /* Function name. */ + bfd_vma offset; /* Offset into section. */ + } u; +} +alent; + +/* Object and core file sections. */ +typedef struct bfd_section *sec_ptr; + +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) + +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) + +typedef enum bfd_print_symbol +{ + bfd_print_symbol_name, + bfd_print_symbol_more, + bfd_print_symbol_all +} bfd_print_symbol_type; + +/* Information about a symbol that nm needs. */ + +typedef struct _symbol_info +{ + symvalue value; + char type; + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ +} symbol_info; + +/* Get the name of a stabs type code. */ + +extern const char *bfd_get_stab_name (int); + +/* Hash table routines. There is no way to free up a hash table. */ + +/* An element in the hash table. Most uses will actually use a larger + structure, and an instance of this will be the first field. */ + +struct bfd_hash_entry +{ + /* Next entry for this hash code. */ + struct bfd_hash_entry *next; + /* String being hashed. */ + const char *string; + /* Hash code. This is the full hash code, not the index into the + table. */ + unsigned long hash; +}; + +/* A hash table. */ + +struct bfd_hash_table +{ + /* The hash array. */ + struct bfd_hash_entry **table; + /* A function used to create new elements in the hash table. The + first entry is itself a pointer to an element. When this + function is first invoked, this pointer will be NULL. However, + having the pointer permits a hierarchy of method functions to be + built each of which calls the function in the superclass. Thus + each function should be written to allocate a new block of memory + only if the argument is NULL. */ + struct bfd_hash_entry *(*newfunc) + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); + /* An objalloc for this hash table. This is a struct objalloc *, + but we use void * to avoid requiring the inclusion of objalloc.h. */ + void *memory; + /* The number of slots in the hash table. */ + unsigned int size; + /* The number of entries in the hash table. */ + unsigned int count; + /* The size of elements. */ + unsigned int entsize; + /* If non-zero, don't grow the hash table. */ + unsigned int frozen:1; +}; + +/* Initialize a hash table. */ +extern bfd_boolean bfd_hash_table_init + (struct bfd_hash_table *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *), + unsigned int); + +/* Initialize a hash table specifying a size. */ +extern bfd_boolean bfd_hash_table_init_n + (struct bfd_hash_table *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *), + unsigned int, unsigned int); + +/* Free up a hash table. */ +extern void bfd_hash_table_free + (struct bfd_hash_table *); + +/* Look up a string in a hash table. If CREATE is TRUE, a new entry + will be created for this string if one does not already exist. The + COPY argument must be TRUE if this routine should copy the string + into newly allocated memory when adding an entry. */ +extern struct bfd_hash_entry *bfd_hash_lookup + (struct bfd_hash_table *, const char *, bfd_boolean create, + bfd_boolean copy); + +/* Insert an entry in a hash table. */ +extern struct bfd_hash_entry *bfd_hash_insert + (struct bfd_hash_table *, const char *, unsigned long); + +/* Rename an entry in a hash table. */ +extern void bfd_hash_rename + (struct bfd_hash_table *, const char *, struct bfd_hash_entry *); + +/* Replace an entry in a hash table. */ +extern void bfd_hash_replace + (struct bfd_hash_table *, struct bfd_hash_entry *old, + struct bfd_hash_entry *nw); + +/* Base method for creating a hash table entry. */ +extern struct bfd_hash_entry *bfd_hash_newfunc + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); + +/* Grab some space for a hash table entry. */ +extern void *bfd_hash_allocate + (struct bfd_hash_table *, unsigned int); + +/* Traverse a hash table in a random order, calling a function on each + element. If the function returns FALSE, the traversal stops. The + INFO argument is passed to the function. */ +extern void bfd_hash_traverse + (struct bfd_hash_table *, + bfd_boolean (*) (struct bfd_hash_entry *, void *), + void *info); + +/* Allows the default size of a hash table to be configured. New hash + tables allocated using bfd_hash_table_init will be created with + this size. */ +extern unsigned long bfd_hash_set_default_size (unsigned long); + +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + +/* This structure is used to keep track of stabs in sections + information while linking. */ + +struct stab_info +{ + /* A hash table used to hold stabs strings. */ + struct bfd_strtab_hash *strings; + /* The header file hash table. */ + struct bfd_hash_table includes; + /* The first .stabstr section. */ + struct bfd_section *stabstr; +}; + +#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table + +/* User program access to BFD facilities. */ + +/* Direct I/O routines, for programs which know more about the object + file than BFD does. Use higher level routines if possible. */ + +extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *); +extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *); +extern int bfd_seek (bfd *, file_ptr, int); +extern file_ptr bfd_tell (bfd *); +extern int bfd_flush (bfd *); +extern int bfd_stat (bfd *, struct stat *); + +/* Deprecated old routines. */ +#if __GNUC__ +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#else +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) +#endif +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); + +extern bfd_boolean bfd_cache_close + (bfd *abfd); +/* NB: This declaration should match the autogenerated one in libbfd.h. */ + +extern bfd_boolean bfd_cache_close_all (void); + +extern bfd_boolean bfd_record_phdr + (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, + bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **); + +/* Byte swapping routines. */ + +bfd_uint64_t bfd_getb64 (const void *); +bfd_uint64_t bfd_getl64 (const void *); +bfd_int64_t bfd_getb_signed_64 (const void *); +bfd_int64_t bfd_getl_signed_64 (const void *); +bfd_vma bfd_getb32 (const void *); +bfd_vma bfd_getl32 (const void *); +bfd_signed_vma bfd_getb_signed_32 (const void *); +bfd_signed_vma bfd_getl_signed_32 (const void *); +bfd_vma bfd_getb16 (const void *); +bfd_vma bfd_getl16 (const void *); +bfd_signed_vma bfd_getb_signed_16 (const void *); +bfd_signed_vma bfd_getl_signed_16 (const void *); +void bfd_putb64 (bfd_uint64_t, void *); +void bfd_putl64 (bfd_uint64_t, void *); +void bfd_putb32 (bfd_vma, void *); +void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); +void bfd_putb16 (bfd_vma, void *); +void bfd_putl16 (bfd_vma, void *); + +/* Byte swapping routines which take size and endiannes as arguments. */ + +bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); +void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); + + +/* mmap hacks */ + +struct _bfd_window_internal; +typedef struct _bfd_window_internal bfd_window_internal; + +typedef struct _bfd_window +{ + /* What the user asked for. */ + void *data; + bfd_size_type size; + /* The actual window used by BFD. Small user-requested read-only + regions sharing a page may share a single window into the object + file. Read-write versions shouldn't until I've fixed things to + keep track of which portions have been claimed by the + application; don't want to give the same region back when the + application wants two writable copies! */ + struct _bfd_window_internal *i; +} +bfd_window; + +extern void bfd_init_window + (bfd_window *); +extern void bfd_free_window + (bfd_window *); +extern bfd_boolean bfd_get_file_window + (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ + +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); + +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; +/* Extracted from init.c. */ +unsigned int bfd_init (void); + + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) +/* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ +extern unsigned int bfd_use_reserved_id; +bfd *bfd_fopen (const char *filename, const char *target, + const char *mode, int fd); + +bfd *bfd_openr (const char *filename, const char *target); + +bfd *bfd_fdopenr (const char *filename, const char *target, int fd); + +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); + +bfd *bfd_openr_iovec (const char *filename, const char *target, + void *(*open_func) (struct bfd *nbfd, + void *open_closure), + void *open_closure, + file_ptr (*pread_func) (struct bfd *nbfd, + void *stream, + void *buf, + file_ptr nbytes, + file_ptr offset), + int (*close_func) (struct bfd *nbfd, + void *stream), + int (*stat_func) (struct bfd *abfd, + void *stream, + struct stat *sb)); + +bfd *bfd_openw (const char *filename, const char *target); + +bfd_boolean bfd_close (bfd *abfd); + +bfd_boolean bfd_close_all_done (bfd *); + +bfd *bfd_create (const char *filename, bfd *templ); + +bfd_boolean bfd_make_writable (bfd *abfd); + +bfd_boolean bfd_make_readable (bfd *abfd); + +void *bfd_alloc (bfd *abfd, bfd_size_type wanted); + +void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); + +unsigned long bfd_calc_gnu_debuglink_crc32 + (unsigned long crc, const unsigned char *buf, bfd_size_type len); + +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + +char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); + +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + +struct bfd_section *bfd_create_gnu_debuglink_section + (bfd *abfd, const char *filename); + +bfd_boolean bfd_fill_in_gnu_debuglink_section + (bfd *abfd, struct bfd_section *sect, const char *filename); + +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + +/* Extracted from libbfd.c. */ + +/* Byte swapping macros for user section data. */ + +#define bfd_put_8(abfd, val, ptr) \ + ((void) (*((unsigned char *) (ptr)) = (val) & 0xff)) +#define bfd_put_signed_8 \ + bfd_put_8 +#define bfd_get_8(abfd, ptr) \ + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) +#define bfd_get_signed_8(abfd, ptr) \ + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + +#define bfd_put_16(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) +#define bfd_put_signed_16 \ + bfd_put_16 +#define bfd_get_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx16, (ptr)) +#define bfd_get_signed_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) + +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + +#define bfd_put_32(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) +#define bfd_put_signed_32 \ + bfd_put_32 +#define bfd_get_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx32, (ptr)) +#define bfd_get_signed_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) + +#define bfd_put_64(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) +#define bfd_put_signed_64 \ + bfd_put_64 +#define bfd_get_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx64, (ptr)) +#define bfd_get_signed_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) + +#define bfd_get(bits, abfd, ptr) \ + ((bits) == 8 ? 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)) + +#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)) + + +/* Byte swapping macros for file header data. */ + +#define bfd_h_put_8(abfd, val, ptr) \ + bfd_put_8 (abfd, val, ptr) +#define bfd_h_put_signed_8(abfd, val, ptr) \ + bfd_put_8 (abfd, val, ptr) +#define bfd_h_get_8(abfd, ptr) \ + bfd_get_8 (abfd, ptr) +#define bfd_h_get_signed_8(abfd, ptr) \ + bfd_get_signed_8 (abfd, ptr) + +#define bfd_h_put_16(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_h_putx16, (val, ptr)) +#define bfd_h_put_signed_16 \ + bfd_h_put_16 +#define bfd_h_get_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx16, (ptr)) +#define bfd_h_get_signed_16(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr)) + +#define bfd_h_put_32(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_h_putx32, (val, ptr)) +#define bfd_h_put_signed_32 \ + bfd_h_put_32 +#define bfd_h_get_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx32, (ptr)) +#define bfd_h_get_signed_32(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr)) + +#define bfd_h_put_64(abfd, val, ptr) \ + BFD_SEND (abfd, bfd_h_putx64, (val, ptr)) +#define bfd_h_put_signed_64 \ + bfd_h_put_64 +#define bfd_h_get_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx64, (ptr)) +#define bfd_h_get_signed_64(abfd, ptr) \ + BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) + +/* Aliases for the above, which should eventually go away. */ + +#define H_PUT_64 bfd_h_put_64 +#define H_PUT_32 bfd_h_put_32 +#define H_PUT_16 bfd_h_put_16 +#define H_PUT_8 bfd_h_put_8 +#define H_PUT_S64 bfd_h_put_signed_64 +#define H_PUT_S32 bfd_h_put_signed_32 +#define H_PUT_S16 bfd_h_put_signed_16 +#define H_PUT_S8 bfd_h_put_signed_8 +#define H_GET_64 bfd_h_get_64 +#define H_GET_32 bfd_h_get_32 +#define H_GET_16 bfd_h_get_16 +#define H_GET_8 bfd_h_get_8 +#define H_GET_S64 bfd_h_get_signed_64 +#define H_GET_S32 bfd_h_get_signed_32 +#define H_GET_S16 bfd_h_get_signed_16 +#define H_GET_S8 bfd_h_get_signed_8 + + +/* Extracted from bfdio.c. */ +long bfd_get_mtime (bfd *abfd); + +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); + +void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, + int prot, int flags, file_ptr offset, + void **map_addr, bfd_size_type *map_len); + +/* Extracted from bfdwin.c. */ +/* Extracted from section.c. */ + +typedef struct bfd_section +{ + /* The name of the section; the name isn't a copy, the pointer is + the same as that passed to bfd_make_section. */ + const char *name; + + /* A unique sequence number. */ + unsigned int id; + + /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ + unsigned int index; + + /* The next section in the list belonging to the BFD, or NULL. */ + struct bfd_section *next; + + /* The previous section in the list belonging to the BFD, or NULL. */ + struct bfd_section *prev; + + /* The field flags contains attributes of the section. Some + flags are read in from the object file, and some are + synthesized from other information. */ + flagword flags; + +#define SEC_NO_FLAGS 0x0 + + /* Tells the OS to allocate space for this section when loading. + This is clear for a section containing debug information only. */ +#define SEC_ALLOC 0x1 + + /* Tells the OS to load the section from the file when loading. + This is clear for a .bss section. */ +#define SEC_LOAD 0x2 + + /* The section contains data still to be relocated, so there is + some relocation information too. */ +#define SEC_RELOC 0x4 + + /* A signal to the OS that the section contains read only data. */ +#define SEC_READONLY 0x8 + + /* The section contains code only. */ +#define SEC_CODE 0x10 + + /* The section contains data only. */ +#define SEC_DATA 0x20 + + /* The section will reside in ROM. */ +#define SEC_ROM 0x40 + + /* The section contains constructor information. This section + type is used by the linker to create lists of constructors and + destructors used by <>. When a back end sees a symbol + which should be used in a constructor list, it creates a new + section for the type of name (e.g., <<__CTOR_LIST__>>), attaches + the symbol to it, and builds a relocation. To build the lists + of constructors, all the linker has to do is catenate all the + sections called <<__CTOR_LIST__>> and relocate the data + contained within - exactly the operations it would peform on + standard data. */ +#define SEC_CONSTRUCTOR 0x80 + + /* The section has contents - a data section could be + <> | <>; a debug section could be + <> */ +#define SEC_HAS_CONTENTS 0x100 + + /* An instruction to the linker to not output the section + even if it has information which would normally be written. */ +#define SEC_NEVER_LOAD 0x200 + + /* The section contains thread local data. */ +#define SEC_THREAD_LOCAL 0x400 + + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 + + /* The section contains common symbols (symbols may be defined + multiple times, the value of a symbol is the amount of + space it requires, and the largest symbol value is the one + used). Most targets have exactly one of these (which we + translate to bfd_com_section_ptr), but ECOFF has two. */ +#define SEC_IS_COMMON 0x1000 + + /* The section contains only debugging information. For + example, this is set for ELF .debug and .stab sections. + strip tests this flag to see if a section can be + discarded. */ +#define SEC_DEBUGGING 0x2000 + + /* The contents of this section are held in memory pointed to + by the contents field. This is checked by bfd_get_section_contents, + and the data is retrieved from memory if appropriate. */ +#define SEC_IN_MEMORY 0x4000 + + /* The contents of this section are to be excluded by the + linker for executable and shared objects unless those + objects are to be further relocated. */ +#define SEC_EXCLUDE 0x8000 + + /* The contents of this section are to be sorted based on the sum of + the symbol and addend values specified by the associated relocation + entries. Entries without associated relocation entries will be + appended to the end of the section in an unspecified order. */ +#define SEC_SORT_ENTRIES 0x10000 + + /* When linking, duplicate sections of the same name should be + discarded, rather than being combined into a single section as + is usually done. This is similar to how common symbols are + handled. See SEC_LINK_DUPLICATES below. */ +#define SEC_LINK_ONCE 0x20000 + + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker + should handle duplicate sections. */ +#define SEC_LINK_DUPLICATES 0xc0000 + + /* This value for SEC_LINK_DUPLICATES means that duplicate + sections with the same name should simply be discarded. */ +#define SEC_LINK_DUPLICATES_DISCARD 0x0 + + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if there are any duplicate sections, although + it should still only link one copy. */ +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 + + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections are a different size. */ +#define SEC_LINK_DUPLICATES_SAME_SIZE 0x80000 + + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections contain different + contents. */ +#define SEC_LINK_DUPLICATES_SAME_CONTENTS \ + (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE) + + /* This section was created by the linker as part of dynamic + relocation or other arcane processing. It is skipped when + going through the first-pass output, trusting that someone + else up the line will take care of it later. */ +#define SEC_LINKER_CREATED 0x100000 + + /* This section should not be subject to garbage collection. + Also set to inform the linker that this section should not be + listed in the link map as discarded. */ +#define SEC_KEEP 0x200000 + + /* This section contains "short" data, and should be placed + "near" the GP. */ +#define SEC_SMALL_DATA 0x400000 + + /* Attempt to merge identical entities in the section. + Entity size is given in the entsize field. */ +#define SEC_MERGE 0x800000 + + /* If given with SEC_MERGE, entities to merge are zero terminated + strings where entsize specifies character size instead of fixed + size entries. */ +#define SEC_STRINGS 0x1000000 + + /* This section contains data about section groups. */ +#define SEC_GROUP 0x2000000 + + /* The section is a COFF shared library section. This flag is + only for the linker. If this type of section appears in + the input file, the linker must copy it to the output file + without changing the vma or size. FIXME: Although this + was originally intended to be general, it really is COFF + specific (and the flag was renamed to indicate this). It + might be cleaner to have some more general mechanism to + allow the back end to control what the linker does with + sections. */ +#define SEC_COFF_SHARED_LIBRARY 0x4000000 + + /* This input section should be copied to output in reverse order + as an array of pointers. This is for ELF linker internal use + only. */ +#define SEC_ELF_REVERSE_COPY 0x4000000 + + /* This section contains data which may be shared with other + executables or shared objects. This is for COFF only. */ +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 + + /* When a section with this flag is being linked, then if the size of + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, + it should be aligned on a page boundary. This is for TI + TMS320C54X only. */ +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 + + /* Conditionally link this section; do not link if there are no + references found to any symbol in the section. This is for TI + TMS320C54X only. */ +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 + + /* Indicate that section has the no read flag set. This happens + when memory read flag isn't set. */ +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 + + /* End of section flags. */ + + /* Some internal packed boolean fields. */ + + /* See the vma field. */ + unsigned int user_set_vma : 1; + + /* A mark flag used by some of the linker backends. */ + unsigned int linker_mark : 1; + + /* Another mark flag used by some of the linker backends. Set for + output sections that have an input section. */ + unsigned int linker_has_input : 1; + + /* Mark flag used by some linker backends for garbage collection. */ + unsigned int gc_mark : 1; + + /* Section compression status. */ + unsigned int compress_status : 2; +#define COMPRESS_SECTION_NONE 0 +#define COMPRESS_SECTION_DONE 1 +#define DECOMPRESS_SECTION_SIZED 2 + + /* The following flags are used by the ELF linker. */ + + /* Mark sections which have been allocated to segments. */ + unsigned int segment_mark : 1; + + /* Type of sec_info information. */ + unsigned int sec_info_type:3; +#define SEC_INFO_TYPE_NONE 0 +#define SEC_INFO_TYPE_STABS 1 +#define SEC_INFO_TYPE_MERGE 2 +#define SEC_INFO_TYPE_EH_FRAME 3 +#define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 + + /* Nonzero if this section uses RELA relocations, rather than REL. */ + unsigned int use_rela_p:1; + + /* Bits used by various backends. The generic code doesn't touch + these fields. */ + + unsigned int sec_flg0:1; + unsigned int sec_flg1:1; + unsigned int sec_flg2:1; + unsigned int sec_flg3:1; + unsigned int sec_flg4:1; + unsigned int sec_flg5:1; + + /* End of internal packed boolean fields. */ + + /* The virtual memory address of the section - where it will be + at run time. The symbols are relocated against this. The + user_set_vma flag is maintained by bfd; if it's not set, the + backend can assign addresses (for example, in <>, where + the default address for <<.data>> is dependent on the specific + target and various flags). */ + bfd_vma vma; + + /* The load address of the section - where it would be in a + rom image; really only used for writing section header + information. */ + bfd_vma lma; + + /* The size of the section in *octets*, as it will be output. + Contains a value even if the section has no contents (e.g., the + size of <<.bss>>). */ + bfd_size_type size; + + /* For input sections, the original size on disk of the section, in + octets. This field should be set for any section whose size is + changed by linker relaxation. It is required for sections where + the linker relaxation scheme doesn't cache altered section and + reloc contents (stabs, eh_frame, SEC_MERGE, some coff relaxing + targets), and thus the original size needs to be kept to read the + section multiple times. For output sections, rawsize holds the + section size calculated on a previous linker relaxation pass. */ + bfd_size_type rawsize; + + /* The compressed size of the section in octets. */ + bfd_size_type compressed_size; + + /* Relaxation table. */ + struct relax_table *relax; + + /* Count of used relaxation table entries. */ + int relax_count; + + + /* If this section is going to be output, then this value is the + offset in *bytes* into the output section of the first byte in the + input section (byte ==> smallest addressable unit on the + target). In most cases, if this was going to start at the + 100th octet (8-bit quantity) in the output section, this value + would be 100. However, if the target byte size is 16 bits + (bfd_octets_per_byte is "2"), this value would be 50. */ + bfd_vma output_offset; + + /* The output section through which to map on output. */ + struct bfd_section *output_section; + + /* The alignment requirement of the section, as an exponent of 2 - + e.g., 3 aligns to 2^3 (or 8). */ + unsigned int alignment_power; + + /* If an input section, a pointer to a vector of relocation + records for the data in this section. */ + struct reloc_cache_entry *relocation; + + /* If an output section, a pointer to a vector of pointers to + relocation records for the data in this section. */ + struct reloc_cache_entry **orelocation; + + /* The number of relocation records in one of the above. */ + unsigned reloc_count; + + /* Information below is back end specific - and not always used + or updated. */ + + /* File position of section data. */ + file_ptr filepos; + + /* File position of relocation info. */ + file_ptr rel_filepos; + + /* File position of line data. */ + file_ptr line_filepos; + + /* Pointer to data for applications. */ + void *userdata; + + /* If the SEC_IN_MEMORY flag is set, this points to the actual + contents. */ + unsigned char *contents; + + /* Attached line number information. */ + alent *lineno; + + /* Number of line number records. */ + unsigned int lineno_count; + + /* Entity size for merging purposes. */ + unsigned int entsize; + + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct bfd_section *kept_section; + + /* When a section is being output, this value changes as more + linenumbers are written out. */ + file_ptr moving_line_filepos; + + /* What the section number is in the target world. */ + int target_index; + + void *used_by_bfd; + + /* If this is a constructor section then here is a list of the + relocations created to relocate items within it. */ + struct relent_chain *constructor_chain; + + /* The BFD which owns the section. */ + bfd *owner; + + /* A symbol which points at this section only. */ + struct bfd_symbol *symbol; + struct bfd_symbol **symbol_ptr_ptr; + + /* Early in the link process, map_head and map_tail are used to build + a list of input sections attached to an output section. Later, + output sections use these fields for a list of bfd_link_order + structs. */ + union { + struct bfd_link_order *link_order; + struct bfd_section *s; + } map_head, map_tail; +} asection; + +/* Relax table contains information about instructions which can + be removed by relaxation -- replacing a long address with a + short address. */ +struct relax_table { + /* Address where bytes may be deleted. */ + bfd_vma addr; + + /* Number of bytes to be deleted. */ + int size; +}; + +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + +/* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. */ +extern asection _bfd_std_section[4]; + +#define BFD_ABS_SECTION_NAME "*ABS*" +#define BFD_UND_SECTION_NAME "*UND*" +#define BFD_COM_SECTION_NAME "*COM*" +#define BFD_IND_SECTION_NAME "*IND*" + +/* Pointer to the common section. */ +#define bfd_com_section_ptr (&_bfd_std_section[0]) +/* Pointer to the undefined section. */ +#define bfd_und_section_ptr (&_bfd_std_section[1]) +/* Pointer to the absolute section. */ +#define bfd_abs_section_ptr (&_bfd_std_section[2]) +/* Pointer to the indirect section. */ +#define bfd_ind_section_ptr (&_bfd_std_section[3]) + +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} + +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} + +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} + +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ + /* name, id, index, next, prev, flags, user_set_vma, */ \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + \ + /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ + 0, 0, 1, 0, \ + \ + /* segment_mark, sec_info_type, use_rela_p, */ \ + 0, 0, 0, \ + \ + /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5, */ \ + 0, 0, 0, 0, 0, 0, \ + \ + /* vma, lma, size, rawsize, compressed_size, relax, relax_count, */ \ + 0, 0, 0, 0, 0, 0, 0, \ + \ + /* output_offset, output_section, alignment_power, */ \ + 0, &SEC, 0, \ + \ + /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ + NULL, NULL, 0, 0, 0, \ + \ + /* line_filepos, userdata, contents, lineno, lineno_count, */ \ + 0, NULL, NULL, NULL, 0, \ + \ + /* entsize, kept_section, moving_line_filepos, */ \ + 0, NULL, 0, \ + \ + /* target_index, used_by_bfd, constructor_chain, owner, */ \ + 0, NULL, NULL, NULL, \ + \ + /* symbol, symbol_ptr_ptr, */ \ + (struct bfd_symbol *) SYM, &SEC.symbol, \ + \ + /* map_head, map_tail */ \ + { NULL }, { NULL } \ + } + +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + +void bfd_section_list_clear (bfd *); + +asection *bfd_get_section_by_name (bfd *abfd, const char *name); + +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); + +asection *bfd_get_linker_section (bfd *abfd, const char *name); + +asection *bfd_get_section_by_name_if + (bfd *abfd, + const char *name, + bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); + +char *bfd_get_unique_section_name + (bfd *abfd, const char *templat, int *count); + +asection *bfd_make_section_old_way (bfd *abfd, const char *name); + +asection *bfd_make_section_anyway_with_flags + (bfd *abfd, const char *name, flagword flags); + +asection *bfd_make_section_anyway (bfd *abfd, const char *name); + +asection *bfd_make_section_with_flags + (bfd *, const char *name, flagword flags); + +asection *bfd_make_section (bfd *, const char *name); + +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); + +void bfd_rename_section + (asection *sec, const char *newname); + +void bfd_map_over_sections + (bfd *abfd, + void (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); + +asection *bfd_sections_find_if + (bfd *abfd, + bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), + void *obj); + +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); + +bfd_boolean bfd_set_section_contents + (bfd *abfd, asection *section, const void *data, + file_ptr offset, bfd_size_type count); + +bfd_boolean bfd_get_section_contents + (bfd *abfd, asection *section, void *location, file_ptr offset, + bfd_size_type count); + +bfd_boolean bfd_malloc_and_get_section + (bfd *abfd, asection *section, bfd_byte **buf); + +bfd_boolean bfd_copy_private_section_data + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); + +#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) +bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); + +const char *bfd_generic_group_name (bfd *, const asection *sec); + +bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); + +/* Extracted from archures.c. */ +enum bfd_architecture +{ + bfd_arch_unknown, /* File arch not known. */ + bfd_arch_obscure, /* Arch known, not one of these. */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ + + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 + + bfd_arch_sparc, /* SPARC. */ +#define bfd_mach_sparc 1 +/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ +#define bfd_mach_sparc_sparclet 2 +#define bfd_mach_sparc_sparclite 3 +#define bfd_mach_sparc_v8plus 4 +#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */ +#define bfd_mach_sparc_sparclite_le 6 +#define bfd_mach_sparc_v9 7 +#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ +#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ +/* Nonzero if MACH has the v9 instruction set. */ +#define bfd_mach_sparc_v9_p(mach) \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ + && (mach) != bfd_mach_sparc_sparclite_le) +/* Nonzero if MACH is a 64 bit sparc architecture. */ +#define bfd_mach_sparc_64bit_p(mach) \ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ +#define bfd_mach_mips3000 3000 +#define bfd_mach_mips3900 3900 +#define bfd_mach_mips4000 4000 +#define bfd_mach_mips4010 4010 +#define bfd_mach_mips4100 4100 +#define bfd_mach_mips4111 4111 +#define bfd_mach_mips4120 4120 +#define bfd_mach_mips4300 4300 +#define bfd_mach_mips4400 4400 +#define bfd_mach_mips4600 4600 +#define bfd_mach_mips4650 4650 +#define bfd_mach_mips5000 5000 +#define bfd_mach_mips5400 5400 +#define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 +#define bfd_mach_mips6000 6000 +#define bfd_mach_mips7000 7000 +#define bfd_mach_mips8000 8000 +#define bfd_mach_mips9000 9000 +#define bfd_mach_mips10000 10000 +#define bfd_mach_mips12000 12000 +#define bfd_mach_mips14000 14000 +#define bfd_mach_mips16000 16000 +#define bfd_mach_mips16 16 +#define bfd_mach_mips5 5 +#define bfd_mach_mips_loongson_2e 3001 +#define bfd_mach_mips_loongson_2f 3002 +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ +#define bfd_mach_mips_octeon 6501 +#define bfd_mach_mips_octeonp 6601 +#define bfd_mach_mips_octeon2 6502 +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ +#define bfd_mach_mipsisa32 32 +#define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 +#define bfd_mach_mipsisa64 64 +#define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 +#define bfd_mach_mips_micromips 96 + bfd_arch_i386, /* Intel 386. */ +#define bfd_mach_i386_intel_syntax (1 << 0) +#define bfd_mach_i386_i8086 (1 << 1) +#define bfd_mach_i386_i386 (1 << 2) +#define bfd_mach_x86_64 (1 << 3) +#define bfd_mach_x64_32 (1 << 4) +#define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) +#define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) +#define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) + bfd_arch_l1om, /* Intel L1OM. */ +#define bfd_mach_l1om (1 << 5) +#define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) + bfd_arch_k1om, /* Intel K1OM. */ +#define bfd_mach_k1om (1 << 6) +#define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ + bfd_arch_plugin, + bfd_arch_powerpc, /* PowerPC. */ +#define bfd_mach_ppc 32 +#define bfd_mach_ppc64 64 +#define bfd_mach_ppc_403 403 +#define bfd_mach_ppc_403gc 4030 +#define bfd_mach_ppc_405 405 +#define bfd_mach_ppc_505 505 +#define bfd_mach_ppc_601 601 +#define bfd_mach_ppc_602 602 +#define bfd_mach_ppc_603 603 +#define bfd_mach_ppc_ec603e 6031 +#define bfd_mach_ppc_604 604 +#define bfd_mach_ppc_620 620 +#define bfd_mach_ppc_630 630 +#define bfd_mach_ppc_750 750 +#define bfd_mach_ppc_860 860 +#define bfd_mach_ppc_a35 35 +#define bfd_mach_ppc_rs64ii 642 +#define bfd_mach_ppc_rs64iii 643 +#define bfd_mach_ppc_7400 7400 +#define bfd_mach_ppc_e500 500 +#define bfd_mach_ppc_e500mc 5001 +#define bfd_mach_ppc_e500mc64 5005 +#define bfd_mach_ppc_e5500 5006 +#define bfd_mach_ppc_e6500 5007 +#define bfd_mach_ppc_titan 83 +#define bfd_mach_ppc_vle 84 + bfd_arch_rs6000, /* IBM RS/6000. */ +#define bfd_mach_rs6k 6000 +#define bfd_mach_rs6k_rs1 6001 +#define bfd_mach_rs6k_rsc 6003 +#define bfd_mach_rs6k_rs2 6002 + bfd_arch_hppa, /* HP PA RISC. */ +#define bfd_mach_hppa10 10 +#define bfd_mach_hppa11 11 +#define bfd_mach_hppa20 20 +#define bfd_mach_hppa20w 25 + bfd_arch_d10v, /* Mitsubishi D10V. */ +#define bfd_mach_d10v 1 +#define bfd_mach_d10v_ts2 2 +#define bfd_mach_d10v_ts3 3 + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ +#define bfd_mach_m6812_default 0 +#define bfd_mach_m6812 1 +#define bfd_mach_m6812s 2 + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ +#define bfd_mach_z8001 1 +#define bfd_mach_z8002 2 + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b +#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 + bfd_arch_arm, /* Advanced Risc Machines ARM. */ +#define bfd_mach_arm_unknown 0 +#define bfd_mach_arm_2 1 +#define bfd_mach_arm_2a 2 +#define bfd_mach_arm_3 3 +#define bfd_mach_arm_3M 4 +#define bfd_mach_arm_4 5 +#define bfd_mach_arm_4T 6 +#define bfd_mach_arm_5 7 +#define bfd_mach_arm_5T 8 +#define bfd_mach_arm_5TE 9 +#define bfd_mach_arm_XScale 10 +#define bfd_mach_arm_ep9312 11 +#define bfd_mach_arm_iWMMXt 12 +#define bfd_mach_arm_iWMMXt2 13 +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ +#define bfd_mach_tic3x 30 +#define bfd_mach_tic4x 40 + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ +#define bfd_mach_v850 1 +#define bfd_mach_v850e 'E' +#define bfd_mach_v850e1 '1' +#define bfd_mach_v850e2 0x4532 +#define bfd_mach_v850e2v3 0x45325633 +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ +#define bfd_mach_m32r 1 /* For backwards compatibility. */ +#define bfd_mach_m32rx 'x' +#define bfd_mach_m32r2 '2' + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 +#define bfd_mach_am33 330 +#define bfd_mach_am33_2 332 + bfd_arch_fr30, +#define bfd_mach_fr30 0x46523330 + bfd_arch_frv, +#define bfd_mach_frv 1 +#define bfd_mach_frvsimple 2 +#define bfd_mach_fr300 300 +#define bfd_mach_fr400 400 +#define bfd_mach_fr450 450 +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ +#define bfd_mach_fr500 500 +#define bfd_mach_fr550 550 + bfd_arch_moxie, /* The moxie processor. */ +#define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 + bfd_arch_mcore, + bfd_arch_mep, +#define bfd_mach_mep 1 +#define bfd_mach_mep_h1 0x6831 +#define bfd_mach_mep_c5 0x6335 + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ +#define bfd_mach_ia64_elf64 64 +#define bfd_mach_ia64_elf32 32 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ +#define bfd_mach_ip2022 1 +#define bfd_mach_ip2022ext 2 + bfd_arch_iq2000, /* Vitesse IQ2000. */ +#define bfd_mach_iq2000 1 +#define bfd_mach_iq10 2 + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ +#define bfd_mach_epiphany16 1 +#define bfd_mach_epiphany32 2 + bfd_arch_mt, +#define bfd_mach_ms1 1 +#define bfd_mach_mrisc2 2 +#define bfd_mach_ms2 3 + bfd_arch_pj, + bfd_arch_avr, /* Atmel AVR microcontrollers. */ +#define bfd_mach_avr1 1 +#define bfd_mach_avr2 2 +#define bfd_mach_avr25 25 +#define bfd_mach_avr3 3 +#define bfd_mach_avr31 31 +#define bfd_mach_avr35 35 +#define bfd_mach_avr4 4 +#define bfd_mach_avr5 5 +#define bfd_mach_avr51 51 +#define bfd_mach_avr6 6 +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ +#define bfd_mach_bfin 1 + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ +#define bfd_mach_cr16 1 + bfd_arch_crx, /* National Semiconductor CRX. */ +#define bfd_mach_crx 1 + bfd_arch_cris, /* Axis CRIS. */ +#define bfd_mach_cris_v0_v10 255 +#define bfd_mach_cris_v32 32 +#define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 + bfd_arch_rl78, +#define bfd_mach_rl78 0x75 + bfd_arch_rx, /* Renesas RX. */ +#define bfd_mach_rx 0x75 +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ +#define bfd_mach_s390_31 31 +#define bfd_mach_s390_64 64 + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 + bfd_arch_mmix, /* Donald Knuth's educational processor. */ + bfd_arch_xstormy16, +#define bfd_mach_xstormy16 1 + bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_xc16x 1 +#define bfd_mach_xc16xl 2 +#define bfd_mach_xc16xs 3 + bfd_arch_xgate, /* Freescale XGATE. */ +#define bfd_mach_xgate 1 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ +#define bfd_mach_xtensa 1 + bfd_arch_z80, +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ +#define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 + bfd_arch_last + }; + +typedef struct bfd_arch_info +{ + int bits_per_word; + int bits_per_address; + int bits_per_byte; + enum bfd_architecture arch; + unsigned long mach; + const char *arch_name; + const char *printable_name; + unsigned int section_align_power; + /* TRUE if this is the default machine for the architecture. + The default arch should be the first entry for an arch so that + all the entries for that arch can be accessed via <>. */ + bfd_boolean the_default; + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); + + bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); + + /* Allocate via bfd_malloc and return a fill buffer of size COUNT. If + IS_BIGENDIAN is TRUE, the order of bytes is big endian. If CODE is + TRUE, the buffer contains code. */ + void *(*fill) (bfd_size_type count, bfd_boolean is_bigendian, + bfd_boolean code); + + const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; +} +bfd_arch_info_type; + +const char *bfd_printable_name (bfd *abfd); + +const bfd_arch_info_type *bfd_scan_arch (const char *string); + +const char **bfd_arch_list (void); + +const bfd_arch_info_type *bfd_arch_get_compatible + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); + +void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); + +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); + +enum bfd_architecture bfd_get_arch (const bfd *abfd); + +unsigned long bfd_get_mach (const bfd *abfd); + +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); + +const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); + +const bfd_arch_info_type *bfd_lookup_arch + (enum bfd_architecture arch, unsigned long machine); + +const char *bfd_printable_arch_mach + (enum bfd_architecture arch, unsigned long machine); + +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); + +unsigned int bfd_arch_mach_octets_per_byte + (enum bfd_architecture arch, unsigned long machine); + +/* Extracted from reloc.c. */ + +typedef enum bfd_reloc_status +{ + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, + + /* The relocation was performed, but there was an overflow. */ + bfd_reloc_overflow, + + /* The address to relocate was not within the section supplied. */ + bfd_reloc_outofrange, + + /* Used by special functions. */ + bfd_reloc_continue, + + /* Unsupported relocation size requested. */ + bfd_reloc_notsupported, + + /* Unused. */ + bfd_reloc_other, + + /* The symbol to relocate against was undefined. */ + bfd_reloc_undefined, + + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ + bfd_reloc_dangerous + } + bfd_reloc_status_type; + +typedef const struct reloc_howto_struct reloc_howto_type; + +typedef struct reloc_cache_entry +{ + /* A pointer into the canonical table of pointers. */ + struct bfd_symbol **sym_ptr_ptr; + + /* offset in section. */ + bfd_size_type address; + + /* addend for relocation value. */ + bfd_vma addend; + + /* Pointer to how to perform the required relocation. */ + reloc_howto_type *howto; + +} +arelent; + + +enum complain_overflow +{ + /* Do not complain on overflow. */ + complain_overflow_dont, + + /* Complain if the value overflows when considered as a signed + number one bit larger than the field. ie. A bitfield of N bits + is allowed to represent -2**n to 2**n-1. */ + complain_overflow_bitfield, + + /* Complain if the value overflows when considered as a signed + number. */ + complain_overflow_signed, + + /* Complain if the value overflows when considered as an + unsigned number. */ + complain_overflow_unsigned +}; +struct reloc_howto_struct +{ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ + unsigned int type; + + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; + + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; + + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; + + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; + + /* What type of overflow error should be checked for when + relocating. */ + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; + + /* The relocation value should be negated before applying. */ + unsigned int negate:1; + + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; + + /* Some formats record a relocation addend in the section contents + rather than with the relocation. For ELF formats this is the + distinction between USE_REL and USE_RELA (though the code checks + for USE_REL == 1/0). The value of this field is TRUE if the + addend is recorded with the section contents; when performing a + partial link (ld -r) the section contents (the data) will be + modified. The value of this field is FALSE if addends are + recorded with the relocation (in arelent.addend); when performing + a partial link the relocation will be modified. + All relocations for all ELF USE_RELA targets should set this field + to FALSE (values of TRUE should be looked on with suspicion). + However, the converse is not true: not all relocations of all ELF + USE_REL targets set this field to TRUE. Why this is so is peculiar + to each particular target. For relocs that aren't used in partial + links (e.g. GOT stuff) it doesn't matter what this is set to. */ + unsigned int partial_inplace:1; + + /* When some formats create PC relative instructions, they leave + the value of the pc of the place being relocated in the offset + slot of the instruction, so that a PC relative relocation can + be made just by adding in an ordinary offset (e.g., sun3 a.out). + Some formats leave the displacement part of an instruction + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; +}; + +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } +#define EMPTY_HOWTO(C) \ + HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ + NULL, FALSE, 0, 0, FALSE) + +unsigned int bfd_get_reloc_size (reloc_howto_type *); + +typedef struct relent_chain +{ + arelent relent; + struct relent_chain *next; +} +arelent_chain; + +bfd_reloc_status_type bfd_check_overflow + (enum complain_overflow how, + unsigned int bitsize, + unsigned int rightshift, + unsigned int addrsize, + bfd_vma relocation); + +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + +bfd_reloc_status_type bfd_perform_relocation + (bfd *abfd, + arelent *reloc_entry, + void *data, + asection *input_section, + bfd *output_bfd, + char **error_message); + +bfd_reloc_status_type bfd_install_relocation + (bfd *abfd, + arelent *reloc_entry, + void *data, bfd_vma data_start, + asection *input_section, + char **error_message); + +enum bfd_reloc_code_real { + _dummy_first_bfd_reloc_code_real, + + +/* Basic absolute relocations of N bits. */ + BFD_RELOC_64, + BFD_RELOC_32, + BFD_RELOC_26, + BFD_RELOC_24, + BFD_RELOC_16, + BFD_RELOC_14, + BFD_RELOC_8, + +/* PC-relative relocations. Sometimes these are relative to the address +of the relocation itself; sometimes they are relative to the start of +the section containing the relocation. It depends on the specific target. */ + BFD_RELOC_64_PCREL, + BFD_RELOC_32_PCREL, + BFD_RELOC_24_PCREL, + BFD_RELOC_16_PCREL, + BFD_RELOC_12_PCREL, + BFD_RELOC_8_PCREL, + +/* Section relative relocations. Some targets need this for DWARF2. */ + BFD_RELOC_32_SECREL, + +/* For ELF. */ + BFD_RELOC_32_GOT_PCREL, + BFD_RELOC_16_GOT_PCREL, + BFD_RELOC_8_GOT_PCREL, + BFD_RELOC_32_GOTOFF, + BFD_RELOC_16_GOTOFF, + BFD_RELOC_LO16_GOTOFF, + BFD_RELOC_HI16_GOTOFF, + BFD_RELOC_HI16_S_GOTOFF, + BFD_RELOC_8_GOTOFF, + BFD_RELOC_64_PLT_PCREL, + BFD_RELOC_32_PLT_PCREL, + BFD_RELOC_24_PLT_PCREL, + BFD_RELOC_16_PLT_PCREL, + BFD_RELOC_8_PLT_PCREL, + BFD_RELOC_64_PLTOFF, + BFD_RELOC_32_PLTOFF, + BFD_RELOC_16_PLTOFF, + BFD_RELOC_LO16_PLTOFF, + BFD_RELOC_HI16_PLTOFF, + BFD_RELOC_HI16_S_PLTOFF, + BFD_RELOC_8_PLTOFF, + +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + +/* Relocations used by 68K ELF. */ + BFD_RELOC_68K_GLOB_DAT, + BFD_RELOC_68K_JMP_SLOT, + BFD_RELOC_68K_RELATIVE, + BFD_RELOC_68K_TLS_GD32, + BFD_RELOC_68K_TLS_GD16, + BFD_RELOC_68K_TLS_GD8, + BFD_RELOC_68K_TLS_LDM32, + BFD_RELOC_68K_TLS_LDM16, + BFD_RELOC_68K_TLS_LDM8, + BFD_RELOC_68K_TLS_LDO32, + BFD_RELOC_68K_TLS_LDO16, + BFD_RELOC_68K_TLS_LDO8, + BFD_RELOC_68K_TLS_IE32, + BFD_RELOC_68K_TLS_IE16, + BFD_RELOC_68K_TLS_IE8, + BFD_RELOC_68K_TLS_LE32, + BFD_RELOC_68K_TLS_LE16, + BFD_RELOC_68K_TLS_LE8, + +/* Linkage-table relative. */ + BFD_RELOC_32_BASEREL, + BFD_RELOC_16_BASEREL, + BFD_RELOC_LO16_BASEREL, + BFD_RELOC_HI16_BASEREL, + BFD_RELOC_HI16_S_BASEREL, + BFD_RELOC_8_BASEREL, + BFD_RELOC_RVA, + +/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */ + BFD_RELOC_8_FFnn, + +/* These PC-relative relocations are stored as word displacements -- +i.e., byte displacements shifted right two bits. The 30-bit word +displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the +SPARC. (SPARC tools generally refer to this as <>.) The +signed 16-bit displacement is used on the MIPS, and the 23-bit +displacement is used on the Alpha. */ + BFD_RELOC_32_PCREL_S2, + BFD_RELOC_16_PCREL_S2, + BFD_RELOC_23_PCREL_S2, + +/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of +the target word. These are used on the SPARC. */ + BFD_RELOC_HI22, + BFD_RELOC_LO10, + +/* For systems that allocate a Global Pointer register, these are +displacements off that register. These relocation types are +handled specially, because the value the register will have is +decided relatively late. */ + BFD_RELOC_GPREL16, + BFD_RELOC_GPREL32, + +/* SPARC ELF relocations. There is probably some overlap with other +relocation types already defined. */ + BFD_RELOC_NONE, + BFD_RELOC_SPARC_WDISP22, + BFD_RELOC_SPARC22, + BFD_RELOC_SPARC13, + BFD_RELOC_SPARC_GOT10, + BFD_RELOC_SPARC_GOT13, + BFD_RELOC_SPARC_GOT22, + BFD_RELOC_SPARC_PC10, + BFD_RELOC_SPARC_PC22, + BFD_RELOC_SPARC_WPLT30, + BFD_RELOC_SPARC_COPY, + BFD_RELOC_SPARC_GLOB_DAT, + BFD_RELOC_SPARC_JMP_SLOT, + BFD_RELOC_SPARC_RELATIVE, + BFD_RELOC_SPARC_UA16, + BFD_RELOC_SPARC_UA32, + BFD_RELOC_SPARC_UA64, + BFD_RELOC_SPARC_GOTDATA_HIX22, + BFD_RELOC_SPARC_GOTDATA_LOX10, + BFD_RELOC_SPARC_GOTDATA_OP_HIX22, + BFD_RELOC_SPARC_GOTDATA_OP_LOX10, + BFD_RELOC_SPARC_GOTDATA_OP, + BFD_RELOC_SPARC_JMP_IREL, + BFD_RELOC_SPARC_IRELATIVE, + +/* I think these are specific to SPARC a.out (e.g., Sun 4). */ + BFD_RELOC_SPARC_BASE13, + BFD_RELOC_SPARC_BASE22, + +/* SPARC64 relocations */ +#define BFD_RELOC_SPARC_64 BFD_RELOC_64 + BFD_RELOC_SPARC_10, + BFD_RELOC_SPARC_11, + BFD_RELOC_SPARC_OLO10, + BFD_RELOC_SPARC_HH22, + BFD_RELOC_SPARC_HM10, + BFD_RELOC_SPARC_LM22, + BFD_RELOC_SPARC_PC_HH22, + BFD_RELOC_SPARC_PC_HM10, + BFD_RELOC_SPARC_PC_LM22, + BFD_RELOC_SPARC_WDISP16, + BFD_RELOC_SPARC_WDISP19, + BFD_RELOC_SPARC_7, + BFD_RELOC_SPARC_6, + BFD_RELOC_SPARC_5, +#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL + BFD_RELOC_SPARC_PLT32, + BFD_RELOC_SPARC_PLT64, + BFD_RELOC_SPARC_HIX22, + BFD_RELOC_SPARC_LOX10, + BFD_RELOC_SPARC_H44, + BFD_RELOC_SPARC_M44, + BFD_RELOC_SPARC_L44, + BFD_RELOC_SPARC_REGISTER, + BFD_RELOC_SPARC_H34, + BFD_RELOC_SPARC_SIZE32, + BFD_RELOC_SPARC_SIZE64, + BFD_RELOC_SPARC_WDISP10, + +/* SPARC little endian relocation */ + BFD_RELOC_SPARC_REV32, + +/* SPARC TLS relocations */ + BFD_RELOC_SPARC_TLS_GD_HI22, + BFD_RELOC_SPARC_TLS_GD_LO10, + BFD_RELOC_SPARC_TLS_GD_ADD, + BFD_RELOC_SPARC_TLS_GD_CALL, + BFD_RELOC_SPARC_TLS_LDM_HI22, + BFD_RELOC_SPARC_TLS_LDM_LO10, + BFD_RELOC_SPARC_TLS_LDM_ADD, + BFD_RELOC_SPARC_TLS_LDM_CALL, + BFD_RELOC_SPARC_TLS_LDO_HIX22, + BFD_RELOC_SPARC_TLS_LDO_LOX10, + BFD_RELOC_SPARC_TLS_LDO_ADD, + BFD_RELOC_SPARC_TLS_IE_HI22, + BFD_RELOC_SPARC_TLS_IE_LO10, + BFD_RELOC_SPARC_TLS_IE_LD, + BFD_RELOC_SPARC_TLS_IE_LDX, + BFD_RELOC_SPARC_TLS_IE_ADD, + BFD_RELOC_SPARC_TLS_LE_HIX22, + BFD_RELOC_SPARC_TLS_LE_LOX10, + BFD_RELOC_SPARC_TLS_DTPMOD32, + BFD_RELOC_SPARC_TLS_DTPMOD64, + BFD_RELOC_SPARC_TLS_DTPOFF32, + BFD_RELOC_SPARC_TLS_DTPOFF64, + BFD_RELOC_SPARC_TLS_TPOFF32, + BFD_RELOC_SPARC_TLS_TPOFF64, + +/* SPU Relocations. */ + BFD_RELOC_SPU_IMM7, + BFD_RELOC_SPU_IMM8, + BFD_RELOC_SPU_IMM10, + BFD_RELOC_SPU_IMM10W, + BFD_RELOC_SPU_IMM16, + BFD_RELOC_SPU_IMM16W, + BFD_RELOC_SPU_IMM18, + BFD_RELOC_SPU_PCREL9a, + BFD_RELOC_SPU_PCREL9b, + BFD_RELOC_SPU_PCREL16, + BFD_RELOC_SPU_LO16, + BFD_RELOC_SPU_HI16, + BFD_RELOC_SPU_PPU32, + BFD_RELOC_SPU_PPU64, + BFD_RELOC_SPU_ADD_PIC, + +/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or +"addend" in some special way. +For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when +writing; when reading, it will be the absolute section symbol. The +addend is the displacement in bytes of the "lda" instruction from +the "ldah" instruction (which is at the address of this reloc). */ + BFD_RELOC_ALPHA_GPDISP_HI16, + +/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as +with GPDISP_HI16 relocs. The addend is ignored when writing the +relocations out, and is filled in with the file's GP value on +reading, for convenience. */ + BFD_RELOC_ALPHA_GPDISP_LO16, + +/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16 +relocation except that there is no accompanying GPDISP_LO16 +relocation. */ + BFD_RELOC_ALPHA_GPDISP, + +/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference; +the assembler turns it into a LDQ instruction to load the address of +the symbol, and then fills in a register in the real instruction. + +The LITERAL reloc, at the LDQ instruction, refers to the .lita +section symbol. The addend is ignored when writing, but is filled +in with the file's GP value on reading, for convenience, as with the +GPDISP_LO16 reloc. + +The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16. +It should refer to the symbol to be referenced, as with 16_GOTOFF, +but it generates output not based on the position within the .got +section, but relative to the GP value chosen for the file during the +final link stage. + +The LITUSE reloc, on the instruction using the loaded address, gives +information to the linker that it might be able to use to optimize +away some literal section references. The symbol is ignored (read +as the absolute section symbol), and the "addend" indicates the type +of instruction using the register: +1 - "memory" fmt insn +2 - byte-manipulation (byte offset reg) +3 - jsr (target of branch) */ + BFD_RELOC_ALPHA_LITERAL, + BFD_RELOC_ALPHA_ELF_LITERAL, + BFD_RELOC_ALPHA_LITUSE, + +/* The HINT relocation indicates a value that should be filled into the +"hint" field of a jmp/jsr/ret instruction, for possible branch- +prediction logic which may be provided on some processors. */ + BFD_RELOC_ALPHA_HINT, + +/* The LINKAGE relocation outputs a linkage pair in the object file, +which is filled by the linker. */ + BFD_RELOC_ALPHA_LINKAGE, + +/* The CODEADDR relocation outputs a STO_CA in the object file, +which is filled by the linker. */ + BFD_RELOC_ALPHA_CODEADDR, + +/* The GPREL_HI/LO relocations together form a 32-bit offset from the +GP register. */ + BFD_RELOC_ALPHA_GPREL_HI16, + BFD_RELOC_ALPHA_GPREL_LO16, + +/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must +share a common GP, and the target address is adjusted for +STO_ALPHA_STD_GPLOAD. */ + BFD_RELOC_ALPHA_BRSGP, + +/* The NOP relocation outputs a NOP if the longword displacement +between two procedure entry points is < 2^21. */ + BFD_RELOC_ALPHA_NOP, + +/* The BSR relocation outputs a BSR if the longword displacement +between two procedure entry points is < 2^21. */ + BFD_RELOC_ALPHA_BSR, + +/* The LDA relocation outputs a LDA if the longword displacement +between two procedure entry points is < 2^16. */ + BFD_RELOC_ALPHA_LDA, + +/* The BOH relocation outputs a BSR if the longword displacement +between two procedure entry points is < 2^21, or else a hint. */ + BFD_RELOC_ALPHA_BOH, + +/* Alpha thread-local storage relocations. */ + BFD_RELOC_ALPHA_TLSGD, + BFD_RELOC_ALPHA_TLSLDM, + BFD_RELOC_ALPHA_DTPMOD64, + BFD_RELOC_ALPHA_GOTDTPREL16, + BFD_RELOC_ALPHA_DTPREL64, + BFD_RELOC_ALPHA_DTPREL_HI16, + BFD_RELOC_ALPHA_DTPREL_LO16, + BFD_RELOC_ALPHA_DTPREL16, + BFD_RELOC_ALPHA_GOTTPREL16, + BFD_RELOC_ALPHA_TPREL64, + BFD_RELOC_ALPHA_TPREL_HI16, + BFD_RELOC_ALPHA_TPREL_LO16, + BFD_RELOC_ALPHA_TPREL16, + +/* The MIPS jump instruction. */ + BFD_RELOC_MIPS_JMP, + BFD_RELOC_MICROMIPS_JMP, + +/* The MIPS16 jump instruction. */ + BFD_RELOC_MIPS16_JMP, + +/* MIPS16 GP relative reloc. */ + BFD_RELOC_MIPS16_GPREL, + +/* High 16 bits of 32-bit value; simple reloc. */ + BFD_RELOC_HI16, + +/* High 16 bits of 32-bit value but the low 16 bits will be sign +extended and added to form the final result. If the low 16 +bits form a negative number, we need to add one to the high value +to compensate for the borrow when the low bits are added. */ + BFD_RELOC_HI16_S, + +/* Low 16 bits. */ + BFD_RELOC_LO16, + +/* High 16 bits of 32-bit pc-relative value */ + BFD_RELOC_HI16_PCREL, + +/* High 16 bits of 32-bit pc-relative value, adjusted */ + BFD_RELOC_HI16_S_PCREL, + +/* Low 16 bits of pc-relative value */ + BFD_RELOC_LO16_PCREL, + +/* Equivalent of BFD_RELOC_MIPS_*, but with the MIPS16 layout of +16-bit immediate fields */ + BFD_RELOC_MIPS16_GOT16, + BFD_RELOC_MIPS16_CALL16, + +/* MIPS16 high 16 bits of 32-bit value. */ + BFD_RELOC_MIPS16_HI16, + +/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign +extended and added to form the final result. If the low 16 +bits form a negative number, we need to add one to the high value +to compensate for the borrow when the low bits are added. */ + BFD_RELOC_MIPS16_HI16_S, + +/* MIPS16 low 16 bits. */ + BFD_RELOC_MIPS16_LO16, + +/* MIPS16 TLS relocations */ + BFD_RELOC_MIPS16_TLS_GD, + BFD_RELOC_MIPS16_TLS_LDM, + BFD_RELOC_MIPS16_TLS_DTPREL_HI16, + BFD_RELOC_MIPS16_TLS_DTPREL_LO16, + BFD_RELOC_MIPS16_TLS_GOTTPREL, + BFD_RELOC_MIPS16_TLS_TPREL_HI16, + BFD_RELOC_MIPS16_TLS_TPREL_LO16, + +/* Relocation against a MIPS literal section. */ + BFD_RELOC_MIPS_LITERAL, + BFD_RELOC_MICROMIPS_LITERAL, + +/* microMIPS PC-relative relocations. */ + BFD_RELOC_MICROMIPS_7_PCREL_S1, + BFD_RELOC_MICROMIPS_10_PCREL_S1, + BFD_RELOC_MICROMIPS_16_PCREL_S1, + +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + +/* microMIPS versions of generic BFD relocs. */ + BFD_RELOC_MICROMIPS_GPREL16, + BFD_RELOC_MICROMIPS_HI16, + BFD_RELOC_MICROMIPS_HI16_S, + BFD_RELOC_MICROMIPS_LO16, + +/* MIPS ELF relocations. */ + BFD_RELOC_MIPS_GOT16, + BFD_RELOC_MICROMIPS_GOT16, + BFD_RELOC_MIPS_CALL16, + BFD_RELOC_MICROMIPS_CALL16, + BFD_RELOC_MIPS_GOT_HI16, + BFD_RELOC_MICROMIPS_GOT_HI16, + BFD_RELOC_MIPS_GOT_LO16, + BFD_RELOC_MICROMIPS_GOT_LO16, + BFD_RELOC_MIPS_CALL_HI16, + BFD_RELOC_MICROMIPS_CALL_HI16, + BFD_RELOC_MIPS_CALL_LO16, + BFD_RELOC_MICROMIPS_CALL_LO16, + BFD_RELOC_MIPS_SUB, + BFD_RELOC_MICROMIPS_SUB, + BFD_RELOC_MIPS_GOT_PAGE, + BFD_RELOC_MICROMIPS_GOT_PAGE, + BFD_RELOC_MIPS_GOT_OFST, + BFD_RELOC_MICROMIPS_GOT_OFST, + BFD_RELOC_MIPS_GOT_DISP, + BFD_RELOC_MICROMIPS_GOT_DISP, + BFD_RELOC_MIPS_SHIFT5, + BFD_RELOC_MIPS_SHIFT6, + BFD_RELOC_MIPS_INSERT_A, + BFD_RELOC_MIPS_INSERT_B, + BFD_RELOC_MIPS_DELETE, + BFD_RELOC_MIPS_HIGHEST, + BFD_RELOC_MICROMIPS_HIGHEST, + BFD_RELOC_MIPS_HIGHER, + BFD_RELOC_MICROMIPS_HIGHER, + BFD_RELOC_MIPS_SCN_DISP, + BFD_RELOC_MICROMIPS_SCN_DISP, + BFD_RELOC_MIPS_REL16, + BFD_RELOC_MIPS_RELGOT, + BFD_RELOC_MIPS_JALR, + BFD_RELOC_MICROMIPS_JALR, + BFD_RELOC_MIPS_TLS_DTPMOD32, + BFD_RELOC_MIPS_TLS_DTPREL32, + BFD_RELOC_MIPS_TLS_DTPMOD64, + BFD_RELOC_MIPS_TLS_DTPREL64, + BFD_RELOC_MIPS_TLS_GD, + BFD_RELOC_MICROMIPS_TLS_GD, + BFD_RELOC_MIPS_TLS_LDM, + BFD_RELOC_MICROMIPS_TLS_LDM, + BFD_RELOC_MIPS_TLS_DTPREL_HI16, + BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16, + BFD_RELOC_MIPS_TLS_DTPREL_LO16, + BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16, + BFD_RELOC_MIPS_TLS_GOTTPREL, + BFD_RELOC_MICROMIPS_TLS_GOTTPREL, + BFD_RELOC_MIPS_TLS_TPREL32, + BFD_RELOC_MIPS_TLS_TPREL64, + BFD_RELOC_MIPS_TLS_TPREL_HI16, + BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, + BFD_RELOC_MIPS_TLS_TPREL_LO16, + BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, + + +/* MIPS ELF relocations (VxWorks and PLT extensions). */ + BFD_RELOC_MIPS_COPY, + BFD_RELOC_MIPS_JUMP_SLOT, + + +/* Moxie ELF relocations. */ + BFD_RELOC_MOXIE_10_PCREL, + + +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + +/* Fujitsu Frv Relocations. */ + BFD_RELOC_FRV_LABEL16, + BFD_RELOC_FRV_LABEL24, + BFD_RELOC_FRV_LO16, + BFD_RELOC_FRV_HI16, + BFD_RELOC_FRV_GPREL12, + BFD_RELOC_FRV_GPRELU12, + BFD_RELOC_FRV_GPREL32, + BFD_RELOC_FRV_GPRELHI, + BFD_RELOC_FRV_GPRELLO, + BFD_RELOC_FRV_GOT12, + BFD_RELOC_FRV_GOTHI, + BFD_RELOC_FRV_GOTLO, + BFD_RELOC_FRV_FUNCDESC, + BFD_RELOC_FRV_FUNCDESC_GOT12, + BFD_RELOC_FRV_FUNCDESC_GOTHI, + BFD_RELOC_FRV_FUNCDESC_GOTLO, + BFD_RELOC_FRV_FUNCDESC_VALUE, + BFD_RELOC_FRV_FUNCDESC_GOTOFF12, + BFD_RELOC_FRV_FUNCDESC_GOTOFFHI, + BFD_RELOC_FRV_FUNCDESC_GOTOFFLO, + BFD_RELOC_FRV_GOTOFF12, + BFD_RELOC_FRV_GOTOFFHI, + BFD_RELOC_FRV_GOTOFFLO, + BFD_RELOC_FRV_GETTLSOFF, + BFD_RELOC_FRV_TLSDESC_VALUE, + BFD_RELOC_FRV_GOTTLSDESC12, + BFD_RELOC_FRV_GOTTLSDESCHI, + BFD_RELOC_FRV_GOTTLSDESCLO, + BFD_RELOC_FRV_TLSMOFF12, + BFD_RELOC_FRV_TLSMOFFHI, + BFD_RELOC_FRV_TLSMOFFLO, + BFD_RELOC_FRV_GOTTLSOFF12, + BFD_RELOC_FRV_GOTTLSOFFHI, + BFD_RELOC_FRV_GOTTLSOFFLO, + BFD_RELOC_FRV_TLSOFF, + BFD_RELOC_FRV_TLSDESC_RELAX, + BFD_RELOC_FRV_GETTLSOFF_RELAX, + BFD_RELOC_FRV_TLSOFF_RELAX, + BFD_RELOC_FRV_TLSMOFF, + + +/* This is a 24bit GOT-relative reloc for the mn10300. */ + BFD_RELOC_MN10300_GOTOFF24, + +/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. */ + BFD_RELOC_MN10300_GOT32, + +/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. */ + BFD_RELOC_MN10300_GOT24, + +/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. */ + BFD_RELOC_MN10300_GOT16, + +/* Copy symbol at runtime. */ + BFD_RELOC_MN10300_COPY, + +/* Create GOT entry. */ + BFD_RELOC_MN10300_GLOB_DAT, + +/* Create PLT entry. */ + BFD_RELOC_MN10300_JMP_SLOT, + +/* Adjust by program base. */ + BFD_RELOC_MN10300_RELATIVE, + +/* Together with another reloc targeted at the same location, +allows for a value that is the difference of two symbols +in the same section. */ + BFD_RELOC_MN10300_SYM_DIFF, + +/* The addend of this reloc is an alignment power that must +be honoured at the offset's location, regardless of linker +relaxation. */ + BFD_RELOC_MN10300_ALIGN, + +/* Various TLS-related relocations. */ + BFD_RELOC_MN10300_TLS_GD, + BFD_RELOC_MN10300_TLS_LD, + BFD_RELOC_MN10300_TLS_LDO, + BFD_RELOC_MN10300_TLS_GOTIE, + BFD_RELOC_MN10300_TLS_IE, + BFD_RELOC_MN10300_TLS_LE, + BFD_RELOC_MN10300_TLS_DTPMOD, + BFD_RELOC_MN10300_TLS_DTPOFF, + BFD_RELOC_MN10300_TLS_TPOFF, + +/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the +instruction. */ + BFD_RELOC_MN10300_32_PCREL, + +/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the +instruction. */ + BFD_RELOC_MN10300_16_PCREL, + + +/* i386/elf relocations */ + BFD_RELOC_386_GOT32, + BFD_RELOC_386_PLT32, + BFD_RELOC_386_COPY, + BFD_RELOC_386_GLOB_DAT, + BFD_RELOC_386_JUMP_SLOT, + BFD_RELOC_386_RELATIVE, + BFD_RELOC_386_GOTOFF, + BFD_RELOC_386_GOTPC, + BFD_RELOC_386_TLS_TPOFF, + BFD_RELOC_386_TLS_IE, + BFD_RELOC_386_TLS_GOTIE, + BFD_RELOC_386_TLS_LE, + BFD_RELOC_386_TLS_GD, + BFD_RELOC_386_TLS_LDM, + BFD_RELOC_386_TLS_LDO_32, + BFD_RELOC_386_TLS_IE_32, + BFD_RELOC_386_TLS_LE_32, + BFD_RELOC_386_TLS_DTPMOD32, + BFD_RELOC_386_TLS_DTPOFF32, + BFD_RELOC_386_TLS_TPOFF32, + BFD_RELOC_386_TLS_GOTDESC, + BFD_RELOC_386_TLS_DESC_CALL, + BFD_RELOC_386_TLS_DESC, + BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, + +/* x86-64/elf relocations */ + BFD_RELOC_X86_64_GOT32, + BFD_RELOC_X86_64_PLT32, + BFD_RELOC_X86_64_COPY, + BFD_RELOC_X86_64_GLOB_DAT, + BFD_RELOC_X86_64_JUMP_SLOT, + BFD_RELOC_X86_64_RELATIVE, + BFD_RELOC_X86_64_GOTPCREL, + BFD_RELOC_X86_64_32S, + BFD_RELOC_X86_64_DTPMOD64, + BFD_RELOC_X86_64_DTPOFF64, + BFD_RELOC_X86_64_TPOFF64, + BFD_RELOC_X86_64_TLSGD, + BFD_RELOC_X86_64_TLSLD, + BFD_RELOC_X86_64_DTPOFF32, + BFD_RELOC_X86_64_GOTTPOFF, + BFD_RELOC_X86_64_TPOFF32, + BFD_RELOC_X86_64_GOTOFF64, + BFD_RELOC_X86_64_GOTPC32, + BFD_RELOC_X86_64_GOT64, + BFD_RELOC_X86_64_GOTPCREL64, + BFD_RELOC_X86_64_GOTPC64, + BFD_RELOC_X86_64_GOTPLT64, + BFD_RELOC_X86_64_PLTOFF64, + BFD_RELOC_X86_64_GOTPC32_TLSDESC, + BFD_RELOC_X86_64_TLSDESC_CALL, + BFD_RELOC_X86_64_TLSDESC, + BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, + +/* ns32k relocations */ + BFD_RELOC_NS32K_IMM_8, + BFD_RELOC_NS32K_IMM_16, + BFD_RELOC_NS32K_IMM_32, + BFD_RELOC_NS32K_IMM_8_PCREL, + BFD_RELOC_NS32K_IMM_16_PCREL, + BFD_RELOC_NS32K_IMM_32_PCREL, + BFD_RELOC_NS32K_DISP_8, + BFD_RELOC_NS32K_DISP_16, + BFD_RELOC_NS32K_DISP_32, + BFD_RELOC_NS32K_DISP_8_PCREL, + BFD_RELOC_NS32K_DISP_16_PCREL, + BFD_RELOC_NS32K_DISP_32_PCREL, + +/* PDP11 relocations */ + BFD_RELOC_PDP11_DISP_8_PCREL, + BFD_RELOC_PDP11_DISP_6_PCREL, + +/* Picojava relocs. Not all of these appear in object files. */ + BFD_RELOC_PJ_CODE_HI16, + BFD_RELOC_PJ_CODE_LO16, + BFD_RELOC_PJ_CODE_DIR16, + BFD_RELOC_PJ_CODE_DIR32, + BFD_RELOC_PJ_CODE_REL16, + BFD_RELOC_PJ_CODE_REL32, + +/* Power(rs6000) and PowerPC relocations. */ + BFD_RELOC_PPC_B26, + BFD_RELOC_PPC_BA26, + BFD_RELOC_PPC_TOC16, + BFD_RELOC_PPC_B16, + BFD_RELOC_PPC_B16_BRTAKEN, + BFD_RELOC_PPC_B16_BRNTAKEN, + BFD_RELOC_PPC_BA16, + BFD_RELOC_PPC_BA16_BRTAKEN, + BFD_RELOC_PPC_BA16_BRNTAKEN, + BFD_RELOC_PPC_COPY, + BFD_RELOC_PPC_GLOB_DAT, + BFD_RELOC_PPC_JMP_SLOT, + BFD_RELOC_PPC_RELATIVE, + BFD_RELOC_PPC_LOCAL24PC, + BFD_RELOC_PPC_EMB_NADDR32, + BFD_RELOC_PPC_EMB_NADDR16, + BFD_RELOC_PPC_EMB_NADDR16_LO, + BFD_RELOC_PPC_EMB_NADDR16_HI, + BFD_RELOC_PPC_EMB_NADDR16_HA, + BFD_RELOC_PPC_EMB_SDAI16, + BFD_RELOC_PPC_EMB_SDA2I16, + BFD_RELOC_PPC_EMB_SDA2REL, + BFD_RELOC_PPC_EMB_SDA21, + BFD_RELOC_PPC_EMB_MRKREF, + BFD_RELOC_PPC_EMB_RELSEC16, + BFD_RELOC_PPC_EMB_RELST_LO, + BFD_RELOC_PPC_EMB_RELST_HI, + BFD_RELOC_PPC_EMB_RELST_HA, + BFD_RELOC_PPC_EMB_BIT_FLD, + BFD_RELOC_PPC_EMB_RELSDA, + BFD_RELOC_PPC_VLE_REL8, + BFD_RELOC_PPC_VLE_REL15, + BFD_RELOC_PPC_VLE_REL24, + BFD_RELOC_PPC_VLE_LO16A, + BFD_RELOC_PPC_VLE_LO16D, + BFD_RELOC_PPC_VLE_HI16A, + BFD_RELOC_PPC_VLE_HI16D, + BFD_RELOC_PPC_VLE_HA16A, + BFD_RELOC_PPC_VLE_HA16D, + BFD_RELOC_PPC_VLE_SDA21, + BFD_RELOC_PPC_VLE_SDA21_LO, + BFD_RELOC_PPC_VLE_SDAREL_LO16A, + BFD_RELOC_PPC_VLE_SDAREL_LO16D, + BFD_RELOC_PPC_VLE_SDAREL_HI16A, + BFD_RELOC_PPC_VLE_SDAREL_HI16D, + BFD_RELOC_PPC_VLE_SDAREL_HA16A, + BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, + BFD_RELOC_PPC64_HIGHER, + BFD_RELOC_PPC64_HIGHER_S, + BFD_RELOC_PPC64_HIGHEST, + BFD_RELOC_PPC64_HIGHEST_S, + BFD_RELOC_PPC64_TOC16_LO, + BFD_RELOC_PPC64_TOC16_HI, + BFD_RELOC_PPC64_TOC16_HA, + BFD_RELOC_PPC64_TOC, + BFD_RELOC_PPC64_PLTGOT16, + BFD_RELOC_PPC64_PLTGOT16_LO, + BFD_RELOC_PPC64_PLTGOT16_HI, + BFD_RELOC_PPC64_PLTGOT16_HA, + BFD_RELOC_PPC64_ADDR16_DS, + BFD_RELOC_PPC64_ADDR16_LO_DS, + BFD_RELOC_PPC64_GOT16_DS, + BFD_RELOC_PPC64_GOT16_LO_DS, + BFD_RELOC_PPC64_PLT16_LO_DS, + BFD_RELOC_PPC64_SECTOFF_DS, + BFD_RELOC_PPC64_SECTOFF_LO_DS, + BFD_RELOC_PPC64_TOC16_DS, + BFD_RELOC_PPC64_TOC16_LO_DS, + BFD_RELOC_PPC64_PLTGOT16_DS, + BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, + +/* PowerPC and PowerPC64 thread-local storage relocations. */ + BFD_RELOC_PPC_TLS, + BFD_RELOC_PPC_TLSGD, + BFD_RELOC_PPC_TLSLD, + BFD_RELOC_PPC_DTPMOD, + BFD_RELOC_PPC_TPREL16, + BFD_RELOC_PPC_TPREL16_LO, + BFD_RELOC_PPC_TPREL16_HI, + BFD_RELOC_PPC_TPREL16_HA, + BFD_RELOC_PPC_TPREL, + BFD_RELOC_PPC_DTPREL16, + BFD_RELOC_PPC_DTPREL16_LO, + BFD_RELOC_PPC_DTPREL16_HI, + BFD_RELOC_PPC_DTPREL16_HA, + BFD_RELOC_PPC_DTPREL, + BFD_RELOC_PPC_GOT_TLSGD16, + BFD_RELOC_PPC_GOT_TLSGD16_LO, + BFD_RELOC_PPC_GOT_TLSGD16_HI, + BFD_RELOC_PPC_GOT_TLSGD16_HA, + BFD_RELOC_PPC_GOT_TLSLD16, + BFD_RELOC_PPC_GOT_TLSLD16_LO, + BFD_RELOC_PPC_GOT_TLSLD16_HI, + BFD_RELOC_PPC_GOT_TLSLD16_HA, + BFD_RELOC_PPC_GOT_TPREL16, + BFD_RELOC_PPC_GOT_TPREL16_LO, + BFD_RELOC_PPC_GOT_TPREL16_HI, + BFD_RELOC_PPC_GOT_TPREL16_HA, + BFD_RELOC_PPC_GOT_DTPREL16, + BFD_RELOC_PPC_GOT_DTPREL16_LO, + BFD_RELOC_PPC_GOT_DTPREL16_HI, + BFD_RELOC_PPC_GOT_DTPREL16_HA, + BFD_RELOC_PPC64_TPREL16_DS, + BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, + BFD_RELOC_PPC64_TPREL16_HIGHER, + BFD_RELOC_PPC64_TPREL16_HIGHERA, + BFD_RELOC_PPC64_TPREL16_HIGHEST, + BFD_RELOC_PPC64_TPREL16_HIGHESTA, + BFD_RELOC_PPC64_DTPREL16_DS, + BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, + BFD_RELOC_PPC64_DTPREL16_HIGHER, + BFD_RELOC_PPC64_DTPREL16_HIGHERA, + BFD_RELOC_PPC64_DTPREL16_HIGHEST, + BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, + +/* IBM 370/390 relocations */ + BFD_RELOC_I370_D12, + +/* The type of reloc used to build a constructor table - at the moment +probably a 32 bit wide absolute relocation, but the target can choose. +It generally does map to one of the other relocation types. */ + BFD_RELOC_CTOR, + +/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are +not stored in the instruction. */ + BFD_RELOC_ARM_PCREL_BRANCH, + +/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. */ + BFD_RELOC_ARM_PCREL_BLX, + +/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. */ + BFD_RELOC_THUMB_PCREL_BLX, + +/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction. */ + BFD_RELOC_ARM_PCREL_CALL, + +/* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ + BFD_RELOC_ARM_PCREL_JUMP, + +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + +/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. +The lowest bit must be zero and is not stored in the instruction. +Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an +"nn" one smaller in all cases. Note further that BRANCH23 +corresponds to R_ARM_THM_CALL. */ + BFD_RELOC_THUMB_PCREL_BRANCH7, + BFD_RELOC_THUMB_PCREL_BRANCH9, + BFD_RELOC_THUMB_PCREL_BRANCH12, + BFD_RELOC_THUMB_PCREL_BRANCH20, + BFD_RELOC_THUMB_PCREL_BRANCH23, + BFD_RELOC_THUMB_PCREL_BRANCH25, + +/* 12-bit immediate offset, used in ARM-format ldr and str instructions. */ + BFD_RELOC_ARM_OFFSET_IMM, + +/* 5-bit immediate offset, used in Thumb-format ldr and str instructions. */ + BFD_RELOC_ARM_THUMB_OFFSET, + +/* Pc-relative or absolute relocation depending on target. Used for +entries in .init_array sections. */ + BFD_RELOC_ARM_TARGET1, + +/* Read-only segment base relative address. */ + BFD_RELOC_ARM_ROSEGREL32, + +/* Data segment base relative address. */ + BFD_RELOC_ARM_SBREL32, + +/* This reloc is used for references to RTTI data from exception handling +tables. The actual definition depends on the target. It may be a +pc-relative or some form of GOT-indirect relocation. */ + BFD_RELOC_ARM_TARGET2, + +/* 31-bit PC relative address. */ + BFD_RELOC_ARM_PREL31, + +/* Low and High halfword relocations for MOVW and MOVT instructions. */ + BFD_RELOC_ARM_MOVW, + BFD_RELOC_ARM_MOVT, + BFD_RELOC_ARM_MOVW_PCREL, + BFD_RELOC_ARM_MOVT_PCREL, + BFD_RELOC_ARM_THUMB_MOVW, + BFD_RELOC_ARM_THUMB_MOVT, + BFD_RELOC_ARM_THUMB_MOVW_PCREL, + BFD_RELOC_ARM_THUMB_MOVT_PCREL, + +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + +/* Relocations for setting up GOTs and PLTs for shared libraries. */ + BFD_RELOC_ARM_JUMP_SLOT, + BFD_RELOC_ARM_GLOB_DAT, + BFD_RELOC_ARM_GOT32, + BFD_RELOC_ARM_PLT32, + BFD_RELOC_ARM_RELATIVE, + BFD_RELOC_ARM_GOTOFF, + BFD_RELOC_ARM_GOTPC, + BFD_RELOC_ARM_GOT_PREL, + +/* ARM thread-local storage relocations. */ + BFD_RELOC_ARM_TLS_GD32, + BFD_RELOC_ARM_TLS_LDO32, + BFD_RELOC_ARM_TLS_LDM32, + BFD_RELOC_ARM_TLS_DTPOFF32, + BFD_RELOC_ARM_TLS_DTPMOD32, + BFD_RELOC_ARM_TLS_TPOFF32, + BFD_RELOC_ARM_TLS_IE32, + BFD_RELOC_ARM_TLS_LE32, + BFD_RELOC_ARM_TLS_GOTDESC, + BFD_RELOC_ARM_TLS_CALL, + BFD_RELOC_ARM_THM_TLS_CALL, + BFD_RELOC_ARM_TLS_DESCSEQ, + BFD_RELOC_ARM_THM_TLS_DESCSEQ, + BFD_RELOC_ARM_TLS_DESC, + +/* ARM group relocations. */ + BFD_RELOC_ARM_ALU_PC_G0_NC, + BFD_RELOC_ARM_ALU_PC_G0, + BFD_RELOC_ARM_ALU_PC_G1_NC, + BFD_RELOC_ARM_ALU_PC_G1, + BFD_RELOC_ARM_ALU_PC_G2, + BFD_RELOC_ARM_LDR_PC_G0, + BFD_RELOC_ARM_LDR_PC_G1, + BFD_RELOC_ARM_LDR_PC_G2, + BFD_RELOC_ARM_LDRS_PC_G0, + BFD_RELOC_ARM_LDRS_PC_G1, + BFD_RELOC_ARM_LDRS_PC_G2, + BFD_RELOC_ARM_LDC_PC_G0, + BFD_RELOC_ARM_LDC_PC_G1, + BFD_RELOC_ARM_LDC_PC_G2, + BFD_RELOC_ARM_ALU_SB_G0_NC, + BFD_RELOC_ARM_ALU_SB_G0, + BFD_RELOC_ARM_ALU_SB_G1_NC, + BFD_RELOC_ARM_ALU_SB_G1, + BFD_RELOC_ARM_ALU_SB_G2, + BFD_RELOC_ARM_LDR_SB_G0, + BFD_RELOC_ARM_LDR_SB_G1, + BFD_RELOC_ARM_LDR_SB_G2, + BFD_RELOC_ARM_LDRS_SB_G0, + BFD_RELOC_ARM_LDRS_SB_G1, + BFD_RELOC_ARM_LDRS_SB_G2, + BFD_RELOC_ARM_LDC_SB_G0, + BFD_RELOC_ARM_LDC_SB_G1, + BFD_RELOC_ARM_LDC_SB_G2, + +/* Annotation of BX instructions. */ + BFD_RELOC_ARM_V4BX, + +/* ARM support for STT_GNU_IFUNC. */ + BFD_RELOC_ARM_IRELATIVE, + +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + +/* These relocs are only used within the ARM assembler. They are not +(at present) written to any object files. */ + BFD_RELOC_ARM_IMMEDIATE, + BFD_RELOC_ARM_ADRL_IMMEDIATE, + BFD_RELOC_ARM_T32_IMMEDIATE, + BFD_RELOC_ARM_T32_ADD_IMM, + BFD_RELOC_ARM_T32_IMM12, + BFD_RELOC_ARM_T32_ADD_PC12, + BFD_RELOC_ARM_SHIFT_IMM, + BFD_RELOC_ARM_SMC, + BFD_RELOC_ARM_HVC, + BFD_RELOC_ARM_SWI, + BFD_RELOC_ARM_MULTI, + BFD_RELOC_ARM_CP_OFF_IMM, + BFD_RELOC_ARM_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_CP_OFF_IMM, + BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, + BFD_RELOC_ARM_ADR_IMM, + BFD_RELOC_ARM_LDR_IMM, + BFD_RELOC_ARM_LITERAL, + BFD_RELOC_ARM_IN_POOL, + BFD_RELOC_ARM_OFFSET_IMM8, + BFD_RELOC_ARM_T32_OFFSET_U8, + BFD_RELOC_ARM_T32_OFFSET_IMM, + BFD_RELOC_ARM_HWLITERAL, + BFD_RELOC_ARM_THUMB_ADD, + BFD_RELOC_ARM_THUMB_IMM, + BFD_RELOC_ARM_THUMB_SHIFT, + +/* Renesas / SuperH SH relocs. Not all of these appear in object files. */ + BFD_RELOC_SH_PCDISP8BY2, + BFD_RELOC_SH_PCDISP12BY2, + BFD_RELOC_SH_IMM3, + BFD_RELOC_SH_IMM3U, + BFD_RELOC_SH_DISP12, + BFD_RELOC_SH_DISP12BY2, + BFD_RELOC_SH_DISP12BY4, + BFD_RELOC_SH_DISP12BY8, + BFD_RELOC_SH_DISP20, + BFD_RELOC_SH_DISP20BY8, + BFD_RELOC_SH_IMM4, + BFD_RELOC_SH_IMM4BY2, + BFD_RELOC_SH_IMM4BY4, + BFD_RELOC_SH_IMM8, + BFD_RELOC_SH_IMM8BY2, + BFD_RELOC_SH_IMM8BY4, + BFD_RELOC_SH_PCRELIMM8BY2, + BFD_RELOC_SH_PCRELIMM8BY4, + BFD_RELOC_SH_SWITCH16, + BFD_RELOC_SH_SWITCH32, + BFD_RELOC_SH_USES, + BFD_RELOC_SH_COUNT, + BFD_RELOC_SH_ALIGN, + BFD_RELOC_SH_CODE, + BFD_RELOC_SH_DATA, + BFD_RELOC_SH_LABEL, + BFD_RELOC_SH_LOOP_START, + BFD_RELOC_SH_LOOP_END, + BFD_RELOC_SH_COPY, + BFD_RELOC_SH_GLOB_DAT, + BFD_RELOC_SH_JMP_SLOT, + BFD_RELOC_SH_RELATIVE, + BFD_RELOC_SH_GOTPC, + BFD_RELOC_SH_GOT_LOW16, + BFD_RELOC_SH_GOT_MEDLOW16, + BFD_RELOC_SH_GOT_MEDHI16, + BFD_RELOC_SH_GOT_HI16, + BFD_RELOC_SH_GOTPLT_LOW16, + BFD_RELOC_SH_GOTPLT_MEDLOW16, + BFD_RELOC_SH_GOTPLT_MEDHI16, + BFD_RELOC_SH_GOTPLT_HI16, + BFD_RELOC_SH_PLT_LOW16, + BFD_RELOC_SH_PLT_MEDLOW16, + BFD_RELOC_SH_PLT_MEDHI16, + BFD_RELOC_SH_PLT_HI16, + BFD_RELOC_SH_GOTOFF_LOW16, + BFD_RELOC_SH_GOTOFF_MEDLOW16, + BFD_RELOC_SH_GOTOFF_MEDHI16, + BFD_RELOC_SH_GOTOFF_HI16, + BFD_RELOC_SH_GOTPC_LOW16, + BFD_RELOC_SH_GOTPC_MEDLOW16, + BFD_RELOC_SH_GOTPC_MEDHI16, + BFD_RELOC_SH_GOTPC_HI16, + BFD_RELOC_SH_COPY64, + BFD_RELOC_SH_GLOB_DAT64, + BFD_RELOC_SH_JMP_SLOT64, + BFD_RELOC_SH_RELATIVE64, + BFD_RELOC_SH_GOT10BY4, + BFD_RELOC_SH_GOT10BY8, + BFD_RELOC_SH_GOTPLT10BY4, + BFD_RELOC_SH_GOTPLT10BY8, + BFD_RELOC_SH_GOTPLT32, + BFD_RELOC_SH_SHMEDIA_CODE, + BFD_RELOC_SH_IMMU5, + BFD_RELOC_SH_IMMS6, + BFD_RELOC_SH_IMMS6BY32, + BFD_RELOC_SH_IMMU6, + BFD_RELOC_SH_IMMS10, + BFD_RELOC_SH_IMMS10BY2, + BFD_RELOC_SH_IMMS10BY4, + BFD_RELOC_SH_IMMS10BY8, + BFD_RELOC_SH_IMMS16, + BFD_RELOC_SH_IMMU16, + BFD_RELOC_SH_IMM_LOW16, + BFD_RELOC_SH_IMM_LOW16_PCREL, + BFD_RELOC_SH_IMM_MEDLOW16, + BFD_RELOC_SH_IMM_MEDLOW16_PCREL, + BFD_RELOC_SH_IMM_MEDHI16, + BFD_RELOC_SH_IMM_MEDHI16_PCREL, + BFD_RELOC_SH_IMM_HI16, + BFD_RELOC_SH_IMM_HI16_PCREL, + BFD_RELOC_SH_PT_16, + BFD_RELOC_SH_TLS_GD_32, + BFD_RELOC_SH_TLS_LD_32, + BFD_RELOC_SH_TLS_LDO_32, + BFD_RELOC_SH_TLS_IE_32, + BFD_RELOC_SH_TLS_LE_32, + BFD_RELOC_SH_TLS_DTPMOD32, + BFD_RELOC_SH_TLS_DTPOFF32, + BFD_RELOC_SH_TLS_TPOFF32, + BFD_RELOC_SH_GOT20, + BFD_RELOC_SH_GOTOFF20, + BFD_RELOC_SH_GOTFUNCDESC, + BFD_RELOC_SH_GOTFUNCDESC20, + BFD_RELOC_SH_GOTOFFFUNCDESC, + BFD_RELOC_SH_GOTOFFFUNCDESC20, + BFD_RELOC_SH_FUNCDESC, + +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, + +/* ADI Blackfin 16 bit immediate absolute reloc. */ + BFD_RELOC_BFIN_16_IMM, + +/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits. */ + BFD_RELOC_BFIN_16_HIGH, + +/* ADI Blackfin 'a' part of LSETUP. */ + BFD_RELOC_BFIN_4_PCREL, + +/* ADI Blackfin. */ + BFD_RELOC_BFIN_5_PCREL, + +/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits. */ + BFD_RELOC_BFIN_16_LOW, + +/* ADI Blackfin. */ + BFD_RELOC_BFIN_10_PCREL, + +/* ADI Blackfin 'b' part of LSETUP. */ + BFD_RELOC_BFIN_11_PCREL, + +/* ADI Blackfin. */ + BFD_RELOC_BFIN_12_PCREL_JUMP, + +/* ADI Blackfin Short jump, pcrel. */ + BFD_RELOC_BFIN_12_PCREL_JUMP_S, + +/* ADI Blackfin Call.x not implemented. */ + BFD_RELOC_BFIN_24_PCREL_CALL_X, + +/* ADI Blackfin Long Jump pcrel. */ + BFD_RELOC_BFIN_24_PCREL_JUMP_L, + +/* ADI Blackfin FD-PIC relocations. */ + BFD_RELOC_BFIN_GOT17M4, + BFD_RELOC_BFIN_GOTHI, + BFD_RELOC_BFIN_GOTLO, + BFD_RELOC_BFIN_FUNCDESC, + BFD_RELOC_BFIN_FUNCDESC_GOT17M4, + BFD_RELOC_BFIN_FUNCDESC_GOTHI, + BFD_RELOC_BFIN_FUNCDESC_GOTLO, + BFD_RELOC_BFIN_FUNCDESC_VALUE, + BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, + BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI, + BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, + BFD_RELOC_BFIN_GOTOFF17M4, + BFD_RELOC_BFIN_GOTOFFHI, + BFD_RELOC_BFIN_GOTOFFLO, + +/* ADI Blackfin GOT relocation. */ + BFD_RELOC_BFIN_GOT, + +/* ADI Blackfin PLTPC relocation. */ + BFD_RELOC_BFIN_PLTPC, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_PUSH, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_CONST, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_ADD, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_SUB, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_MULT, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_DIV, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_MOD, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_LSHIFT, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_RSHIFT, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_AND, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_OR, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_XOR, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_LAND, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_LOR, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_LEN, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_NEG, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_COMP, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_PAGE, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_HWPAGE, + +/* ADI Blackfin arithmetic relocation. */ + BFD_ARELOC_BFIN_ADDR, + +/* Mitsubishi D10V relocs. +This is a 10-bit reloc with the right 2 bits +assumed to be 0. */ + BFD_RELOC_D10V_10_PCREL_R, + +/* Mitsubishi D10V relocs. +This is a 10-bit reloc with the right 2 bits +assumed to be 0. This is the same as the previous reloc +except it is in the left container, i.e., +shifted left 15 bits. */ + BFD_RELOC_D10V_10_PCREL_L, + +/* This is an 18-bit reloc with the right 2 bits +assumed to be 0. */ + BFD_RELOC_D10V_18, + +/* This is an 18-bit reloc with the right 2 bits +assumed to be 0. */ + BFD_RELOC_D10V_18_PCREL, + +/* Mitsubishi D30V relocs. +This is a 6-bit absolute reloc. */ + BFD_RELOC_D30V_6, + +/* This is a 6-bit pc-relative reloc with +the right 3 bits assumed to be 0. */ + BFD_RELOC_D30V_9_PCREL, + +/* This is a 6-bit pc-relative reloc with +the right 3 bits assumed to be 0. Same +as the previous reloc but on the right side +of the container. */ + BFD_RELOC_D30V_9_PCREL_R, + +/* This is a 12-bit absolute reloc with the +right 3 bitsassumed to be 0. */ + BFD_RELOC_D30V_15, + +/* This is a 12-bit pc-relative reloc with +the right 3 bits assumed to be 0. */ + BFD_RELOC_D30V_15_PCREL, + +/* This is a 12-bit pc-relative reloc with +the right 3 bits assumed to be 0. Same +as the previous reloc but on the right side +of the container. */ + BFD_RELOC_D30V_15_PCREL_R, + +/* This is an 18-bit absolute reloc with +the right 3 bits assumed to be 0. */ + BFD_RELOC_D30V_21, + +/* This is an 18-bit pc-relative reloc with +the right 3 bits assumed to be 0. */ + BFD_RELOC_D30V_21_PCREL, + +/* This is an 18-bit pc-relative reloc with +the right 3 bits assumed to be 0. Same +as the previous reloc but on the right side +of the container. */ + BFD_RELOC_D30V_21_PCREL_R, + +/* This is a 32-bit absolute reloc. */ + BFD_RELOC_D30V_32, + +/* This is a 32-bit pc-relative reloc. */ + BFD_RELOC_D30V_32_PCREL, + +/* DLX relocs */ + BFD_RELOC_DLX_HI16_S, + +/* DLX relocs */ + BFD_RELOC_DLX_LO16, + +/* DLX relocs */ + BFD_RELOC_DLX_JMP26, + +/* Renesas M16C/M32C Relocations. */ + BFD_RELOC_M32C_HI8, + BFD_RELOC_M32C_RL_JUMP, + BFD_RELOC_M32C_RL_1ADDR, + BFD_RELOC_M32C_RL_2ADDR, + +/* Renesas M32R (formerly Mitsubishi M32R) relocs. +This is a 24 bit absolute address. */ + BFD_RELOC_M32R_24, + +/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */ + BFD_RELOC_M32R_10_PCREL, + +/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */ + BFD_RELOC_M32R_18_PCREL, + +/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */ + BFD_RELOC_M32R_26_PCREL, + +/* This is a 16-bit reloc containing the high 16 bits of an address +used when the lower 16 bits are treated as unsigned. */ + BFD_RELOC_M32R_HI16_ULO, + +/* This is a 16-bit reloc containing the high 16 bits of an address +used when the lower 16 bits are treated as signed. */ + BFD_RELOC_M32R_HI16_SLO, + +/* This is a 16-bit reloc containing the lower 16 bits of an address. */ + BFD_RELOC_M32R_LO16, + +/* This is a 16-bit reloc containing the small data area offset for use in +add3, load, and store instructions. */ + BFD_RELOC_M32R_SDA16, + +/* For PIC. */ + BFD_RELOC_M32R_GOT24, + BFD_RELOC_M32R_26_PLTREL, + BFD_RELOC_M32R_COPY, + BFD_RELOC_M32R_GLOB_DAT, + BFD_RELOC_M32R_JMP_SLOT, + BFD_RELOC_M32R_RELATIVE, + BFD_RELOC_M32R_GOTOFF, + BFD_RELOC_M32R_GOTOFF_HI_ULO, + BFD_RELOC_M32R_GOTOFF_HI_SLO, + BFD_RELOC_M32R_GOTOFF_LO, + BFD_RELOC_M32R_GOTPC24, + BFD_RELOC_M32R_GOT16_HI_ULO, + BFD_RELOC_M32R_GOT16_HI_SLO, + BFD_RELOC_M32R_GOT16_LO, + BFD_RELOC_M32R_GOTPC_HI_ULO, + BFD_RELOC_M32R_GOTPC_HI_SLO, + BFD_RELOC_M32R_GOTPC_LO, + +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + +/* This is a 9-bit reloc */ + BFD_RELOC_V850_9_PCREL, + +/* This is a 22-bit reloc */ + BFD_RELOC_V850_22_PCREL, + +/* This is a 16 bit offset from the short data area pointer. */ + BFD_RELOC_V850_SDA_16_16_OFFSET, + +/* This is a 16 bit offset (of which only 15 bits are used) from the +short data area pointer. */ + BFD_RELOC_V850_SDA_15_16_OFFSET, + +/* This is a 16 bit offset from the zero data area pointer. */ + BFD_RELOC_V850_ZDA_16_16_OFFSET, + +/* This is a 16 bit offset (of which only 15 bits are used) from the +zero data area pointer. */ + BFD_RELOC_V850_ZDA_15_16_OFFSET, + +/* This is an 8 bit offset (of which only 6 bits are used) from the +tiny data area pointer. */ + BFD_RELOC_V850_TDA_6_8_OFFSET, + +/* This is an 8bit offset (of which only 7 bits are used) from the tiny +data area pointer. */ + BFD_RELOC_V850_TDA_7_8_OFFSET, + +/* This is a 7 bit offset from the tiny data area pointer. */ + BFD_RELOC_V850_TDA_7_7_OFFSET, + +/* This is a 16 bit offset from the tiny data area pointer. */ + BFD_RELOC_V850_TDA_16_16_OFFSET, + +/* This is a 5 bit offset (of which only 4 bits are used) from the tiny +data area pointer. */ + BFD_RELOC_V850_TDA_4_5_OFFSET, + +/* This is a 4 bit offset from the tiny data area pointer. */ + BFD_RELOC_V850_TDA_4_4_OFFSET, + +/* This is a 16 bit offset from the short data area pointer, with the +bits placed non-contiguously in the instruction. */ + BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, + +/* This is a 16 bit offset from the zero data area pointer, with the +bits placed non-contiguously in the instruction. */ + BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, + +/* This is a 6 bit offset from the call table base pointer. */ + BFD_RELOC_V850_CALLT_6_7_OFFSET, + +/* This is a 16 bit offset from the call table base pointer. */ + BFD_RELOC_V850_CALLT_16_16_OFFSET, + +/* Used for relaxing indirect function calls. */ + BFD_RELOC_V850_LONGCALL, + +/* Used for relaxing indirect jumps. */ + BFD_RELOC_V850_LONGJUMP, + +/* Used to maintain alignment whilst relaxing. */ + BFD_RELOC_V850_ALIGN, + +/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu +instructions. */ + BFD_RELOC_V850_LO16_SPLIT_OFFSET, + +/* This is a 16-bit reloc. */ + BFD_RELOC_V850_16_PCREL, + +/* This is a 17-bit reloc. */ + BFD_RELOC_V850_17_PCREL, + +/* This is a 23-bit reloc. */ + BFD_RELOC_V850_23, + +/* This is a 32-bit reloc. */ + BFD_RELOC_V850_32_PCREL, + +/* This is a 32-bit reloc. */ + BFD_RELOC_V850_32_ABS, + +/* This is a 16-bit reloc. */ + BFD_RELOC_V850_16_SPLIT_OFFSET, + +/* This is a 16-bit reloc. */ + BFD_RELOC_V850_16_S1, + +/* Low 16 bits. 16 bit shifted by 1. */ + BFD_RELOC_V850_LO16_S1, + +/* This is a 16 bit offset from the call table base pointer. */ + BFD_RELOC_V850_CALLT_15_16_OFFSET, + +/* DSO relocations. */ + BFD_RELOC_V850_32_GOTPCREL, + +/* DSO relocations. */ + BFD_RELOC_V850_16_GOT, + +/* DSO relocations. */ + BFD_RELOC_V850_32_GOT, + +/* DSO relocations. */ + BFD_RELOC_V850_22_PLT_PCREL, + +/* DSO relocations. */ + BFD_RELOC_V850_32_PLT_PCREL, + +/* DSO relocations. */ + BFD_RELOC_V850_COPY, + +/* DSO relocations. */ + BFD_RELOC_V850_GLOB_DAT, + +/* DSO relocations. */ + BFD_RELOC_V850_JMP_SLOT, + +/* DSO relocations. */ + BFD_RELOC_V850_RELATIVE, + +/* DSO relocations. */ + BFD_RELOC_V850_16_GOTOFF, + +/* DSO relocations. */ + BFD_RELOC_V850_32_GOTOFF, + +/* start code. */ + BFD_RELOC_V850_CODE, + +/* start data in text. */ + BFD_RELOC_V850_DATA, + +/* This is a 8bit DP reloc for the tms320c30, where the most +significant 8 bits of a 24 bit word are placed into the least +significant 8 bits of the opcode. */ + BFD_RELOC_TIC30_LDP, + +/* This is a 7bit reloc for the tms320c54x, where the least +significant 7 bits of a 16 bit word are placed into the least +significant 7 bits of the opcode. */ + BFD_RELOC_TIC54X_PARTLS7, + +/* This is a 9bit DP reloc for the tms320c54x, where the most +significant 9 bits of a 16 bit word are placed into the least +significant 9 bits of the opcode. */ + BFD_RELOC_TIC54X_PARTMS9, + +/* This is an extended address 23-bit reloc for the tms320c54x. */ + BFD_RELOC_TIC54X_23, + +/* This is a 16-bit reloc for the tms320c54x, where the least +significant 16 bits of a 23-bit extended address are placed into +the opcode. */ + BFD_RELOC_TIC54X_16_OF_23, + +/* This is a reloc for the tms320c54x, where the most +significant 7 bits of a 23-bit extended address are placed into +the opcode. */ + BFD_RELOC_TIC54X_MS7_OF_23, + +/* TMS320C6000 relocations. */ + BFD_RELOC_C6000_PCR_S21, + BFD_RELOC_C6000_PCR_S12, + BFD_RELOC_C6000_PCR_S10, + BFD_RELOC_C6000_PCR_S7, + BFD_RELOC_C6000_ABS_S16, + BFD_RELOC_C6000_ABS_L16, + BFD_RELOC_C6000_ABS_H16, + BFD_RELOC_C6000_SBR_U15_B, + BFD_RELOC_C6000_SBR_U15_H, + BFD_RELOC_C6000_SBR_U15_W, + BFD_RELOC_C6000_SBR_S16, + BFD_RELOC_C6000_SBR_L16_B, + BFD_RELOC_C6000_SBR_L16_H, + BFD_RELOC_C6000_SBR_L16_W, + BFD_RELOC_C6000_SBR_H16_B, + BFD_RELOC_C6000_SBR_H16_H, + BFD_RELOC_C6000_SBR_H16_W, + BFD_RELOC_C6000_SBR_GOT_U15_W, + BFD_RELOC_C6000_SBR_GOT_L16_W, + BFD_RELOC_C6000_SBR_GOT_H16_W, + BFD_RELOC_C6000_DSBT_INDEX, + BFD_RELOC_C6000_PREL31, + BFD_RELOC_C6000_COPY, + BFD_RELOC_C6000_JUMP_SLOT, + BFD_RELOC_C6000_EHTYPE, + BFD_RELOC_C6000_PCR_H16, + BFD_RELOC_C6000_PCR_L16, + BFD_RELOC_C6000_ALIGN, + BFD_RELOC_C6000_FPHEAD, + BFD_RELOC_C6000_NOCMP, + +/* This is a 48 bit reloc for the FR30 that stores 32 bits. */ + BFD_RELOC_FR30_48, + +/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into +two sections. */ + BFD_RELOC_FR30_20, + +/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in +4 bits. */ + BFD_RELOC_FR30_6_IN_4, + +/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset +into 8 bits. */ + BFD_RELOC_FR30_8_IN_8, + +/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset +into 8 bits. */ + BFD_RELOC_FR30_9_IN_8, + +/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset +into 8 bits. */ + BFD_RELOC_FR30_10_IN_8, + +/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative +short offset into 8 bits. */ + BFD_RELOC_FR30_9_PCREL, + +/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative +short offset into 11 bits. */ + BFD_RELOC_FR30_12_PCREL, + +/* Motorola Mcore relocations. */ + BFD_RELOC_MCORE_PCREL_IMM8BY4, + BFD_RELOC_MCORE_PCREL_IMM11BY2, + BFD_RELOC_MCORE_PCREL_IMM4BY2, + BFD_RELOC_MCORE_PCREL_32, + BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_MCORE_RVA, + +/* Toshiba Media Processor Relocations. */ + BFD_RELOC_MEP_8, + BFD_RELOC_MEP_16, + BFD_RELOC_MEP_32, + BFD_RELOC_MEP_PCREL8A2, + BFD_RELOC_MEP_PCREL12A2, + BFD_RELOC_MEP_PCREL17A2, + BFD_RELOC_MEP_PCREL24A2, + BFD_RELOC_MEP_PCABS24A2, + BFD_RELOC_MEP_LOW16, + BFD_RELOC_MEP_HI16U, + BFD_RELOC_MEP_HI16S, + BFD_RELOC_MEP_GPREL, + BFD_RELOC_MEP_TPREL, + BFD_RELOC_MEP_TPREL7, + BFD_RELOC_MEP_TPREL7A2, + BFD_RELOC_MEP_TPREL7A4, + BFD_RELOC_MEP_UIMM24, + BFD_RELOC_MEP_ADDR24A4, + BFD_RELOC_MEP_GNU_VTINHERIT, + BFD_RELOC_MEP_GNU_VTENTRY, + + +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + +/* These are relocations for the GETA instruction. */ + BFD_RELOC_MMIX_GETA, + BFD_RELOC_MMIX_GETA_1, + BFD_RELOC_MMIX_GETA_2, + BFD_RELOC_MMIX_GETA_3, + +/* These are relocations for a conditional branch instruction. */ + BFD_RELOC_MMIX_CBRANCH, + BFD_RELOC_MMIX_CBRANCH_J, + BFD_RELOC_MMIX_CBRANCH_1, + BFD_RELOC_MMIX_CBRANCH_2, + BFD_RELOC_MMIX_CBRANCH_3, + +/* These are relocations for the PUSHJ instruction. */ + BFD_RELOC_MMIX_PUSHJ, + BFD_RELOC_MMIX_PUSHJ_1, + BFD_RELOC_MMIX_PUSHJ_2, + BFD_RELOC_MMIX_PUSHJ_3, + BFD_RELOC_MMIX_PUSHJ_STUBBABLE, + +/* These are relocations for the JMP instruction. */ + BFD_RELOC_MMIX_JMP, + BFD_RELOC_MMIX_JMP_1, + BFD_RELOC_MMIX_JMP_2, + BFD_RELOC_MMIX_JMP_3, + +/* This is a relocation for a relative address as in a GETA instruction or +a branch. */ + BFD_RELOC_MMIX_ADDR19, + +/* This is a relocation for a relative address as in a JMP instruction. */ + BFD_RELOC_MMIX_ADDR27, + +/* This is a relocation for an instruction field that may be a general +register or a value 0..255. */ + BFD_RELOC_MMIX_REG_OR_BYTE, + +/* This is a relocation for an instruction field that may be a general +register. */ + BFD_RELOC_MMIX_REG, + +/* This is a relocation for two instruction fields holding a register and +an offset, the equivalent of the relocation. */ + BFD_RELOC_MMIX_BASE_PLUS_OFFSET, + +/* This relocation is an assertion that the expression is not allocated as +a global register. It does not modify contents. */ + BFD_RELOC_MMIX_LOCAL, + +/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative +short offset into 7 bits. */ + BFD_RELOC_AVR_7_PCREL, + +/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative +short offset into 12 bits. */ + BFD_RELOC_AVR_13_PCREL, + +/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually +program memory address) into 16 bits. */ + BFD_RELOC_AVR_16_PM, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually +data memory address) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_LO8_LDI, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit +of data memory address) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_HI8_LDI, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit +of program memory address) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_HH8_LDI, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit +of 32 bit value) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_MS8_LDI, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value +(usually data memory address) into 8 bit immediate value of SUBI insn. */ + BFD_RELOC_AVR_LO8_LDI_NEG, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value +(high 8 bit of data memory address) into 8 bit immediate value of +SUBI insn. */ + BFD_RELOC_AVR_HI8_LDI_NEG, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value +(most high 8 bit of program memory address) into 8 bit immediate value +of LDI or SUBI insn. */ + BFD_RELOC_AVR_HH8_LDI_NEG, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb +of 32 bit value) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_MS8_LDI_NEG, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually +command address) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_LO8_LDI_PM, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value +(command address) into 8 bit immediate value of LDI insn. If the address +is beyond the 128k boundary, the linker inserts a jump stub for this reloc +in the lower 128k. */ + BFD_RELOC_AVR_LO8_LDI_GS, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit +of command address) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_HI8_LDI_PM, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit +of command address) into 8 bit immediate value of LDI insn. If the address +is beyond the 128k boundary, the linker inserts a jump stub for this reloc +below 128k. */ + BFD_RELOC_AVR_HI8_LDI_GS, + +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit +of command address) into 8 bit immediate value of LDI insn. */ + BFD_RELOC_AVR_HH8_LDI_PM, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value +(usually command address) into 8 bit immediate value of SUBI insn. */ + BFD_RELOC_AVR_LO8_LDI_PM_NEG, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value +(high 8 bit of 16 bit command address) into 8 bit immediate value +of SUBI insn. */ + BFD_RELOC_AVR_HI8_LDI_PM_NEG, + +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value +(high 6 bit of 22 bit command address) into 8 bit immediate +value of SUBI insn. */ + BFD_RELOC_AVR_HH8_LDI_PM_NEG, + +/* This is a 32 bit reloc for the AVR that stores 23 bit value +into 22 bits. */ + BFD_RELOC_AVR_CALL, + +/* This is a 16 bit reloc for the AVR that stores all needed bits +for absolute addressing with ldi with overflow check to linktime */ + BFD_RELOC_AVR_LDI, + +/* This is a 6 bit reloc for the AVR that stores offset for ldd/std +instructions */ + BFD_RELOC_AVR_6, + +/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw +instructions */ + BFD_RELOC_AVR_6_ADIW, + +/* This is a 8 bit reloc for the AVR that stores bits 0..7 of a symbol +in .byte lo8(symbol) */ + BFD_RELOC_AVR_8_LO, + +/* This is a 8 bit reloc for the AVR that stores bits 8..15 of a symbol +in .byte hi8(symbol) */ + BFD_RELOC_AVR_8_HI, + +/* This is a 8 bit reloc for the AVR that stores bits 16..23 of a symbol +in .byte hlo8(symbol) */ + BFD_RELOC_AVR_8_HLO, + +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + +/* Renesas RL78 Relocations. */ + BFD_RELOC_RL78_NEG8, + BFD_RELOC_RL78_NEG16, + BFD_RELOC_RL78_NEG24, + BFD_RELOC_RL78_NEG32, + BFD_RELOC_RL78_16_OP, + BFD_RELOC_RL78_24_OP, + BFD_RELOC_RL78_32_OP, + BFD_RELOC_RL78_8U, + BFD_RELOC_RL78_16U, + BFD_RELOC_RL78_24U, + BFD_RELOC_RL78_DIR3U_PCREL, + BFD_RELOC_RL78_DIFF, + BFD_RELOC_RL78_GPRELB, + BFD_RELOC_RL78_GPRELW, + BFD_RELOC_RL78_GPRELL, + BFD_RELOC_RL78_SYM, + BFD_RELOC_RL78_OP_SUBTRACT, + BFD_RELOC_RL78_OP_NEG, + BFD_RELOC_RL78_OP_AND, + BFD_RELOC_RL78_OP_SHRA, + BFD_RELOC_RL78_ABS8, + BFD_RELOC_RL78_ABS16, + BFD_RELOC_RL78_ABS16_REV, + BFD_RELOC_RL78_ABS32, + BFD_RELOC_RL78_ABS32_REV, + BFD_RELOC_RL78_ABS16U, + BFD_RELOC_RL78_ABS16UW, + BFD_RELOC_RL78_ABS16UL, + BFD_RELOC_RL78_RELAX, + BFD_RELOC_RL78_HI16, + BFD_RELOC_RL78_HI8, + BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, + +/* Renesas RX Relocations. */ + BFD_RELOC_RX_NEG8, + BFD_RELOC_RX_NEG16, + BFD_RELOC_RX_NEG24, + BFD_RELOC_RX_NEG32, + BFD_RELOC_RX_16_OP, + BFD_RELOC_RX_24_OP, + BFD_RELOC_RX_32_OP, + BFD_RELOC_RX_8U, + BFD_RELOC_RX_16U, + BFD_RELOC_RX_24U, + BFD_RELOC_RX_DIR3U_PCREL, + BFD_RELOC_RX_DIFF, + BFD_RELOC_RX_GPRELB, + BFD_RELOC_RX_GPRELW, + BFD_RELOC_RX_GPRELL, + BFD_RELOC_RX_SYM, + BFD_RELOC_RX_OP_SUBTRACT, + BFD_RELOC_RX_OP_NEG, + BFD_RELOC_RX_ABS8, + BFD_RELOC_RX_ABS16, + BFD_RELOC_RX_ABS16_REV, + BFD_RELOC_RX_ABS32, + BFD_RELOC_RX_ABS32_REV, + BFD_RELOC_RX_ABS16U, + BFD_RELOC_RX_ABS16UW, + BFD_RELOC_RX_ABS16UL, + BFD_RELOC_RX_RELAX, + +/* Direct 12 bit. */ + BFD_RELOC_390_12, + +/* 12 bit GOT offset. */ + BFD_RELOC_390_GOT12, + +/* 32 bit PC relative PLT address. */ + BFD_RELOC_390_PLT32, + +/* Copy symbol at runtime. */ + BFD_RELOC_390_COPY, + +/* Create GOT entry. */ + BFD_RELOC_390_GLOB_DAT, + +/* Create PLT entry. */ + BFD_RELOC_390_JMP_SLOT, + +/* Adjust by program base. */ + BFD_RELOC_390_RELATIVE, + +/* 32 bit PC relative offset to GOT. */ + BFD_RELOC_390_GOTPC, + +/* 16 bit GOT offset. */ + BFD_RELOC_390_GOT16, + +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + +/* PC relative 16 bit shifted by 1. */ + BFD_RELOC_390_PC16DBL, + +/* 16 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT16DBL, + +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + +/* PC relative 32 bit shifted by 1. */ + BFD_RELOC_390_PC32DBL, + +/* 32 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT32DBL, + +/* 32 bit PC rel. GOT shifted by 1. */ + BFD_RELOC_390_GOTPCDBL, + +/* 64 bit GOT offset. */ + BFD_RELOC_390_GOT64, + +/* 64 bit PC relative PLT address. */ + BFD_RELOC_390_PLT64, + +/* 32 bit rel. offset to GOT entry. */ + BFD_RELOC_390_GOTENT, + +/* 64 bit offset to GOT. */ + BFD_RELOC_390_GOTOFF64, + +/* 12-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT12, + +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT16, + +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT32, + +/* 64-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT64, + +/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLTENT, + +/* 16-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF16, + +/* 32-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF32, + +/* 64-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF64, + +/* s390 tls relocations. */ + BFD_RELOC_390_TLS_LOAD, + BFD_RELOC_390_TLS_GDCALL, + BFD_RELOC_390_TLS_LDCALL, + BFD_RELOC_390_TLS_GD32, + BFD_RELOC_390_TLS_GD64, + BFD_RELOC_390_TLS_GOTIE12, + BFD_RELOC_390_TLS_GOTIE32, + BFD_RELOC_390_TLS_GOTIE64, + BFD_RELOC_390_TLS_LDM32, + BFD_RELOC_390_TLS_LDM64, + BFD_RELOC_390_TLS_IE32, + BFD_RELOC_390_TLS_IE64, + BFD_RELOC_390_TLS_IEENT, + BFD_RELOC_390_TLS_LE32, + BFD_RELOC_390_TLS_LE64, + BFD_RELOC_390_TLS_LDO32, + BFD_RELOC_390_TLS_LDO64, + BFD_RELOC_390_TLS_DTPMOD, + BFD_RELOC_390_TLS_DTPOFF, + BFD_RELOC_390_TLS_TPOFF, + +/* Long displacement extension. */ + BFD_RELOC_390_20, + BFD_RELOC_390_GOT20, + BFD_RELOC_390_GOTPLT20, + BFD_RELOC_390_TLS_GOTIE20, + +/* STT_GNU_IFUNC relocation. */ + BFD_RELOC_390_IRELATIVE, + +/* Score relocations +Low 16 bit for load/store */ + BFD_RELOC_SCORE_GPREL15, + +/* This is a 24-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_DUMMY2, + BFD_RELOC_SCORE_JMP, + +/* This is a 19-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_BRANCH, + +/* This is a 32-bit reloc for 48-bit instructions. */ + BFD_RELOC_SCORE_IMM30, + +/* This is a 32-bit reloc for 48-bit instructions. */ + BFD_RELOC_SCORE_IMM32, + +/* This is a 11-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE16_JMP, + +/* This is a 8-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE16_BRANCH, + +/* This is a 9-bit reloc with the right 1 bit assumed to be 0 */ + BFD_RELOC_SCORE_BCMP, + +/* Undocumented Score relocs */ + BFD_RELOC_SCORE_GOT15, + BFD_RELOC_SCORE_GOT_LO16, + BFD_RELOC_SCORE_CALL15, + BFD_RELOC_SCORE_DUMMY_HI16, + +/* Scenix IP2K - 9-bit register number / data address */ + BFD_RELOC_IP2K_FR9, + +/* Scenix IP2K - 4-bit register/data bank number */ + BFD_RELOC_IP2K_BANK, + +/* Scenix IP2K - low 13 bits of instruction word address */ + BFD_RELOC_IP2K_ADDR16CJP, + +/* Scenix IP2K - high 3 bits of instruction word address */ + BFD_RELOC_IP2K_PAGE3, + +/* Scenix IP2K - ext/low/high 8 bits of data address */ + BFD_RELOC_IP2K_LO8DATA, + BFD_RELOC_IP2K_HI8DATA, + BFD_RELOC_IP2K_EX8DATA, + +/* Scenix IP2K - low/high 8 bits of instruction word address */ + BFD_RELOC_IP2K_LO8INSN, + BFD_RELOC_IP2K_HI8INSN, + +/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ + BFD_RELOC_IP2K_PC_SKIP, + +/* Scenix IP2K - 16 bit word address in text section. */ + BFD_RELOC_IP2K_TEXT, + +/* Scenix IP2K - 7-bit sp or dp offset */ + BFD_RELOC_IP2K_FR_OFFSET, + +/* Scenix VPE4K coprocessor - data/insn-space addressing */ + BFD_RELOC_VPE4KMATH_DATA, + BFD_RELOC_VPE4KMATH_INSN, + +/* These two relocations are used by the linker to determine which of +the entries in a C++ virtual function table are actually used. When +the --gc-sections option is given, the linker will zero out the entries +that are not used, so that the code for those functions need not be +included in the output. + +VTABLE_INHERIT is a zero-space relocation used to describe to the +linker the inheritance tree of a C++ virtual function table. The +relocation's symbol should be the parent class' vtable, and the +relocation should be located at the child vtable. + +VTABLE_ENTRY is a zero-space relocation that describes the use of a +virtual function table entry. The reloc's symbol should refer to the +table of the class mentioned in the code. Off of that base, an offset +describes the entry that is being used. For Rela hosts, this offset +is stored in the reloc's addend. For Rel hosts, we are forced to put +this offset in the reloc's section offset. */ + BFD_RELOC_VTABLE_INHERIT, + BFD_RELOC_VTABLE_ENTRY, + +/* Intel IA64 Relocations. */ + BFD_RELOC_IA64_IMM14, + BFD_RELOC_IA64_IMM22, + BFD_RELOC_IA64_IMM64, + BFD_RELOC_IA64_DIR32MSB, + BFD_RELOC_IA64_DIR32LSB, + BFD_RELOC_IA64_DIR64MSB, + BFD_RELOC_IA64_DIR64LSB, + BFD_RELOC_IA64_GPREL22, + BFD_RELOC_IA64_GPREL64I, + BFD_RELOC_IA64_GPREL32MSB, + BFD_RELOC_IA64_GPREL32LSB, + BFD_RELOC_IA64_GPREL64MSB, + BFD_RELOC_IA64_GPREL64LSB, + BFD_RELOC_IA64_LTOFF22, + BFD_RELOC_IA64_LTOFF64I, + BFD_RELOC_IA64_PLTOFF22, + BFD_RELOC_IA64_PLTOFF64I, + BFD_RELOC_IA64_PLTOFF64MSB, + BFD_RELOC_IA64_PLTOFF64LSB, + BFD_RELOC_IA64_FPTR64I, + BFD_RELOC_IA64_FPTR32MSB, + BFD_RELOC_IA64_FPTR32LSB, + BFD_RELOC_IA64_FPTR64MSB, + BFD_RELOC_IA64_FPTR64LSB, + BFD_RELOC_IA64_PCREL21B, + BFD_RELOC_IA64_PCREL21BI, + BFD_RELOC_IA64_PCREL21M, + BFD_RELOC_IA64_PCREL21F, + BFD_RELOC_IA64_PCREL22, + BFD_RELOC_IA64_PCREL60B, + BFD_RELOC_IA64_PCREL64I, + BFD_RELOC_IA64_PCREL32MSB, + BFD_RELOC_IA64_PCREL32LSB, + BFD_RELOC_IA64_PCREL64MSB, + BFD_RELOC_IA64_PCREL64LSB, + BFD_RELOC_IA64_LTOFF_FPTR22, + BFD_RELOC_IA64_LTOFF_FPTR64I, + BFD_RELOC_IA64_LTOFF_FPTR32MSB, + BFD_RELOC_IA64_LTOFF_FPTR32LSB, + BFD_RELOC_IA64_LTOFF_FPTR64MSB, + BFD_RELOC_IA64_LTOFF_FPTR64LSB, + BFD_RELOC_IA64_SEGREL32MSB, + BFD_RELOC_IA64_SEGREL32LSB, + BFD_RELOC_IA64_SEGREL64MSB, + BFD_RELOC_IA64_SEGREL64LSB, + BFD_RELOC_IA64_SECREL32MSB, + BFD_RELOC_IA64_SECREL32LSB, + BFD_RELOC_IA64_SECREL64MSB, + BFD_RELOC_IA64_SECREL64LSB, + BFD_RELOC_IA64_REL32MSB, + BFD_RELOC_IA64_REL32LSB, + BFD_RELOC_IA64_REL64MSB, + BFD_RELOC_IA64_REL64LSB, + BFD_RELOC_IA64_LTV32MSB, + BFD_RELOC_IA64_LTV32LSB, + BFD_RELOC_IA64_LTV64MSB, + BFD_RELOC_IA64_LTV64LSB, + BFD_RELOC_IA64_IPLTMSB, + BFD_RELOC_IA64_IPLTLSB, + BFD_RELOC_IA64_COPY, + BFD_RELOC_IA64_LTOFF22X, + BFD_RELOC_IA64_LDXMOV, + BFD_RELOC_IA64_TPREL14, + BFD_RELOC_IA64_TPREL22, + BFD_RELOC_IA64_TPREL64I, + BFD_RELOC_IA64_TPREL64MSB, + BFD_RELOC_IA64_TPREL64LSB, + BFD_RELOC_IA64_LTOFF_TPREL22, + BFD_RELOC_IA64_DTPMOD64MSB, + BFD_RELOC_IA64_DTPMOD64LSB, + BFD_RELOC_IA64_LTOFF_DTPMOD22, + BFD_RELOC_IA64_DTPREL14, + BFD_RELOC_IA64_DTPREL22, + BFD_RELOC_IA64_DTPREL64I, + BFD_RELOC_IA64_DTPREL32MSB, + BFD_RELOC_IA64_DTPREL32LSB, + BFD_RELOC_IA64_DTPREL64MSB, + BFD_RELOC_IA64_DTPREL64LSB, + BFD_RELOC_IA64_LTOFF_DTPREL22, + +/* Motorola 68HC11 reloc. +This is the 8 bit high part of an absolute address. */ + BFD_RELOC_M68HC11_HI8, + +/* Motorola 68HC11 reloc. +This is the 8 bit low part of an absolute address. */ + BFD_RELOC_M68HC11_LO8, + +/* Motorola 68HC11 reloc. +This is the 3 bit of a value. */ + BFD_RELOC_M68HC11_3B, + +/* Motorola 68HC11 reloc. +This reloc marks the beginning of a jump/call instruction. +It is used for linker relaxation to correctly identify beginning +of instruction and change some branches to use PC-relative +addressing mode. */ + BFD_RELOC_M68HC11_RL_JUMP, + +/* Motorola 68HC11 reloc. +This reloc marks a group of several instructions that gcc generates +and for which the linker relaxation pass can modify and/or remove +some of them. */ + BFD_RELOC_M68HC11_RL_GROUP, + +/* Motorola 68HC11 reloc. +This is the 16-bit lower part of an address. It is used for 'call' +instruction to specify the symbol address without any special +transformation (due to memory bank window). */ + BFD_RELOC_M68HC11_LO16, + +/* Motorola 68HC11 reloc. +This is a 8-bit reloc that specifies the page number of an address. +It is used by 'call' instruction to specify the page number of +the symbol. */ + BFD_RELOC_M68HC11_PAGE, + +/* Motorola 68HC11 reloc. +This is a 24-bit reloc that represents the address with a 16-bit +value and a 8-bit page number. The symbol address is transformed +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ + BFD_RELOC_M68HC11_24, + +/* Motorola 68HC12 reloc. +This is the 5 bits of a value. */ + BFD_RELOC_M68HC12_5B, + +/* Freescale XGATE reloc. +This reloc marks the beginning of a bra/jal instruction. */ + BFD_RELOC_XGATE_RL_JUMP, + +/* Freescale XGATE reloc. +This reloc marks a group of several instructions that gcc generates +and for which the linker relaxation pass can modify and/or remove +some of them. */ + BFD_RELOC_XGATE_RL_GROUP, + +/* Freescale XGATE reloc. +This is the 16-bit lower part of an address. It is used for the '16-bit' +instructions. */ + BFD_RELOC_XGATE_LO16, + +/* Freescale XGATE reloc. */ + BFD_RELOC_XGATE_GPAGE, + +/* Freescale XGATE reloc. */ + BFD_RELOC_XGATE_24, + +/* Freescale XGATE reloc. +This is a 9-bit pc-relative reloc. */ + BFD_RELOC_XGATE_PCREL_9, + +/* Freescale XGATE reloc. +This is a 10-bit pc-relative reloc. */ + BFD_RELOC_XGATE_PCREL_10, + +/* Freescale XGATE reloc. +This is the 16-bit lower part of an address. It is used for the '16-bit' +instructions. */ + BFD_RELOC_XGATE_IMM8_LO, + +/* Freescale XGATE reloc. +This is the 16-bit higher part of an address. It is used for the '16-bit' +instructions. */ + BFD_RELOC_XGATE_IMM8_HI, + +/* Freescale XGATE reloc. +This is a 3-bit pc-relative reloc. */ + BFD_RELOC_XGATE_IMM3, + +/* Freescale XGATE reloc. +This is a 4-bit pc-relative reloc. */ + BFD_RELOC_XGATE_IMM4, + +/* Freescale XGATE reloc. +This is a 5-bit pc-relative reloc. */ + BFD_RELOC_XGATE_IMM5, + +/* Motorola 68HC12 reloc. +This is the 9 bits of a value. */ + BFD_RELOC_M68HC12_9B, + +/* Motorola 68HC12 reloc. +This is the 16 bits of a value. */ + BFD_RELOC_M68HC12_16B, + +/* Motorola 68HC12/XGATE reloc. +This is a PCREL9 branch. */ + BFD_RELOC_M68HC12_9_PCREL, + +/* Motorola 68HC12/XGATE reloc. +This is a PCREL10 branch. */ + BFD_RELOC_M68HC12_10_PCREL, + +/* Motorola 68HC12/XGATE reloc. +This is the 8 bit low part of an absolute address and immediately precedes +a matching HI8XG part. */ + BFD_RELOC_M68HC12_LO8XG, + +/* Motorola 68HC12/XGATE reloc. +This is the 8 bit high part of an absolute address and immediately follows +a matching LO8XG part. */ + BFD_RELOC_M68HC12_HI8XG, + +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, + +/* NS CR16 Relocations. */ + BFD_RELOC_CR16_NUM8, + BFD_RELOC_CR16_NUM16, + BFD_RELOC_CR16_NUM32, + BFD_RELOC_CR16_NUM32a, + BFD_RELOC_CR16_REGREL0, + BFD_RELOC_CR16_REGREL4, + BFD_RELOC_CR16_REGREL4a, + BFD_RELOC_CR16_REGREL14, + BFD_RELOC_CR16_REGREL14a, + BFD_RELOC_CR16_REGREL16, + BFD_RELOC_CR16_REGREL20, + BFD_RELOC_CR16_REGREL20a, + BFD_RELOC_CR16_ABS20, + BFD_RELOC_CR16_ABS24, + BFD_RELOC_CR16_IMM4, + BFD_RELOC_CR16_IMM8, + BFD_RELOC_CR16_IMM16, + BFD_RELOC_CR16_IMM20, + BFD_RELOC_CR16_IMM24, + BFD_RELOC_CR16_IMM32, + BFD_RELOC_CR16_IMM32a, + BFD_RELOC_CR16_DISP4, + BFD_RELOC_CR16_DISP8, + BFD_RELOC_CR16_DISP16, + BFD_RELOC_CR16_DISP20, + BFD_RELOC_CR16_DISP24, + BFD_RELOC_CR16_DISP24a, + BFD_RELOC_CR16_SWITCH8, + BFD_RELOC_CR16_SWITCH16, + BFD_RELOC_CR16_SWITCH32, + BFD_RELOC_CR16_GOT_REGREL20, + BFD_RELOC_CR16_GOTC_REGREL20, + BFD_RELOC_CR16_GLOB_DAT, + +/* NS CRX Relocations. */ + BFD_RELOC_CRX_REL4, + BFD_RELOC_CRX_REL8, + BFD_RELOC_CRX_REL8_CMP, + BFD_RELOC_CRX_REL16, + BFD_RELOC_CRX_REL24, + BFD_RELOC_CRX_REL32, + BFD_RELOC_CRX_REGREL12, + BFD_RELOC_CRX_REGREL22, + BFD_RELOC_CRX_REGREL28, + BFD_RELOC_CRX_REGREL32, + BFD_RELOC_CRX_ABS16, + BFD_RELOC_CRX_ABS32, + BFD_RELOC_CRX_NUM8, + BFD_RELOC_CRX_NUM16, + BFD_RELOC_CRX_NUM32, + BFD_RELOC_CRX_IMM16, + BFD_RELOC_CRX_IMM32, + BFD_RELOC_CRX_SWITCH8, + BFD_RELOC_CRX_SWITCH16, + BFD_RELOC_CRX_SWITCH32, + +/* These relocs are only used within the CRIS assembler. They are not +(at present) written to any object files. */ + BFD_RELOC_CRIS_BDISP8, + BFD_RELOC_CRIS_UNSIGNED_5, + BFD_RELOC_CRIS_SIGNED_6, + BFD_RELOC_CRIS_UNSIGNED_6, + BFD_RELOC_CRIS_SIGNED_8, + BFD_RELOC_CRIS_UNSIGNED_8, + BFD_RELOC_CRIS_SIGNED_16, + BFD_RELOC_CRIS_UNSIGNED_16, + BFD_RELOC_CRIS_LAPCQ_OFFSET, + BFD_RELOC_CRIS_UNSIGNED_4, + +/* Relocs used in ELF shared libraries for CRIS. */ + BFD_RELOC_CRIS_COPY, + BFD_RELOC_CRIS_GLOB_DAT, + BFD_RELOC_CRIS_JUMP_SLOT, + BFD_RELOC_CRIS_RELATIVE, + +/* 32-bit offset to symbol-entry within GOT. */ + BFD_RELOC_CRIS_32_GOT, + +/* 16-bit offset to symbol-entry within GOT. */ + BFD_RELOC_CRIS_16_GOT, + +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_CRIS_32_GOTPLT, + +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_CRIS_16_GOTPLT, + +/* 32-bit offset to symbol, relative to GOT. */ + BFD_RELOC_CRIS_32_GOTREL, + +/* 32-bit offset to symbol with PLT entry, relative to GOT. */ + BFD_RELOC_CRIS_32_PLT_GOTREL, + +/* 32-bit offset to symbol with PLT entry, relative to this relocation. */ + BFD_RELOC_CRIS_32_PLT_PCREL, + +/* Relocs used in TLS code for CRIS. */ + BFD_RELOC_CRIS_32_GOT_GD, + BFD_RELOC_CRIS_16_GOT_GD, + BFD_RELOC_CRIS_32_GD, + BFD_RELOC_CRIS_DTP, + BFD_RELOC_CRIS_32_DTPREL, + BFD_RELOC_CRIS_16_DTPREL, + BFD_RELOC_CRIS_32_GOT_TPREL, + BFD_RELOC_CRIS_16_GOT_TPREL, + BFD_RELOC_CRIS_32_TPREL, + BFD_RELOC_CRIS_16_TPREL, + BFD_RELOC_CRIS_DTPMOD, + BFD_RELOC_CRIS_32_IE, + +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, + +/* H8 elf Relocations. */ + BFD_RELOC_H8_DIR16A8, + BFD_RELOC_H8_DIR16R8, + BFD_RELOC_H8_DIR24A8, + BFD_RELOC_H8_DIR24R8, + BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, + +/* Sony Xstormy16 Relocations. */ + BFD_RELOC_XSTORMY16_REL_12, + BFD_RELOC_XSTORMY16_12, + BFD_RELOC_XSTORMY16_24, + BFD_RELOC_XSTORMY16_FPTR16, + +/* Self-describing complex relocations. */ + BFD_RELOC_RELC, + + +/* Infineon Relocations. */ + BFD_RELOC_XC16X_PAG, + BFD_RELOC_XC16X_POF, + BFD_RELOC_XC16X_SEG, + BFD_RELOC_XC16X_SOF, + +/* Relocations used by VAX ELF. */ + BFD_RELOC_VAX_GLOB_DAT, + BFD_RELOC_VAX_JMP_SLOT, + BFD_RELOC_VAX_RELATIVE, + +/* Morpho MT - 16 bit immediate relocation. */ + BFD_RELOC_MT_PC16, + +/* Morpho MT - Hi 16 bits of an address. */ + BFD_RELOC_MT_HI16, + +/* Morpho MT - Low 16 bits of an address. */ + BFD_RELOC_MT_LO16, + +/* Morpho MT - Used to tell the linker which vtable entries are used. */ + BFD_RELOC_MT_GNU_VTINHERIT, + +/* Morpho MT - Used to tell the linker which vtable entries are used. */ + BFD_RELOC_MT_GNU_VTENTRY, + +/* Morpho MT - 8 bit immediate relocation. */ + BFD_RELOC_MT_PCINSN8, + +/* msp430 specific relocation codes */ + BFD_RELOC_MSP430_10_PCREL, + BFD_RELOC_MSP430_16_PCREL, + BFD_RELOC_MSP430_16, + BFD_RELOC_MSP430_16_PCREL_BYTE, + BFD_RELOC_MSP430_16_BYTE, + BFD_RELOC_MSP430_2X_PCREL, + BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, + +/* IQ2000 Relocations. */ + BFD_RELOC_IQ2000_OFFSET_16, + BFD_RELOC_IQ2000_OFFSET_21, + BFD_RELOC_IQ2000_UHI16, + +/* Special Xtensa relocation used only by PLT entries in ELF shared +objects to indicate that the runtime linker should set the value +to one of its own internal functions or data structures. */ + BFD_RELOC_XTENSA_RTLD, + +/* Xtensa relocations for ELF shared objects. */ + BFD_RELOC_XTENSA_GLOB_DAT, + BFD_RELOC_XTENSA_JMP_SLOT, + BFD_RELOC_XTENSA_RELATIVE, + +/* Xtensa relocation used in ELF object files for symbols that may require +PLT entries. Otherwise, this is just a generic 32-bit relocation. */ + BFD_RELOC_XTENSA_PLT, + +/* Xtensa relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +first symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_XTENSA_DIFF8, + BFD_RELOC_XTENSA_DIFF16, + BFD_RELOC_XTENSA_DIFF32, + +/* Generic Xtensa relocations for instruction operands. Only the slot +number is encoded in the relocation. The relocation applies to the +last PC-relative immediate operand, or if there are no PC-relative +immediates, to the last immediate operand. */ + BFD_RELOC_XTENSA_SLOT0_OP, + BFD_RELOC_XTENSA_SLOT1_OP, + BFD_RELOC_XTENSA_SLOT2_OP, + BFD_RELOC_XTENSA_SLOT3_OP, + BFD_RELOC_XTENSA_SLOT4_OP, + BFD_RELOC_XTENSA_SLOT5_OP, + BFD_RELOC_XTENSA_SLOT6_OP, + BFD_RELOC_XTENSA_SLOT7_OP, + BFD_RELOC_XTENSA_SLOT8_OP, + BFD_RELOC_XTENSA_SLOT9_OP, + BFD_RELOC_XTENSA_SLOT10_OP, + BFD_RELOC_XTENSA_SLOT11_OP, + BFD_RELOC_XTENSA_SLOT12_OP, + BFD_RELOC_XTENSA_SLOT13_OP, + BFD_RELOC_XTENSA_SLOT14_OP, + +/* Alternate Xtensa relocations. Only the slot is encoded in the +relocation. The meaning of these relocations is opcode-specific. */ + BFD_RELOC_XTENSA_SLOT0_ALT, + BFD_RELOC_XTENSA_SLOT1_ALT, + BFD_RELOC_XTENSA_SLOT2_ALT, + BFD_RELOC_XTENSA_SLOT3_ALT, + BFD_RELOC_XTENSA_SLOT4_ALT, + BFD_RELOC_XTENSA_SLOT5_ALT, + BFD_RELOC_XTENSA_SLOT6_ALT, + BFD_RELOC_XTENSA_SLOT7_ALT, + BFD_RELOC_XTENSA_SLOT8_ALT, + BFD_RELOC_XTENSA_SLOT9_ALT, + BFD_RELOC_XTENSA_SLOT10_ALT, + BFD_RELOC_XTENSA_SLOT11_ALT, + BFD_RELOC_XTENSA_SLOT12_ALT, + BFD_RELOC_XTENSA_SLOT13_ALT, + BFD_RELOC_XTENSA_SLOT14_ALT, + +/* Xtensa relocations for backward compatibility. These have all been +replaced by BFD_RELOC_XTENSA_SLOT0_OP. */ + BFD_RELOC_XTENSA_OP0, + BFD_RELOC_XTENSA_OP1, + BFD_RELOC_XTENSA_OP2, + +/* Xtensa relocation to mark that the assembler expanded the +instructions from an original target. The expansion size is +encoded in the reloc size. */ + BFD_RELOC_XTENSA_ASM_EXPAND, + +/* Xtensa relocation to mark that the linker should simplify +assembler-expanded instructions. This is commonly used +internally by the linker after analysis of a +BFD_RELOC_XTENSA_ASM_EXPAND. */ + BFD_RELOC_XTENSA_ASM_SIMPLIFY, + +/* Xtensa TLS relocations. */ + BFD_RELOC_XTENSA_TLSDESC_FN, + BFD_RELOC_XTENSA_TLSDESC_ARG, + BFD_RELOC_XTENSA_TLS_DTPOFF, + BFD_RELOC_XTENSA_TLS_TPOFF, + BFD_RELOC_XTENSA_TLS_FUNC, + BFD_RELOC_XTENSA_TLS_ARG, + BFD_RELOC_XTENSA_TLS_CALL, + +/* 8 bit signed offset in (ix+d) or (iy+d). */ + BFD_RELOC_Z80_DISP8, + +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + +/* DJNZ offset. */ + BFD_RELOC_Z8K_DISP7, + +/* CALR offset. */ + BFD_RELOC_Z8K_CALLR, + +/* 4 bit value. */ + BFD_RELOC_Z8K_IMM4L, + +/* Lattice Mico32 relocations. */ + BFD_RELOC_LM32_CALL, + BFD_RELOC_LM32_BRANCH, + BFD_RELOC_LM32_16_GOT, + BFD_RELOC_LM32_GOTOFF_HI16, + BFD_RELOC_LM32_GOTOFF_LO16, + BFD_RELOC_LM32_COPY, + BFD_RELOC_LM32_GLOB_DAT, + BFD_RELOC_LM32_JMP_SLOT, + BFD_RELOC_LM32_RELATIVE, + +/* Difference between two section addreses. Must be followed by a +BFD_RELOC_MACH_O_PAIR. */ + BFD_RELOC_MACH_O_SECTDIFF, + +/* Like BFD_RELOC_MACH_O_SECTDIFF but with a local symbol. */ + BFD_RELOC_MACH_O_LOCAL_SECTDIFF, + +/* Pair of relocation. Contains the first symbol. */ + BFD_RELOC_MACH_O_PAIR, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + +/* PCREL relocations. They are marked as branch to create PLT entry if +required. */ + BFD_RELOC_MACH_O_X86_64_BRANCH32, + BFD_RELOC_MACH_O_X86_64_BRANCH8, + +/* Used when referencing a GOT entry. */ + BFD_RELOC_MACH_O_X86_64_GOT, + +/* Used when loading a GOT entry with movq. It is specially marked so that +the linker could optimize the movq to a leaq if possible. */ + BFD_RELOC_MACH_O_X86_64_GOT_LOAD, + +/* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ + BFD_RELOC_MACH_O_X86_64_PCREL32_1, + +/* Same as BFD_RELOC_32_PCREL but with an implicit -2 addend. */ + BFD_RELOC_MACH_O_X86_64_PCREL32_2, + +/* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ + BFD_RELOC_MACH_O_X86_64_PCREL32_4, + +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the +low 16 bits of a value */ + BFD_RELOC_MICROBLAZE_32_LO, + +/* This is a 32 bit pc-relative reloc for the microblaze that +stores the low 16 bits of a value */ + BFD_RELOC_MICROBLAZE_32_LO_PCREL, + +/* This is a 32 bit reloc for the microblaze that stores a +value relative to the read-only small data area anchor */ + BFD_RELOC_MICROBLAZE_32_ROSDA, + +/* This is a 32 bit reloc for the microblaze that stores a +value relative to the read-write small data area anchor */ + BFD_RELOC_MICROBLAZE_32_RWSDA, + +/* This is a 32 bit reloc for the microblaze to handle +expressions of the form "Symbol Op Symbol" */ + BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is +done here - only used for relaxing */ + BFD_RELOC_MICROBLAZE_64_NONE, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative GOT offset */ + BFD_RELOC_MICROBLAZE_64_GOTPC, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +GOT offset */ + BFD_RELOC_MICROBLAZE_64_GOT, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset into PLT */ + BFD_RELOC_MICROBLAZE_64_PLT, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative +value in two words (with an imm instruction). The relocation is +relative offset from _GLOBAL_OFFSET_TABLE_ */ + BFD_RELOC_MICROBLAZE_64_GOTOFF, + +/* This is a 32 bit reloc that stores the 32 bit GOT relative +value in a word. The relocation is relative offset from */ + BFD_RELOC_MICROBLAZE_32_GOTOFF, + +/* This is used to tell the dynamic linker to copy the value out of +the dynamic object into the runtime process image. */ + BFD_RELOC_MICROBLAZE_COPY, + +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, + +/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page +offset, giving a 4KB aligned page base address. */ + BFD_RELOC_AARCH64_ADR_HI21_PCREL, + +/* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page +offset, giving a 4KB aligned page base address, but with no overflow +checking. */ + BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, + +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, + +/* AArch64 19 bit pc-relative conditional branch and compare & branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_BRANCH19, + +/* AArch64 26 bit pc-relative unconditional branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_JUMP26, + +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, + +/* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST16_LO12, + +/* AArch64 32-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST32_LO12, + +/* AArch64 64-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST64_LO12, + +/* AArch64 128-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST128_LO12, + +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, + +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, + +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, + +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, + +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, + +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, + +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, + +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, + +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, + +/* Get to the page base of the global offset table entry for a symbols +tls_index structure as part of an adrp instruction using a 21 bit PC +relative value. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ + BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, + +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, + +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_COPY, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_GLOB_DAT, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_JUMP_SLOT, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, + +/* Tilera TILEPro Relocations. */ + BFD_RELOC_TILEPRO_COPY, + BFD_RELOC_TILEPRO_GLOB_DAT, + BFD_RELOC_TILEPRO_JMP_SLOT, + BFD_RELOC_TILEPRO_RELATIVE, + BFD_RELOC_TILEPRO_BROFF_X1, + BFD_RELOC_TILEPRO_JOFFLONG_X1, + BFD_RELOC_TILEPRO_JOFFLONG_X1_PLT, + BFD_RELOC_TILEPRO_IMM8_X0, + BFD_RELOC_TILEPRO_IMM8_Y0, + BFD_RELOC_TILEPRO_IMM8_X1, + BFD_RELOC_TILEPRO_IMM8_Y1, + BFD_RELOC_TILEPRO_DEST_IMM8_X1, + BFD_RELOC_TILEPRO_MT_IMM15_X1, + BFD_RELOC_TILEPRO_MF_IMM15_X1, + BFD_RELOC_TILEPRO_IMM16_X0, + BFD_RELOC_TILEPRO_IMM16_X1, + BFD_RELOC_TILEPRO_IMM16_X0_LO, + BFD_RELOC_TILEPRO_IMM16_X1_LO, + BFD_RELOC_TILEPRO_IMM16_X0_HI, + BFD_RELOC_TILEPRO_IMM16_X1_HI, + BFD_RELOC_TILEPRO_IMM16_X0_HA, + BFD_RELOC_TILEPRO_IMM16_X1_HA, + BFD_RELOC_TILEPRO_IMM16_X0_PCREL, + BFD_RELOC_TILEPRO_IMM16_X1_PCREL, + BFD_RELOC_TILEPRO_IMM16_X0_LO_PCREL, + BFD_RELOC_TILEPRO_IMM16_X1_LO_PCREL, + BFD_RELOC_TILEPRO_IMM16_X0_HI_PCREL, + BFD_RELOC_TILEPRO_IMM16_X1_HI_PCREL, + BFD_RELOC_TILEPRO_IMM16_X0_HA_PCREL, + BFD_RELOC_TILEPRO_IMM16_X1_HA_PCREL, + BFD_RELOC_TILEPRO_IMM16_X0_GOT, + BFD_RELOC_TILEPRO_IMM16_X1_GOT, + BFD_RELOC_TILEPRO_IMM16_X0_GOT_LO, + BFD_RELOC_TILEPRO_IMM16_X1_GOT_LO, + BFD_RELOC_TILEPRO_IMM16_X0_GOT_HI, + BFD_RELOC_TILEPRO_IMM16_X1_GOT_HI, + BFD_RELOC_TILEPRO_IMM16_X0_GOT_HA, + BFD_RELOC_TILEPRO_IMM16_X1_GOT_HA, + BFD_RELOC_TILEPRO_MMSTART_X0, + BFD_RELOC_TILEPRO_MMEND_X0, + BFD_RELOC_TILEPRO_MMSTART_X1, + BFD_RELOC_TILEPRO_MMEND_X1, + BFD_RELOC_TILEPRO_SHAMT_X0, + BFD_RELOC_TILEPRO_SHAMT_X1, + BFD_RELOC_TILEPRO_SHAMT_Y0, + BFD_RELOC_TILEPRO_SHAMT_Y1, + BFD_RELOC_TILEPRO_TLS_GD_CALL, + BFD_RELOC_TILEPRO_IMM8_X0_TLS_GD_ADD, + BFD_RELOC_TILEPRO_IMM8_X1_TLS_GD_ADD, + BFD_RELOC_TILEPRO_IMM8_Y0_TLS_GD_ADD, + BFD_RELOC_TILEPRO_IMM8_Y1_TLS_GD_ADD, + BFD_RELOC_TILEPRO_TLS_IE_LOAD, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_LO, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_LO, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HI, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HI, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_GD_HA, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_GD_HA, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_LO, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_LO, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HI, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HI, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_IE_HA, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_IE_HA, + BFD_RELOC_TILEPRO_TLS_DTPMOD32, + BFD_RELOC_TILEPRO_TLS_DTPOFF32, + BFD_RELOC_TILEPRO_TLS_TPOFF32, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_LO, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_LO, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HI, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HI, + BFD_RELOC_TILEPRO_IMM16_X0_TLS_LE_HA, + BFD_RELOC_TILEPRO_IMM16_X1_TLS_LE_HA, + +/* Tilera TILE-Gx Relocations. */ + BFD_RELOC_TILEGX_HW0, + BFD_RELOC_TILEGX_HW1, + BFD_RELOC_TILEGX_HW2, + BFD_RELOC_TILEGX_HW3, + BFD_RELOC_TILEGX_HW0_LAST, + BFD_RELOC_TILEGX_HW1_LAST, + BFD_RELOC_TILEGX_HW2_LAST, + BFD_RELOC_TILEGX_COPY, + BFD_RELOC_TILEGX_GLOB_DAT, + BFD_RELOC_TILEGX_JMP_SLOT, + BFD_RELOC_TILEGX_RELATIVE, + BFD_RELOC_TILEGX_BROFF_X1, + BFD_RELOC_TILEGX_JUMPOFF_X1, + BFD_RELOC_TILEGX_JUMPOFF_X1_PLT, + BFD_RELOC_TILEGX_IMM8_X0, + BFD_RELOC_TILEGX_IMM8_Y0, + BFD_RELOC_TILEGX_IMM8_X1, + BFD_RELOC_TILEGX_IMM8_Y1, + BFD_RELOC_TILEGX_DEST_IMM8_X1, + BFD_RELOC_TILEGX_MT_IMM14_X1, + BFD_RELOC_TILEGX_MF_IMM14_X1, + BFD_RELOC_TILEGX_MMSTART_X0, + BFD_RELOC_TILEGX_MMEND_X0, + BFD_RELOC_TILEGX_SHAMT_X0, + BFD_RELOC_TILEGX_SHAMT_X1, + BFD_RELOC_TILEGX_SHAMT_Y0, + BFD_RELOC_TILEGX_SHAMT_Y1, + BFD_RELOC_TILEGX_IMM16_X0_HW0, + BFD_RELOC_TILEGX_IMM16_X1_HW0, + BFD_RELOC_TILEGX_IMM16_X0_HW1, + BFD_RELOC_TILEGX_IMM16_X1_HW1, + BFD_RELOC_TILEGX_IMM16_X0_HW2, + BFD_RELOC_TILEGX_IMM16_X1_HW2, + BFD_RELOC_TILEGX_IMM16_X0_HW3, + BFD_RELOC_TILEGX_IMM16_X1_HW3, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, + BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, + BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, + BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_LE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_LE, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_LE, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_LE, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_LE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_GD, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_GD, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_GD, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, + BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_IE, + BFD_RELOC_TILEGX_TLS_DTPMOD64, + BFD_RELOC_TILEGX_TLS_DTPOFF64, + BFD_RELOC_TILEGX_TLS_TPOFF64, + BFD_RELOC_TILEGX_TLS_DTPMOD32, + BFD_RELOC_TILEGX_TLS_DTPOFF32, + BFD_RELOC_TILEGX_TLS_TPOFF32, + BFD_RELOC_TILEGX_TLS_GD_CALL, + BFD_RELOC_TILEGX_IMM8_X0_TLS_GD_ADD, + BFD_RELOC_TILEGX_IMM8_X1_TLS_GD_ADD, + BFD_RELOC_TILEGX_IMM8_Y0_TLS_GD_ADD, + BFD_RELOC_TILEGX_IMM8_Y1_TLS_GD_ADD, + BFD_RELOC_TILEGX_TLS_IE_LOAD, + BFD_RELOC_TILEGX_IMM8_X0_TLS_ADD, + BFD_RELOC_TILEGX_IMM8_X1_TLS_ADD, + BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, + BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, + +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + +/* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ + BFD_RELOC_EPIPHANY_SIMM8, + +/* Adapteva EPIPHANY - 24 bit signed pc-relative displacement */ + BFD_RELOC_EPIPHANY_SIMM24, + +/* Adapteva EPIPHANY - 16 most-significant bits of absolute address */ + BFD_RELOC_EPIPHANY_HIGH, + +/* Adapteva EPIPHANY - 16 least-significant bits of absolute address */ + BFD_RELOC_EPIPHANY_LOW, + +/* Adapteva EPIPHANY - 11 bit signed number - add/sub immediate */ + BFD_RELOC_EPIPHANY_SIMM11, + +/* Adapteva EPIPHANY - 11 bit sign-magnitude number (ld/st displacement) */ + BFD_RELOC_EPIPHANY_IMM11, + +/* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ + BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, + BFD_RELOC_UNUSED }; + +typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; +reloc_howto_type *bfd_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); +reloc_howto_type *bfd_reloc_name_lookup + (bfd *abfd, const char *reloc_name); + +const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); + +/* Extracted from syms.c. */ + +typedef struct bfd_symbol +{ + /* A pointer to the BFD which owns the symbol. This information + is necessary so that a back end can work out what additional + information (invisible to the application writer) is carried + with the symbol. + + This field is *almost* redundant, since you can use section->owner + instead, except that some symbols point to the global sections + bfd_{abs,com,und}_section. This could be fixed by making + these globals be per-bfd (or per-target-flavor). FIXME. */ + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ + + /* The text of the symbol. The name is left alone, and not copied; the + application may not alter it. */ + const char *name; + + /* The value of the symbol. This really should be a union of a + numeric value with a pointer, since some flags indicate that + a pointer to another symbol is stored here. */ + symvalue value; + + /* Attributes of a symbol. */ +#define BSF_NO_FLAGS 0 + + /* The symbol has local scope; <> in <>. The value + is the offset into the section of the data. */ +#define BSF_LOCAL (1 << 0) + + /* The symbol has global scope; initialized data in <>. The + value is the offset into the section of the data. */ +#define BSF_GLOBAL (1 << 1) + + /* The symbol has global scope and is exported. The value is + the offset into the section of the data. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ + + /* A normal C symbol would be one of: + <>, <> or <>. */ + + /* The symbol is a debugging record. The value has an arbitrary + meaning, unless BSF_DEBUGGING_RELOC is also set. */ +#define BSF_DEBUGGING (1 << 2) + + /* The symbol denotes a function entry point. Used in ELF, + perhaps others someday. */ +#define BSF_FUNCTION (1 << 3) + + /* Used by the linker. */ +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) + + /* A weak global symbol, overridable without warnings by + a regular global symbol of the same name. */ +#define BSF_WEAK (1 << 7) + + /* This symbol was created to point to a section, e.g. ELF's + STT_SECTION symbols. */ +#define BSF_SECTION_SYM (1 << 8) + + /* The symbol used to be a common symbol, but now it is + allocated. */ +#define BSF_OLD_COMMON (1 << 9) + + /* In some files the type of a symbol sometimes alters its + location in an output file - ie in coff a <> symbol + which is also <> symbol appears where it was + declared and not at the end of a section. This bit is set + by the target BFD part to convey this information. */ +#define BSF_NOT_AT_END (1 << 10) + + /* Signal that the symbol is the label of constructor section. */ +#define BSF_CONSTRUCTOR (1 << 11) + + /* Signal that the symbol is a warning symbol. The name is a + warning. The name of the next symbol is the one to warn about; + if a reference is made to a symbol with the same name as the next + symbol, a warning is issued by the linker. */ +#define BSF_WARNING (1 << 12) + + /* Signal that the symbol is indirect. This symbol is an indirect + pointer to the symbol with the same name as the next symbol. */ +#define BSF_INDIRECT (1 << 13) + + /* BSF_FILE marks symbols that contain a file name. This is used + for ELF STT_FILE symbols. */ +#define BSF_FILE (1 << 14) + + /* Symbol is from dynamic linking information. */ +#define BSF_DYNAMIC (1 << 15) + + /* The symbol denotes a data object. Used in ELF, and perhaps + others someday. */ +#define BSF_OBJECT (1 << 16) + + /* This symbol is a debugging symbol. The value is the offset + into the section of the data. BSF_DEBUGGING should be set + as well. */ +#define BSF_DEBUGGING_RELOC (1 << 17) + + /* This symbol is thread local. Used in ELF. */ +#define BSF_THREAD_LOCAL (1 << 18) + + /* This symbol represents a complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_RELC (1 << 19) + + /* This symbol represents a signed complex relocation expression, + with the expression tree serialized in the symbol name. */ +#define BSF_SRELC (1 << 20) + + /* This symbol was created by bfd_get_synthetic_symtab. */ +#define BSF_SYNTHETIC (1 << 21) + + /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. + The dynamic linker will compute the value of this symbol by + calling the function that it points to. BSF_FUNCTION must + also be also set. */ +#define BSF_GNU_INDIRECT_FUNCTION (1 << 22) + /* This symbol is a globally unique data object. The dynamic linker + will make sure that in the entire process there is just one symbol + with this name and type in use. BSF_OBJECT must also be set. */ +#define BSF_GNU_UNIQUE (1 << 23) + + flagword flags; + + /* A pointer to the section to which this symbol is + relative. This will always be non NULL, there are special + sections for undefined and absolute symbols. */ + struct bfd_section *section; + + /* Back end special data. */ + union + { + void *p; + bfd_vma i; + } + udata; +} +asymbol; + +#define bfd_get_symtab_upper_bound(abfd) \ + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + +bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); + +bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); + +#define bfd_is_local_label_name(abfd, name) \ + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + +bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); + +#define bfd_is_target_special_symbol(abfd, sym) \ + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + +#define bfd_canonicalize_symtab(abfd, location) \ + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + +bfd_boolean bfd_set_symtab + (bfd *abfd, asymbol **location, unsigned int count); + +void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); + +#define bfd_make_empty_symbol(abfd) \ + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + +asymbol *_bfd_generic_make_empty_symbol (bfd *); + +#define bfd_make_debug_symbol(abfd,ptr,size) \ + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + +int bfd_decode_symclass (asymbol *symbol); + +bfd_boolean bfd_is_undefined_symclass (int symclass); + +void bfd_symbol_info (asymbol *symbol, symbol_info *ret); + +bfd_boolean bfd_copy_private_symbol_data + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); + +#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) + +/* Extracted from bfd.c. */ + +enum bfd_direction + { + no_direction = 0, + read_direction = 1, + write_direction = 2, + both_direction = 3 + }; + +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + +struct bfd +{ + /* The filename the application opened the BFD with. */ + const char *filename; + + /* A pointer to the target jump table. */ + const struct bfd_target *xvec; + + /* The IOSTREAM, and corresponding IO vector that provide access + to the file backing the BFD. */ + void *iostream; + const struct bfd_iovec *iovec; + + /* The caching routines use these to maintain a + least-recently-used list of BFDs. */ + struct bfd *lru_prev, *lru_next; + + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ + ufile_ptr where; + + /* File modified time, if mtime_set is TRUE. */ + long mtime; + + /* A unique identifier of the BFD */ + unsigned int id; + + /* The format which belongs to the BFD. (object, core, etc.) */ + ENUM_BITFIELD (bfd_format) format : 3; + + /* The direction with which the BFD was opened. */ + ENUM_BITFIELD (bfd_direction) direction : 2; + + /* Format_specific flags. */ + flagword flags; + + /* Values that may appear in the flags field of a BFD. These also + appear in the object_flags field of the bfd_target structure, where + they indicate the set of flags used by that backend (not all flags + are meaningful for all object file formats) (FIXME: at the moment, + the object_flags values have mostly just been copied from backend + to another, and are not necessarily correct). */ + +#define BFD_NO_FLAGS 0x0 + + /* BFD contains relocation entries. */ +#define HAS_RELOC 0x1 + + /* BFD is directly executable. */ +#define EXEC_P 0x2 + + /* BFD has line number information (basically used for F_LNNO in a + COFF header). */ +#define HAS_LINENO 0x4 + + /* BFD has debugging information. */ +#define HAS_DEBUG 0x08 + + /* BFD has symbols. */ +#define HAS_SYMS 0x10 + + /* BFD has local symbols (basically used for F_LSYMS in a COFF + header). */ +#define HAS_LOCALS 0x20 + + /* BFD is a dynamic object. */ +#define DYNAMIC 0x40 + + /* Text section is write protected (if D_PAGED is not set, this is + like an a.out NMAGIC file) (the linker sets this by default, but + clears it for -r or -N). */ +#define WP_TEXT 0x80 + + /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the + linker sets this by default, but clears it for -r or -n or -N). */ +#define D_PAGED 0x100 + + /* BFD is relaxable (this means that bfd_relax_section may be able to + do something) (sometimes bfd_relax_section can do something even if + this is not set). */ +#define BFD_IS_RELAXABLE 0x200 + + /* This may be set before writing out a BFD to request using a + traditional format. For example, this is used to request that when + writing out an a.out object the symbols not be hashed to eliminate + duplicates. */ +#define BFD_TRADITIONAL_FORMAT 0x400 + + /* This flag indicates that the BFD contents are actually cached + in memory. If this is set, iostream points to a bfd_in_memory + struct. */ +#define BFD_IN_MEMORY 0x800 + + /* This BFD has been created by the linker and doesn't correspond + to any input file. */ +#define BFD_LINKER_CREATED 0x1000 + + /* This may be set before writing out a BFD to request that it + be written using values for UIDs, GIDs, timestamps, etc. that + will be consistent from run to run. */ +#define BFD_DETERMINISTIC_OUTPUT 0x2000 + + /* Compress sections in this BFD. */ +#define BFD_COMPRESS 0x4000 + + /* Decompress sections in this BFD. */ +#define BFD_DECOMPRESS 0x8000 + + /* BFD is a dummy, for plugins. */ +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 + + /* Flags bits to be saved in bfd_preserve_save. */ +#define BFD_FLAGS_SAVED \ + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) + + /* Flags bits which are for BFD use only. */ +#define BFD_FLAGS_FOR_BFD_USE_MASK \ + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; + + /* Currently my_archive is tested before adding origin to + anything. I believe that this can become always an add of + origin, with origin set to 0 for non archive files. */ + ufile_ptr origin; + + /* The origin in the archive of the proxy entry. This will + normally be the same as origin, except for thin archives, + when it will contain the current offset of the proxy in the + thin archive rather than the offset of the bfd in its actual + container. */ + ufile_ptr proxy_origin; + + /* A hash table for section names. */ + struct bfd_hash_table section_htab; + + /* Pointer to linked list of sections. */ + struct bfd_section *sections; + + /* The last section on the section list. */ + struct bfd_section *section_last; + + /* The number of sections. */ + unsigned int section_count; + + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + + /* Stuff only useful for object files: + The start address. */ + bfd_vma start_address; + + /* Symbol table for output BFD (with symcount entries). + Also used by the linker to cache input BFD symbols. */ + struct bfd_symbol **outsymbols; + + /* Used for input and output. */ + unsigned int symcount; + + /* Used for slurped dynamic symbol tables. */ + unsigned int dynsymcount; + + /* Pointer to structure which contains architecture information. */ + const struct bfd_arch_info *arch_info; + + /* Stuff only useful for archives. */ + void *arelt_data; + struct bfd *my_archive; /* The containing archive BFD. */ + struct bfd *archive_next; /* The next BFD in the archive. */ + struct bfd *archive_head; /* The first BFD in the archive. */ + struct bfd *nested_archives; /* List of nested archive in a flattened + thin archive. */ + + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; + + /* Used by the back end to hold private data. */ + union + { + struct aout_data_struct *aout_data; + struct artdata *aout_ar_data; + struct coff_tdata *coff_obj_data; + struct pe_tdata *pe_obj_data; + struct xcoff_tdata *xcoff_obj_data; + struct ecoff_tdata *ecoff_obj_data; + struct srec_data_struct *srec_data; + struct verilog_data_struct *verilog_data; + struct ihex_data_struct *ihex_data; + struct tekhex_data_struct *tekhex_data; + struct elf_obj_tdata *elf_obj_data; + struct mmo_data_struct *mmo_data; + struct sun_core_struct *sun_core_data; + struct sco5_core_struct *sco5_core_data; + struct trad_core_struct *trad_core_data; + struct som_data_struct *som_data; + struct hpux_core_struct *hpux_core_data; + struct hppabsd_core_struct *hppabsd_core_data; + struct sgi_core_struct *sgi_core_data; + struct lynx_core_struct *lynx_core_data; + struct osf_core_struct *osf_core_data; + struct cisco_core_struct *cisco_core_data; + struct versados_data_struct *versados_data; + struct netbsd_core_struct *netbsd_core_data; + struct mach_o_data_struct *mach_o_data; + struct mach_o_fat_data_struct *mach_o_fat_data; + struct plugin_data_struct *plugin_data; + struct bfd_pef_data_struct *pef_data; + struct bfd_pef_xlib_data_struct *pef_xlib_data; + struct bfd_sym_data_struct *sym_data; + void *any; + } + tdata; + + /* Used by the application to hold private data. */ + void *usrdata; + + /* Where all the allocated stuff under this BFD goes. This is a + struct objalloc *, but we use void * to avoid requiring the inclusion + of objalloc.h. */ + void *memory; + + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; +}; + +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + +typedef enum bfd_error +{ + bfd_error_no_error = 0, + bfd_error_system_call, + bfd_error_invalid_target, + bfd_error_wrong_format, + bfd_error_wrong_object_format, + bfd_error_invalid_operation, + bfd_error_no_memory, + bfd_error_no_symbols, + bfd_error_no_armap, + bfd_error_no_more_archived_files, + bfd_error_malformed_archive, + bfd_error_missing_dso, + bfd_error_file_not_recognized, + bfd_error_file_ambiguously_recognized, + bfd_error_no_contents, + bfd_error_nonrepresentable_section, + bfd_error_no_debug_section, + bfd_error_bad_value, + bfd_error_file_truncated, + bfd_error_file_too_big, + bfd_error_sorry, + bfd_error_on_input, + bfd_error_invalid_error_code +} +bfd_error_type; + +bfd_error_type bfd_get_error (void); + +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); + +const char *bfd_errmsg (bfd_error_type error_tag); + +void bfd_perror (const char *message); + + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; + +bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); + +void bfd_set_error_program_name (const char *); + + +typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, + const char *bfd_version, + const char *bfd_file, + int bfd_line); + +bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); + +long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); + +long bfd_canonicalize_reloc + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); + +void bfd_set_reloc + (bfd *abfd, asection *sec, arelent **rel, unsigned int count); + +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) +bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); + +int bfd_get_arch_size (bfd *abfd); + +int bfd_get_sign_extend_vma (bfd *abfd); + +bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); + +unsigned int bfd_get_gp_size (bfd *abfd); + +void bfd_set_gp_size (bfd *abfd, unsigned int i); + +bfd_vma bfd_scan_vma (const char *string, const char **end, int base); + +bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); + +#define bfd_copy_private_header_data(ibfd, obfd) \ + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) +bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); + +#define bfd_copy_private_bfd_data(ibfd, obfd) \ + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) +bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); + +#define bfd_set_private_flags(abfd, flags) \ + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) +#define bfd_sizeof_headers(abfd, info) \ + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) + +#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, NULL)) + +#define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) + +#define bfd_find_line(abfd, syms, sym, file, line) \ + BFD_SEND (abfd, _bfd_find_line, \ + (abfd, syms, sym, file, line)) + +#define bfd_find_inliner_info(abfd, file, func, line) \ + BFD_SEND (abfd, _bfd_find_inliner_info, \ + (abfd, file, func, line)) + +#define bfd_debug_info_start(abfd) \ + BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) + +#define bfd_debug_info_end(abfd) \ + BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) + +#define bfd_debug_info_accumulate(abfd, section) \ + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) + +#define bfd_stat_arch_elt(abfd, stat) \ + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) + +#define bfd_update_armap_timestamp(abfd) \ + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) + +#define bfd_set_arch_mach(abfd, arch, mach)\ + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) + +#define bfd_relax_section(abfd, section, link_info, again) \ + BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) + +#define bfd_gc_sections(abfd, link_info) \ + BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info)) + +#define bfd_lookup_section_flags(link_info, flag_info, section) \ + BFD_SEND (abfd, _bfd_lookup_section_flags, (link_info, flag_info, section)) + +#define bfd_merge_sections(abfd, link_info) \ + BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info)) + +#define bfd_is_group_section(abfd, sec) \ + BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) + +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + +#define bfd_discard_group(abfd, sec) \ + BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) + +#define bfd_link_hash_table_create(abfd) \ + BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) + +#define bfd_link_add_symbols(abfd, info) \ + BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) + +#define bfd_link_just_syms(abfd, sec, info) \ + BFD_SEND (abfd, _bfd_link_just_syms, (sec, info)) + +#define bfd_final_link(abfd, info) \ + BFD_SEND (abfd, _bfd_final_link, (abfd, info)) + +#define bfd_free_cached_info(abfd) \ + BFD_SEND (abfd, _bfd_free_cached_info, (abfd)) + +#define bfd_get_dynamic_symtab_upper_bound(abfd) \ + BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd)) + +#define bfd_print_private_bfd_data(abfd, file)\ + BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file)) + +#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \ + BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols)) + +#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \ + BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \ + dyncount, dynsyms, ret)) + +#define bfd_get_dynamic_reloc_upper_bound(abfd) \ + BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd)) + +#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \ + BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) + +extern bfd_byte *bfd_get_relocated_section_contents + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, + bfd_boolean, asymbol **); + +bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); + +bfd_vma bfd_emul_get_maxpagesize (const char *); + +void bfd_emul_set_maxpagesize (const char *, bfd_vma); + +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); + +void bfd_emul_set_commonpagesize (const char *, bfd_vma); + +char *bfd_demangle (bfd *, const char *, int); + +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + +/* Extracted from archive.c. */ +symindex bfd_get_next_mapent + (bfd *abfd, symindex previous, carsym **sym); + +bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); + +bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); + +/* Extracted from corefile.c. */ +const char *bfd_core_file_failing_command (bfd *abfd); + +int bfd_core_file_failing_signal (bfd *abfd); + +int bfd_core_file_pid (bfd *abfd); + +bfd_boolean core_file_matches_executable_p + (bfd *core_bfd, bfd *exec_bfd); + +bfd_boolean generic_core_file_matches_executable_p + (bfd *core_bfd, bfd *exec_bfd); + +/* Extracted from targets.c. */ +#define BFD_SEND(bfd, message, arglist) \ + ((*((bfd)->xvec->message)) arglist) + +#ifdef DEBUG_BFD_SEND +#undef BFD_SEND +#define BFD_SEND(bfd, message, arglist) \ + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ + ((*((bfd)->xvec->message)) arglist) : \ + (bfd_assert (__FILE__,__LINE__), NULL)) +#endif +#define BFD_SEND_FMT(bfd, message, arglist) \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) + +#ifdef DEBUG_BFD_SEND +#undef BFD_SEND_FMT +#define BFD_SEND_FMT(bfd, message, arglist) \ + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ + (bfd_assert (__FILE__,__LINE__), NULL)) +#endif + +enum bfd_flavour +{ + /* N.B. Update bfd_flavour_name if you change this. */ + bfd_target_unknown_flavour, + bfd_target_aout_flavour, + bfd_target_coff_flavour, + bfd_target_ecoff_flavour, + bfd_target_xcoff_flavour, + bfd_target_elf_flavour, + bfd_target_tekhex_flavour, + bfd_target_srec_flavour, + bfd_target_verilog_flavour, + bfd_target_ihex_flavour, + bfd_target_som_flavour, + bfd_target_os9k_flavour, + bfd_target_versados_flavour, + bfd_target_msdos_flavour, + bfd_target_ovax_flavour, + bfd_target_evax_flavour, + bfd_target_mmo_flavour, + bfd_target_mach_o_flavour, + bfd_target_pef_flavour, + bfd_target_pef_xlib_flavour, + bfd_target_sym_flavour +}; + +enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; + +/* Forward declaration. */ +typedef struct bfd_link_info _bfd_link_info; + +/* Forward declaration. */ +typedef struct flag_info flag_info; + +typedef struct bfd_target +{ + /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ + const char *name; + + /* The "flavour" of a back end is a general indication about + the contents of a file. */ + enum bfd_flavour flavour; + + /* The order of bytes within the data area of a file. */ + enum bfd_endian byteorder; + + /* The order of bytes within the header parts of a file. */ + enum bfd_endian header_byteorder; + + /* A mask of all the flags which an executable may have set - + from the set <>, <>, ...<>. */ + flagword object_flags; + + /* A mask of all the flags which a section may have set - from + the set <>, <>, ...<>. */ + flagword section_flags; + + /* The character normally found at the front of a symbol. + (if any), perhaps `_'. */ + char symbol_leading_char; + + /* The pad character for file names within an archive header. */ + char ar_pad_char; + + /* The maximum number of characters in an archive header. */ + unsigned char ar_max_namelen; + + /* How well this target matches, used to select between various + possible targets when more than one target matches. */ + unsigned char match_priority; + + /* Entries for byte swapping for data. These are different from the + other entry points, since they don't take a BFD as the first argument. + Certain other handlers could do the same. */ + bfd_uint64_t (*bfd_getx64) (const void *); + bfd_int64_t (*bfd_getx_signed_64) (const void *); + void (*bfd_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_getx32) (const void *); + bfd_signed_vma (*bfd_getx_signed_32) (const void *); + void (*bfd_putx32) (bfd_vma, void *); + bfd_vma (*bfd_getx16) (const void *); + bfd_signed_vma (*bfd_getx_signed_16) (const void *); + void (*bfd_putx16) (bfd_vma, void *); + + /* Byte swapping for the headers. */ + bfd_uint64_t (*bfd_h_getx64) (const void *); + bfd_int64_t (*bfd_h_getx_signed_64) (const void *); + void (*bfd_h_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_h_getx32) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); + void (*bfd_h_putx32) (bfd_vma, void *); + bfd_vma (*bfd_h_getx16) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); + void (*bfd_h_putx16) (bfd_vma, void *); + + /* Format dependent routines: these are vectors of entry points + within the target vector structure, one for each format to check. */ + + /* Check the format of a file being read. Return a <> or zero. */ + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); + + /* Set the format of a file being written. */ + bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); + + /* Write cached information into a file being written, at <>. */ + bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); + + + /* Generic entry points. */ +#define BFD_JUMP_TABLE_GENERIC(NAME) \ + NAME##_close_and_cleanup, \ + NAME##_bfd_free_cached_info, \ + NAME##_new_section_hook, \ + NAME##_get_section_contents, \ + NAME##_get_section_contents_in_window + + /* Called when the BFD is being closed to do any necessary cleanup. */ + bfd_boolean (*_close_and_cleanup) (bfd *); + /* Ask the BFD to free all cached information. */ + bfd_boolean (*_bfd_free_cached_info) (bfd *); + /* Called when a new section is created. */ + bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); + /* Read the contents of a section. */ + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); + + /* Entry points to copy private data. */ +#define BFD_JUMP_TABLE_COPY(NAME) \ + NAME##_bfd_copy_private_bfd_data, \ + NAME##_bfd_merge_private_bfd_data, \ + _bfd_generic_init_private_section_data, \ + NAME##_bfd_copy_private_section_data, \ + NAME##_bfd_copy_private_symbol_data, \ + NAME##_bfd_copy_private_header_data, \ + NAME##_bfd_set_private_flags, \ + NAME##_bfd_print_private_bfd_data + + /* Called to copy BFD general private data from one object file + to another. */ + bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); + /* Called to merge BFD general private data from one object file + to a common output file when linking. */ + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); + /* Called to initialize BFD private section data from one object file + to another. */ +#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); + /* Called to copy BFD private section data from one object file + to another. */ + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); + /* Called to copy BFD private symbol data from one symbol + to another. */ + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); + /* Called to copy BFD private header data from one object file + to another. */ + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); + /* Called to set private backend flags. */ + bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); + + /* Called to print private BFD data. */ + bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); + + /* Core file entry points. */ +#define BFD_JUMP_TABLE_CORE(NAME) \ + NAME##_core_file_failing_command, \ + NAME##_core_file_failing_signal, \ + NAME##_core_file_matches_executable_p, \ + NAME##_core_file_pid + + char * (*_core_file_failing_command) (bfd *); + int (*_core_file_failing_signal) (bfd *); + bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); + int (*_core_file_pid) (bfd *); + + /* Archive entry points. */ +#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ + NAME##_slurp_armap, \ + NAME##_slurp_extended_name_table, \ + NAME##_construct_extended_name_table, \ + NAME##_truncate_arname, \ + NAME##_write_armap, \ + NAME##_read_ar_hdr, \ + NAME##_write_ar_hdr, \ + NAME##_openr_next_archived_file, \ + NAME##_get_elt_at_index, \ + NAME##_generic_stat_arch_elt, \ + NAME##_update_armap_timestamp + + bfd_boolean (*_bfd_slurp_armap) (bfd *); + bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); + void (*_bfd_truncate_arname) (bfd *, const char *, char *); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); + void * (*_bfd_read_ar_hdr_fn) (bfd *); + bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); + bfd * (*openr_next_archived_file) (bfd *, bfd *); +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) + bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); + int (*_bfd_stat_arch_elt) (bfd *, struct stat *); + bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); + + /* Entry points used for symbols. */ +#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ + NAME##_get_symtab_upper_bound, \ + NAME##_canonicalize_symtab, \ + NAME##_make_empty_symbol, \ + NAME##_print_symbol, \ + NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ + NAME##_bfd_is_local_label_name, \ + NAME##_bfd_is_target_special_symbol, \ + NAME##_get_lineno, \ + NAME##_find_nearest_line, \ + NAME##_find_line, \ + NAME##_find_inliner_info, \ + NAME##_bfd_make_debug_symbol, \ + NAME##_read_minisymbols, \ + NAME##_minisymbol_to_symbol + + long (*_bfd_get_symtab_upper_bound) (bfd *); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); + struct bfd_symbol * + (*_bfd_make_empty_symbol) (bfd *); + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) + bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); + bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); + alent * (*_get_lineno) (bfd *, struct bfd_symbol *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); + bfd_boolean (*_bfd_find_inliner_info) + (bfd *, const char **, const char **, unsigned int *); + /* Back-door to allow format-aware applications to create debug symbols + while using BFD for everything else. Currently used by the assembler + when creating COFF files. */ + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); +#define bfd_read_minisymbols(b, d, m, s) \ + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); +#define bfd_minisymbol_to_symbol(b, d, m, f) \ + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); + + /* Routines for relocs. */ +#define BFD_JUMP_TABLE_RELOCS(NAME) \ + NAME##_get_reloc_upper_bound, \ + NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ + NAME##_bfd_reloc_type_lookup, \ + NAME##_bfd_reloc_name_lookup + + long (*_get_reloc_upper_bound) (bfd *, sec_ptr); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); + /* See documentation on reloc types. */ + reloc_howto_type * + (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); + reloc_howto_type * + (*reloc_name_lookup) (bfd *, const char *); + + /* Routines used when writing an object file. */ +#define BFD_JUMP_TABLE_WRITE(NAME) \ + NAME##_set_arch_mach, \ + NAME##_set_section_contents + + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); + + /* Routines used by the linker. */ +#define BFD_JUMP_TABLE_LINK(NAME) \ + NAME##_sizeof_headers, \ + NAME##_bfd_get_relocated_section_contents, \ + NAME##_bfd_relax_section, \ + NAME##_bfd_link_hash_table_create, \ + NAME##_bfd_link_add_symbols, \ + NAME##_bfd_link_just_syms, \ + NAME##_bfd_copy_link_hash_symbol_type, \ + NAME##_bfd_final_link, \ + NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ + NAME##_bfd_gc_sections, \ + NAME##_bfd_lookup_section_flags, \ + NAME##_bfd_merge_sections, \ + NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ + NAME##_bfd_discard_group, \ + NAME##_section_already_linked, \ + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop + + int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); + + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); + + /* Create a hash table for the linker. Different backends store + different information in this table. */ + struct bfd_link_hash_table * + (*_bfd_link_hash_table_create) (bfd *); + + /* Add symbols from this object file into the hash table. */ + bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); + + /* Indicate that we are only retrieving symbol values from this section. */ + void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); + + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ +#define bfd_copy_link_hash_symbol_type(b, t, f) \ + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); + + /* Do a link based on the link_order structures attached to each + section of the BFD. */ + bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); + + /* Should this section be split up into smaller pieces during linking. */ + bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + + /* Remove sections that are not referenced from the output. */ + bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); + + /* Sets the bitmask of allowed and disallowed section flags. */ + bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, + struct flag_info *, asection *); + + /* Attempt to merge SEC_MERGE sections. */ + bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); + + /* Is this section a member of a group? */ + bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + + /* Discard members of a group. */ + bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); + + /* Check if SEC has been already linked during a reloceatable or + final link. */ + bfd_boolean (*_section_already_linked) (bfd *, asection *, + struct bfd_link_info *); + + /* Define a common symbol. */ + bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + + /* Routines to handle dynamic symbols and relocs. */ +#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ + NAME##_get_dynamic_symtab_upper_bound, \ + NAME##_canonicalize_dynamic_symtab, \ + NAME##_get_synthetic_symtab, \ + NAME##_get_dynamic_reloc_upper_bound, \ + NAME##_canonicalize_dynamic_reloc + + /* Get the amount of memory required to hold the dynamic symbols. */ + long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); + /* Read in the dynamic symbols. */ + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); + /* Create synthetized symbols. */ + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); + /* Get the amount of memory required to hold the dynamic relocs. */ + long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); + /* Read in the dynamic relocs. */ + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); + + /* Opposite endian version of this target. */ + const struct bfd_target *alternative_target; + + /* Data for use by back-end routines, which isn't + generic enough to belong in this structure. */ + const void *backend_data; + +} bfd_target; + +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + +bfd_boolean bfd_set_default_target (const char *name); + +const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); + +const bfd_target *bfd_get_target_info (const char *target_name, + bfd *abfd, + bfd_boolean *is_bigendian, + int *underscoring, + const char **def_target_arch); +const char ** bfd_target_list (void); + +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); + +/* Extracted from format.c. */ +bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); + +bfd_boolean bfd_check_format_matches + (bfd *abfd, bfd_format format, char ***matching); + +bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); + +const char *bfd_format_string (bfd_format format); + +/* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + +bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); + +#define bfd_link_split_section(abfd, sec) \ + BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) + +bfd_boolean bfd_section_already_linked (bfd *abfd, + asection *sec, + struct bfd_link_info *info); + +#define bfd_section_already_linked(abfd, sec, info) \ + BFD_SEND (abfd, _section_already_linked, (abfd, sec, info)) + +bfd_boolean bfd_generic_define_common_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_define_common_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) + +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + +struct bfd_elf_version_tree * bfd_find_version_for_sym + (struct bfd_elf_version_tree *verdefs, + const char *sym_name, bfd_boolean *hide); + +bfd_boolean bfd_hide_sym_by_version + (struct bfd_elf_version_tree *verdefs, const char *sym_name); + +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) +/* Extracted from simple.c. */ +bfd_byte *bfd_simple_get_relocated_section_contents + (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); + +/* Extracted from compress.c. */ +bfd_boolean bfd_get_full_section_contents + (bfd *abfd, asection *section, bfd_byte **ptr); + +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + +bfd_boolean bfd_is_section_compressed + (bfd *abfd, asection *section); + +bfd_boolean bfd_init_section_decompress_status + (bfd *abfd, asection *section); + +bfd_boolean bfd_init_section_compress_status + (bfd *abfd, asection *section); + +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfd_stdint.h new file mode 100644 index 000000000..eb208f55a --- /dev/null +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfd_stdint.h @@ -0,0 +1,51 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* generated for aarch64_be--netbsd-gcc (NetBSD nb1 20200311) 8.4.0 */ + +#ifndef GCC_GENERATED_STDINT_H +#define GCC_GENERATED_STDINT_H 1 + +#include +#include +/* glibc uses these symbols as guards to prevent redefinitions. */ +#ifdef __int8_t_defined +#define _INT8_T +#define _INT16_T +#define _INT32_T +#endif +#ifdef __uint32_t_defined +#define _UINT32_T +#endif + + +/* Some systems have guard macros to prevent redefinitions, define them. */ +#ifndef _INT8_T +#define _INT8_T +#endif +#ifndef _INT16_T +#define _INT16_T +#endif +#ifndef _INT32_T +#define _INT32_T +#endif +#ifndef _UINT8_T +#define _UINT8_T +#endif +#ifndef _UINT16_T +#define _UINT16_T +#endif +#ifndef _UINT32_T +#define _UINT32_T +#endif + +/* system headers have good uint64_t and int64_t */ +#ifndef _INT64_T +#define _INT64_T +#endif +#ifndef _UINT64_T +#define _UINT64_T +#endif + +#endif /* GCC_GENERATED_STDINT_H */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfdver.h new file mode 100644 index 000000000..35cba00d4 --- /dev/null +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/bfdver.h @@ -0,0 +1,26 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" +#define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/config.h b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/config.h new file mode 100644 index 000000000..588e281a2 --- /dev/null +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/config.h @@ -0,0 +1,423 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Check that config.h is #included before system headers + (this works only for glibc, but that should be enough). */ +#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) +# error config.h must be #included before system headers +#endif +#define __CONFIG_H__ 1 + +/* Name of host specific core header file to include in elf.c. */ +/* #undef CORE_HEADER */ + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the declaration of `basename', and to 0 if you + don't. */ +#define HAVE_DECL_BASENAME 0 + +/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ +#define HAVE_DECL_FFS 1 + +/* Define to 1 if you have the declaration of `free', and to 0 if you don't. + */ +#define HAVE_DECL_FREE 1 + +/* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't. + */ +#define HAVE_DECL_FSEEKO 1 + +/* Define to 1 if you have the declaration of `fseeko64', and to 0 if you + don't. */ +#define HAVE_DECL_FSEEKO64 0 + +/* Define to 1 if you have the declaration of `ftello', and to 0 if you don't. + */ +#define HAVE_DECL_FTELLO 1 + +/* Define to 1 if you have the declaration of `ftello64', and to 0 if you + don't. */ +#define HAVE_DECL_FTELLO64 0 + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#define HAVE_DECL_GETENV 1 + +/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. + */ +#define HAVE_DECL_MALLOC 1 + +/* Define to 1 if you have the declaration of `realloc', and to 0 if you + don't. */ +#define HAVE_DECL_REALLOC 1 + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#define HAVE_DECL_SNPRINTF 1 + +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. + */ +#define HAVE_DECL_STPCPY 1 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. + */ +#define HAVE_DECL_STRSTR 1 + +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VSNPRINTF 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `fcntl' function. */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `fdopen' function. */ +#define HAVE_FDOPEN 1 + +/* Define to 1 if you have the `fileno' function. */ +#define HAVE_FILENO 1 + +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + +/* Define to 1 if you have the `fopen64' function. */ +/* #undef HAVE_FOPEN64 */ + +/* Define to 1 if you have the `fseeko' function. */ +#define HAVE_FSEEKO 1 + +/* Define to 1 if you have the `fseeko64' function. */ +/* #undef HAVE_FSEEKO64 */ + +/* Define to 1 if you have the `ftello' function. */ +#define HAVE_FTELLO 1 + +/* Define to 1 if you have the `ftello64' function. */ +/* #undef HAVE_FTELLO64 */ + +/* Define to 1 if you have the `getgid' function. */ +#define HAVE_GETGID 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getuid' function. */ +#define HAVE_GETUID 1 + +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define if has lwpstatus_t. */ +/* #undef HAVE_LWPSTATUS_T */ + +/* Define if has lwpstatus_t.pr_context. */ +/* #undef HAVE_LWPSTATUS_T_PR_CONTEXT */ + +/* Define if has lwpstatus_t.pr_fpreg. */ +/* #undef HAVE_LWPSTATUS_T_PR_FPREG */ + +/* Define if has lwpstatus_t.pr_reg. */ +/* #undef HAVE_LWPSTATUS_T_PR_REG */ + +/* Define if has lwpxstatus_t. */ +/* #undef HAVE_LWPXSTATUS_T */ + +/* Define to 1 if you have the `madvise' function. */ +#define HAVE_MADVISE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `mprotect' function. */ +#define HAVE_MPROTECT 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define if has prpsinfo32_t. */ +/* #undef HAVE_PRPSINFO32_T */ + +/* Define if has prpsinfo32_t.pr_pid. */ +/* #undef HAVE_PRPSINFO32_T_PR_PID */ + +/* Define if has prpsinfo_t. */ +/* #undef HAVE_PRPSINFO_T */ + +/* Define if has prpsinfo_t.pr_pid. */ +/* #undef HAVE_PRPSINFO_T_PR_PID */ + +/* Define if has prstatus32_t. */ +/* #undef HAVE_PRSTATUS32_T */ + +/* Define if has prstatus32_t.pr_who. */ +/* #undef HAVE_PRSTATUS32_T_PR_WHO */ + +/* Define if has prstatus_t. */ +/* #undef HAVE_PRSTATUS_T */ + +/* Define if has prstatus_t.pr_who. */ +/* #undef HAVE_PRSTATUS_T_PR_WHO */ + +/* Define if has psinfo32_t. */ +/* #undef HAVE_PSINFO32_T */ + +/* Define if has psinfo32_t.pr_pid. */ +/* #undef HAVE_PSINFO32_T_PR_PID */ + +/* Define if has psinfo_t. */ +/* #undef HAVE_PSINFO_T */ + +/* Define if has psinfo_t.pr_pid. */ +/* #undef HAVE_PSINFO_T_PR_PID */ + +/* Define if has pstatus32_t. */ +/* #undef HAVE_PSTATUS32_T */ + +/* Define if has pstatus_t. */ +/* #undef HAVE_PSTATUS_T */ + +/* Define if has pxstatus_t. */ +/* #undef HAVE_PXSTATUS_T */ + +/* Define to 1 if you have the `setitimer' function. */ +#define HAVE_SETITIMER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDDEF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + +/* Define if struct core_dumpx has member c_impl */ +/* #undef HAVE_ST_C_IMPL */ + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PROCFS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + +/* Define if has win32_pstatus_t. */ +/* #undef HAVE_WIN32_PSTATUS_T */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "bfd" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "bfd" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "bfd 2.34" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "bfd" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.34" + +/* The size of `char', as computed by sizeof. */ +/* #undef SIZEOF_CHAR */ + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* The size of `short', as computed by sizeof. */ +/* #undef SIZEOF_SHORT */ + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +#define STRING_WITH_STRINGS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Name of host specific header file to include in trad-core.c. */ +/* #undef TRAD_HEADER */ + +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + +/* Use b modifier when opening binary files? */ +/* #undef USE_BINARY_FOPEN */ + +/* Define if we should use leading underscore on 64 bit mingw targets */ +/* #undef USE_MINGW64_LEADING_UNDERSCORES */ + +/* Use mmap if it's available? */ +/* #undef USE_MMAP */ + +/* Define if we should default to creating read-only plt entries */ +/* #undef USE_SECUREPLT */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..31ccca3c4 --- /dev/null +++ b/external/gpl3/binutils/lib/libbfd/arch/aarch64eb/defs.mk @@ -0,0 +1,10 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libbfd_la_DEPENDENCIES=elf64-aarch64.lo elfxx-aarch64.lo elf-ifunc.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-aarch64.lo elf32.lo elf32-arm.lo elf-nacl.lo elf-vxworks.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-aarch64.lo cpu-arm.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo +G_DEFS=-DHAVE_CONFIG_H +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=aarch64_elf64_be_vec -DSELECT_VECS='&aarch64_elf64_be_vec,&aarch64_elf64_le_vec,&aarch64_elf32_le_vec,&aarch64_elf32_be_vec,&arm_elf32_be_vec,&arm_elf32_le_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_aarch64_arch,&bfd_arm_arch' +G_HAVEVECS=-DHAVE_aarch64_elf64_be_vec -DHAVE_aarch64_elf64_le_vec -DHAVE_aarch64_elf32_le_vec -DHAVE_aarch64_elf32_be_vec -DHAVE_arm_elf32_be_vec -DHAVE_arm_elf32_le_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd.h index eca2773c6..ef0fdff8b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd_stdint.h index 42091c49e..6a35ac193 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/alpha/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for alpha--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for alpha--netbsd-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/alpha/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/alpha/config.h b/external/gpl3/binutils/lib/libbfd/arch/alpha/config.h index ce31e69d8..588e281a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/alpha/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/alpha/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/alpha/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/alpha/defs.mk index c39857d8b..f75ac3e2e 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/alpha/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/alpha/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-alpha.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo coff-alpha.lo ecoff.lo ecofflink.lo elf64-gen.lo elf32-gen.lo elf32.lo cpu-alpha.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-alpha.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo coff-alpha.lo ecoff.lo ecofflink.lo coffgen.lo elf64-gen.lo elf32-gen.lo elf32.lo plugin.lo cpu-alpha.lo netbsd-core.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_alpha_vec -DHAVE_ecoffalpha_little_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_alpha_vec -DSELECT_VECS='&bfd_elf64_alpha_vec,&ecoffalpha_little_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_alpha_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=alpha_elf64_vec -DSELECT_VECS='&alpha_elf64_vec,&alpha_ecoff_le_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_alpha_arch' +G_HAVEVECS=-DHAVE_alpha_elf64_vec -DHAVE_alpha_ecoff_le_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/arm/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/arm/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/arm/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/arm/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/arm/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/arm/bfd_stdint.h index 139c90a39..2c13f2e28 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/arm/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/arm/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for arm--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for arm--netbsdelf-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/arm/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/arm/config.h b/external/gpl3/binutils/lib/libbfd/arch/arm/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/arm/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/arm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/arm/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/arm/defs.mk index 2b158e406..3ddf69580 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/arm/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/arm/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo armnetbsd.lo aout32.lo coff-arm.lo cofflink.lo elf32-gen.lo cpu-arm.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-arm.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_littlearm_vec -DHAVE_bfd_elf32_bigarm_vec -DHAVE_armnetbsd_vec -DHAVE_armcoff_little_vec -DHAVE_armcoff_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_littlearm_vec -DSELECT_VECS='&bfd_elf32_littlearm_vec,&bfd_elf32_bigarm_vec,&armnetbsd_vec,&armcoff_little_vec,&armcoff_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=arm_elf32_le_vec -DSELECT_VECS='&arm_elf32_le_vec,&arm_elf32_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_HAVEVECS=-DHAVE_arm_elf32_le_vec -DHAVE_arm_elf32_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd_stdint.h index ca525c084..ac6a06d9e 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/armeb/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for armeb--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for armeb--netbsdelf-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/armeb/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/armeb/config.h b/external/gpl3/binutils/lib/libbfd/arch/armeb/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/armeb/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/armeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/armeb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/armeb/defs.mk index 03b8fe2cd..2e3ce993a 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/armeb/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/armeb/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo armnetbsd.lo aout32.lo coff-arm.lo cofflink.lo elf32-gen.lo cpu-arm.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-arm.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_bigarm_vec -DHAVE_bfd_elf32_littlearm_vec -DHAVE_armnetbsd_vec -DHAVE_armcoff_little_vec -DHAVE_armcoff_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_bigarm_vec -DSELECT_VECS='&bfd_elf32_bigarm_vec,&bfd_elf32_littlearm_vec,&armnetbsd_vec,&armcoff_little_vec,&armcoff_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=arm_elf32_be_vec -DSELECT_VECS='&arm_elf32_be_vec,&arm_elf32_le_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_HAVEVECS=-DHAVE_arm_elf32_be_vec -DHAVE_arm_elf32_le_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd.h index 85ecdcb1e..c30c7f943 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", @@ -11,9 +11,7 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -73,7 +71,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +82,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -285,7 +283,7 @@ alent; /* Object and core file sections. */ #define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) typedef struct bfd_section *sec_ptr; @@ -305,13 +303,13 @@ typedef struct bfd_section *sec_ptr; #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) +#define bfd_get_section_limit_octets(bfd, sec) \ + ((bfd)->direction != write_direction && (sec)->rawsize != 0 \ + ? (sec)->rawsize : (sec)->size) + /* Find the address one past the end of SEC. */ #define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) + (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd)) /* Return TRUE if input section SEC has been discarded. */ #define discarded_section(sec) \ @@ -450,6 +448,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -530,8 +538,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *); #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) - extern bfd_boolean bfd_cache_close (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ @@ -659,6 +665,8 @@ extern struct bfd_link_needed_list *bfd_elf_get_needed_list (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_elf_get_bfd_needed_list (bfd *, struct bfd_link_needed_list **); +extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *, + const char *, bfd_vma); extern bfd_boolean bfd_elf_size_dynamic_sections (bfd *, const char *, const char *, const char *, const char *, const char *, const char * const *, struct bfd_link_info *, struct bfd_section **); @@ -674,7 +682,7 @@ extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info +extern int bfd_elf_discard_info (bfd *, struct bfd_link_info *); extern unsigned int _bfd_elf_default_action_discarded (struct bfd_section *); @@ -696,19 +704,21 @@ extern int bfd_get_elf_phdrs (bfd *abfd, void *phdrs); /* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, bfd_size_type len)); @@ -820,12 +830,6 @@ struct internal_syment; union internal_auxent; #endif -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - extern bfd_boolean bfd_coff_set_symbol_class (bfd *, struct bfd_symbol *, unsigned int); @@ -856,6 +860,23 @@ extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan extern void bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *, struct bfd_link_info *); +/* ARM STM STM32L4XX erratum workaround support. */ +typedef enum +{ + BFD_ARM_STM32L4XX_FIX_NONE, + BFD_ARM_STM32L4XX_FIX_DEFAULT, + BFD_ARM_STM32L4XX_FIX_ALL +} bfd_arm_stm32l4xx_fix; + +extern void bfd_elf32_arm_set_stm32l4xx_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -885,7 +906,7 @@ extern bfd_boolean bfd_elf32_arm_process_before_allocation void bfd_elf32_arm_set_target_relocs (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); + bfd_arm_stm32l4xx_fix, int, int, int, int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -893,15 +914,19 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *); -/* ELF ARM mapping symbol support */ +/* ELF ARM mapping symbol support. */ #define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) #define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) #define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) #define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); +extern bfd_boolean bfd_is_arm_special_symbol_name + (const char *, int); + +extern void bfd_elf32_arm_set_byteswap_code + (struct bfd_link_info *, int); + +extern void bfd_elf32_arm_use_long_plt (void); /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines @@ -920,7 +945,8 @@ extern void elf32_arm_next_input_section (struct bfd_link_info *, struct bfd_section *); extern bfd_boolean elf32_arm_size_stubs (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); + struct bfd_section * (*) (const char *, struct bfd_section *, unsigned int), + void (*) (void)); extern bfd_boolean elf32_arm_build_stubs (struct bfd_link_info *); @@ -942,8 +968,14 @@ extern unsigned int _bfd_elf_ppc_at_tprel_transform extern void bfd_elf64_aarch64_init_maps (bfd *); -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); +extern void bfd_elf32_aarch64_init_maps + (bfd *); + +extern void bfd_elf64_aarch64_set_options + (bfd *, struct bfd_link_info *, int, int, int, int, int); + +extern void bfd_elf32_aarch64_set_options + (bfd *, struct bfd_link_info *, int, int, int, int, int); /* ELF AArch64 mapping symbol support. */ #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) @@ -953,7 +985,7 @@ void bfd_elf64_aarch64_set_options extern bfd_boolean bfd_is_aarch64_special_symbol_name (const char * name, int type); -/* AArch64 stub generation support. Called from the linker. */ +/* AArch64 stub generation support for ELF64. Called from the linker. */ extern int elf64_aarch64_setup_section_lists (bfd *, struct bfd_link_info *); extern void elf64_aarch64_next_input_section @@ -964,7 +996,19 @@ extern bfd_boolean elf64_aarch64_size_stubs void (*) (void)); extern bfd_boolean elf64_aarch64_build_stubs (struct bfd_link_info *); - +/* AArch64 stub generation support for ELF32. Called from the linker. */ +extern int elf32_aarch64_setup_section_lists + (bfd *, struct bfd_link_info *); +extern void elf32_aarch64_next_input_section + (struct bfd_link_info *, struct bfd_section *); +extern bfd_boolean elf32_aarch64_size_stubs + (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, + struct bfd_section * (*) (const char *, struct bfd_section *), + void (*) (void)); +extern bfd_boolean elf32_aarch64_build_stubs + (struct bfd_link_info *); + + /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page (struct bfd_section *, int); @@ -983,30 +1027,17 @@ extern void bfd_elf32_ia64_after_parse extern void bfd_elf64_ia64_after_parse (int); -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); +/* V850 Note manipulation routines. */ +extern bfd_boolean v850_elf_create_sections + (struct bfd_link_info *); +extern bfd_boolean v850_elf_set_note + (bfd *, unsigned int, unsigned int); /* Extracted from init.c. */ void bfd_init (void); /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +1046,7 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,8 +1082,16 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); @@ -1183,6 +1222,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +1230,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1369,6 +1409,10 @@ typedef struct bfd_section executables or shared objects. This is for COFF only. */ #define SEC_COFF_SHARED 0x8000000 + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 + /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, @@ -1376,11 +1420,18 @@ typedef struct bfd_section TMS320C54X only. */ #define SEC_TIC54X_BLOCK 0x10000000 + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 + /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ #define SEC_TIC54X_CLINK 0x20000000 + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ #define SEC_COFF_NOREAD 0x40000000 @@ -1420,6 +1471,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1564,20 +1617,46 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val) +{ + ptr->userdata = val; + return TRUE; +} + +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 = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val) +{ + ptr->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,13 +1664,13 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) @@ -1735,7 +1814,7 @@ void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,6 +1839,8 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); +int bfd_get_next_section_id (void); + bfd_boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags); @@ -1856,7 +1937,9 @@ enum bfd_architecture #define bfd_mach_i960_jx 7 #define bfd_mach_i960_hx 8 - bfd_arch_or32, /* OpenRISC 32 */ + bfd_arch_or1k, /* OpenRISC 1000 */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 bfd_arch_sparc, /* SPARC */ #define bfd_mach_sparc 1 @@ -1878,7 +1961,7 @@ enum bfd_architecture #define bfd_mach_sparc_64bit_p(mach) \ ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 +#define bfd_mach_spu 256 bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 @@ -1894,6 +1977,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1911,11 +1995,18 @@ enum bfd_architecture #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 +#define bfd_mach_mips_octeon3 6503 #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_intel_syntax (1 << 0) @@ -1932,6 +2023,14 @@ enum bfd_architecture bfd_arch_k1om, /* Intel K1OM */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) bfd_arch_we32k, /* AT&T WE32xxx */ bfd_arch_tahoe, /* CCI/Harris Tahoe */ bfd_arch_i860, /* Intel 860 */ @@ -1978,6 +2077,9 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 + bfd_arch_riscv, /* RISC-V */ +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rs6000, /* IBM RS/6000 */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 @@ -2046,6 +2148,12 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 + bfd_arch_nds32, /* Andes NDS32 */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -2056,16 +2164,20 @@ enum bfd_architecture bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ bfd_arch_tic80, /* TI TMS320c80 (MVP) */ bfd_arch_v850, /* NEC V850 */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */ bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 bfd_arch_m32c, /* Renesas M16C/M32C. */ #define bfd_mach_m16c 0x75 #define bfd_mach_m32c 0x78 @@ -2091,11 +2203,15 @@ enum bfd_architecture #define bfd_mach_fr550 550 bfd_arch_moxie, /* The moxie processor */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor */ +#define bfd_mach_ft32 1 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 + bfd_arch_metag, +#define bfd_mach_metag 1 bfd_arch_ia64, /* HP/Intel ia64 */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 @@ -2124,6 +2240,7 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 +#define bfd_mach_avrtiny 100 #define bfd_mach_avrxmega1 101 #define bfd_mach_avrxmega2 102 #define bfd_mach_avrxmega3 103 @@ -2150,10 +2267,9 @@ enum bfd_architecture bfd_arch_s390, /* IBM s390 */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ + bfd_arch_score, /* Sunplus score */ #define bfd_mach_score3 3 #define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 @@ -2165,7 +2281,12 @@ enum bfd_architecture #define bfd_mach_msp14 14 #define bfd_mach_msp15 15 #define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 #define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 #define bfd_mach_msp31 31 #define bfd_mach_msp32 32 #define bfd_mach_msp33 33 @@ -2173,6 +2294,10 @@ enum bfd_architecture #define bfd_mach_msp42 42 #define bfd_mach_msp43 43 #define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 @@ -2196,6 +2321,13 @@ enum bfd_architecture #define bfd_mach_tilegx32 2 bfd_arch_aarch64, /* AArch64 */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium */ +#define bfd_mach_visium 1 bfd_arch_last }; @@ -2261,6 +2393,7 @@ unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { /* No errors detected. */ @@ -2310,6 +2443,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,6 +2462,7 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; +struct bfd_symbol; /* Forward declaration. */ struct reloc_howto_struct { @@ -2521,6 +2656,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2851,6 +2990,12 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +3058,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +3070,13 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +3201,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +3231,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +3310,7 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +3334,10 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3219,6 +3382,10 @@ instruction. */ BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3484,16 +3651,73 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTFOFF_S9, + BFD_RELOC_AC_SECTFOFF_S9_1, + BFD_RELOC_AC_SECTFOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3964,205 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_TPOFF, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4419,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4558,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4620,28 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4675,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4734,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4807,9 +5306,66 @@ a matching LO8XG part. */ BFD_RELOC_860_HIGOT, BFD_RELOC_860_HIGOTOFF, -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_GOTOFF_HI16, + BFD_RELOC_OR1K_GOTOFF_LO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5373,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5422,75 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -5019,52 +5645,52 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5698,109 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5811,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5855,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5901,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5933,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +6021,100 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6255,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6281,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5484,7 +6328,17 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5682,6 +6536,7 @@ bfd_boolean bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6545,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_uknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5717,17 +6582,17 @@ struct bfd /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ - flagword flags; + flagword flags : 18; /* Values that may appear in the flags field of a BFD. These also appear in the object_flags field of the bfd_target structure, where @@ -5786,40 +6651,86 @@ struct bfd struct. */ #define BFD_IN_MEMORY 0x800 - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 - /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN \ + | BFD_COMPRESS_GABI) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6756,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,12 +6785,12 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union @@ -5928,40 +6843,19 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6869,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5996,6 +6891,7 @@ const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); + typedef void (*bfd_error_handler_type) (const char *, ...); bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); @@ -6004,6 +6900,7 @@ void bfd_set_error_program_name (const char *); bfd_error_handler_type bfd_get_error_handler (void); + typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, const char *bfd_file, @@ -6059,12 +6956,12 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6113,9 +7010,6 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,24 +7047,6 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); @@ -6181,6 +7057,22 @@ void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,6 +7118,7 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, @@ -6443,12 +7336,12 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ @@ -6465,14 +7358,14 @@ typedef struct bfd_target void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, symbol_info *); #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) + (bfd *, struct bfd_symbol *, bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, const char **, const char **, unsigned int *, unsigned int *); bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, struct bfd_symbol *, @@ -6526,7 +7419,6 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ @@ -6553,16 +7445,14 @@ typedef struct bfd_target struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) void (*_bfd_copy_link_hash_symbol_type) @@ -6648,6 +7538,8 @@ const bfd_target *bfd_search_for_target (int (*search_func) (const bfd_target *, void *), void *); +const char *bfd_flavour_name (enum bfd_flavour flavour); + /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6690,13 +7582,17 @@ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7602,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd_stdint.h index a389b3c1f..7c068d02f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ -/* generated for m5407--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for m5407--netbsdelf-gcc (NetBSD nb1 20160606) 5.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfdver.h index 01f42b546..faa28bdec 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/coldfire/bfdver.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +#define BFD_VERSION_DATE 20160629 +#define BFD_VERSION 226010000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.26.1" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/coldfire/config.h b/external/gpl3/binutils/lib/libbfd/arch/coldfire/config.h index 0927064f9..254f14abb 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/coldfire/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/coldfire/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -22,6 +22,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +73,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -117,6 +129,9 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 @@ -239,6 +254,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +272,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,19 +295,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ @@ -359,7 +380,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/coldfire/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/coldfire/defs.mk index 06b815fbb..065ef56e2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/coldfire/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/coldfire/defs.mk @@ -1,9 +1,9 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-m68k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo m68knetbsd.lo aout32.lo m68k4knetbsd.lo hp300bsd.lo sunos.lo elf32-gen.lo cpu-m68k.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-m68k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo m68knetbsd.lo aout32.lo m68k4knetbsd.lo hp300bsd.lo sunos.lo elf32-gen.lo plugin.lo cpu-m68k.lo cpu-plugin.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_m68k_vec -DHAVE_m68knetbsd_vec -DHAVE_m68k4knetbsd_vec -DHAVE_hp300bsd_vec -DHAVE_sunos_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_m68k_vec -DSELECT_VECS='&bfd_elf32_m68k_vec,&m68knetbsd_vec,&m68k4knetbsd_vec,&hp300bsd_vec,&sunos_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_m68k_arch' +G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_m68k_elf32_vec -DHAVE_m68k_aout_nbsd_vec -DHAVE_m68k_aout_4knbsd_vec -DHAVE_m68k_aout_hp300bsd_vec -DHAVE_sparc_aout_sunos_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -I./../intl +G_TDEFAULTS=-DDEFAULT_VECTOR=m68k_elf32_vec -DSELECT_VECS='&m68k_elf32_vec,&m68k_aout_nbsd_vec,&m68k_aout_4knbsd_vec,&m68k_aout_hp300bsd_vec,&sparc_aout_sunos_be_vec,&elf32_le_vec,&elf32_be_vec,&plugin_vec' -DSELECT_ARCHITECTURES='&bfd_m68k_arch,&bfd_plugin_arch' diff --git a/external/gpl3/binutils/lib/libbfd/arch/earm/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/earm/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earm/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earm/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h index bc3113d41..58ac1e9ca 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earm/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for arm-elf32-minix-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for arm-elf32-minix-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earm/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/earm/config.h b/external/gpl3/binutils/lib/libbfd/arch/earm/config.h index d2d9ab16b..83e7fb074 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earm/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -24,6 +28,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -71,10 +79,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -98,6 +114,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -119,12 +138,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -242,9 +273,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -260,15 +297,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -280,25 +320,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -327,6 +367,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -339,9 +382,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -365,7 +405,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/earm/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/earm/defs.mk index 2b158e406..3ddf69580 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earm/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/earm/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo armnetbsd.lo aout32.lo coff-arm.lo cofflink.lo elf32-gen.lo cpu-arm.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-arm.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_littlearm_vec -DHAVE_bfd_elf32_bigarm_vec -DHAVE_armnetbsd_vec -DHAVE_armcoff_little_vec -DHAVE_armcoff_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_littlearm_vec -DSELECT_VECS='&bfd_elf32_littlearm_vec,&bfd_elf32_bigarm_vec,&armnetbsd_vec,&armcoff_little_vec,&armcoff_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=arm_elf32_le_vec -DSELECT_VECS='&arm_elf32_le_vec,&arm_elf32_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_HAVEVECS=-DHAVE_arm_elf32_le_vec -DHAVE_arm_elf32_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd_stdint.h index 1ad6417f6..46e71ba89 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for armeb--netbsdelf-eabi-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for armeb--netbsdelf-eabi-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmeb/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmeb/config.h b/external/gpl3/binutils/lib/libbfd/arch/earmeb/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmeb/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmeb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/earmeb/defs.mk index 03b8fe2cd..2e3ce993a 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmeb/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/earmeb/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo armnetbsd.lo aout32.lo coff-arm.lo cofflink.lo elf32-gen.lo cpu-arm.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-arm.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_bigarm_vec -DHAVE_bfd_elf32_littlearm_vec -DHAVE_armnetbsd_vec -DHAVE_armcoff_little_vec -DHAVE_armcoff_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_bigarm_vec -DSELECT_VECS='&bfd_elf32_bigarm_vec,&bfd_elf32_littlearm_vec,&armnetbsd_vec,&armcoff_little_vec,&armcoff_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=arm_elf32_be_vec -DSELECT_VECS='&arm_elf32_be_vec,&arm_elf32_le_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_HAVEVECS=-DHAVE_arm_elf32_be_vec -DHAVE_arm_elf32_le_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd_stdint.h index a2f544f92..8a4b45496 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for arm--netbsdelf-eabihf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for arm--netbsdelf-eabihf-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhf/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhf/config.h b/external/gpl3/binutils/lib/libbfd/arch/earmhf/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhf/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhf/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhf/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/earmhf/defs.mk index 2b158e406..3ddf69580 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhf/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhf/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo armnetbsd.lo aout32.lo coff-arm.lo cofflink.lo elf32-gen.lo cpu-arm.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-arm.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_littlearm_vec -DHAVE_bfd_elf32_bigarm_vec -DHAVE_armnetbsd_vec -DHAVE_armcoff_little_vec -DHAVE_armcoff_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_littlearm_vec -DSELECT_VECS='&bfd_elf32_littlearm_vec,&bfd_elf32_bigarm_vec,&armnetbsd_vec,&armcoff_little_vec,&armcoff_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=arm_elf32_le_vec -DSELECT_VECS='&arm_elf32_le_vec,&arm_elf32_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_HAVEVECS=-DHAVE_arm_elf32_le_vec -DHAVE_arm_elf32_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd_stdint.h index ef8bf0251..f0db3a319 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for armeb--netbsdelf-eabihf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for armeb--netbsdelf-eabihf-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/config.h b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/defs.mk index 03b8fe2cd..2e3ce993a 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/earmhfeb/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo armnetbsd.lo aout32.lo coff-arm.lo cofflink.lo elf32-gen.lo cpu-arm.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-arm.lo elf32.lo elf-nacl.lo elf-vxworks.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-arm.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_bigarm_vec -DHAVE_bfd_elf32_littlearm_vec -DHAVE_armnetbsd_vec -DHAVE_armcoff_little_vec -DHAVE_armcoff_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_bigarm_vec -DSELECT_VECS='&bfd_elf32_bigarm_vec,&bfd_elf32_littlearm_vec,&armnetbsd_vec,&armcoff_little_vec,&armcoff_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=arm_elf32_be_vec -DSELECT_VECS='&arm_elf32_be_vec,&arm_elf32_le_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_arm_arch' +G_HAVEVECS=-DHAVE_arm_elf32_be_vec -DHAVE_arm_elf32_le_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd_stdint.h index 987303858..5370c8e79 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/hppa/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for hppa--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for hppa--netbsd-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/hppa/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/hppa/config.h b/external/gpl3/binutils/lib/libbfd/arch/hppa/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/hppa/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/hppa/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/hppa/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/hppa/defs.mk index 09825eedc..2a2c0986b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/hppa/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/hppa/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-hppa.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-gen.lo cpu-hppa.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-hppa.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-hppa.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_hppa_nbsd_vec -DHAVE_bfd_elf32_hppa_vec -DHAVE_bfd_elf32_hppa_linux_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_hppa_nbsd_vec -DSELECT_VECS='&bfd_elf32_hppa_nbsd_vec,&bfd_elf32_hppa_vec,&bfd_elf32_hppa_linux_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_hppa_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=hppa_elf32_nbsd_vec -DSELECT_VECS='&hppa_elf32_nbsd_vec,&hppa_elf32_vec,&hppa_elf32_linux_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_hppa_arch' +G_HAVEVECS=-DHAVE_hppa_elf32_nbsd_vec -DHAVE_hppa_elf32_vec -DHAVE_hppa_elf32_linux_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/i386/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/i386/bfd.h index 85ecdcb1e..8057d5204 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/i386/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/i386/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/i386/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/i386/bfd_stdint.h index 82a492fe7..78f516572 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/i386/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/i386/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for i486--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for i486--netbsdelf-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/i386/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/i386/bfdver.h index 01f42b546..75bff1507 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/i386/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/i386/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/i386/config.h b/external/gpl3/binutils/lib/libbfd/arch/i386/config.h index d2d9ab16b..41563982c 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/i386/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/i386/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -24,6 +28,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -71,10 +79,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -98,6 +114,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -119,12 +138,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -242,9 +273,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -260,15 +297,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -280,25 +320,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -327,6 +367,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -339,9 +382,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -365,7 +405,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/i386/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/i386/defs.mk index fa207517b..af7444703 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/i386/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/i386/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-gen.lo cpu-i386.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-i386.lo elfxx-x86.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo coffgen.lo plugin.lo cpu-i386.lo elf32-gen.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_i386_minix_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_i386_minix_vec -DSELECT_VECS='&bfd_elf32_i386_minix_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_i386_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=i386_elf32_minix_vec -DSELECT_VECS='&i386_elf32_minix_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_i386_arch' +G_HAVEVECS=-DHAVE_i386_elf32_minix_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd.h index 3a5dbd5b3..ef0fdff8b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd_stdint.h index 6e8f86433..80c2527ca 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/ia64/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for ia64--netbsd-gcc (NetBSD nb1 20120916) 4.8.3 20140302 (prerelease) */ +/* generated for ia64--netbsd-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/ia64/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/ia64/bfdver.h index bf38bb3fe..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/ia64/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/ia64/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/ia64/config.h b/external/gpl3/binutils/lib/libbfd/arch/ia64/config.h index 2ce225a19..588e281a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/ia64/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/ia64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/ia64/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/ia64/defs.mk index 46673b3e8..0ae70f03f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/ia64/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/ia64/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-ia64.lo elfxx-ia64.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo pei-ia64.lo pepigen.lo cofflink.lo elf64-gen.lo elf32-gen.lo elf32.lo cpu-ia64.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-ia64.lo elfxx-ia64.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo pei-ia64.lo pepigen.lo cofflink.lo coffgen.lo elf64-gen.lo elf32-gen.lo elf32.lo plugin.lo cpu-ia64.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_ia64_little_vec -DHAVE_bfd_elf64_ia64_big_vec -DHAVE_bfd_pei_ia64_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_ia64_little_vec -DSELECT_VECS='&bfd_elf64_ia64_little_vec,&bfd_elf64_ia64_big_vec,&bfd_pei_ia64_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_ia64_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=ia64_elf64_le_vec -DSELECT_VECS='&ia64_elf64_le_vec,&ia64_elf64_be_vec,&ia64_pei_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_ia64_arch' +G_HAVEVECS=-DHAVE_ia64_elf64_le_vec -DHAVE_ia64_elf64_be_vec -DHAVE_ia64_pei_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd_stdint.h index 2670fdcce..283ac6661 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68000/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for m68010--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for m68010--netbsdelf-gcc (NetBSD nb3 20190319) 7.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68000/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/m68000/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68000/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68000/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68000/config.h b/external/gpl3/binutils/lib/libbfd/arch/m68000/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68000/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68000/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68000/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/m68000/defs.mk index e75f14c02..61b16c230 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68000/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/m68000/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-m68k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo m68knetbsd.lo aout32.lo m68k4knetbsd.lo hp300bsd.lo sunos.lo elf32-gen.lo cpu-m68k.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-m68k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-m68k.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_m68k_vec -DHAVE_m68knetbsd_vec -DHAVE_m68k4knetbsd_vec -DHAVE_hp300bsd_vec -DHAVE_sunos_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_m68k_vec -DSELECT_VECS='&bfd_elf32_m68k_vec,&m68knetbsd_vec,&m68k4knetbsd_vec,&hp300bsd_vec,&sunos_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_m68k_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=m68k_elf32_vec -DSELECT_VECS='&m68k_elf32_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_m68k_arch' +G_HAVEVECS=-DHAVE_m68k_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd_stdint.h index a6347e38e..2da607a0a 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68k/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for m68k--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for m68k--netbsdelf-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68k/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/m68k/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68k/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68k/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68k/config.h b/external/gpl3/binutils/lib/libbfd/arch/m68k/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68k/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/m68k/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/m68k/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/m68k/defs.mk index e75f14c02..61b16c230 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/m68k/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/m68k/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-m68k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo m68knetbsd.lo aout32.lo m68k4knetbsd.lo hp300bsd.lo sunos.lo elf32-gen.lo cpu-m68k.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-m68k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-m68k.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_m68k_vec -DHAVE_m68knetbsd_vec -DHAVE_m68k4knetbsd_vec -DHAVE_hp300bsd_vec -DHAVE_sunos_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_m68k_vec -DSELECT_VECS='&bfd_elf32_m68k_vec,&m68knetbsd_vec,&m68k4knetbsd_vec,&hp300bsd_vec,&sunos_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_m68k_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=m68k_elf32_vec -DSELECT_VECS='&m68k_elf32_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_m68k_arch' +G_HAVEVECS=-DHAVE_m68k_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd.h index a0f1885c6..8b0d38d1e 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd_stdint.h index 79e27ba41..4a3c8cc30 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for mips64--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for mips64--netbsd-gcc (NetBSD nb3 20190319) 7.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/config.h b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/defs.mk index 70129d123..4a1856957 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64eb/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64eb/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo ecofflink.lo elf64-mips.lo elf64.lo elf32-mips.lo elf64-gen.lo elf32-gen.lo cpu-mips.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo ecofflink.lo coffgen.lo elf32-mips.lo elf64-mips.lo elf64.lo coff-mips.lo ecoff.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-mips.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_ntradbigmips_vec -DHAVE_bfd_elf64_tradbigmips_vec -DHAVE_bfd_elf64_tradlittlemips_vec -DHAVE_bfd_elf32_ntradlittlemips_vec -DHAVE_bfd_elf32_tradlittlemips_vec -DHAVE_bfd_elf32_tradbigmips_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_ntradbigmips_vec -DSELECT_VECS='&bfd_elf32_ntradbigmips_vec,&bfd_elf64_tradbigmips_vec,&bfd_elf64_tradlittlemips_vec,&bfd_elf32_ntradlittlemips_vec,&bfd_elf32_tradlittlemips_vec,&bfd_elf32_tradbigmips_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=mips_elf32_ntrad_be_vec -DSELECT_VECS='&mips_elf32_ntrad_be_vec,&mips_elf32_ntrad_le_vec,&mips_elf32_trad_be_vec,&mips_elf32_trad_le_vec,&mips_elf64_trad_be_vec,&mips_elf64_trad_le_vec,&mips_ecoff_be_vec,&mips_ecoff_le_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_HAVEVECS=-DHAVE_mips_elf32_ntrad_be_vec -DHAVE_mips_elf32_ntrad_le_vec -DHAVE_mips_elf32_trad_be_vec -DHAVE_mips_elf32_trad_le_vec -DHAVE_mips_elf64_trad_be_vec -DHAVE_mips_elf64_trad_le_vec -DHAVE_mips_ecoff_be_vec -DHAVE_mips_ecoff_le_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd.h index a0f1885c6..8b0d38d1e 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd_stdint.h index 1157ceb23..0db73d4f1 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for mips64el--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for mips64el--netbsd-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64el/config.h b/external/gpl3/binutils/lib/libbfd/arch/mips64el/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64el/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/mips64el/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/mips64el/defs.mk index f7c140c38..fde02e775 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mips64el/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/mips64el/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo ecofflink.lo elf64-mips.lo elf64.lo elf32-mips.lo elf64-gen.lo elf32-gen.lo cpu-mips.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo ecofflink.lo coffgen.lo elf32-mips.lo elf64-mips.lo elf64.lo coff-mips.lo ecoff.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-mips.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_ntradlittlemips_vec -DHAVE_bfd_elf64_tradbigmips_vec -DHAVE_bfd_elf64_tradlittlemips_vec -DHAVE_bfd_elf32_ntradbigmips_vec -DHAVE_bfd_elf32_tradlittlemips_vec -DHAVE_bfd_elf32_tradbigmips_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_ntradlittlemips_vec -DSELECT_VECS='&bfd_elf32_ntradlittlemips_vec,&bfd_elf64_tradbigmips_vec,&bfd_elf64_tradlittlemips_vec,&bfd_elf32_ntradbigmips_vec,&bfd_elf32_tradlittlemips_vec,&bfd_elf32_tradbigmips_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=mips_elf32_ntrad_le_vec -DSELECT_VECS='&mips_elf32_ntrad_le_vec,&mips_elf32_ntrad_be_vec,&mips_elf32_trad_le_vec,&mips_elf32_trad_be_vec,&mips_elf64_trad_le_vec,&mips_elf64_trad_be_vec,&mips_ecoff_le_vec,&mips_ecoff_be_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_HAVEVECS=-DHAVE_mips_elf32_ntrad_le_vec -DHAVE_mips_elf32_ntrad_be_vec -DHAVE_mips_elf32_trad_le_vec -DHAVE_mips_elf32_trad_be_vec -DHAVE_mips_elf64_trad_le_vec -DHAVE_mips_elf64_trad_be_vec -DHAVE_mips_ecoff_le_vec -DHAVE_mips_ecoff_be_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd.h index 80726a6a6..b4d0be9c4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd_stdint.h index 87e7997c8..2b51966a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for mipseb--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for mipseb--netbsd-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipseb/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipseb/config.h b/external/gpl3/binutils/lib/libbfd/arch/mipseb/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipseb/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipseb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipseb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/mipseb/defs.mk index e527c3ab1..9be4455b3 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipseb/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/mipseb/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo ecofflink.lo elf64-mips.lo elf64.lo coff-mips.lo ecoff.lo elf64-gen.lo elf32-gen.lo cpu-mips.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo ecofflink.lo coffgen.lo elfn32-mips.lo elf64-mips.lo elf64.lo coff-mips.lo ecoff.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-mips.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_tradbigmips_vec -DHAVE_bfd_elf32_tradlittlemips_vec -DHAVE_bfd_elf64_tradbigmips_vec -DHAVE_bfd_elf64_tradlittlemips_vec -DHAVE_ecoff_big_vec -DHAVE_ecoff_little_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_tradbigmips_vec -DSELECT_VECS='&bfd_elf32_tradbigmips_vec,&bfd_elf32_tradlittlemips_vec,&bfd_elf64_tradbigmips_vec,&bfd_elf64_tradlittlemips_vec,&ecoff_big_vec,&ecoff_little_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=mips_elf32_trad_be_vec -DSELECT_VECS='&mips_elf32_trad_be_vec,&mips_elf32_trad_le_vec,&mips_elf32_ntrad_be_vec,&mips_elf32_ntrad_le_vec,&mips_elf64_trad_le_vec,&mips_elf64_trad_be_vec,&mips_ecoff_be_vec,&mips_ecoff_le_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_HAVEVECS=-DHAVE_mips_elf32_trad_be_vec -DHAVE_mips_elf32_trad_le_vec -DHAVE_mips_elf32_ntrad_be_vec -DHAVE_mips_elf32_ntrad_le_vec -DHAVE_mips_elf64_trad_le_vec -DHAVE_mips_elf64_trad_be_vec -DHAVE_mips_ecoff_be_vec -DHAVE_mips_ecoff_le_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd.h index 80726a6a6..b4d0be9c4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd_stdint.h index 57be7b0c1..5241b455f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for mipsel--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for mipsel--netbsd-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipsel/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipsel/config.h b/external/gpl3/binutils/lib/libbfd/arch/mipsel/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipsel/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/mipsel/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/mipsel/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/mipsel/defs.mk index 38b3ad5ac..17e0b6b37 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/mipsel/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/mipsel/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo ecofflink.lo elf64-mips.lo elf64.lo coff-mips.lo ecoff.lo elf64-gen.lo elf32-gen.lo cpu-mips.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo ecofflink.lo coffgen.lo elfn32-mips.lo elf64-mips.lo elf64.lo coff-mips.lo ecoff.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-mips.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_tradlittlemips_vec -DHAVE_bfd_elf32_tradbigmips_vec -DHAVE_bfd_elf64_tradbigmips_vec -DHAVE_bfd_elf64_tradlittlemips_vec -DHAVE_ecoff_little_vec -DHAVE_ecoff_big_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_tradlittlemips_vec -DSELECT_VECS='&bfd_elf32_tradlittlemips_vec,&bfd_elf32_tradbigmips_vec,&bfd_elf64_tradbigmips_vec,&bfd_elf64_tradlittlemips_vec,&ecoff_little_vec,&ecoff_big_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=mips_elf32_trad_le_vec -DSELECT_VECS='&mips_elf32_trad_le_vec,&mips_elf32_trad_be_vec,&mips_elf32_ntrad_le_vec,&mips_elf32_ntrad_be_vec,&mips_elf64_trad_be_vec,&mips_elf64_trad_le_vec,&mips_ecoff_le_vec,&mips_ecoff_be_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_mips_arch' +G_HAVEVECS=-DHAVE_mips_elf32_trad_le_vec -DHAVE_mips_elf32_trad_be_vec -DHAVE_mips_elf32_ntrad_le_vec -DHAVE_mips_elf32_ntrad_be_vec -DHAVE_mips_elf64_trad_be_vec -DHAVE_mips_elf64_trad_le_vec -DHAVE_mips_ecoff_le_vec -DHAVE_mips_ecoff_be_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd.h index 24ae23620..c30c7f943 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd.h @@ -11,9 +11,7 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2015 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -73,7 +71,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +82,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -285,7 +283,7 @@ alent; /* Object and core file sections. */ #define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) typedef struct bfd_section *sec_ptr; @@ -305,13 +303,13 @@ typedef struct bfd_section *sec_ptr; #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) +#define bfd_get_section_limit_octets(bfd, sec) \ + ((bfd)->direction != write_direction && (sec)->rawsize != 0 \ + ? (sec)->rawsize : (sec)->size) + /* Find the address one past the end of SEC. */ #define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) + (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd)) /* Return TRUE if input section SEC has been discarded. */ #define discarded_section(sec) \ @@ -450,6 +448,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -530,8 +538,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *); #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) - extern bfd_boolean bfd_cache_close (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ @@ -659,6 +665,8 @@ extern struct bfd_link_needed_list *bfd_elf_get_needed_list (bfd *, struct bfd_link_info *); extern bfd_boolean bfd_elf_get_bfd_needed_list (bfd *, struct bfd_link_needed_list **); +extern bfd_boolean bfd_elf_stack_segment_size (bfd *, struct bfd_link_info *, + const char *, bfd_vma); extern bfd_boolean bfd_elf_size_dynamic_sections (bfd *, const char *, const char *, const char *, const char *, const char *, const char * const *, struct bfd_link_info *, struct bfd_section **); @@ -674,7 +682,7 @@ extern int bfd_elf_get_dyn_lib_class (bfd *); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info +extern int bfd_elf_discard_info (bfd *, struct bfd_link_info *); extern unsigned int _bfd_elf_default_action_discarded (struct bfd_section *); @@ -696,19 +704,21 @@ extern int bfd_get_elf_phdrs (bfd *abfd, void *phdrs); /* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, bfd_size_type len)); @@ -820,12 +830,6 @@ struct internal_syment; union internal_auxent; #endif -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - extern bfd_boolean bfd_coff_set_symbol_class (bfd *, struct bfd_symbol *, unsigned int); @@ -856,6 +860,23 @@ extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan extern void bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *, struct bfd_link_info *); +/* ARM STM STM32L4XX erratum workaround support. */ +typedef enum +{ + BFD_ARM_STM32L4XX_FIX_NONE, + BFD_ARM_STM32L4XX_FIX_DEFAULT, + BFD_ARM_STM32L4XX_FIX_ALL +} bfd_arm_stm32l4xx_fix; + +extern void bfd_elf32_arm_set_stm32l4xx_fix + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan + (bfd *, struct bfd_link_info *); + +extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations + (bfd *, struct bfd_link_info *); + /* ARM Interworking support. Called from linker. */ extern bfd_boolean bfd_arm_allocate_interworking_sections (struct bfd_link_info *); @@ -885,7 +906,7 @@ extern bfd_boolean bfd_elf32_arm_process_before_allocation void bfd_elf32_arm_set_target_relocs (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); + bfd_arm_stm32l4xx_fix, int, int, int, int, int); extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking (bfd *, struct bfd_link_info *); @@ -893,15 +914,19 @@ extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (bfd *, struct bfd_link_info *); -/* ELF ARM mapping symbol support */ +/* ELF ARM mapping symbol support. */ #define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) #define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) #define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) #define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); +extern bfd_boolean bfd_is_arm_special_symbol_name + (const char *, int); + +extern void bfd_elf32_arm_set_byteswap_code + (struct bfd_link_info *, int); + +extern void bfd_elf32_arm_use_long_plt (void); /* ARM Note section processing. */ extern bfd_boolean bfd_arm_merge_machines @@ -920,7 +945,8 @@ extern void elf32_arm_next_input_section (struct bfd_link_info *, struct bfd_section *); extern bfd_boolean elf32_arm_size_stubs (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); + struct bfd_section * (*) (const char *, struct bfd_section *, unsigned int), + void (*) (void)); extern bfd_boolean elf32_arm_build_stubs (struct bfd_link_info *); @@ -942,8 +968,14 @@ extern unsigned int _bfd_elf_ppc_at_tprel_transform extern void bfd_elf64_aarch64_init_maps (bfd *); -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); +extern void bfd_elf32_aarch64_init_maps + (bfd *); + +extern void bfd_elf64_aarch64_set_options + (bfd *, struct bfd_link_info *, int, int, int, int, int); + +extern void bfd_elf32_aarch64_set_options + (bfd *, struct bfd_link_info *, int, int, int, int, int); /* ELF AArch64 mapping symbol support. */ #define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) @@ -953,7 +985,7 @@ void bfd_elf64_aarch64_set_options extern bfd_boolean bfd_is_aarch64_special_symbol_name (const char * name, int type); -/* AArch64 stub generation support. Called from the linker. */ +/* AArch64 stub generation support for ELF64. Called from the linker. */ extern int elf64_aarch64_setup_section_lists (bfd *, struct bfd_link_info *); extern void elf64_aarch64_next_input_section @@ -964,7 +996,19 @@ extern bfd_boolean elf64_aarch64_size_stubs void (*) (void)); extern bfd_boolean elf64_aarch64_build_stubs (struct bfd_link_info *); - +/* AArch64 stub generation support for ELF32. Called from the linker. */ +extern int elf32_aarch64_setup_section_lists + (bfd *, struct bfd_link_info *); +extern void elf32_aarch64_next_input_section + (struct bfd_link_info *, struct bfd_section *); +extern bfd_boolean elf32_aarch64_size_stubs + (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, + struct bfd_section * (*) (const char *, struct bfd_section *), + void (*) (void)); +extern bfd_boolean elf32_aarch64_build_stubs + (struct bfd_link_info *); + + /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page (struct bfd_section *, int); @@ -983,30 +1027,17 @@ extern void bfd_elf32_ia64_after_parse extern void bfd_elf64_ia64_after_parse (int); -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); +/* V850 Note manipulation routines. */ +extern bfd_boolean v850_elf_create_sections + (struct bfd_link_info *); +extern bfd_boolean v850_elf_set_note + (bfd *, unsigned int, unsigned int); /* Extracted from init.c. */ void bfd_init (void); /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +1046,7 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,8 +1082,16 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); @@ -1183,6 +1222,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +1230,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1369,6 +1409,10 @@ typedef struct bfd_section executables or shared objects. This is for COFF only. */ #define SEC_COFF_SHARED 0x8000000 + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 + /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, @@ -1376,11 +1420,18 @@ typedef struct bfd_section TMS320C54X only. */ #define SEC_TIC54X_BLOCK 0x10000000 + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 + /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ #define SEC_TIC54X_CLINK 0x20000000 + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ #define SEC_COFF_NOREAD 0x40000000 @@ -1420,6 +1471,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1564,20 +1617,46 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val) +{ + ptr->userdata = val; + return TRUE; +} + +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 = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val) +{ + ptr->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,13 +1664,13 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) @@ -1735,7 +1814,7 @@ void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,6 +1839,8 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); +int bfd_get_next_section_id (void); + bfd_boolean bfd_set_section_flags (bfd *abfd, asection *sec, flagword flags); @@ -1857,8 +1938,8 @@ enum bfd_architecture #define bfd_mach_i960_hx 8 bfd_arch_or1k, /* OpenRISC 1000 */ -#define bfd_mach_or1k 1 -#define bfd_mach_or1knd 2 +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 bfd_arch_sparc, /* SPARC */ #define bfd_mach_sparc 1 @@ -1880,7 +1961,7 @@ enum bfd_architecture #define bfd_mach_sparc_64bit_p(mach) \ ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 +#define bfd_mach_spu 256 bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 @@ -1896,6 +1977,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1913,11 +1995,18 @@ enum bfd_architecture #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 +#define bfd_mach_mips_octeon3 6503 #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_intel_syntax (1 << 0) @@ -1934,6 +2023,14 @@ enum bfd_architecture bfd_arch_k1om, /* Intel K1OM */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) bfd_arch_we32k, /* AT&T WE32xxx */ bfd_arch_tahoe, /* CCI/Harris Tahoe */ bfd_arch_i860, /* Intel 860 */ @@ -1980,6 +2077,9 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 + bfd_arch_riscv, /* RISC-V */ +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rs6000, /* IBM RS/6000 */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 @@ -2048,6 +2148,12 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 + bfd_arch_nds32, /* Andes NDS32 */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ @@ -2058,16 +2164,20 @@ enum bfd_architecture bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ bfd_arch_tic80, /* TI TMS320c80 (MVP) */ bfd_arch_v850, /* NEC V850 */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI) */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5') */ bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 bfd_arch_m32c, /* Renesas M16C/M32C. */ #define bfd_mach_m16c 0x75 #define bfd_mach_m32c 0x78 @@ -2093,11 +2203,15 @@ enum bfd_architecture #define bfd_mach_fr550 550 bfd_arch_moxie, /* The moxie processor */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor */ +#define bfd_mach_ft32 1 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 + bfd_arch_metag, +#define bfd_mach_metag 1 bfd_arch_ia64, /* HP/Intel ia64 */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 @@ -2126,6 +2240,7 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 +#define bfd_mach_avrtiny 100 #define bfd_mach_avrxmega1 101 #define bfd_mach_avrxmega2 102 #define bfd_mach_avrxmega3 103 @@ -2152,10 +2267,9 @@ enum bfd_architecture bfd_arch_s390, /* IBM s390 */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ + bfd_arch_score, /* Sunplus score */ #define bfd_mach_score3 3 #define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 @@ -2167,7 +2281,12 @@ enum bfd_architecture #define bfd_mach_msp14 14 #define bfd_mach_msp15 15 #define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 #define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 #define bfd_mach_msp31 31 #define bfd_mach_msp32 32 #define bfd_mach_msp33 33 @@ -2175,6 +2294,10 @@ enum bfd_architecture #define bfd_mach_msp42 42 #define bfd_mach_msp43 43 #define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 @@ -2198,6 +2321,13 @@ enum bfd_architecture #define bfd_mach_tilegx32 2 bfd_arch_aarch64, /* AArch64 */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium */ +#define bfd_mach_visium 1 bfd_arch_last }; @@ -2263,6 +2393,7 @@ unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { /* No errors detected. */ @@ -2312,6 +2443,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2330,6 +2462,7 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; +struct bfd_symbol; /* Forward declaration. */ struct reloc_howto_struct { @@ -2523,6 +2656,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2853,6 +2990,12 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2915,6 +3058,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2926,6 +3070,13 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3050,6 +3201,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3079,6 +3231,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3154,6 +3310,7 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3177,6 +3334,10 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3221,6 +3382,10 @@ instruction. */ BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3486,16 +3651,73 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTFOFF_S9, + BFD_RELOC_AC_SECTFOFF_S9_1, + BFD_RELOC_AC_SECTFOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3742,6 +3964,205 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_TPOFF, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3998,6 +4419,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4097,7 +4558,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4159,6 +4620,28 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4192,6 +4675,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4249,12 +4734,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4835,12 +5332,48 @@ a matching LO8XG part. */ BFD_RELOC_OR1K_TLS_DTPOFF, BFD_RELOC_OR1K_TLS_DTPMOD, +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4889,6 +5422,75 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -5043,52 +5645,52 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5096,14 +5698,109 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5114,45 +5811,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5170,86 +5855,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOTPAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5257,14 +5901,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5272,6 +5933,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5281,34 +6021,100 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5449,10 +6255,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5467,6 +6281,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5508,7 +6328,17 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5706,6 +6536,7 @@ bfd_boolean bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5714,11 +6545,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_uknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5741,17 +6582,17 @@ struct bfd /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ - flagword flags; + flagword flags : 18; /* Values that may appear in the flags field of a BFD. These also appear in the object_flags field of the bfd_target structure, where @@ -5810,40 +6651,86 @@ struct bfd struct. */ #define BFD_IN_MEMORY 0x800 - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 - /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN \ + | BFD_COMPRESS_GABI) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5869,17 +6756,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5894,12 +6785,12 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union @@ -5952,40 +6843,19 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5999,6 +6869,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -6020,6 +6891,7 @@ const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); + typedef void (*bfd_error_handler_type) (const char *, ...); bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); @@ -6028,6 +6900,7 @@ void bfd_set_error_program_name (const char *); bfd_error_handler_type bfd_get_error_handler (void); + typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, const char *bfd_file, @@ -6083,12 +6956,12 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6137,9 +7010,6 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6177,24 +7047,6 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); @@ -6205,6 +7057,22 @@ void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6250,6 +7118,7 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, @@ -6467,12 +7336,12 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ @@ -6489,14 +7358,14 @@ typedef struct bfd_target void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, symbol_info *); #define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) + (bfd *, struct bfd_symbol *, bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + (bfd *, struct bfd_symbol **, struct bfd_section *, bfd_vma, const char **, const char **, unsigned int *, unsigned int *); bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, struct bfd_symbol *, @@ -6550,7 +7419,6 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ @@ -6577,16 +7445,14 @@ typedef struct bfd_target struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) void (*_bfd_copy_link_hash_symbol_type) @@ -6672,6 +7538,8 @@ const bfd_target *bfd_search_for_target (int (*search_func) (const bfd_target *, void *), void *); +const char *bfd_flavour_name (enum bfd_flavour flavour); + /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6714,13 +7582,17 @@ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6730,6 +7602,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd_stdint.h index 6d653ee0f..04c89ad74 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/or1k/bfd_stdint.h @@ -2,7 +2,7 @@ /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ -/* generated for or1k--netbsd-gcc (NetBSD nb1 20140527) 4.8.3 */ +/* generated for or1k--netbsd-gcc (NetBSD nb3 20151015) 4.8.5 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/or1k/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/or1k/bfdver.h index bf38bb3fe..faa28bdec 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/or1k/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/or1k/bfdver.h @@ -2,7 +2,7 @@ /* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +#define BFD_VERSION_DATE 20160629 +#define BFD_VERSION 226010000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.26.1" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/or1k/config.h b/external/gpl3/binutils/lib/libbfd/arch/or1k/config.h index bbc4a209f..254f14abb 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/or1k/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/or1k/config.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -22,6 +22,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +73,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -117,6 +129,9 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 @@ -239,6 +254,9 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +272,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,19 +295,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ @@ -359,7 +380,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/or1k/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/or1k/defs.mk index 70de436cf..f08beadf5 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/or1k/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/or1k/defs.mk @@ -2,8 +2,8 @@ # Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp # Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-or1k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-gen.lo cpu-or1k.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-or1k.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-or1k.lo cpu-plugin.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_or1k_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_or1k_big_vec -DSELECT_VECS='&bfd_elf32_or1k_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_or1k_arch' +G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_or1k_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -I./../intl +G_TDEFAULTS=-DDEFAULT_VECTOR=or1k_elf32_vec -DSELECT_VECS='&or1k_elf32_vec,&elf32_le_vec,&elf32_be_vec,&plugin_vec' -DSELECT_ARCHITECTURES='&bfd_or1k_arch,&bfd_plugin_arch' diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd.h index df69b98bc..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,62 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or1k, /* OpenRISC 1000 */ -#define bfd_mach_or1k 1 -#define bfd_mach_or1knd 2 - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1872,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1896,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1908,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1928,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1980,62 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_riscv, /* RISC-V */ -#define bfd_mach_riscv32 132 -#define bfd_mach_riscv64 164 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2051,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2091,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2110,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2129,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2218,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2230,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2244,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2260,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2289,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2315,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2333,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2394,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2460,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2490,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2526,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2580,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2856,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2918,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2929,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3053,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3082,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3157,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3180,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3214,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3253,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3299,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3361,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3378,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3489,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3745,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -4001,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4100,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4162,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4195,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4252,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4625,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4778,107 +4981,54 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - /* OpenRISC 1000 Relocations. */ BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_GOTPC_HI16, BFD_RELOC_OR1K_GOTPC_LO16, BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, BFD_RELOC_OR1K_PLT26, - BFD_RELOC_OR1K_GOTOFF_HI16, - BFD_RELOC_OR1K_GOTOFF_LO16, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, BFD_RELOC_OR1K_COPY, BFD_RELOC_OR1K_GLOB_DAT, BFD_RELOC_OR1K_JMP_SLOT, BFD_RELOC_OR1K_RELATIVE, BFD_RELOC_OR1K_TLS_GD_HI16, BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_HI16, BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_LDO_HI16, BFD_RELOC_OR1K_TLS_LDO_LO16, BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, BFD_RELOC_OR1K_TLS_TPOFF, BFD_RELOC_OR1K_TLS_DTPOFF, BFD_RELOC_OR1K_TLS_DTPMOD, -/* RISC-V relocations. */ - BFD_RELOC_RISCV_HI20, - BFD_RELOC_RISCV_PCREL_HI20, - BFD_RELOC_RISCV_PCREL_LO12_I, - BFD_RELOC_RISCV_PCREL_LO12_S, - BFD_RELOC_RISCV_LO12_I, - BFD_RELOC_RISCV_LO12_S, - BFD_RELOC_RISCV_GPREL12_I, - BFD_RELOC_RISCV_GPREL12_S, - BFD_RELOC_RISCV_TPREL_HI20, - BFD_RELOC_RISCV_TPREL_LO12_I, - BFD_RELOC_RISCV_TPREL_LO12_S, - BFD_RELOC_RISCV_TPREL_ADD, - BFD_RELOC_RISCV_CALL, - BFD_RELOC_RISCV_CALL_PLT, - BFD_RELOC_RISCV_ADD8, - BFD_RELOC_RISCV_ADD16, - BFD_RELOC_RISCV_ADD32, - BFD_RELOC_RISCV_ADD64, - BFD_RELOC_RISCV_SUB8, - BFD_RELOC_RISCV_SUB16, - BFD_RELOC_RISCV_SUB32, - BFD_RELOC_RISCV_SUB64, - BFD_RELOC_RISCV_GOT_HI20, - BFD_RELOC_RISCV_TLS_GOT_HI20, - BFD_RELOC_RISCV_TLS_GD_HI20, - BFD_RELOC_RISCV_JMP, - BFD_RELOC_RISCV_TLS_DTPMOD32, - BFD_RELOC_RISCV_TLS_DTPREL32, - BFD_RELOC_RISCV_TLS_DTPMOD64, - BFD_RELOC_RISCV_TLS_DTPREL64, - BFD_RELOC_RISCV_TLS_TPREL32, - BFD_RELOC_RISCV_TLS_TPREL64, - BFD_RELOC_RISCV_ALIGN, - /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4927,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -5024,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -5054,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5066,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5081,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5134,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5152,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5208,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5295,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5310,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5319,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5487,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5505,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5526,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5546,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5580,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5680,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5700,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5723,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5740,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5752,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5772,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5798,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5907,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5932,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5990,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -6037,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -6045,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -6052,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6073,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6083,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6100,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6169,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6215,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6288,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6325,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6387,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6411,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6432,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6485,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6505,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6588,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6637,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6651,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6663,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6674,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6695,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6706,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6721,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6740,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6747,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6768,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd_stdint.h index 3bb355e69..2ec66bdc9 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for powerpc--netbsd-gcc (NetBSD nb2 20150115) 4.8.5 */ +/* generated for powerpc--netbsd-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc/config.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/powerpc/defs.mk index 92edf9310..d1cf19f2c 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-ppc.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo coff-rs6000.lo xcofflink.lo ppcboot.lo elf32-gen.lo cpu-rs6000.lo cpu-powerpc.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-ppc.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo coff-rs6000.lo xcofflink.lo coffgen.lo ppcboot.lo elf32-gen.lo plugin.lo cpu-rs6000.lo cpu-powerpc.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_powerpc_vec -DHAVE_rs6000coff_vec -DHAVE_bfd_elf32_powerpcle_vec -DHAVE_ppcboot_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_powerpc_vec -DSELECT_VECS='&bfd_elf32_powerpc_vec,&rs6000coff_vec,&bfd_elf32_powerpcle_vec,&ppcboot_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_rs6000_arch,&bfd_powerpc_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=powerpc_elf32_vec -DSELECT_VECS='&powerpc_elf32_vec,&rs6000_xcoff_vec,&powerpc_elf32_le_vec,&powerpc_boot_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_rs6000_arch,&bfd_powerpc_arch' +G_HAVEVECS=-DHAVE_powerpc_elf32_vec -DHAVE_rs6000_xcoff_vec -DHAVE_powerpc_elf32_le_vec -DHAVE_powerpc_boot_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd.h index 8681cea83..ef0fdff8b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd_stdint.h index d38c7244f..822b7d3d6 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for powerpc64--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for powerpc64--netbsd-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfdver.h index 0fc281eba..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/config.h b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/config.h index 4cf83f644..588e281a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/defs.mk index 3e49c67ef..6297e2418 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/powerpc64/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/powerpc64/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-ppc.lo elf64-gen.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-ppc.lo elf-vxworks.lo elf32.lo coff-rs6000.lo xcofflink.lo coff64-rs6000.lo aix5ppc-core.lo elf32-gen.lo cpu-rs6000.lo cpu-powerpc.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-ppc.lo elf64-gen.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-ppc.lo elf-vxworks.lo elf32.lo coff-rs6000.lo xcofflink.lo coffgen.lo coff64-rs6000.lo aix5ppc-core.lo elf32-gen.lo plugin.lo cpu-rs6000.lo cpu-powerpc.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_powerpc_vec -DHAVE_bfd_elf64_powerpcle_vec -DHAVE_bfd_elf32_powerpc_vec -DHAVE_bfd_elf32_powerpcle_vec -DHAVE_rs6000coff_vec -DHAVE_rs6000coff64_vec -DHAVE_aix5coff64_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_powerpc_vec -DSELECT_VECS='&bfd_elf64_powerpc_vec,&bfd_elf64_powerpcle_vec,&bfd_elf32_powerpc_vec,&bfd_elf32_powerpcle_vec,&rs6000coff_vec,&rs6000coff64_vec,&aix5coff64_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_rs6000_arch,&bfd_powerpc_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=powerpc_elf64_vec -DSELECT_VECS='&powerpc_elf64_vec,&powerpc_elf64_le_vec,&powerpc_elf32_vec,&powerpc_elf32_le_vec,&rs6000_xcoff_vec,&rs6000_xcoff64_vec,&rs6000_xcoff64_aix_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_rs6000_arch,&bfd_powerpc_arch' +G_HAVEVECS=-DHAVE_powerpc_elf64_vec -DHAVE_powerpc_elf64_le_vec -DHAVE_powerpc_elf32_vec -DHAVE_powerpc_elf32_le_vec -DHAVE_rs6000_xcoff_vec -DHAVE_rs6000_xcoff64_vec -DHAVE_rs6000_xcoff64_aix_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd.h index 76d774782..b4d0be9c4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -92,7 +93,7 @@ extern "C" { #define BFD_ARCH_SIZE 64 /* The word size of the default bfd target. */ -#define BFD_DEFAULT_TARGET_SIZE 64 +#define BFD_DEFAULT_TARGET_SIZE 32 #define BFD_HOST_64BIT_LONG 0 #define BFD_HOST_64BIT_LONG_LONG 1 @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,62 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or1k, /* OpenRISC 1000 */ -#define bfd_mach_or1k 1 -#define bfd_mach_or1knd 2 - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1872,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1896,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1908,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1928,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1980,62 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_riscv, /* RISC-V */ -#define bfd_mach_riscv32 132 -#define bfd_mach_riscv64 164 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2051,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2091,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2110,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2129,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2218,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2230,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2244,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2260,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2289,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2315,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2333,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2394,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2460,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2490,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2526,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2580,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2856,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2918,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2929,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3053,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3082,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3157,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3180,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3214,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3253,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3299,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3361,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3378,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3489,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3745,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -4001,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4100,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4162,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4195,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4252,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4625,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4778,107 +4981,54 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - /* OpenRISC 1000 Relocations. */ BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_GOTPC_HI16, BFD_RELOC_OR1K_GOTPC_LO16, BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, BFD_RELOC_OR1K_PLT26, - BFD_RELOC_OR1K_GOTOFF_HI16, - BFD_RELOC_OR1K_GOTOFF_LO16, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, BFD_RELOC_OR1K_COPY, BFD_RELOC_OR1K_GLOB_DAT, BFD_RELOC_OR1K_JMP_SLOT, BFD_RELOC_OR1K_RELATIVE, BFD_RELOC_OR1K_TLS_GD_HI16, BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_HI16, BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_LDO_HI16, BFD_RELOC_OR1K_TLS_LDO_LO16, BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, BFD_RELOC_OR1K_TLS_TPOFF, BFD_RELOC_OR1K_TLS_DTPOFF, BFD_RELOC_OR1K_TLS_DTPMOD, -/* RISC-V relocations. */ - BFD_RELOC_RISCV_HI20, - BFD_RELOC_RISCV_PCREL_HI20, - BFD_RELOC_RISCV_PCREL_LO12_I, - BFD_RELOC_RISCV_PCREL_LO12_S, - BFD_RELOC_RISCV_LO12_I, - BFD_RELOC_RISCV_LO12_S, - BFD_RELOC_RISCV_GPREL12_I, - BFD_RELOC_RISCV_GPREL12_S, - BFD_RELOC_RISCV_TPREL_HI20, - BFD_RELOC_RISCV_TPREL_LO12_I, - BFD_RELOC_RISCV_TPREL_LO12_S, - BFD_RELOC_RISCV_TPREL_ADD, - BFD_RELOC_RISCV_CALL, - BFD_RELOC_RISCV_CALL_PLT, - BFD_RELOC_RISCV_ADD8, - BFD_RELOC_RISCV_ADD16, - BFD_RELOC_RISCV_ADD32, - BFD_RELOC_RISCV_ADD64, - BFD_RELOC_RISCV_SUB8, - BFD_RELOC_RISCV_SUB16, - BFD_RELOC_RISCV_SUB32, - BFD_RELOC_RISCV_SUB64, - BFD_RELOC_RISCV_GOT_HI20, - BFD_RELOC_RISCV_TLS_GOT_HI20, - BFD_RELOC_RISCV_TLS_GD_HI20, - BFD_RELOC_RISCV_JMP, - BFD_RELOC_RISCV_TLS_DTPMOD32, - BFD_RELOC_RISCV_TLS_DTPREL32, - BFD_RELOC_RISCV_TLS_DTPMOD64, - BFD_RELOC_RISCV_TLS_DTPREL64, - BFD_RELOC_RISCV_TLS_TPREL32, - BFD_RELOC_RISCV_TLS_TPREL64, - BFD_RELOC_RISCV_ALIGN, - /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4927,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -5024,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -5054,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5066,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5081,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5134,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5152,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5208,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5295,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5310,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5319,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5487,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5505,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5526,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5546,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5580,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5680,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5700,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5723,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5740,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5752,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5772,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5798,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5907,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5932,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5990,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -6037,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -6045,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -6052,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6073,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6083,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6100,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6169,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6215,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6288,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6325,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6387,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6411,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6432,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6485,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6505,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6588,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6637,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6651,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6663,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6674,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6695,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6706,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6721,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6740,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6747,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6768,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd_stdint.h index c825afc87..72109b6b7 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for riscv32--netbsd-gcc (NetBSD nb2 20150115) 4.8.4 */ +/* generated for riscv32--netbsd-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfdver.h index bf38bb3fe..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv32/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv32/config.h b/external/gpl3/binutils/lib/libbfd/arch/riscv32/config.h index bbc4a209f..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv32/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv32/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv32/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/riscv32/defs.mk index 6835b72be..7325db38f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv32/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv32/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-riscv.lo elf64.lo elfxx-riscv.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-riscv.lo elf64-gen.lo elf32-gen.lo cpu-riscv.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-riscv.lo elfxx-riscv.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf64-riscv.lo elf64.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-riscv.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_riscv_vec -DHAVE_bfd_elf32_riscv_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_riscv_vec -DSELECT_VECS='&bfd_elf64_riscv_vec,&bfd_elf32_riscv_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_riscv_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=riscv_elf32_vec -DSELECT_VECS='&riscv_elf32_vec,&riscv_elf64_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_riscv_arch' +G_HAVEVECS=-DHAVE_riscv_elf32_vec -DHAVE_riscv_elf64_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd.h index 7550fb9e7..ef0fdff8b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,62 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or1k, /* OpenRISC 1000 */ -#define bfd_mach_or1k 1 -#define bfd_mach_or1knd 2 - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1872,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1896,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1908,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1928,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1980,62 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_riscv, /* RISC-V */ -#define bfd_mach_riscv32 132 -#define bfd_mach_riscv64 164 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2051,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2091,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2110,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2129,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2218,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2230,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2244,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2260,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2289,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2315,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2333,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2394,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2460,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2490,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2526,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2580,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2856,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2918,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2929,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3053,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3082,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3157,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3180,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3214,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3253,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3299,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3361,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3378,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3489,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3745,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -4001,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4100,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4162,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4195,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4252,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4625,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4778,107 +4981,54 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - /* OpenRISC 1000 Relocations. */ BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, BFD_RELOC_OR1K_GOTPC_HI16, BFD_RELOC_OR1K_GOTPC_LO16, BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, BFD_RELOC_OR1K_PLT26, - BFD_RELOC_OR1K_GOTOFF_HI16, - BFD_RELOC_OR1K_GOTOFF_LO16, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, BFD_RELOC_OR1K_COPY, BFD_RELOC_OR1K_GLOB_DAT, BFD_RELOC_OR1K_JMP_SLOT, BFD_RELOC_OR1K_RELATIVE, BFD_RELOC_OR1K_TLS_GD_HI16, BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, BFD_RELOC_OR1K_TLS_LDM_HI16, BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, BFD_RELOC_OR1K_TLS_LDO_HI16, BFD_RELOC_OR1K_TLS_LDO_LO16, BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, BFD_RELOC_OR1K_TLS_TPOFF, BFD_RELOC_OR1K_TLS_DTPOFF, BFD_RELOC_OR1K_TLS_DTPMOD, -/* RISC-V relocations. */ - BFD_RELOC_RISCV_HI20, - BFD_RELOC_RISCV_PCREL_HI20, - BFD_RELOC_RISCV_PCREL_LO12_I, - BFD_RELOC_RISCV_PCREL_LO12_S, - BFD_RELOC_RISCV_LO12_I, - BFD_RELOC_RISCV_LO12_S, - BFD_RELOC_RISCV_GPREL12_I, - BFD_RELOC_RISCV_GPREL12_S, - BFD_RELOC_RISCV_TPREL_HI20, - BFD_RELOC_RISCV_TPREL_LO12_I, - BFD_RELOC_RISCV_TPREL_LO12_S, - BFD_RELOC_RISCV_TPREL_ADD, - BFD_RELOC_RISCV_CALL, - BFD_RELOC_RISCV_CALL_PLT, - BFD_RELOC_RISCV_ADD8, - BFD_RELOC_RISCV_ADD16, - BFD_RELOC_RISCV_ADD32, - BFD_RELOC_RISCV_ADD64, - BFD_RELOC_RISCV_SUB8, - BFD_RELOC_RISCV_SUB16, - BFD_RELOC_RISCV_SUB32, - BFD_RELOC_RISCV_SUB64, - BFD_RELOC_RISCV_GOT_HI20, - BFD_RELOC_RISCV_TLS_GOT_HI20, - BFD_RELOC_RISCV_TLS_GD_HI20, - BFD_RELOC_RISCV_JMP, - BFD_RELOC_RISCV_TLS_DTPMOD32, - BFD_RELOC_RISCV_TLS_DTPREL32, - BFD_RELOC_RISCV_TLS_DTPMOD64, - BFD_RELOC_RISCV_TLS_DTPREL64, - BFD_RELOC_RISCV_TLS_TPREL32, - BFD_RELOC_RISCV_TLS_TPREL64, - BFD_RELOC_RISCV_ALIGN, - /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, BFD_RELOC_H8_DIR16R8, BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4927,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -5024,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -5054,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5066,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5081,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5134,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5152,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5208,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5295,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5310,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5319,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5487,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5505,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5526,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5546,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5580,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5680,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5700,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5723,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5740,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5752,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5772,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5798,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5907,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5932,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5990,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -6037,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -6045,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -6052,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6073,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6083,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6100,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6169,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6215,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6288,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6325,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6387,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6411,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6432,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6485,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6505,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6588,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6637,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6651,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6663,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6674,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6695,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6706,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6721,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6740,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6747,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6768,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd_stdint.h index 9b24ee73c..a01c5001f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for riscv64--netbsd-gcc (NetBSD nb2 20150115) 4.8.4 */ +/* generated for riscv64--netbsd-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfdver.h index bf38bb3fe..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv64/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv64/config.h b/external/gpl3/binutils/lib/libbfd/arch/riscv64/config.h index 2ce225a19..588e281a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv64/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/riscv64/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/riscv64/defs.mk index 6835b72be..38a764a7d 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/riscv64/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/riscv64/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-riscv.lo elf64.lo elfxx-riscv.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-riscv.lo elf64-gen.lo elf32-gen.lo cpu-riscv.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-riscv.lo elf64.lo elfxx-riscv.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-riscv.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-riscv.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_riscv_vec -DHAVE_bfd_elf32_riscv_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_riscv_vec -DSELECT_VECS='&bfd_elf64_riscv_vec,&bfd_elf32_riscv_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_riscv_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=riscv_elf64_vec -DSELECT_VECS='&riscv_elf64_vec,&riscv_elf32_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_riscv_arch' +G_HAVEVECS=-DHAVE_riscv_elf64_vec -DHAVE_riscv_elf32_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd.h index 80726a6a6..b4d0be9c4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd_stdint.h index a14540867..6a9f6b816 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for sh--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for sh--netbsdelf-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/config.h b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/defs.mk index 72b327663..1c8d85bb1 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3eb/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3eb/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-sh.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo coff-sh.lo cofflink.lo elf32-sh64.lo elf32-sh64-com.lo elf64-sh64.lo elf64.lo elf64-gen.lo elf32-gen.lo cpu-sh.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-sh.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo coff-sh.lo cofflink.lo coffgen.lo elf32-gen.lo plugin.lo cpu-sh.lo netbsd-core.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_shnbsd_vec -DHAVE_bfd_elf32_shlnbsd_vec -DHAVE_shcoff_vec -DHAVE_shlcoff_vec -DHAVE_bfd_elf32_sh64lnbsd_vec -DHAVE_bfd_elf32_sh64nbsd_vec -DHAVE_bfd_elf64_sh64lnbsd_vec -DHAVE_bfd_elf64_sh64nbsd_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_shnbsd_vec -DSELECT_VECS='&bfd_elf32_shnbsd_vec,&bfd_elf32_shlnbsd_vec,&shcoff_vec,&shlcoff_vec,&bfd_elf32_sh64lnbsd_vec,&bfd_elf32_sh64nbsd_vec,&bfd_elf64_sh64lnbsd_vec,&bfd_elf64_sh64nbsd_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_sh_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=sh_elf32_nbsd_vec -DSELECT_VECS='&sh_elf32_nbsd_vec,&sh_elf32_nbsd_le_vec,&sh_coff_vec,&sh_coff_le_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_sh_arch' +G_HAVEVECS=-DHAVE_sh_elf32_nbsd_vec -DHAVE_sh_elf32_nbsd_le_vec -DHAVE_sh_coff_vec -DHAVE_sh_coff_le_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd.h index 80726a6a6..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,12 +85,12 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ -#define BFD_ARCH_SIZE 64 +#define BFD_ARCH_SIZE 32 /* The word size of the default bfd target. */ #define BFD_DEFAULT_TARGET_SIZE 32 @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd_stdint.h index 52f7f8881..a7c545e0a 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for shle--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for shle--netbsdelf-gcc (NetBSD nb4 20181109) 6.5.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3el/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3el/config.h b/external/gpl3/binutils/lib/libbfd/arch/sh3el/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3el/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/sh3el/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/sh3el/defs.mk index 8099ced70..acd91f9a9 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sh3el/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/sh3el/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-sh.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo coff-sh.lo cofflink.lo elf32-sh64.lo elf32-sh64-com.lo elf64-sh64.lo elf64.lo elf64-gen.lo elf32-gen.lo cpu-sh.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-sh.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo coff-sh.lo cofflink.lo coffgen.lo elf32-gen.lo plugin.lo cpu-sh.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_shlnbsd_vec -DHAVE_bfd_elf32_shnbsd_vec -DHAVE_shcoff_vec -DHAVE_shlcoff_vec -DHAVE_bfd_elf32_sh64lnbsd_vec -DHAVE_bfd_elf32_sh64nbsd_vec -DHAVE_bfd_elf64_sh64lnbsd_vec -DHAVE_bfd_elf64_sh64nbsd_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_shlnbsd_vec -DSELECT_VECS='&bfd_elf32_shlnbsd_vec,&bfd_elf32_shnbsd_vec,&shcoff_vec,&shlcoff_vec,&bfd_elf32_sh64lnbsd_vec,&bfd_elf32_sh64nbsd_vec,&bfd_elf64_sh64lnbsd_vec,&bfd_elf64_sh64nbsd_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_sh_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=sh_elf32_nbsd_le_vec -DSELECT_VECS='&sh_elf32_nbsd_le_vec,&sh_elf32_nbsd_vec,&sh_coff_vec,&sh_coff_le_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_sh_arch' +G_HAVEVECS=-DHAVE_sh_elf32_nbsd_le_vec -DHAVE_sh_elf32_nbsd_vec -DHAVE_sh_coff_vec -DHAVE_sh_coff_le_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h index 83bcf8873..b4d0be9c4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd_stdint.h index 30bb1a5a4..3ac6840a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for sparc--netbsdelf-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for sparc--netbsdelf-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/sparc/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc/config.h b/external/gpl3/binutils/lib/libbfd/arch/sparc/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk index ec04caf4a..5f2cf3dc2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo sparcnetbsd.lo aout32.lo sunos.lo elf32-gen.lo cpu-sparc.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-gen.lo plugin.lo cpu-sparc.lo netbsd-core.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_sparc_vec -DHAVE_sparcnetbsd_vec -DHAVE_sunos_big_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_sparc_vec -DSELECT_VECS='&bfd_elf32_sparc_vec,&sparcnetbsd_vec,&sunos_big_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_sparc_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=sparc_elf32_vec -DSELECT_VECS='&sparc_elf32_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_sparc_arch' +G_HAVEVECS=-DHAVE_sparc_elf32_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd.h index eca2773c6..ef0fdff8b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd_stdint.h index b6684933a..a75d2fb93 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for sparc64--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for sparc64--netbsd-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc64/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc64/config.h b/external/gpl3/binutils/lib/libbfd/arch/sparc64/config.h index ce31e69d8..588e281a2 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc64/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/sparc64/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/sparc64/defs.mk index a07ae62ca..dfab2c8b5 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/sparc64/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/sparc64/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-sparc.lo elf32.lo sunos.lo aout32.lo elf64-gen.lo elf32-gen.lo cpu-sparc.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-sparc.lo elf32.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-sparc.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_sparc_vec -DHAVE_bfd_elf32_sparc_vec -DHAVE_sunos_big_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_sparc_vec -DSELECT_VECS='&bfd_elf64_sparc_vec,&bfd_elf32_sparc_vec,&sunos_big_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_sparc_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=sparc_elf64_vec -DSELECT_VECS='&sparc_elf64_vec,&sparc_elf32_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_sparc_arch' +G_HAVEVECS=-DHAVE_sparc_elf64_vec -DHAVE_sparc_elf32_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/vax/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/vax/bfd.h index 85ecdcb1e..51a7b3b9f 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/vax/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/vax/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/vax/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/vax/bfd_stdint.h index 7f6867a51..7bf8f344e 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/vax/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/vax/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for vax--netbsdelf-gcc (GCC) 4.1.3 20080704 (prerelease) (NetBSD nb3 20111107) */ +/* generated for vax--netbsdelf-gcc (NetBSD nb1 20190930) 8.3.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/vax/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/vax/bfdver.h index 01f42b546..35cba00d4 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/vax/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/vax/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/vax/config.h b/external/gpl3/binutils/lib/libbfd/arch/vax/config.h index 0927064f9..c3ecc5353 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/vax/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/vax/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 4 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/vax/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/vax/defs.mk index 05052069d..f178f5945 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/vax/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/vax/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-vax.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo vaxnetbsd.lo aout32.lo vax1knetbsd.lo elf32-gen.lo cpu-vax.lo netbsd-core.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf32-vax.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo vaxnetbsd.lo aout32.lo vax1knetbsd.lo elf32-gen.lo plugin.lo cpu-vax.lo netbsd-core.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf32_vax_vec -DHAVE_vaxnetbsd_vec -DHAVE_vax1knetbsd_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf32_vax_vec -DSELECT_VECS='&bfd_elf32_vax_vec,&vaxnetbsd_vec,&vax1knetbsd_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_vax_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=vax_elf32_vec -DSELECT_VECS='&vax_elf32_vec,&vax_aout_nbsd_vec,&vax_aout_1knbsd_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_vax_arch' +G_HAVEVECS=-DHAVE_vax_elf32_vec -DHAVE_vax_aout_nbsd_vec -DHAVE_vax_aout_1knbsd_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd.h b/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd.h index eca2773c6..b42940b08 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd.h +++ b/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd.h @@ -1,19 +1,17 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", "linker.c", "simple.c" and "compress.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, - 2012 Free Software Foundation, Inc. + Copyright (C) 1990-2020 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -47,6 +45,9 @@ extern "C" { #include "ansidecl.h" #include "symcat.h" +#include "bfd_stdint.h" +#include "diagnostics.h" +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -73,7 +74,7 @@ extern "C" { problem for example when trying to use STRING_COMMA_LEN to build the arguments to the strncmp() macro. Hence this alternative definition of strncmp is provided here. - + Note - these macros do NOT work if STR2 is not a constant string. */ #define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0) /* strcpy() can have a similar problem, but since we know we are @@ -84,7 +85,7 @@ extern "C" { #define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) -#define BFD_SUPPORTS_PLUGINS 0 +#define BFD_SUPPORTS_PLUGINS 1 /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have @@ -103,6 +104,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -116,7 +135,7 @@ typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif /* Declaring a type wide enough to hold a host long and a host pointer. */ -#define BFD_HOSTPTR_T unsigned long +#define BFD_HOSTPTR_T unsigned long typedef BFD_HOSTPTR_T bfd_hostptr_t; /* Forward declaration. */ @@ -227,39 +246,20 @@ bfd_format; /* A count of carsyms (canonical archive symbols). */ typedef unsigned long symindex; -/* How to perform a relocation. */ -typedef const struct reloc_howto_struct reloc_howto_type; - #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_get_section(x) ((x)->section) -#define bfd_get_output_section(x) ((x)->section->output_section) -#define bfd_set_section(x,y) ((x)->section) = (y) -#define bfd_asymbol_base(x) ((x)->section->vma) -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value) -#define bfd_asymbol_name(x) ((x)->name) -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/ -#define bfd_asymbol_bfd(x) ((x)->the_bfd) -#define bfd_asymbol_flavour(x) \ - (((x)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : bfd_asymbol_bfd (x)->xvec->flavour) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym { - char *name; + const char *name; file_ptr file_offset; /* Look here to find the file. */ } carsym; /* To make these you call a carsymogen. */ /* Used in generating armaps (archive tables of contents). Perhaps just a forward definition would do? */ -struct orl /* Output ranlib. */ +struct orl /* Output ranlib. */ { char **name; /* Symbol name. */ union @@ -269,7 +269,7 @@ struct orl /* Output ranlib. */ } u; /* bfd* or file position. */ int namidx; /* Index into string table. */ }; - + /* Linenumber stuff. */ typedef struct lineno_cache_entry { @@ -277,48 +277,25 @@ typedef struct lineno_cache_entry union { struct bfd_symbol *sym; /* Function name. */ - bfd_vma offset; /* Offset into section. */ + bfd_vma offset; /* Offset into section. */ } u; } alent; /* Object and core file sections. */ - -#define align_power(addr, align) \ - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) - typedef struct bfd_section *sec_ptr; -#define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name) -#define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma) -#define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma) -#define bfd_get_section_alignment(bfd, ptr) ((void) bfd, \ - (ptr)->alignment_power) -#define bfd_section_name(bfd, ptr) ((ptr)->name) -#define bfd_section_size(bfd, ptr) ((ptr)->size) -#define bfd_get_section_size(ptr) ((ptr)->size) -#define bfd_section_vma(bfd, ptr) ((ptr)->vma) -#define bfd_section_lma(bfd, ptr) ((ptr)->lma) -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power) -#define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags) -#define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata) +#define align_power(addr, align) \ + (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align)))) -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) - -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) -/* Find the address one past the end of SEC. */ -#define bfd_get_section_limit(bfd, sec) \ - (((bfd)->direction != write_direction && (sec)->rawsize != 0 \ - ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd)) - -/* Return TRUE if input section SEC has been discarded. */ -#define discarded_section(sec) \ - (!bfd_is_abs_section (sec) \ - && bfd_is_abs_section ((sec)->output_section) \ - && (sec)->sec_info_type != SEC_INFO_TYPE_MERGE \ - && (sec)->sec_info_type != SEC_INFO_TYPE_JUST_SYMS) +/* Align an address upward to a boundary, expressed as a number of bytes. + E.g. align to an 8-byte boundary with argument of 8. Take care never + to wrap around if the address is within boundary-1 of the end of the + address space. */ +#define BFD_ALIGN(this, boundary) \ + ((((bfd_vma) (this) + (boundary) - 1) >= (bfd_vma) (this)) \ + ? (((bfd_vma) (this) + ((boundary) - 1)) & ~ (bfd_vma) ((boundary)-1)) \ + : ~ (bfd_vma) 0) typedef enum bfd_print_symbol { @@ -333,11 +310,11 @@ typedef struct _symbol_info { symvalue value; char type; - const char *name; /* Symbol name. */ - unsigned char stab_type; /* Stab type. */ - char stab_other; /* Stab other. */ - short stab_desc; /* Stab desc. */ - const char *stab_name; /* String for stab type. */ + const char *name; /* Symbol name. */ + unsigned char stab_type; /* Stab type. */ + char stab_other; /* Stab other. */ + short stab_desc; /* Stab desc. */ + const char *stab_name; /* String for stab type. */ } symbol_info; /* Get the name of a stabs type code. */ @@ -375,7 +352,7 @@ struct bfd_hash_table only if the argument is NULL. */ struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); - /* An objalloc for this hash table. This is a struct objalloc *, + /* An objalloc for this hash table. This is a struct objalloc *, but we use void * to avoid requiring the inclusion of objalloc.h. */ void *memory; /* The number of slots in the hash table. */ @@ -450,6 +427,16 @@ extern void bfd_hash_traverse this size. */ extern unsigned long bfd_hash_set_default_size (unsigned long); +/* Types of compressed DWARF debug sections. We currently support + zlib. */ +enum compressed_debug_section_type +{ + COMPRESS_DEBUG_NONE = 0, + COMPRESS_DEBUG = 1 << 0, + COMPRESS_DEBUG_GNU_ZLIB = COMPRESS_DEBUG | 1 << 1, + COMPRESS_DEBUG_GABI_ZLIB = COMPRESS_DEBUG | 1 << 2 +}; + /* This structure is used to keep track of stabs in sections information while linking. */ @@ -480,57 +467,20 @@ extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ + (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #else #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ + (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \ bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ + (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated (const char *, const char *, int, const char *); - -/* Cast from const char * to char * so that caller can assign to - a char * without a warning. */ -#define bfd_get_filename(abfd) ((char *) (abfd)->filename) -#define bfd_get_cacheable(abfd) ((abfd)->cacheable) -#define bfd_get_format(abfd) ((abfd)->format) -#define bfd_get_target(abfd) ((abfd)->xvec->name) -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour) -#define bfd_family_coff(abfd) \ - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \ - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour) -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG) -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE) -#define bfd_header_big_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG) -#define bfd_header_little_endian(abfd) \ - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE) -#define bfd_get_file_flags(abfd) ((abfd)->flags) -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags) -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags) -#define bfd_my_archive(abfd) ((abfd)->my_archive) -#define bfd_has_map(abfd) ((abfd)->has_armap) -#define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive) - -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types) -#define bfd_usrdata(abfd) ((abfd)->usrdata) - -#define bfd_get_start_address(abfd) ((abfd)->start_address) -#define bfd_get_symcount(abfd) ((abfd)->symcount) -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols) -#define bfd_count_sections(abfd) ((abfd)->section_count) - -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount) - -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) - -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) +extern void _bfd_warn_deprecated (const char *, const char *, int, const char *); extern bfd_boolean bfd_cache_close (bfd *abfd); @@ -560,6 +510,8 @@ void bfd_putb64 (bfd_uint64_t, void *); void bfd_putl64 (bfd_uint64_t, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); +void bfd_putb24 (bfd_vma, void *); +void bfd_putl24 (bfd_vma, void *); void bfd_putb16 (bfd_vma, void *); void bfd_putl16 (bfd_vma, void *); @@ -568,195 +520,6 @@ void bfd_putl16 (bfd_vma, void *); bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); -#if defined(__STDC__) || defined(ALMOST_STDC) -struct ecoff_debug_info; -struct ecoff_debug_swap; -struct ecoff_extr; -struct bfd_symbol; -struct bfd_link_info; -struct bfd_link_hash_entry; -struct bfd_section_already_linked; -struct bfd_elf_version_tree; -#endif - -extern bfd_boolean bfd_section_already_linked_table_init (void); -extern void bfd_section_already_linked_table_free (void); -extern bfd_boolean _bfd_handle_already_linked - (struct bfd_section *, struct bfd_section_already_linked *, - struct bfd_link_info *); - -/* Externally visible ECOFF routines. */ - -extern bfd_vma bfd_ecoff_get_gp_value - (bfd * abfd); -extern bfd_boolean bfd_ecoff_set_gp_value - (bfd *abfd, bfd_vma gp_value); -extern bfd_boolean bfd_ecoff_set_regmasks - (bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask); -extern void *bfd_ecoff_debug_init - (bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern void bfd_ecoff_debug_free - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_accumulate_other - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *); -extern bfd_boolean bfd_ecoff_debug_externals - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, bfd_boolean relocatable, - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), - void (*set_index) (struct bfd_symbol *, bfd_size_type)); -extern bfd_boolean bfd_ecoff_debug_one_external - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, const char *name, - struct ecoff_extr *esym); -extern bfd_size_type bfd_ecoff_debug_size - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap); -extern bfd_boolean bfd_ecoff_write_debug - (bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where); -extern bfd_boolean bfd_ecoff_write_accumulated_debug - (void *handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where); - -/* Externally visible ELF routines. */ - -struct bfd_link_needed_list -{ - struct bfd_link_needed_list *next; - bfd *by; - const char *name; -}; - -enum dynamic_lib_link_class { - DYN_NORMAL = 0, - DYN_AS_NEEDED = 1, - DYN_DT_NEEDED = 2, - DYN_NO_ADD_NEEDED = 4, - DYN_NO_NEEDED = 8 -}; - -enum notice_asneeded_action { - notice_as_needed, - notice_not_needed, - notice_needed -}; - -extern bfd_boolean bfd_elf_record_link_assignment - (bfd *, struct bfd_link_info *, const char *, bfd_boolean, - bfd_boolean); -extern struct bfd_link_needed_list *bfd_elf_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_get_bfd_needed_list - (bfd *, struct bfd_link_needed_list **); -extern bfd_boolean bfd_elf_size_dynamic_sections - (bfd *, const char *, const char *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct bfd_section **); -extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr - (bfd *, struct bfd_link_info *); -extern void bfd_elf_set_dt_needed_name - (bfd *, const char *); -extern const char *bfd_elf_get_dt_soname - (bfd *); -extern void bfd_elf_set_dyn_lib_class - (bfd *, enum dynamic_lib_link_class); -extern int bfd_elf_get_dyn_lib_class - (bfd *); -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_elf_discard_info - (bfd *, struct bfd_link_info *); -extern unsigned int _bfd_elf_default_action_discarded - (struct bfd_section *); - -/* Return an upper bound on the number of bytes required to store a - copy of ABFD's program header table entries. Return -1 if an error - occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound - (bfd *abfd); - -/* Copy ABFD's program header table entries to *PHDRS. The entries - will be stored as an array of Elf_Internal_Phdr structures, as - defined in include/elf/internal.h. To find out how large the - buffer needs to be, call bfd_get_elf_phdr_upper_bound. - - Return the number of program header table entries read, or -1 if an - error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs - (bfd *abfd, void *phdrs); - -/* Create a new BFD as if by bfd_openr. Rather than opening a file, - reconstruct an ELF file by reading the segments out of remote memory - based on the ELF file header at EHDR_VMA and the ELF program headers it - points to. If not null, *LOADBASEP is filled in with the difference - between the VMAs from which the segments were read, and the VMAs the - file headers (and hence BFD's idea of each section's VMA) put them at. - - The function TARGET_READ_MEMORY is called to copy LEN bytes from the - remote memory at target address VMA into the local buffer at MYADDR; it - should return zero on success or an `errno' code on failure. TEMPL must - be a BFD for an ELF target with the word size and byte order found in - the remote memory. */ -extern bfd *bfd_elf_bfd_from_remote_memory - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, - bfd_size_type len)); - -extern struct bfd_section *_bfd_elf_tls_setup - (bfd *, struct bfd_link_info *); - -extern struct bfd_section * -_bfd_nearby_section (bfd *, struct bfd_section *, bfd_vma); - -extern void _bfd_fix_excluded_sec_syms - (bfd *, struct bfd_link_info *); - -extern unsigned bfd_m68k_mach_to_features (int); - -extern int bfd_m68k_features_to_mach (unsigned); - -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern void bfd_elf_m68k_set_target_options (struct bfd_link_info *, int); - -extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -extern bfd_boolean bfd_cr16_elf32_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, - char **); - -/* SunOS shared library support routines for the linker. */ - -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sunos_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_sunos_size_dynamic_sections - (bfd *, struct bfd_link_info *, struct bfd_section **, - struct bfd_section **, struct bfd_section **); - -/* Linux shared library support routines for the linker. */ - -extern bfd_boolean bfd_i386linux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_m68klinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); -extern bfd_boolean bfd_sparclinux_size_dynamic_sections - (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -784,229 +547,43 @@ extern void bfd_free_window (bfd_window *); extern bfd_boolean bfd_get_file_window (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); + +/* Externally visible ELF routines. */ -/* XCOFF support routines for the linker. */ +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote + memory based on the ELF file header at EHDR_VMA and the ELF program + headers it points to. If non-zero, SIZE is the known extent of the + object. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs + the file headers (and hence BFD's idea of each section's VMA) put + them at. -extern bfd_boolean bfd_xcoff_split_import_path - (bfd *, const char *, const char **, const char **); -extern bfd_boolean bfd_xcoff_set_archive_import_path - (struct bfd_link_info *, bfd *, const char *); -extern bfd_boolean bfd_xcoff_link_record_set - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); -extern bfd_boolean bfd_xcoff_import_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, - const char *, const char *, const char *, unsigned int); -extern bfd_boolean bfd_xcoff_export_symbol - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); -extern bfd_boolean bfd_xcoff_link_count_reloc - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_record_link_assignment - (bfd *, struct bfd_link_info *, const char *); -extern bfd_boolean bfd_xcoff_size_dynamic_sections - (bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, bfd_boolean, - int, bfd_boolean, unsigned int, struct bfd_section **, bfd_boolean); -extern bfd_boolean bfd_xcoff_link_generate_rtinit - (bfd *, const char *, const char *, bfd_boolean); - -/* XCOFF support routines for ar. */ -extern bfd_boolean bfd_xcoff_ar_archive_set_magic - (bfd *, char *); - -/* Externally visible COFF routines. */ - -#if defined(__STDC__) || defined(ALMOST_STDC) -struct internal_syment; -union internal_auxent; -#endif - -extern bfd_boolean bfd_coff_get_syment - (bfd *, struct bfd_symbol *, struct internal_syment *); - -extern bfd_boolean bfd_coff_get_auxent - (bfd *, struct bfd_symbol *, int, union internal_auxent *); - -extern bfd_boolean bfd_coff_set_symbol_class - (bfd *, struct bfd_symbol *, unsigned int); - -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); - -/* ARM VFP11 erratum workaround support. */ -typedef enum -{ - BFD_ARM_VFP11_FIX_DEFAULT, - BFD_ARM_VFP11_FIX_NONE, - BFD_ARM_VFP11_FIX_SCALAR, - BFD_ARM_VFP11_FIX_VECTOR -} bfd_arm_vfp11_fix; - -extern void bfd_elf32_arm_init_maps - (bfd *); - -extern void bfd_elf32_arm_set_vfp11_fix - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_set_cortex_a8_fix - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan - (bfd *, struct bfd_link_info *); - -extern void bfd_elf32_arm_vfp11_fix_veneer_locations - (bfd *, struct bfd_link_info *); - -/* ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* PE ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_arm_pe_process_before_allocation - (bfd *, struct bfd_link_info *, int); - -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -/* ELF ARM Interworking support. Called from linker. */ -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections - (struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_process_before_allocation - (bfd *, struct bfd_link_info *); - -void bfd_elf32_arm_set_target_relocs - (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix, - int, int, int, int, int); - -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking - (bfd *, struct bfd_link_info *); - -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd - (bfd *, struct bfd_link_info *); - -/* ELF ARM mapping symbol support */ -#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_arm_special_symbol_name - (const char * name, int type); - -extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int); - -/* ARM Note section processing. */ -extern bfd_boolean bfd_arm_merge_machines - (bfd *, bfd *); - -extern bfd_boolean bfd_arm_update_notes - (bfd *, const char *); - -extern unsigned int bfd_arm_get_mach_from_notes - (bfd *, const char *); - -/* ARM stub generation support. Called from the linker. */ -extern int elf32_arm_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf32_arm_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf32_arm_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void)); -extern bfd_boolean elf32_arm_build_stubs - (struct bfd_link_info *); - -/* ARM unwind section editing support. */ -extern bfd_boolean elf32_arm_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* C6x unwind section editing support. */ -extern bfd_boolean elf32_tic6x_fix_exidx_coverage -(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean); - -/* PowerPC @tls opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tls_transform - (unsigned int, unsigned int); -/* PowerPC @tprel opcode transform/validate. */ -extern unsigned int _bfd_elf_ppc_at_tprel_transform - (unsigned int, unsigned int); - -extern void bfd_elf64_aarch64_init_maps - (bfd *); - -void bfd_elf64_aarch64_set_options - (bfd *, struct bfd_link_info *, int, int, int); - -/* ELF AArch64 mapping symbol support. */ -#define BFD_AARCH64_SPECIAL_SYM_TYPE_MAP (1 << 0) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_TAG (1 << 1) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_OTHER (1 << 2) -#define BFD_AARCH64_SPECIAL_SYM_TYPE_ANY (~0) -extern bfd_boolean bfd_is_aarch64_special_symbol_name - (const char * name, int type); - -/* AArch64 stub generation support. Called from the linker. */ -extern int elf64_aarch64_setup_section_lists - (bfd *, struct bfd_link_info *); -extern void elf64_aarch64_next_input_section - (struct bfd_link_info *, struct bfd_section *); -extern bfd_boolean elf64_aarch64_size_stubs - (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - struct bfd_section * (*) (const char *, struct bfd_section *), - void (*) (void)); -extern bfd_boolean elf64_aarch64_build_stubs - (struct bfd_link_info *); - -/* TI COFF load page support. */ -extern void bfd_ticoff_set_section_load_page - (struct bfd_section *, int); - -extern int bfd_ticoff_get_section_load_page - (struct bfd_section *); - -/* H8/300 functions. */ -extern bfd_vma bfd_h8300_pad_address - (bfd *, bfd_vma); - -/* IA64 Itanium code generation. Called from linker. */ -extern void bfd_elf32_ia64_after_parse - (int); - -extern void bfd_elf64_ia64_after_parse - (int); - -/* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ - -struct coff_comdat_info -{ - /* The name of the symbol associated with a comdat section. */ - const char *name; - - /* The local symbol table index of the symbol associated with a - comdat section. This is only meaningful to the object file format - specific code; it is not an index into the list returned by - bfd_canonicalize_symtab. */ - long symbol; -}; - -extern struct coff_comdat_info *bfd_coff_get_comdat_section - (bfd *, struct bfd_section *); + The function TARGET_READ_MEMORY is called to copy LEN bytes from + the remote memory at target address VMA into the local buffer at + MYADDR; it should return zero on success or an `errno' code on + failure. TEMPL must be a BFD for a target with the word size and + byte order found in the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_size_type size, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, + bfd_size_type len)); +/* Forward declarations. */ +struct ecoff_debug_info; +struct ecoff_debug_swap; +struct ecoff_extr; +struct bfd_link_info; +struct bfd_link_hash_entry; /* Extracted from init.c. */ -void bfd_init (void); +unsigned int bfd_init (void); + +/* Value returned by bfd_init. */ + +#define BFD_INIT_MAGIC (sizeof (struct bfd_section)) /* Extracted from opncls.c. */ +/* Set to N to open the next N BFDs using an alternate id space. */ extern unsigned int bfd_use_reserved_id; bfd *bfd_fopen (const char *filename, const char *target, const char *mode, int fd); @@ -1015,7 +592,8 @@ bfd *bfd_openr (const char *filename, const char *target); bfd *bfd_fdopenr (const char *filename, const char *target, int fd); -bfd *bfd_openstreamr (const char *, const char *, void *); +bfd *bfd_openstreamr (const char * filename, const char * target, + void * stream); bfd *bfd_openr_iovec (const char *filename, const char *target, void *(*open_func) (struct bfd *nbfd, @@ -1051,14 +629,26 @@ void *bfd_zalloc (bfd *abfd, bfd_size_type wanted); unsigned long bfd_calc_gnu_debuglink_crc32 (unsigned long crc, const unsigned char *buf, bfd_size_type len); +char *bfd_get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +char *bfd_get_alt_debug_link_info (bfd * abfd, + bfd_size_type *buildid_len, + bfd_byte **buildid_out); + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +char *bfd_follow_gnu_debugaltlink (bfd *abfd, const char *dir); + struct bfd_section *bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename); bfd_boolean bfd_fill_in_gnu_debuglink_section (bfd *abfd, struct bfd_section *sect, const char *filename); +char *bfd_follow_build_id_debuglink (bfd *abfd, const char *dir); + +void bfd_set_filename (bfd *abfd, char *filename); + /* Extracted from libbfd.c. */ /* Byte swapping macros for user section data. */ @@ -1068,9 +658,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(const unsigned char *) (ptr) & 0xff) + ((bfd_vma) *(const unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + ((((bfd_signed_vma) *(const unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) @@ -1081,6 +671,20 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #define bfd_get_signed_16(abfd, ptr) \ BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +#define bfd_put_24(abfd, val, ptr) \ + do \ + if (bfd_big_endian (abfd)) \ + bfd_putb24 ((val), (ptr)); \ + else \ + bfd_putl24 ((val), (ptr)); \ + while (0) + +bfd_vma bfd_getb24 (const void *p); +bfd_vma bfd_getl24 (const void *p); + +#define bfd_get_24(abfd, ptr) \ + (bfd_big_endian (abfd) ? bfd_getb24 (ptr) : bfd_getl24 (ptr)) + #define bfd_put_32(abfd, val, ptr) \ BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ @@ -1100,7 +704,7 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) #define bfd_get(bits, abfd, ptr) \ - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + ((bits) == 8 ? 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) \ @@ -1108,9 +712,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section #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) \ + : (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)) @@ -1175,7 +779,9 @@ bfd_boolean bfd_fill_in_gnu_debuglink_section /* Extracted from bfdio.c. */ long bfd_get_mtime (bfd *abfd); -file_ptr bfd_get_size (bfd *abfd); +ufile_ptr bfd_get_size (bfd *abfd); + +ufile_ptr bfd_get_file_size (bfd *abfd); void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, int prot, int flags, file_ptr offset, @@ -1183,6 +789,7 @@ void *bfd_mmap (bfd *abfd, void *addr, bfd_size_type len, /* Extracted from bfdwin.c. */ /* Extracted from section.c. */ + typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is @@ -1190,10 +797,10 @@ typedef struct bfd_section const char *name; /* A unique sequence number. */ - int id; + unsigned int id; /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */ - int index; + unsigned int index; /* The next section in the list belonging to the BFD, or NULL. */ struct bfd_section *next; @@ -1206,31 +813,31 @@ typedef struct bfd_section synthesized from other information. */ flagword flags; -#define SEC_NO_FLAGS 0x000 +#define SEC_NO_FLAGS 0x0 /* Tells the OS to allocate space for this section when loading. This is clear for a section containing debug information only. */ -#define SEC_ALLOC 0x001 +#define SEC_ALLOC 0x1 /* Tells the OS to load the section from the file when loading. This is clear for a .bss section. */ -#define SEC_LOAD 0x002 +#define SEC_LOAD 0x2 /* The section contains data still to be relocated, so there is some relocation information too. */ -#define SEC_RELOC 0x004 +#define SEC_RELOC 0x4 /* A signal to the OS that the section contains read only data. */ -#define SEC_READONLY 0x008 +#define SEC_READONLY 0x8 /* The section contains code only. */ -#define SEC_CODE 0x010 +#define SEC_CODE 0x10 /* The section contains data only. */ -#define SEC_DATA 0x020 +#define SEC_DATA 0x20 /* The section will reside in ROM. */ -#define SEC_ROM 0x040 +#define SEC_ROM 0x40 /* The section contains constructor information. This section type is used by the linker to create lists of constructors and @@ -1242,75 +849,72 @@ typedef struct bfd_section sections called <<__CTOR_LIST__>> and relocate the data contained within - exactly the operations it would peform on standard data. */ -#define SEC_CONSTRUCTOR 0x080 +#define SEC_CONSTRUCTOR 0x80 /* The section has contents - a data section could be <> | <>; a debug section could be <> */ -#define SEC_HAS_CONTENTS 0x100 +#define SEC_HAS_CONTENTS 0x100 /* An instruction to the linker to not output the section even if it has information which would normally be written. */ -#define SEC_NEVER_LOAD 0x200 +#define SEC_NEVER_LOAD 0x200 /* The section contains thread local data. */ -#define SEC_THREAD_LOCAL 0x400 +#define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of space it requires, and the largest symbol value is the one used). Most targets have exactly one of these (which we translate to bfd_com_section_ptr), but ECOFF has two. */ -#define SEC_IS_COMMON 0x1000 +#define SEC_IS_COMMON 0x1000 /* The section contains only debugging information. For example, this is set for ELF .debug and .stab sections. strip tests this flag to see if a section can be discarded. */ -#define SEC_DEBUGGING 0x2000 +#define SEC_DEBUGGING 0x2000 /* The contents of this section are held in memory pointed to by the contents field. This is checked by bfd_get_section_contents, and the data is retrieved from memory if appropriate. */ -#define SEC_IN_MEMORY 0x4000 +#define SEC_IN_MEMORY 0x4000 /* The contents of this section are to be excluded by the linker for executable and shared objects unless those objects are to be further relocated. */ -#define SEC_EXCLUDE 0x8000 +#define SEC_EXCLUDE 0x8000 /* The contents of this section are to be sorted based on the sum of the symbol and addend values specified by the associated relocation entries. Entries without associated relocation entries will be appended to the end of the section in an unspecified order. */ -#define SEC_SORT_ENTRIES 0x10000 +#define SEC_SORT_ENTRIES 0x10000 /* When linking, duplicate sections of the same name should be discarded, rather than being combined into a single section as is usually done. This is similar to how common symbols are handled. See SEC_LINK_DUPLICATES below. */ -#define SEC_LINK_ONCE 0x20000 +#define SEC_LINK_ONCE 0x20000 /* If SEC_LINK_ONCE is set, this bitfield describes how the linker should handle duplicate sections. */ -#define SEC_LINK_DUPLICATES 0xc0000 +#define SEC_LINK_DUPLICATES 0xc0000 /* This value for SEC_LINK_DUPLICATES means that duplicate sections with the same name should simply be discarded. */ -#define SEC_LINK_DUPLICATES_DISCARD 0x0 +#define SEC_LINK_DUPLICATES_DISCARD 0x0 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if there are any duplicate sections, although it should still only link one copy. */ -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x40000 /* This value for SEC_LINK_DUPLICATES means that the linker should warn if any duplicate sections are a different size. */ @@ -1326,28 +930,28 @@ typedef struct bfd_section relocation or other arcane processing. It is skipped when going through the first-pass output, trusting that someone else up the line will take care of it later. */ -#define SEC_LINKER_CREATED 0x100000 +#define SEC_LINKER_CREATED 0x100000 /* This section should not be subject to garbage collection. Also set to inform the linker that this section should not be listed in the link map as discarded. */ -#define SEC_KEEP 0x200000 +#define SEC_KEEP 0x200000 /* This section contains "short" data, and should be placed "near" the GP. */ -#define SEC_SMALL_DATA 0x400000 +#define SEC_SMALL_DATA 0x400000 /* Attempt to merge identical entities in the section. Entity size is given in the entsize field. */ -#define SEC_MERGE 0x800000 +#define SEC_MERGE 0x800000 /* If given with SEC_MERGE, entities to merge are zero terminated strings where entsize specifies character size instead of fixed size entries. */ -#define SEC_STRINGS 0x1000000 +#define SEC_STRINGS 0x1000000 /* This section contains data about section groups. */ -#define SEC_GROUP 0x2000000 +#define SEC_GROUP 0x2000000 /* The section is a COFF shared library section. This flag is only for the linker. If this type of section appears in @@ -1358,32 +962,51 @@ typedef struct bfd_section might be cleaner to have some more general mechanism to allow the back end to control what the linker does with sections. */ -#define SEC_COFF_SHARED_LIBRARY 0x4000000 +#define SEC_COFF_SHARED_LIBRARY 0x4000000 /* This input section should be copied to output in reverse order as an array of pointers. This is for ELF linker internal use only. */ -#define SEC_ELF_REVERSE_COPY 0x4000000 +#define SEC_ELF_REVERSE_COPY 0x4000000 /* This section contains data which may be shared with other executables or shared objects. This is for COFF only. */ -#define SEC_COFF_SHARED 0x8000000 +#define SEC_COFF_SHARED 0x8000000 + + /* This section should be compressed. This is for ELF linker + internal use only. */ +#define SEC_ELF_COMPRESS 0x8000000 /* When a section with this flag is being linked, then if the size of the input section is less than a page, it should not cross a page boundary. If the size of the input section is one page or more, it should be aligned on a page boundary. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_BLOCK 0x10000000 +#define SEC_TIC54X_BLOCK 0x10000000 + + /* This section should be renamed. This is for ELF linker + internal use only. */ +#define SEC_ELF_RENAME 0x10000000 /* Conditionally link this section; do not link if there are no references found to any symbol in the section. This is for TI TMS320C54X only. */ -#define SEC_TIC54X_CLINK 0x20000000 +#define SEC_TIC54X_CLINK 0x20000000 + + /* This section contains vliw code. This is for Toshiba MeP only. */ +#define SEC_MEP_VLIW 0x20000000 + + /* All symbols, sizes and relocations in this section are octets + instead of bytes. Required for DWARF debug sections as DWARF + information is organized in octets, not bytes. */ +#define SEC_ELF_OCTETS 0x40000000 /* Indicate that section has the no read flag set. This happens when memory read flag isn't set. */ -#define SEC_COFF_NOREAD 0x40000000 +#define SEC_COFF_NOREAD 0x40000000 + + /* Indicate that section has the purecode flag set. */ +#define SEC_ELF_PURECODE 0x80000000 /* End of section flags. */ @@ -1420,6 +1043,8 @@ typedef struct bfd_section #define SEC_INFO_TYPE_MERGE 2 #define SEC_INFO_TYPE_EH_FRAME 3 #define SEC_INFO_TYPE_JUST_SYMS 4 +#define SEC_INFO_TYPE_TARGET 5 +#define SEC_INFO_TYPE_EH_FRAME_ENTRY 6 /* Nonzero if this section uses RELA relocations, rather than REL. */ unsigned int use_rela_p:1; @@ -1449,7 +1074,7 @@ typedef struct bfd_section information. */ bfd_vma lma; - /* The size of the section in octets, as it will be output. + /* The size of the section in *octets*, as it will be output. Contains a value even if the section has no contents (e.g., the size of <<.bss>>). */ bfd_size_type size; @@ -1564,20 +1189,100 @@ typedef struct bfd_section } asection; /* Relax table contains information about instructions which can - be removed by relaxation -- replacing a long address with a + be removed by relaxation -- replacing a long address with a short address. */ struct relax_table { /* Address where bytes may be deleted. */ bfd_vma addr; - + /* Number of bytes to be deleted. */ int size; }; +static inline const char * +bfd_section_name (const asection *sec) +{ + return sec->name; +} + +static inline bfd_size_type +bfd_section_size (const asection *sec) +{ + return sec->size; +} + +static inline bfd_vma +bfd_section_vma (const asection *sec) +{ + return sec->vma; +} + +static inline bfd_vma +bfd_section_lma (const asection *sec) +{ + return sec->lma; +} + +static inline unsigned int +bfd_section_alignment (const asection *sec) +{ + return sec->alignment_power; +} + +static inline flagword +bfd_section_flags (const asection *sec) +{ + return sec->flags; +} + +static inline void * +bfd_section_userdata (const asection *sec) +{ + return sec->userdata; +} +static inline bfd_boolean +bfd_is_com_section (const asection *sec) +{ + return (sec->flags & SEC_IS_COMMON) != 0; +} + +/* Note: the following are provided as inline functions rather than macros + because not all callers use the return value. A macro implementation + would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some + compilers will complain about comma expressions that have no effect. */ +static inline bfd_boolean +bfd_set_section_userdata (asection *sec, void *val) +{ + sec->userdata = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_vma (asection *sec, bfd_vma val) +{ + sec->vma = sec->lma = val; + sec->user_set_vma = TRUE; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_lma (asection *sec, bfd_vma val) +{ + sec->lma = val; + return TRUE; +} + +static inline bfd_boolean +bfd_set_section_alignment (asection *sec, unsigned int val) +{ + sec->alignment_power = val; + return TRUE; +} + /* These sections are global, and are managed by BFD. The application and target back end are not permitted to change the values in these sections. */ -extern asection std_section[4]; +extern asection _bfd_std_section[4]; #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" @@ -1585,117 +1290,51 @@ extern asection std_section[4]; #define BFD_IND_SECTION_NAME "*IND*" /* Pointer to the common section. */ -#define bfd_com_section_ptr (&std_section[0]) +#define bfd_com_section_ptr (&_bfd_std_section[0]) /* Pointer to the undefined section. */ -#define bfd_und_section_ptr (&std_section[1]) +#define bfd_und_section_ptr (&_bfd_std_section[1]) /* Pointer to the absolute section. */ -#define bfd_abs_section_ptr (&std_section[2]) +#define bfd_abs_section_ptr (&_bfd_std_section[2]) /* Pointer to the indirect section. */ -#define bfd_ind_section_ptr (&std_section[3]) +#define bfd_ind_section_ptr (&_bfd_std_section[3]) -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) +static inline bfd_boolean +bfd_is_und_section (const asection *sec) +{ + return sec == bfd_und_section_ptr; +} -#define bfd_is_const_section(SEC) \ - ( ((SEC) == bfd_abs_section_ptr) \ - || ((SEC) == bfd_und_section_ptr) \ - || ((SEC) == bfd_com_section_ptr) \ - || ((SEC) == bfd_ind_section_ptr)) +static inline bfd_boolean +bfd_is_abs_section (const asection *sec) +{ + return sec == bfd_abs_section_ptr; +} -/* Macros to handle insertion and deletion of a bfd's sections. These - only handle the list pointers, ie. do not adjust section_count, - target_index etc. */ -#define bfd_section_list_remove(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - asection *_next = _s->next; \ - asection *_prev = _s->prev; \ - if (_prev) \ - _prev->next = _next; \ - else \ - (ABFD)->sections = _next; \ - if (_next) \ - _next->prev = _prev; \ - else \ - (ABFD)->section_last = _prev; \ - } \ - while (0) -#define bfd_section_list_append(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->next = NULL; \ - if (_abfd->section_last) \ - { \ - _s->prev = _abfd->section_last; \ - _abfd->section_last->next = _s; \ - } \ - else \ - { \ - _s->prev = NULL; \ - _abfd->sections = _s; \ - } \ - _abfd->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_prepend(ABFD, S) \ - do \ - { \ - asection *_s = S; \ - bfd *_abfd = ABFD; \ - _s->prev = NULL; \ - if (_abfd->sections) \ - { \ - _s->next = _abfd->sections; \ - _abfd->sections->prev = _s; \ - } \ - else \ - { \ - _s->next = NULL; \ - _abfd->section_last = _s; \ - } \ - _abfd->sections = _s; \ - } \ - while (0) -#define bfd_section_list_insert_after(ABFD, A, S) \ - do \ - { \ - asection *_a = A; \ - asection *_s = S; \ - asection *_next = _a->next; \ - _s->next = _next; \ - _s->prev = _a; \ - _a->next = _s; \ - if (_next) \ - _next->prev = _s; \ - else \ - (ABFD)->section_last = _s; \ - } \ - while (0) -#define bfd_section_list_insert_before(ABFD, B, S) \ - do \ - { \ - asection *_b = B; \ - asection *_s = S; \ - asection *_prev = _b->prev; \ - _s->prev = _prev; \ - _s->next = _b; \ - _b->prev = _s; \ - if (_prev) \ - _prev->next = _s; \ - else \ - (ABFD)->sections = _s; \ - } \ - while (0) -#define bfd_section_removed_from_list(ABFD, S) \ - ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S)) +static inline bfd_boolean +bfd_is_ind_section (const asection *sec) +{ + return sec == bfd_ind_section_ptr; +} -#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ +static inline bfd_boolean +bfd_is_const_section (const asection *sec) +{ + return sec >= bfd_abs_section_ptr && sec <= bfd_ind_section_ptr; +} + +/* Return TRUE if input section SEC has been discarded. */ +static inline bfd_boolean +discarded_section (const asection *sec) +{ + return (!bfd_is_abs_section (sec) + && bfd_is_abs_section (sec->output_section) + && sec->sec_info_type != SEC_INFO_TYPE_MERGE + && sec->sec_info_type != SEC_INFO_TYPE_JUST_SYMS); +} + +#define BFD_FAKE_SECTION(SEC, SYM, NAME, IDX, FLAGS) \ /* name, id, index, next, prev, flags, user_set_vma, */ \ - { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ + { NAME, IDX, 0, NULL, NULL, FLAGS, 0, \ \ /* linker_mark, linker_has_input, gc_mark, decompress_status, */ \ 0, 0, 1, 0, \ @@ -1731,11 +1370,23 @@ extern asection std_section[4]; { NULL }, { NULL } \ } +/* We use a macro to initialize the static asymbol structures because + traditional C does not permit us to initialize a union member while + gcc warns if we don't initialize it. + the_bfd, name, value, attr, section [, udata] */ +#ifdef __STDC__ +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION, { 0 }} +#else +#define GLOBAL_SYM_INIT(NAME, SECTION) \ + { 0, NAME, 0, BSF_SECTION_SYM, SECTION } +#endif + void bfd_section_list_clear (bfd *); asection *bfd_get_section_by_name (bfd *abfd, const char *name); -asection *bfd_get_next_section_by_name (asection *sec); +asection *bfd_get_next_section_by_name (bfd *ibfd, asection *sec); asection *bfd_get_linker_section (bfd *abfd, const char *name); @@ -1760,11 +1411,10 @@ asection *bfd_make_section_with_flags asection *bfd_make_section (bfd *, const char *name); -bfd_boolean bfd_set_section_flags - (bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags (asection *sec, flagword flags); void bfd_rename_section - (bfd *abfd, asection *sec, const char *newname); + (asection *sec, const char *newname); void bfd_map_over_sections (bfd *abfd, @@ -1776,8 +1426,7 @@ asection *bfd_sections_find_if bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj), void *obj); -bfd_boolean bfd_set_section_size - (bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size (asection *sec, bfd_size_type val); bfd_boolean bfd_set_section_contents (bfd *abfd, asection *section, const void *data, @@ -1794,10 +1443,12 @@ bfd_boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ - BFD_SEND (obfd, _bfd_copy_private_section_data, \ - (ibfd, isection, obfd, osection)) + BFD_SEND (obfd, _bfd_copy_private_section_data, \ + (ibfd, isection, obfd, osection)) bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec); +const char *bfd_generic_group_name (bfd *, const asection *sec); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ @@ -1805,60 +1456,45 @@ enum bfd_architecture { bfd_arch_unknown, /* File arch not known. */ bfd_arch_obscure, /* Arch known, not one of these. */ - bfd_arch_m68k, /* Motorola 68xxx */ -#define bfd_mach_m68000 1 -#define bfd_mach_m68008 2 -#define bfd_mach_m68010 3 -#define bfd_mach_m68020 4 -#define bfd_mach_m68030 5 -#define bfd_mach_m68040 6 -#define bfd_mach_m68060 7 -#define bfd_mach_cpu32 8 -#define bfd_mach_fido 9 -#define bfd_mach_mcf_isa_a_nodiv 10 -#define bfd_mach_mcf_isa_a 11 -#define bfd_mach_mcf_isa_a_mac 12 -#define bfd_mach_mcf_isa_a_emac 13 -#define bfd_mach_mcf_isa_aplus 14 -#define bfd_mach_mcf_isa_aplus_mac 15 -#define bfd_mach_mcf_isa_aplus_emac 16 -#define bfd_mach_mcf_isa_b_nousp 17 -#define bfd_mach_mcf_isa_b_nousp_mac 18 -#define bfd_mach_mcf_isa_b_nousp_emac 19 -#define bfd_mach_mcf_isa_b 20 -#define bfd_mach_mcf_isa_b_mac 21 -#define bfd_mach_mcf_isa_b_emac 22 -#define bfd_mach_mcf_isa_b_float 23 -#define bfd_mach_mcf_isa_b_float_mac 24 -#define bfd_mach_mcf_isa_b_float_emac 25 -#define bfd_mach_mcf_isa_c 26 -#define bfd_mach_mcf_isa_c_mac 27 -#define bfd_mach_mcf_isa_c_emac 28 -#define bfd_mach_mcf_isa_c_nodiv 29 -#define bfd_mach_mcf_isa_c_nodiv_mac 30 -#define bfd_mach_mcf_isa_c_nodiv_emac 31 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that - only accepts a subset of the instructions - available to machines with higher numbers. - The exception is the "ca", which is - incompatible with all other machines except - "core". */ + bfd_arch_m68k, /* Motorola 68xxx. */ +#define bfd_mach_m68000 1 +#define bfd_mach_m68008 2 +#define bfd_mach_m68010 3 +#define bfd_mach_m68020 4 +#define bfd_mach_m68030 5 +#define bfd_mach_m68040 6 +#define bfd_mach_m68060 7 +#define bfd_mach_cpu32 8 +#define bfd_mach_fido 9 +#define bfd_mach_mcf_isa_a_nodiv 10 +#define bfd_mach_mcf_isa_a 11 +#define bfd_mach_mcf_isa_a_mac 12 +#define bfd_mach_mcf_isa_a_emac 13 +#define bfd_mach_mcf_isa_aplus 14 +#define bfd_mach_mcf_isa_aplus_mac 15 +#define bfd_mach_mcf_isa_aplus_emac 16 +#define bfd_mach_mcf_isa_b_nousp 17 +#define bfd_mach_mcf_isa_b_nousp_mac 18 +#define bfd_mach_mcf_isa_b_nousp_emac 19 +#define bfd_mach_mcf_isa_b 20 +#define bfd_mach_mcf_isa_b_mac 21 +#define bfd_mach_mcf_isa_b_emac 22 +#define bfd_mach_mcf_isa_b_float 23 +#define bfd_mach_mcf_isa_b_float_mac 24 +#define bfd_mach_mcf_isa_b_float_emac 25 +#define bfd_mach_mcf_isa_c 26 +#define bfd_mach_mcf_isa_c_mac 27 +#define bfd_mach_mcf_isa_c_emac 28 +#define bfd_mach_mcf_isa_c_nodiv 29 +#define bfd_mach_mcf_isa_c_nodiv_mac 30 +#define bfd_mach_mcf_isa_c_nodiv_emac 31 + bfd_arch_vax, /* DEC Vax. */ -#define bfd_mach_i960_core 1 -#define bfd_mach_i960_ka_sa 2 -#define bfd_mach_i960_kb_sb 3 -#define bfd_mach_i960_mc 4 -#define bfd_mach_i960_xa 5 -#define bfd_mach_i960_ca 6 -#define bfd_mach_i960_jx 7 -#define bfd_mach_i960_hx 8 + bfd_arch_or1k, /* OpenRISC 1000. */ +#define bfd_mach_or1k 1 +#define bfd_mach_or1knd 2 - bfd_arch_or32, /* OpenRISC 32 */ - - bfd_arch_sparc, /* SPARC */ + bfd_arch_sparc, /* SPARC. */ #define bfd_mach_sparc 1 /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 @@ -1870,16 +1506,35 @@ enum bfd_architecture #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */ #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */ #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */ +#define bfd_mach_sparc_v8plusc 11 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v9c 12 /* with UA2005 and T1 add'ns. */ +#define bfd_mach_sparc_v8plusd 13 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v9d 14 /* with UA2007 and T3 add'ns. */ +#define bfd_mach_sparc_v8pluse 15 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v9e 16 /* with OSA2001 and T4 add'ns (no IMA). */ +#define bfd_mach_sparc_v8plusv 17 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v9v 18 /* with OSA2011 and T4 and IMA and FJMAU add'ns. */ +#define bfd_mach_sparc_v8plusm 19 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v9m 20 /* with OSA2015 and M7 add'ns. */ +#define bfd_mach_sparc_v8plusm8 21 /* with OSA2017 and M8 add'ns. */ +#define bfd_mach_sparc_v9m8 22 /* with OSA2017 and M8 add'ns. */ /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9m8 \ && (mach) != bfd_mach_sparc_sparclite_le) /* Nonzero if MACH is a 64 bit sparc architecture. */ #define bfd_mach_sparc_64bit_p(mach) \ - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb) - bfd_arch_spu, /* PowerPC SPU */ -#define bfd_mach_spu 256 - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v9 \ + && (mach) != bfd_mach_sparc_v8plusb \ + && (mach) != bfd_mach_sparc_v8plusc \ + && (mach) != bfd_mach_sparc_v8plusd \ + && (mach) != bfd_mach_sparc_v8pluse \ + && (mach) != bfd_mach_sparc_v8plusv \ + && (mach) != bfd_mach_sparc_v8plusm \ + && (mach) != bfd_mach_sparc_v8plusm8) + bfd_arch_spu, /* PowerPC SPU. */ +#define bfd_mach_spu 256 + bfd_arch_mips, /* MIPS Rxxxx. */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -1894,6 +1549,7 @@ enum bfd_architecture #define bfd_mach_mips5000 5000 #define bfd_mach_mips5400 5400 #define bfd_mach_mips5500 5500 +#define bfd_mach_mips5900 5900 #define bfd_mach_mips6000 6000 #define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 @@ -1906,18 +1562,28 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_loongson_2e 3001 #define bfd_mach_mips_loongson_2f 3002 -#define bfd_mach_mips_loongson_3a 3003 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ +#define bfd_mach_mips_gs464 3003 +#define bfd_mach_mips_gs464e 3004 +#define bfd_mach_mips_gs264e 3005 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01. */ #define bfd_mach_mips_octeon 6501 #define bfd_mach_mips_octeonp 6601 #define bfd_mach_mips_octeon2 6502 -#define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */ +#define bfd_mach_mips_octeon3 6503 +#define bfd_mach_mips_xlr 887682 /* decimal 'XLR'. */ +#define bfd_mach_mips_interaptiv_mr2 736550 /* decimal 'IA2'. */ #define bfd_mach_mipsisa32 32 #define bfd_mach_mipsisa32r2 33 +#define bfd_mach_mipsisa32r3 34 +#define bfd_mach_mipsisa32r5 36 +#define bfd_mach_mipsisa32r6 37 #define bfd_mach_mipsisa64 64 #define bfd_mach_mipsisa64r2 65 +#define bfd_mach_mipsisa64r3 66 +#define bfd_mach_mipsisa64r5 68 +#define bfd_mach_mipsisa64r6 69 #define bfd_mach_mips_micromips 96 - bfd_arch_i386, /* Intel 386 */ + bfd_arch_i386, /* Intel 386. */ #define bfd_mach_i386_intel_syntax (1 << 0) #define bfd_mach_i386_i8086 (1 << 1) #define bfd_mach_i386_i386 (1 << 2) @@ -1926,32 +1592,35 @@ enum bfd_architecture #define bfd_mach_i386_i386_intel_syntax (bfd_mach_i386_i386 | bfd_mach_i386_intel_syntax) #define bfd_mach_x86_64_intel_syntax (bfd_mach_x86_64 | bfd_mach_i386_intel_syntax) #define bfd_mach_x64_32_intel_syntax (bfd_mach_x64_32 | bfd_mach_i386_intel_syntax) - bfd_arch_l1om, /* Intel L1OM */ + bfd_arch_l1om, /* Intel L1OM. */ #define bfd_mach_l1om (1 << 5) #define bfd_mach_l1om_intel_syntax (bfd_mach_l1om | bfd_mach_i386_intel_syntax) - bfd_arch_k1om, /* Intel K1OM */ + bfd_arch_k1om, /* Intel K1OM. */ #define bfd_mach_k1om (1 << 6) #define bfd_mach_k1om_intel_syntax (bfd_mach_k1om | bfd_mach_i386_intel_syntax) - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_m98k, /* Motorola 98xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ -#define bfd_mach_h8300 1 -#define bfd_mach_h8300h 2 -#define bfd_mach_h8300s 3 -#define bfd_mach_h8300hn 4 -#define bfd_mach_h8300sn 5 -#define bfd_mach_h8300sx 6 -#define bfd_mach_h8300sxn 7 - bfd_arch_pdp11, /* DEC PDP-11 */ +#define bfd_mach_i386_nacl (1 << 7) +#define bfd_mach_i386_i386_nacl (bfd_mach_i386_i386 | bfd_mach_i386_nacl) +#define bfd_mach_x86_64_nacl (bfd_mach_x86_64 | bfd_mach_i386_nacl) +#define bfd_mach_x64_32_nacl (bfd_mach_x64_32 | bfd_mach_i386_nacl) + bfd_arch_iamcu, /* Intel MCU. */ +#define bfd_mach_iamcu (1 << 8) +#define bfd_mach_i386_iamcu (bfd_mach_i386_i386 | bfd_mach_iamcu) +#define bfd_mach_i386_iamcu_intel_syntax (bfd_mach_i386_iamcu | bfd_mach_i386_intel_syntax) + bfd_arch_romp, /* IBM ROMP PC/RT. */ + bfd_arch_convex, /* Convex. */ + bfd_arch_m98k, /* Motorola 98xxx. */ + bfd_arch_pyramid, /* Pyramid Technology. */ + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300). */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 + bfd_arch_pdp11, /* DEC PDP-11. */ bfd_arch_plugin, - bfd_arch_powerpc, /* PowerPC */ + bfd_arch_powerpc, /* PowerPC. */ #define bfd_mach_ppc 32 #define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 @@ -1978,59 +1647,59 @@ enum bfd_architecture #define bfd_mach_ppc_e6500 5007 #define bfd_mach_ppc_titan 83 #define bfd_mach_ppc_vle 84 - bfd_arch_rs6000, /* IBM RS/6000 */ + bfd_arch_rs6000, /* IBM RS/6000. */ #define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 - bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_hppa, /* HP PA RISC. */ #define bfd_mach_hppa10 10 #define bfd_mach_hppa11 11 #define bfd_mach_hppa20 20 #define bfd_mach_hppa20w 25 - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_d10v, /* Mitsubishi D10V. */ #define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_dlx, /* DLX */ - bfd_arch_m68hc11, /* Motorola 68HC11 */ - bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_d30v, /* Mitsubishi D30V. */ + bfd_arch_dlx, /* DLX. */ + bfd_arch_m68hc11, /* Motorola 68HC11. */ + bfd_arch_m68hc12, /* Motorola 68HC12. */ #define bfd_mach_m6812_default 0 #define bfd_mach_m6812 1 #define bfd_mach_m6812s 2 - bfd_arch_m9s12x, /* Freescale S12X */ - bfd_arch_m9s12xg, /* Freescale XGATE */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_m9s12x, /* Freescale S12X. */ + bfd_arch_m9s12xg, /* Freescale XGATE. */ + bfd_arch_s12z, /* Freescale S12Z. */ +#define bfd_mach_s12z_default 0 + bfd_arch_z8k, /* Zilog Z8000. */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ -#define bfd_mach_sh 1 -#define bfd_mach_sh2 0x20 -#define bfd_mach_sh_dsp 0x2d -#define bfd_mach_sh2a 0x2a -#define bfd_mach_sh2a_nofpu 0x2b + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH). */ +#define bfd_mach_sh 1 +#define bfd_mach_sh2 0x20 +#define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2a 0x2a +#define bfd_mach_sh2a_nofpu 0x2b #define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 -#define bfd_mach_sh2a_or_sh4 0x2a3 -#define bfd_mach_sh2a_or_sh3e 0x2a4 -#define bfd_mach_sh2e 0x2e -#define bfd_mach_sh3 0x30 -#define bfd_mach_sh3_nommu 0x31 -#define bfd_mach_sh3_dsp 0x3d -#define bfd_mach_sh3e 0x3e -#define bfd_mach_sh4 0x40 -#define bfd_mach_sh4_nofpu 0x41 -#define bfd_mach_sh4_nommu_nofpu 0x42 -#define bfd_mach_sh4a 0x4a -#define bfd_mach_sh4a_nofpu 0x4b -#define bfd_mach_sh4al_dsp 0x4d -#define bfd_mach_sh5 0x50 - bfd_arch_alpha, /* Dec Alpha */ -#define bfd_mach_alpha_ev4 0x10 -#define bfd_mach_alpha_ev5 0x20 -#define bfd_mach_alpha_ev6 0x30 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2 +#define bfd_mach_sh2a_or_sh4 0x2a3 +#define bfd_mach_sh2a_or_sh3e 0x2a4 +#define bfd_mach_sh2e 0x2e +#define bfd_mach_sh3 0x30 +#define bfd_mach_sh3_nommu 0x31 +#define bfd_mach_sh3_dsp 0x3d +#define bfd_mach_sh3e 0x3e +#define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4_nommu_nofpu 0x42 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d + bfd_arch_alpha, /* Dec Alpha. */ +#define bfd_mach_alpha_ev4 0x10 +#define bfd_mach_alpha_ev5 0x20 +#define bfd_mach_alpha_ev6 0x30 bfd_arch_arm, /* Advanced Risc Machines ARM. */ #define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 @@ -2046,36 +1715,58 @@ enum bfd_architecture #define bfd_mach_arm_ep9312 11 #define bfd_mach_arm_iWMMXt 12 #define bfd_mach_arm_iWMMXt2 13 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_arm_5TEJ 14 +#define bfd_mach_arm_6 15 +#define bfd_mach_arm_6KZ 16 +#define bfd_mach_arm_6T2 17 +#define bfd_mach_arm_6K 18 +#define bfd_mach_arm_7 19 +#define bfd_mach_arm_6M 20 +#define bfd_mach_arm_6SM 21 +#define bfd_mach_arm_7EM 22 +#define bfd_mach_arm_8 23 +#define bfd_mach_arm_8R 24 +#define bfd_mach_arm_8M_BASE 25 +#define bfd_mach_arm_8M_MAIN 26 +#define bfd_mach_arm_8_1M_MAIN 27 + bfd_arch_nds32, /* Andes NDS32. */ +#define bfd_mach_n1 1 +#define bfd_mach_n1h 2 +#define bfd_mach_n1h_v2 3 +#define bfd_mach_n1h_v3 4 +#define bfd_mach_n1h_v3m 5 + bfd_arch_ns32k, /* National Semiconductors ns32000. */ + bfd_arch_tic30, /* Texas Instruments TMS320C30. */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X. */ #define bfd_mach_tic3x 30 #define bfd_mach_tic4x 40 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ - bfd_arch_tic6x, /* Texas Instruments TMS320C6X */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X. */ + bfd_arch_tic6x, /* Texas Instruments TMS320C6X. */ + bfd_arch_v850, /* NEC V850. */ + bfd_arch_v850_rh850,/* NEC V850 (using RH850 ABI). */ #define bfd_mach_v850 1 #define bfd_mach_v850e 'E' #define bfd_mach_v850e1 '1' #define bfd_mach_v850e2 0x4532 #define bfd_mach_v850e2v3 0x45325633 - bfd_arch_arc, /* ARC Cores */ -#define bfd_mach_arc_5 5 -#define bfd_mach_arc_6 6 -#define bfd_mach_arc_7 7 -#define bfd_mach_arc_8 8 - bfd_arch_m32c, /* Renesas M16C/M32C. */ -#define bfd_mach_m16c 0x75 -#define bfd_mach_m32c 0x78 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_v850e3v5 0x45335635 /* ('E'|'3'|'V'|'5'). */ + bfd_arch_arc, /* ARC Cores. */ +#define bfd_mach_arc_a4 0 +#define bfd_mach_arc_a5 1 +#define bfd_mach_arc_arc600 2 +#define bfd_mach_arc_arc601 4 +#define bfd_mach_arc_arc700 3 +#define bfd_mach_arc_arcv2 5 + bfd_arch_m32c, /* Renesas M16C/M32C. */ +#define bfd_mach_m16c 0x75 +#define bfd_mach_m32c 0x78 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D). */ #define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' #define bfd_mach_m32r2 '2' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ -#define bfd_mach_mn10300 300 + bfd_arch_mn10200, /* Matsushita MN10200. */ + bfd_arch_mn10300, /* Matsushita MN10300. */ +#define bfd_mach_mn10300 300 #define bfd_mach_am33 330 #define bfd_mach_am33_2 332 bfd_arch_fr30, @@ -2086,17 +1777,22 @@ enum bfd_architecture #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_fr450 450 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */ +#define bfd_mach_frvtomcat 499 /* fr500 prototype. */ #define bfd_mach_fr500 500 #define bfd_mach_fr550 550 - bfd_arch_moxie, /* The moxie processor */ + bfd_arch_moxie, /* The moxie processor. */ #define bfd_mach_moxie 1 + bfd_arch_ft32, /* The ft32 processor. */ +#define bfd_mach_ft32 1 +#define bfd_mach_ft32b 2 bfd_arch_mcore, bfd_arch_mep, #define bfd_mach_mep 1 #define bfd_mach_mep_h1 0x6831 #define bfd_mach_mep_c5 0x6335 - bfd_arch_ia64, /* HP/Intel ia64 */ + bfd_arch_metag, +#define bfd_mach_metag 1 + bfd_arch_ia64, /* HP/Intel ia64. */ #define bfd_mach_ia64_elf64 64 #define bfd_mach_ia64_elf32 32 bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ @@ -2105,7 +1801,9 @@ enum bfd_architecture bfd_arch_iq2000, /* Vitesse IQ2000. */ #define bfd_mach_iq2000 1 #define bfd_mach_iq10 2 - bfd_arch_epiphany, /* Adapteva EPIPHANY */ + bfd_arch_bpf, /* Linux eBPF. */ +#define bfd_mach_bpf 1 + bfd_arch_epiphany, /* Adapteva EPIPHANY. */ #define bfd_mach_epiphany16 1 #define bfd_mach_epiphany32 2 bfd_arch_mt, @@ -2124,78 +1822,117 @@ enum bfd_architecture #define bfd_mach_avr5 5 #define bfd_mach_avr51 51 #define bfd_mach_avr6 6 -#define bfd_mach_avrxmega1 101 -#define bfd_mach_avrxmega2 102 -#define bfd_mach_avrxmega3 103 -#define bfd_mach_avrxmega4 104 -#define bfd_mach_avrxmega5 105 -#define bfd_mach_avrxmega6 106 -#define bfd_mach_avrxmega7 107 - bfd_arch_bfin, /* ADI Blackfin */ +#define bfd_mach_avrtiny 100 +#define bfd_mach_avrxmega1 101 +#define bfd_mach_avrxmega2 102 +#define bfd_mach_avrxmega3 103 +#define bfd_mach_avrxmega4 104 +#define bfd_mach_avrxmega5 105 +#define bfd_mach_avrxmega6 106 +#define bfd_mach_avrxmega7 107 + bfd_arch_bfin, /* ADI Blackfin. */ #define bfd_mach_bfin 1 - bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ + bfd_arch_cr16, /* National Semiconductor CompactRISC (ie CR16). */ #define bfd_mach_cr16 1 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */ -#define bfd_mach_cr16c 1 bfd_arch_crx, /* National Semiconductor CRX. */ #define bfd_mach_crx 1 - bfd_arch_cris, /* Axis CRIS */ + bfd_arch_cris, /* Axis CRIS. */ #define bfd_mach_cris_v0_v10 255 #define bfd_mach_cris_v32 32 #define bfd_mach_cris_v10_v32 1032 + bfd_arch_riscv, +#define bfd_mach_riscv32 132 +#define bfd_mach_riscv64 164 bfd_arch_rl78, -#define bfd_mach_rl78 0x75 +#define bfd_mach_rl78 0x75 bfd_arch_rx, /* Renesas RX. */ #define bfd_mach_rx 0x75 - bfd_arch_s390, /* IBM s390 */ +#define bfd_mach_rx_v2 0x76 +#define bfd_mach_rx_v3 0x77 + bfd_arch_s390, /* IBM s390. */ #define bfd_mach_s390_31 31 #define bfd_mach_s390_64 64 - bfd_arch_score, /* Sunplus score */ -#define bfd_mach_score3 3 -#define bfd_mach_score7 7 - bfd_arch_openrisc, /* OpenRISC */ + bfd_arch_score, /* Sunplus score. */ +#define bfd_mach_score3 3 +#define bfd_mach_score7 7 bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, #define bfd_mach_xstormy16 1 bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ -#define bfd_mach_msp11 11 -#define bfd_mach_msp110 110 -#define bfd_mach_msp12 12 -#define bfd_mach_msp13 13 -#define bfd_mach_msp14 14 -#define bfd_mach_msp15 15 -#define bfd_mach_msp16 16 -#define bfd_mach_msp21 21 -#define bfd_mach_msp31 31 -#define bfd_mach_msp32 32 -#define bfd_mach_msp33 33 -#define bfd_mach_msp41 41 -#define bfd_mach_msp42 42 -#define bfd_mach_msp43 43 -#define bfd_mach_msp44 44 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp20 20 +#define bfd_mach_msp21 21 +#define bfd_mach_msp22 22 +#define bfd_mach_msp23 23 +#define bfd_mach_msp24 24 +#define bfd_mach_msp26 26 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 +#define bfd_mach_msp430x 45 +#define bfd_mach_msp46 46 +#define bfd_mach_msp47 47 +#define bfd_mach_msp54 54 + bfd_arch_xc16x, /* Infineon's XC16X Series. */ #define bfd_mach_xc16x 1 #define bfd_mach_xc16xl 2 #define bfd_mach_xc16xs 3 - bfd_arch_xgate, /* Freescale XGATE */ + bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ #define bfd_mach_xtensa 1 bfd_arch_z80, -#define bfd_mach_z80strict 1 /* No undocumented opcodes. */ -#define bfd_mach_z80 3 /* With ixl, ixh, iyl, and iyh. */ -#define bfd_mach_z80full 7 /* All undocumented instructions. */ -#define bfd_mach_r800 11 /* R800: successor with multiplication. */ - bfd_arch_lm32, /* Lattice Mico32 */ -#define bfd_mach_lm32 1 - bfd_arch_microblaze,/* Xilinx MicroBlaze. */ - bfd_arch_tilepro, /* Tilera TILEPro */ - bfd_arch_tilegx, /* Tilera TILE-Gx */ -#define bfd_mach_tilepro 1 -#define bfd_mach_tilegx 1 -#define bfd_mach_tilegx32 2 - bfd_arch_aarch64, /* AArch64 */ +#define bfd_mach_gbz80 0 /* GameBoy Z80 (reduced instruction set) */ +#define bfd_mach_z80strict 1 /* Z80 without undocumented opcodes. */ +#define bfd_mach_z180 2 /* Z180: successor with additional instructions, but without halves of ix and iy */ +#define bfd_mach_z80 3 /* Z80 with ixl, ixh, iyl, and iyh. */ +#define bfd_mach_ez80_z80 4 /* eZ80 (successor of Z80 & Z180) in Z80 (16-bit address) mode */ +#define bfd_mach_ez80_adl 5 /* eZ80 (successor of Z80 & Z180) in ADL (24-bit address) mode */ +#define bfd_mach_z80full 7 /* Z80 with all undocumented instructions. */ +#define bfd_mach_r800 11 /* R800: successor with multiplication. */ + bfd_arch_lm32, /* Lattice Mico32. */ +#define bfd_mach_lm32 1 + bfd_arch_microblaze,/* Xilinx MicroBlaze. */ + bfd_arch_tilepro, /* Tilera TILEPro. */ + bfd_arch_tilegx, /* Tilera TILE-Gx. */ +#define bfd_mach_tilepro 1 +#define bfd_mach_tilegx 1 +#define bfd_mach_tilegx32 2 + bfd_arch_aarch64, /* AArch64. */ #define bfd_mach_aarch64 0 +#define bfd_mach_aarch64_ilp32 32 + bfd_arch_nios2, /* Nios II. */ +#define bfd_mach_nios2 0 +#define bfd_mach_nios2r1 1 +#define bfd_mach_nios2r2 2 + bfd_arch_visium, /* Visium. */ +#define bfd_mach_visium 1 + bfd_arch_wasm32, /* WebAssembly. */ +#define bfd_mach_wasm32 1 + bfd_arch_pru, /* PRU. */ +#define bfd_mach_pru 0 + bfd_arch_nfp, /* Netronome Flow Processor */ +#define bfd_mach_nfp3200 0x3200 +#define bfd_mach_nfp6000 0x6000 + bfd_arch_csky, /* C-SKY. */ +#define bfd_mach_ck_unknown 0 +#define bfd_mach_ck510 1 +#define bfd_mach_ck610 2 +#define bfd_mach_ck801 3 +#define bfd_mach_ck802 4 +#define bfd_mach_ck803 5 +#define bfd_mach_ck807 6 +#define bfd_mach_ck810 7 bfd_arch_last }; @@ -2213,8 +1950,8 @@ typedef struct bfd_arch_info The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ bfd_boolean the_default; - const struct bfd_arch_info * (*compatible) - (const struct bfd_arch_info *a, const struct bfd_arch_info *b); + const struct bfd_arch_info * (*compatible) (const struct bfd_arch_info *, + const struct bfd_arch_info *); bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); @@ -2225,6 +1962,16 @@ typedef struct bfd_arch_info bfd_boolean code); const struct bfd_arch_info *next; + + /* On some architectures the offset for a relocation can point into + the middle of an instruction. This field specifies the maximum + offset such a relocation can have (in octets). This affects the + behaviour of the disassembler, since a value greater than zero + means that it may need to disassemble an instruction twice, once + to get its length and then a second time to display it. If the + value is negative then this has to be done for every single + instruction, regardless of the offset of the reloc. */ + signed int max_reloc_offset_into_insn; } bfd_arch_info_type; @@ -2239,13 +1986,16 @@ const bfd_arch_info_type *bfd_arch_get_compatible void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture bfd_get_arch (bfd *abfd); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -unsigned long bfd_get_mach (bfd *abfd); +enum bfd_architecture bfd_get_arch (const bfd *abfd); -unsigned int bfd_arch_bits_per_byte (bfd *abfd); +unsigned long bfd_get_mach (const bfd *abfd); -unsigned int bfd_arch_bits_per_address (bfd *abfd); +unsigned int bfd_arch_bits_per_byte (const bfd *abfd); + +unsigned int bfd_arch_bits_per_address (const bfd *abfd); const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @@ -2255,16 +2005,19 @@ const bfd_arch_info_type *bfd_lookup_arch const char *bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine); -unsigned int bfd_octets_per_byte (bfd *abfd); +unsigned int bfd_octets_per_byte (const bfd *abfd, + const asection *sec); unsigned int bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ + typedef enum bfd_reloc_status { - /* No errors detected. */ - bfd_reloc_ok, + /* No errors detected. Note - the value 2 is used so that it + will not be mistaken for the boolean TRUE or FALSE values. */ + bfd_reloc_ok = 2, /* The relocation was performed, but there was an overflow. */ bfd_reloc_overflow, @@ -2284,14 +2037,14 @@ typedef enum bfd_reloc_status /* The symbol to relocate against was undefined. */ bfd_reloc_undefined, - /* The relocation was performed, but may not be ok - presently - generated only when linking i960 coff files with i960 b.out - symbols. If this type is returned, the error_message argument - to bfd_perform_relocation will be set. */ + /* The relocation was performed, but may not be ok. If this type is + returned, the error_message argument to bfd_perform_relocation + will be set. */ bfd_reloc_dangerous } bfd_reloc_status_type; +typedef const struct reloc_howto_struct reloc_howto_type; typedef struct reloc_cache_entry { @@ -2310,6 +2063,7 @@ typedef struct reloc_cache_entry } arelent; + enum complain_overflow { /* Do not complain on overflow. */ @@ -2328,51 +2082,39 @@ enum complain_overflow unsigned number. */ complain_overflow_unsigned }; - struct reloc_howto_struct { - /* The type field has mainly a documentary use - the back end can - do what it wants with it, though normally the back end's - external idea of what a reloc number is stored - in this field. For example, a PC relative word relocation - in a coff environment has the type 023 - because that's - what the outside world calls a R_PCRWORD reloc. */ + /* The type field has mainly a documentary use - the back end can + do what it wants with it, though normally the back end's idea of + an external reloc number is stored in this field. */ unsigned int type; - /* The value the final relocation is shifted right by. This drops - unwanted data from the relocation. */ - unsigned int rightshift; + /* The encoded size of the item to be relocated. This is *not* a + power-of-two measure. Use bfd_get_reloc_size to find the size + of the item in bytes. */ + unsigned int size:3; - /* The size of the item to be relocated. This is *not* a - power-of-two measure. To get the number of bytes operated - on by a type of relocation, use bfd_get_reloc_size. */ - int size; + /* The number of bits in the field to be relocated. This is used + when doing overflow checking. */ + unsigned int bitsize:7; - /* The number of bits in the item to be relocated. This is used - when doing overflow checking. */ - unsigned int bitsize; + /* The value the final relocation is shifted right by. This drops + unwanted data from the relocation. */ + unsigned int rightshift:6; - /* The relocation is relative to the field being relocated. */ - bfd_boolean pc_relative; - - /* The bit position of the reloc value in the destination. - The relocated value is left shifted by this amount. */ - unsigned int bitpos; + /* The bit position of the reloc value in the destination. + The relocated value is left shifted by this amount. */ + unsigned int bitpos:6; /* What type of overflow error should be checked for when relocating. */ - enum complain_overflow complain_on_overflow; + ENUM_BITFIELD (complain_overflow) complain_on_overflow:2; - /* If this field is non null, then the supplied function is - called rather than the normal function. This allows really - strange relocation methods to be accommodated (e.g., i960 callj - instructions). */ - bfd_reloc_status_type (*special_function) - (bfd *, arelent *, struct bfd_symbol *, void *, asection *, - bfd *, char **); + /* The relocation value should be negated before applying. */ + unsigned int negate:1; - /* The textual name of the relocation type. */ - char *name; + /* The relocation is relative to the item being relocated. */ + unsigned int pc_relative:1; /* Some formats record a relocation addend in the section contents rather than with the relocation. For ELF formats this is the @@ -2389,56 +2131,49 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - bfd_boolean partial_inplace; - - /* src_mask selects the part of the instruction (or data) to be used - in the relocation sum. If the target relocations don't have an - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal - dst_mask to extract the addend from the section contents. If - relocations do have an addend in the reloc, eg. ELF USE_RELA, this - field should be zero. Non-zero values for ELF USE_RELA targets are - bogus as in those cases the value in the dst_mask part of the - section contents should be treated as garbage. */ - bfd_vma src_mask; - - /* dst_mask selects which parts of the instruction (or data) are - replaced with a relocated value. */ - bfd_vma dst_mask; + unsigned int partial_inplace:1; /* When some formats create PC relative instructions, they leave the value of the pc of the place being relocated in the offset slot of the instruction, so that a PC relative relocation can be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction - empty (e.g., m88k bcs); this flag signals the fact. */ - bfd_boolean pcrel_offset; + empty (e.g., ELF); this flag signals the fact. */ + unsigned int pcrel_offset:1; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should normally be zero. Non-zero values for ELF USE_RELA + targets should be viewed with suspicion as normally the value in + the dst_mask part of the section contents should be ignored. */ + bfd_vma src_mask; + + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ + bfd_vma dst_mask; + + /* If this field is non null, then the supplied function is + called rather than the normal function. This allows really + strange relocation methods to be accommodated. */ + bfd_reloc_status_type (*special_function) + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); + + /* The textual name of the relocation type. */ + const char *name; }; -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, FALSE, 0, 0, IN) - +#define HOWTO(type, right, size, bits, pcrel, left, ovf, func, name, \ + inplace, src_mask, dst_mask, pcrel_off) \ + { (unsigned) type, size < 0 ? -size : size, bits, right, left, ovf, \ + size < 0, pcrel, inplace, pcrel_off, src_mask, dst_mask, func, name } #define EMPTY_HOWTO(C) \ HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ NULL, FALSE, 0, 0, FALSE) -#define HOWTO_PREPARE(relocation, symbol) \ - { \ - if (symbol != NULL) \ - { \ - if (bfd_is_com_section (symbol->section)) \ - { \ - relocation = 0; \ - } \ - else \ - { \ - relocation = symbol->value; \ - } \ - } \ - } - unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain @@ -2455,6 +2190,12 @@ bfd_reloc_status_type bfd_check_overflow unsigned int addrsize, bfd_vma relocation); +bfd_boolean bfd_reloc_offset_in_range + (reloc_howto_type *howto, + bfd *abfd, + asection *section, + bfd_size_type offset); + bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, @@ -2485,9 +2226,7 @@ enum bfd_reloc_code_real { /* PC-relative relocations. Sometimes these are relative to the address of the relocation itself; sometimes they are relative to the start of -the section containing the relocation. It depends on the specific target. - -The 24-bit relocation is used in some Intel 960 configurations. */ +the section containing the relocation. It depends on the specific target. */ BFD_RELOC_64_PCREL, BFD_RELOC_32_PCREL, BFD_RELOC_24_PCREL, @@ -2521,6 +2260,10 @@ The 24-bit relocation is used in some Intel 960 configurations. */ BFD_RELOC_HI16_S_PLTOFF, BFD_RELOC_8_PLTOFF, +/* Size relocations. */ + BFD_RELOC_SIZE32, + BFD_RELOC_SIZE64, + /* Relocations used by 68K ELF. */ BFD_RELOC_68K_GLOB_DAT, BFD_RELOC_68K_JMP_SLOT, @@ -2575,9 +2318,6 @@ decided relatively late. */ BFD_RELOC_GPREL16, BFD_RELOC_GPREL32, -/* Reloc types used for i960/b.out. */ - BFD_RELOC_I960_CALLJ, - /* SPARC ELF relocations. There is probably some overlap with other relocation types already defined. */ BFD_RELOC_NONE, @@ -2851,6 +2591,15 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_10_PCREL_S1, BFD_RELOC_MICROMIPS_16_PCREL_S1, +/* MIPS16 PC-relative relocation. */ + BFD_RELOC_MIPS16_16_PCREL_S1, + +/* MIPS PC-relative relocations. */ + BFD_RELOC_MIPS_21_PCREL_S2, + BFD_RELOC_MIPS_26_PCREL_S2, + BFD_RELOC_MIPS_18_PCREL_S3, + BFD_RELOC_MIPS_19_PCREL_S2, + /* microMIPS versions of generic BFD relocs. */ BFD_RELOC_MICROMIPS_GPREL16, BFD_RELOC_MICROMIPS_HI16, @@ -2913,6 +2662,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MICROMIPS_TLS_TPREL_HI16, BFD_RELOC_MIPS_TLS_TPREL_LO16, BFD_RELOC_MICROMIPS_TLS_TPREL_LO16, + BFD_RELOC_MIPS_EH, /* MIPS ELF relocations (VxWorks and PLT extensions). */ @@ -2924,6 +2674,18 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MOXIE_10_PCREL, +/* FT32 ELF relocations. */ + BFD_RELOC_FT32_10, + BFD_RELOC_FT32_20, + BFD_RELOC_FT32_17, + BFD_RELOC_FT32_18, + BFD_RELOC_FT32_RELAX, + BFD_RELOC_FT32_SC0, + BFD_RELOC_FT32_SC1, + BFD_RELOC_FT32_15, + BFD_RELOC_FT32_DIFF32, + + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -3048,6 +2810,7 @@ instruction. */ BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_386_TLS_DESC, BFD_RELOC_386_IRELATIVE, + BFD_RELOC_386_GOT32X, /* x86-64/elf relocations */ BFD_RELOC_X86_64_GOT32, @@ -3077,6 +2840,10 @@ instruction. */ BFD_RELOC_X86_64_TLSDESC_CALL, BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_IRELATIVE, + BFD_RELOC_X86_64_PC32_BND, + BFD_RELOC_X86_64_PLT32_BND, + BFD_RELOC_X86_64_GOTPCRELX, + BFD_RELOC_X86_64_REX_GOTPCRELX, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -3152,6 +2919,8 @@ instruction. */ BFD_RELOC_PPC_VLE_SDAREL_HI16D, BFD_RELOC_PPC_VLE_SDAREL_HA16A, BFD_RELOC_PPC_VLE_SDAREL_HA16D, + BFD_RELOC_PPC_16DX_HA, + BFD_RELOC_PPC_REL16DX_HA, BFD_RELOC_PPC64_HIGHER, BFD_RELOC_PPC64_HIGHER_S, BFD_RELOC_PPC64_HIGHEST, @@ -3175,6 +2944,34 @@ instruction. */ BFD_RELOC_PPC64_TOC16_LO_DS, BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, + BFD_RELOC_PPC64_ADDR16_HIGH, + BFD_RELOC_PPC64_ADDR16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGH, + BFD_RELOC_PPC64_REL16_HIGHA, + BFD_RELOC_PPC64_REL16_HIGHER, + BFD_RELOC_PPC64_REL16_HIGHERA, + BFD_RELOC_PPC64_REL16_HIGHEST, + BFD_RELOC_PPC64_REL16_HIGHESTA, + BFD_RELOC_PPC64_ADDR64_LOCAL, + BFD_RELOC_PPC64_ENTRY, + BFD_RELOC_PPC64_REL24_NOTOC, + BFD_RELOC_PPC64_D34, + BFD_RELOC_PPC64_D34_LO, + BFD_RELOC_PPC64_D34_HI30, + BFD_RELOC_PPC64_D34_HA30, + BFD_RELOC_PPC64_PCREL34, + BFD_RELOC_PPC64_GOT_PCREL34, + BFD_RELOC_PPC64_PLT_PCREL34, + BFD_RELOC_PPC64_ADDR16_HIGHER34, + BFD_RELOC_PPC64_ADDR16_HIGHERA34, + BFD_RELOC_PPC64_ADDR16_HIGHEST34, + BFD_RELOC_PPC64_ADDR16_HIGHESTA34, + BFD_RELOC_PPC64_REL16_HIGHER34, + BFD_RELOC_PPC64_REL16_HIGHERA34, + BFD_RELOC_PPC64_REL16_HIGHEST34, + BFD_RELOC_PPC64_REL16_HIGHESTA34, + BFD_RELOC_PPC64_D28, + BFD_RELOC_PPC64_PCREL28, /* PowerPC and PowerPC64 thread-local storage relocations. */ BFD_RELOC_PPC_TLS, @@ -3209,16 +3006,27 @@ instruction. */ BFD_RELOC_PPC_GOT_DTPREL16_HA, BFD_RELOC_PPC64_TPREL16_DS, BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGH, + BFD_RELOC_PPC64_TPREL16_HIGHA, BFD_RELOC_PPC64_TPREL16_HIGHER, BFD_RELOC_PPC64_TPREL16_HIGHERA, BFD_RELOC_PPC64_TPREL16_HIGHEST, BFD_RELOC_PPC64_TPREL16_HIGHESTA, BFD_RELOC_PPC64_DTPREL16_DS, BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGH, + BFD_RELOC_PPC64_DTPREL16_HIGHA, BFD_RELOC_PPC64_DTPREL16_HIGHER, BFD_RELOC_PPC64_DTPREL16_HIGHERA, BFD_RELOC_PPC64_DTPREL16_HIGHEST, BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + BFD_RELOC_PPC64_TPREL34, + BFD_RELOC_PPC64_DTPREL34, + BFD_RELOC_PPC64_GOT_TLSGD34, + BFD_RELOC_PPC64_GOT_TLSLD34, + BFD_RELOC_PPC64_GOT_TPREL34, + BFD_RELOC_PPC64_GOT_DTPREL34, + BFD_RELOC_PPC64_TLS_PCREL, /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, @@ -3248,6 +3056,24 @@ field in the instruction. */ /* ARM 26-bit pc-relative branch for B or conditional BL instruction. */ BFD_RELOC_ARM_PCREL_JUMP, +/* ARM 5-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_THUMB_PCREL_BRANCH5, + +/* ARM 6-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_THUMB_PCREL_BFCSEL, + +/* ARM 17-bit pc-relative branch for Branch Future instructions. */ + BFD_RELOC_ARM_THUMB_BF17, + +/* ARM 13-bit pc-relative branch for BFCSEL instruction. */ + BFD_RELOC_ARM_THUMB_BF13, + +/* ARM 19-bit pc-relative branch for Branch Future Link instruction. */ + BFD_RELOC_ARM_THUMB_BF19, + +/* ARM 12-bit pc-relative branch for Low Overhead Loop instructions. */ + BFD_RELOC_ARM_THUMB_LOOP12, + /* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an @@ -3294,6 +3120,15 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_THUMB_MOVW_PCREL, BFD_RELOC_ARM_THUMB_MOVT_PCREL, +/* ARM FDPIC specific relocations. */ + BFD_RELOC_ARM_GOTFUNCDESC, + BFD_RELOC_ARM_GOTOFFFUNCDESC, + BFD_RELOC_ARM_FUNCDESC, + BFD_RELOC_ARM_FUNCDESC_VALUE, + BFD_RELOC_ARM_TLS_GD32_FDPIC, + BFD_RELOC_ARM_TLS_LDM32_FDPIC, + BFD_RELOC_ARM_TLS_IE32_FDPIC, + /* Relocations for setting up GOTs and PLTs for shared libraries. */ BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_GLOB_DAT, @@ -3356,6 +3191,12 @@ pc-relative or some form of GOT-indirect relocation. */ /* ARM support for STT_GNU_IFUNC. */ BFD_RELOC_ARM_IRELATIVE, +/* Thumb1 relocations to support execute-only code. */ + BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC, + BFD_RELOC_ARM_THUMB_ALU_ABS_G3_NC, + /* These relocs are only used within the ARM assembler. They are not (at present) written to any object files. */ BFD_RELOC_ARM_IMMEDIATE, @@ -3373,6 +3214,7 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_T32_CP_OFF_IMM, BFD_RELOC_ARM_T32_CP_OFF_IMM_S2, + BFD_RELOC_ARM_T32_VLDR_VSTR_OFF_IMM, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -3484,16 +3326,76 @@ pc-relative or some form of GOT-indirect relocation. */ BFD_RELOC_SH_GOTOFFFUNCDESC20, BFD_RELOC_SH_FUNCDESC, -/* ARC Cores relocs. -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are -not stored in the instruction. The high 20 bits are installed in bits 26 -through 7 of the instruction. */ - BFD_RELOC_ARC_B22_PCREL, - -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not -stored in the instruction. The high 24 bits are installed in bits 23 -through 0. */ - BFD_RELOC_ARC_B26, +/* ARC relocs. */ + BFD_RELOC_ARC_NONE, + BFD_RELOC_ARC_8, + BFD_RELOC_ARC_16, + BFD_RELOC_ARC_24, + BFD_RELOC_ARC_32, + BFD_RELOC_ARC_N8, + BFD_RELOC_ARC_N16, + BFD_RELOC_ARC_N24, + BFD_RELOC_ARC_N32, + BFD_RELOC_ARC_SDA, + BFD_RELOC_ARC_SECTOFF, + BFD_RELOC_ARC_S21H_PCREL, + BFD_RELOC_ARC_S21W_PCREL, + BFD_RELOC_ARC_S25H_PCREL, + BFD_RELOC_ARC_S25W_PCREL, + BFD_RELOC_ARC_SDA32, + BFD_RELOC_ARC_SDA_LDST, + BFD_RELOC_ARC_SDA_LDST1, + BFD_RELOC_ARC_SDA_LDST2, + BFD_RELOC_ARC_SDA16_LD, + BFD_RELOC_ARC_SDA16_LD1, + BFD_RELOC_ARC_SDA16_LD2, + BFD_RELOC_ARC_S13_PCREL, + BFD_RELOC_ARC_W, + BFD_RELOC_ARC_32_ME, + BFD_RELOC_ARC_32_ME_S, + BFD_RELOC_ARC_N32_ME, + BFD_RELOC_ARC_SECTOFF_ME, + BFD_RELOC_ARC_SDA32_ME, + BFD_RELOC_ARC_W_ME, + BFD_RELOC_AC_SECTOFF_U8, + BFD_RELOC_AC_SECTOFF_U8_1, + BFD_RELOC_AC_SECTOFF_U8_2, + BFD_RELOC_AC_SECTOFF_S9, + BFD_RELOC_AC_SECTOFF_S9_1, + BFD_RELOC_AC_SECTOFF_S9_2, + BFD_RELOC_ARC_SECTOFF_ME_1, + BFD_RELOC_ARC_SECTOFF_ME_2, + BFD_RELOC_ARC_SECTOFF_1, + BFD_RELOC_ARC_SECTOFF_2, + BFD_RELOC_ARC_SDA_12, + BFD_RELOC_ARC_SDA16_ST2, + BFD_RELOC_ARC_32_PCREL, + BFD_RELOC_ARC_PC32, + BFD_RELOC_ARC_GOT32, + BFD_RELOC_ARC_GOTPC32, + BFD_RELOC_ARC_PLT32, + BFD_RELOC_ARC_COPY, + BFD_RELOC_ARC_GLOB_DAT, + BFD_RELOC_ARC_JMP_SLOT, + BFD_RELOC_ARC_RELATIVE, + BFD_RELOC_ARC_GOTOFF, + BFD_RELOC_ARC_GOTPC, + BFD_RELOC_ARC_S21W_PCREL_PLT, + BFD_RELOC_ARC_S25H_PCREL_PLT, + BFD_RELOC_ARC_TLS_DTPMOD, + BFD_RELOC_ARC_TLS_TPOFF, + BFD_RELOC_ARC_TLS_GD_GOT, + BFD_RELOC_ARC_TLS_GD_LD, + BFD_RELOC_ARC_TLS_GD_CALL, + BFD_RELOC_ARC_TLS_IE_GOT, + BFD_RELOC_ARC_TLS_DTPOFF, + BFD_RELOC_ARC_TLS_DTPOFF_S9, + BFD_RELOC_ARC_TLS_LE_S9, + BFD_RELOC_ARC_TLS_LE_32, + BFD_RELOC_ARC_S25W_PCREL_PLT, + BFD_RELOC_ARC_S21H_PCREL_PLT, + BFD_RELOC_ARC_NPS_CMEM16, + BFD_RELOC_ARC_JLI_SECTOFF, /* ADI Blackfin 16 bit immediate absolute reloc. */ BFD_RELOC_BFIN_16_IMM, @@ -3740,6 +3642,223 @@ add3, load, and store instructions. */ BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO, +/* NDS32 relocs. +This is a 20 bit absolute address. */ + BFD_RELOC_NDS32_20, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_9_PCREL, + +/* This is a 9-bit pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_WORD_9_PCREL, + +/* This is an 15-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_15_PCREL, + +/* This is an 17-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_17_PCREL, + +/* This is a 25-bit reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_25_PCREL, + +/* This is a 20-bit reloc containing the high 20 bits of an address +used with the lower 12 bits */ + BFD_RELOC_NDS32_HI20, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift right by 3. This is used with ldi,sdi... */ + BFD_RELOC_NDS32_LO12S3, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 2. This is used with lwi,swi... */ + BFD_RELOC_NDS32_LO12S2, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 1. This is used with lhi,shi... */ + BFD_RELOC_NDS32_LO12S1, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is used with lbisbi... */ + BFD_RELOC_NDS32_LO12S0, + +/* This is a 12-bit reloc containing the lower 12 bits of an address +then shift left by 0. This is only used with branch relaxations */ + BFD_RELOC_NDS32_LO12S0_ORI, + +/* This is a 15-bit reloc containing the small data area 18-bit signed offset +and shift left by 3 for use in ldi, sdi... */ + BFD_RELOC_NDS32_SDA15S3, + +/* This is a 15-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi, swi... */ + BFD_RELOC_NDS32_SDA15S2, + +/* This is a 15-bit reloc containing the small data area 16-bit signed offset +and shift left by 1 for use in lhi, shi... */ + BFD_RELOC_NDS32_SDA15S1, + +/* This is a 15-bit reloc containing the small data area 15-bit signed offset +and shift left by 0 for use in lbi, sbi... */ + BFD_RELOC_NDS32_SDA15S0, + +/* This is a 16-bit reloc containing the small data area 16-bit signed offset +and shift left by 3 */ + BFD_RELOC_NDS32_SDA16S3, + +/* This is a 17-bit reloc containing the small data area 17-bit signed offset +and shift left by 2 for use in lwi.gp, swi.gp... */ + BFD_RELOC_NDS32_SDA17S2, + +/* This is a 18-bit reloc containing the small data area 18-bit signed offset +and shift left by 1 for use in lhi.gp, shi.gp... */ + BFD_RELOC_NDS32_SDA18S1, + +/* This is a 19-bit reloc containing the small data area 19-bit signed offset +and shift left by 0 for use in lbi.gp, sbi.gp... */ + BFD_RELOC_NDS32_SDA19S0, + +/* for PIC */ + BFD_RELOC_NDS32_GOT20, + BFD_RELOC_NDS32_9_PLTREL, + BFD_RELOC_NDS32_25_PLTREL, + BFD_RELOC_NDS32_COPY, + BFD_RELOC_NDS32_GLOB_DAT, + BFD_RELOC_NDS32_JMP_SLOT, + BFD_RELOC_NDS32_RELATIVE, + BFD_RELOC_NDS32_GOTOFF, + BFD_RELOC_NDS32_GOTOFF_HI20, + BFD_RELOC_NDS32_GOTOFF_LO12, + BFD_RELOC_NDS32_GOTPC20, + BFD_RELOC_NDS32_GOT_HI20, + BFD_RELOC_NDS32_GOT_LO12, + BFD_RELOC_NDS32_GOTPC_HI20, + BFD_RELOC_NDS32_GOTPC_LO12, + +/* for relax */ + BFD_RELOC_NDS32_INSN16, + BFD_RELOC_NDS32_LABEL, + BFD_RELOC_NDS32_LONGCALL1, + BFD_RELOC_NDS32_LONGCALL2, + BFD_RELOC_NDS32_LONGCALL3, + BFD_RELOC_NDS32_LONGJUMP1, + BFD_RELOC_NDS32_LONGJUMP2, + BFD_RELOC_NDS32_LONGJUMP3, + BFD_RELOC_NDS32_LOADSTORE, + BFD_RELOC_NDS32_9_FIXED, + BFD_RELOC_NDS32_15_FIXED, + BFD_RELOC_NDS32_17_FIXED, + BFD_RELOC_NDS32_25_FIXED, + BFD_RELOC_NDS32_LONGCALL4, + BFD_RELOC_NDS32_LONGCALL5, + BFD_RELOC_NDS32_LONGCALL6, + BFD_RELOC_NDS32_LONGJUMP4, + BFD_RELOC_NDS32_LONGJUMP5, + BFD_RELOC_NDS32_LONGJUMP6, + BFD_RELOC_NDS32_LONGJUMP7, + +/* for PIC */ + BFD_RELOC_NDS32_PLTREL_HI20, + BFD_RELOC_NDS32_PLTREL_LO12, + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + BFD_RELOC_NDS32_PLT_GOTREL_LO12, + +/* for floating point */ + BFD_RELOC_NDS32_SDA12S2_DP, + BFD_RELOC_NDS32_SDA12S2_SP, + BFD_RELOC_NDS32_LO12S2_DP, + BFD_RELOC_NDS32_LO12S2_SP, + +/* for dwarf2 debug_line. */ + BFD_RELOC_NDS32_DWARF2_OP1, + BFD_RELOC_NDS32_DWARF2_OP2, + BFD_RELOC_NDS32_DWARF2_LEB, + +/* for eliminate 16-bit instructions */ + BFD_RELOC_NDS32_UPDATE_TA, + +/* for PIC object relaxation */ + BFD_RELOC_NDS32_PLT_GOTREL_LO20, + BFD_RELOC_NDS32_PLT_GOTREL_LO15, + BFD_RELOC_NDS32_PLT_GOTREL_LO19, + BFD_RELOC_NDS32_GOT_LO15, + BFD_RELOC_NDS32_GOT_LO19, + BFD_RELOC_NDS32_GOTOFF_LO15, + BFD_RELOC_NDS32_GOTOFF_LO19, + BFD_RELOC_NDS32_GOT15S2, + BFD_RELOC_NDS32_GOT17S2, + +/* NDS32 relocs. +This is a 5 bit absolute address. */ + BFD_RELOC_NDS32_5, + +/* This is a 10-bit unsigned pc-relative reloc with the right 1 bit assumed to be 0. */ + BFD_RELOC_NDS32_10_UPCREL, + +/* If fp were omitted, fp can used as another gp. */ + BFD_RELOC_NDS32_SDA_FP7U2_RELA, + +/* relaxation relative relocation types */ + BFD_RELOC_NDS32_RELAX_ENTRY, + BFD_RELOC_NDS32_GOT_SUFF, + BFD_RELOC_NDS32_GOTOFF_SUFF, + BFD_RELOC_NDS32_PLT_GOT_SUFF, + BFD_RELOC_NDS32_MULCALL_SUFF, + BFD_RELOC_NDS32_PTR, + BFD_RELOC_NDS32_PTR_COUNT, + BFD_RELOC_NDS32_PTR_RESOLVED, + BFD_RELOC_NDS32_PLTBLOCK, + BFD_RELOC_NDS32_RELAX_REGION_BEGIN, + BFD_RELOC_NDS32_RELAX_REGION_END, + BFD_RELOC_NDS32_MINUEND, + BFD_RELOC_NDS32_SUBTRAHEND, + BFD_RELOC_NDS32_DIFF8, + BFD_RELOC_NDS32_DIFF16, + BFD_RELOC_NDS32_DIFF32, + BFD_RELOC_NDS32_DIFF_ULEB128, + BFD_RELOC_NDS32_EMPTY, + +/* This is a 25 bit absolute address. */ + BFD_RELOC_NDS32_25_ABS, + +/* For ex9 and ifc using. */ + BFD_RELOC_NDS32_DATA, + BFD_RELOC_NDS32_TRAN, + BFD_RELOC_NDS32_17IFC_PCREL, + BFD_RELOC_NDS32_10IFCU_PCREL, + +/* For TLS. */ + BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, + BFD_RELOC_NDS32_TLS_LE_HI20, + BFD_RELOC_NDS32_TLS_LE_LO12, + BFD_RELOC_NDS32_TLS_LE_20, + BFD_RELOC_NDS32_TLS_LE_15S0, + BFD_RELOC_NDS32_TLS_LE_15S1, + BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* For floating load store relaxation. */ + BFD_RELOC_NDS32_LSI, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -3996,6 +4115,46 @@ short offset into 11 bits. */ BFD_RELOC_MEP_GNU_VTENTRY, +/* Imagination Technologies Meta relocations. */ + BFD_RELOC_METAG_HIADDR16, + BFD_RELOC_METAG_LOADDR16, + BFD_RELOC_METAG_RELBRANCH, + BFD_RELOC_METAG_GETSETOFF, + BFD_RELOC_METAG_HIOG, + BFD_RELOC_METAG_LOOG, + BFD_RELOC_METAG_REL8, + BFD_RELOC_METAG_REL16, + BFD_RELOC_METAG_HI16_GOTOFF, + BFD_RELOC_METAG_LO16_GOTOFF, + BFD_RELOC_METAG_GETSET_GOTOFF, + BFD_RELOC_METAG_GETSET_GOT, + BFD_RELOC_METAG_HI16_GOTPC, + BFD_RELOC_METAG_LO16_GOTPC, + BFD_RELOC_METAG_HI16_PLT, + BFD_RELOC_METAG_LO16_PLT, + BFD_RELOC_METAG_RELBRANCH_PLT, + BFD_RELOC_METAG_GOTOFF, + BFD_RELOC_METAG_PLT, + BFD_RELOC_METAG_COPY, + BFD_RELOC_METAG_JMP_SLOT, + BFD_RELOC_METAG_RELATIVE, + BFD_RELOC_METAG_GLOB_DAT, + BFD_RELOC_METAG_TLS_GD, + BFD_RELOC_METAG_TLS_LDM, + BFD_RELOC_METAG_TLS_LDO_HI16, + BFD_RELOC_METAG_TLS_LDO_LO16, + BFD_RELOC_METAG_TLS_LDO, + BFD_RELOC_METAG_TLS_IE, + BFD_RELOC_METAG_TLS_IENONPIC, + BFD_RELOC_METAG_TLS_IENONPIC_HI16, + BFD_RELOC_METAG_TLS_IENONPIC_LO16, + BFD_RELOC_METAG_TLS_TPOFF, + BFD_RELOC_METAG_TLS_DTPMOD, + BFD_RELOC_METAG_TLS_DTPOFF, + BFD_RELOC_METAG_TLS_LE, + BFD_RELOC_METAG_TLS_LE_HI16, + BFD_RELOC_METAG_TLS_LE_LO16, + /* These are relocations for the GETA instruction. */ BFD_RELOC_MMIX_GETA, BFD_RELOC_MMIX_GETA_1, @@ -4095,7 +4254,7 @@ of 32 bit value) into 8 bit immediate value of LDI insn. */ command address) into 8 bit immediate value of LDI insn. */ BFD_RELOC_AVR_LO8_LDI_PM, -/* This is a 16 bit reloc for the AVR that stores 8 bit value +/* This is a 16 bit reloc for the AVR that stores 8 bit value (command address) into 8 bit immediate value of LDI insn. If the address is beyond the 128k boundary, the linker inserts a jump stub for this reloc in the lower 128k. */ @@ -4157,6 +4316,78 @@ in .byte hi8(symbol) */ in .byte hlo8(symbol) */ BFD_RELOC_AVR_8_HLO, +/* AVR relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. */ + BFD_RELOC_AVR_DIFF8, + BFD_RELOC_AVR_DIFF16, + BFD_RELOC_AVR_DIFF32, + +/* This is a 7 bit reloc for the AVR that stores SRAM address for 16bit +lds and sts instructions supported only tiny core. */ + BFD_RELOC_AVR_LDS_STS_16, + +/* This is a 6 bit reloc for the AVR that stores an I/O register +number for the IN and OUT instructions */ + BFD_RELOC_AVR_PORT6, + +/* This is a 5 bit reloc for the AVR that stores an I/O register +number for the SBIC, SBIS, SBI and CBI instructions */ + BFD_RELOC_AVR_PORT5, + +/* RISC-V relocations. */ + BFD_RELOC_RISCV_HI20, + BFD_RELOC_RISCV_PCREL_HI20, + BFD_RELOC_RISCV_PCREL_LO12_I, + BFD_RELOC_RISCV_PCREL_LO12_S, + BFD_RELOC_RISCV_LO12_I, + BFD_RELOC_RISCV_LO12_S, + BFD_RELOC_RISCV_GPREL12_I, + BFD_RELOC_RISCV_GPREL12_S, + BFD_RELOC_RISCV_TPREL_HI20, + BFD_RELOC_RISCV_TPREL_LO12_I, + BFD_RELOC_RISCV_TPREL_LO12_S, + BFD_RELOC_RISCV_TPREL_ADD, + BFD_RELOC_RISCV_CALL, + BFD_RELOC_RISCV_CALL_PLT, + BFD_RELOC_RISCV_ADD8, + BFD_RELOC_RISCV_ADD16, + BFD_RELOC_RISCV_ADD32, + BFD_RELOC_RISCV_ADD64, + BFD_RELOC_RISCV_SUB8, + BFD_RELOC_RISCV_SUB16, + BFD_RELOC_RISCV_SUB32, + BFD_RELOC_RISCV_SUB64, + BFD_RELOC_RISCV_GOT_HI20, + BFD_RELOC_RISCV_TLS_GOT_HI20, + BFD_RELOC_RISCV_TLS_GD_HI20, + BFD_RELOC_RISCV_JMP, + BFD_RELOC_RISCV_TLS_DTPMOD32, + BFD_RELOC_RISCV_TLS_DTPREL32, + BFD_RELOC_RISCV_TLS_DTPMOD64, + BFD_RELOC_RISCV_TLS_DTPREL64, + BFD_RELOC_RISCV_TLS_TPREL32, + BFD_RELOC_RISCV_TLS_TPREL64, + BFD_RELOC_RISCV_ALIGN, + BFD_RELOC_RISCV_RVC_BRANCH, + BFD_RELOC_RISCV_RVC_JUMP, + BFD_RELOC_RISCV_RVC_LUI, + BFD_RELOC_RISCV_GPREL_I, + BFD_RELOC_RISCV_GPREL_S, + BFD_RELOC_RISCV_TPREL_I, + BFD_RELOC_RISCV_TPREL_S, + BFD_RELOC_RISCV_RELAX, + BFD_RELOC_RISCV_CFA, + BFD_RELOC_RISCV_SUB6, + BFD_RELOC_RISCV_SET6, + BFD_RELOC_RISCV_SET8, + BFD_RELOC_RISCV_SET16, + BFD_RELOC_RISCV_SET32, + BFD_RELOC_RISCV_32_PCREL, + /* Renesas RL78 Relocations. */ BFD_RELOC_RL78_NEG8, BFD_RELOC_RL78_NEG16, @@ -4190,6 +4421,8 @@ in .byte hlo8(symbol) */ BFD_RELOC_RL78_HI16, BFD_RELOC_RL78_HI8, BFD_RELOC_RL78_LO16, + BFD_RELOC_RL78_CODE, + BFD_RELOC_RL78_SADDR, /* Renesas RX Relocations. */ BFD_RELOC_RX_NEG8, @@ -4247,12 +4480,24 @@ in .byte hlo8(symbol) */ /* 16 bit GOT offset. */ BFD_RELOC_390_GOT16, +/* PC relative 12 bit shifted by 1. */ + BFD_RELOC_390_PC12DBL, + +/* 12 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT12DBL, + /* PC relative 16 bit shifted by 1. */ BFD_RELOC_390_PC16DBL, /* 16 bit PC rel. PLT shifted by 1. */ BFD_RELOC_390_PLT16DBL, +/* PC relative 24 bit shifted by 1. */ + BFD_RELOC_390_PC24DBL, + +/* 24 bit PC rel. PLT shifted by 1. */ + BFD_RELOC_390_PLT24DBL, + /* PC relative 32 bit shifted by 1. */ BFD_RELOC_390_PC32DBL, @@ -4620,47 +4865,10 @@ This is the 8 bit high part of an absolute address and immediately follows a matching LO8XG part. */ BFD_RELOC_M68HC12_HI8XG, -/* NS CR16C Relocations. */ - BFD_RELOC_16C_NUM08, - BFD_RELOC_16C_NUM08_C, - BFD_RELOC_16C_NUM16, - BFD_RELOC_16C_NUM16_C, - BFD_RELOC_16C_NUM32, - BFD_RELOC_16C_NUM32_C, - BFD_RELOC_16C_DISP04, - BFD_RELOC_16C_DISP04_C, - BFD_RELOC_16C_DISP08, - BFD_RELOC_16C_DISP08_C, - BFD_RELOC_16C_DISP16, - BFD_RELOC_16C_DISP16_C, - BFD_RELOC_16C_DISP24, - BFD_RELOC_16C_DISP24_C, - BFD_RELOC_16C_DISP24a, - BFD_RELOC_16C_DISP24a_C, - BFD_RELOC_16C_REG04, - BFD_RELOC_16C_REG04_C, - BFD_RELOC_16C_REG04a, - BFD_RELOC_16C_REG04a_C, - BFD_RELOC_16C_REG14, - BFD_RELOC_16C_REG14_C, - BFD_RELOC_16C_REG16, - BFD_RELOC_16C_REG16_C, - BFD_RELOC_16C_REG20, - BFD_RELOC_16C_REG20_C, - BFD_RELOC_16C_ABS20, - BFD_RELOC_16C_ABS20_C, - BFD_RELOC_16C_ABS24, - BFD_RELOC_16C_ABS24_C, - BFD_RELOC_16C_IMM04, - BFD_RELOC_16C_IMM04_C, - BFD_RELOC_16C_IMM16, - BFD_RELOC_16C_IMM16_C, - BFD_RELOC_16C_IMM20, - BFD_RELOC_16C_IMM20_C, - BFD_RELOC_16C_IMM24, - BFD_RELOC_16C_IMM24_C, - BFD_RELOC_16C_IMM32, - BFD_RELOC_16C_IMM32_C, +/* Freescale S12Z reloc. +This is a 15 bit relative address. If the most significant bits are all zero +then it may be truncated to 8 bits. */ + BFD_RELOC_S12Z_15_PCREL, /* NS CR16 Relocations. */ BFD_RELOC_CR16_NUM8, @@ -4773,43 +4981,46 @@ a matching LO8XG part. */ BFD_RELOC_CRIS_DTPMOD, BFD_RELOC_CRIS_32_IE, -/* Intel i860 Relocations. */ - BFD_RELOC_860_COPY, - BFD_RELOC_860_GLOB_DAT, - BFD_RELOC_860_JUMP_SLOT, - BFD_RELOC_860_RELATIVE, - BFD_RELOC_860_PC26, - BFD_RELOC_860_PLT26, - BFD_RELOC_860_PC16, - BFD_RELOC_860_LOW0, - BFD_RELOC_860_SPLIT0, - BFD_RELOC_860_LOW1, - BFD_RELOC_860_SPLIT1, - BFD_RELOC_860_LOW2, - BFD_RELOC_860_SPLIT2, - BFD_RELOC_860_LOW3, - BFD_RELOC_860_LOGOT0, - BFD_RELOC_860_SPGOT0, - BFD_RELOC_860_LOGOT1, - BFD_RELOC_860_SPGOT1, - BFD_RELOC_860_LOGOTOFF0, - BFD_RELOC_860_SPGOTOFF0, - BFD_RELOC_860_LOGOTOFF1, - BFD_RELOC_860_SPGOTOFF1, - BFD_RELOC_860_LOGOTOFF2, - BFD_RELOC_860_LOGOTOFF3, - BFD_RELOC_860_LOPC, - BFD_RELOC_860_HIGHADJ, - BFD_RELOC_860_HAGOT, - BFD_RELOC_860_HAGOTOFF, - BFD_RELOC_860_HAPC, - BFD_RELOC_860_HIGH, - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - -/* OpenRISC Relocations. */ - BFD_RELOC_OPENRISC_ABS_26, - BFD_RELOC_OPENRISC_REL_26, +/* OpenRISC 1000 Relocations. */ + BFD_RELOC_OR1K_REL_26, + BFD_RELOC_OR1K_SLO16, + BFD_RELOC_OR1K_PCREL_PG21, + BFD_RELOC_OR1K_LO13, + BFD_RELOC_OR1K_SLO13, + BFD_RELOC_OR1K_GOTPC_HI16, + BFD_RELOC_OR1K_GOTPC_LO16, + BFD_RELOC_OR1K_GOT16, + BFD_RELOC_OR1K_GOT_PG21, + BFD_RELOC_OR1K_GOT_LO13, + BFD_RELOC_OR1K_PLT26, + BFD_RELOC_OR1K_PLTA26, + BFD_RELOC_OR1K_GOTOFF_SLO16, + BFD_RELOC_OR1K_COPY, + BFD_RELOC_OR1K_GLOB_DAT, + BFD_RELOC_OR1K_JMP_SLOT, + BFD_RELOC_OR1K_RELATIVE, + BFD_RELOC_OR1K_TLS_GD_HI16, + BFD_RELOC_OR1K_TLS_GD_LO16, + BFD_RELOC_OR1K_TLS_GD_PG21, + BFD_RELOC_OR1K_TLS_GD_LO13, + BFD_RELOC_OR1K_TLS_LDM_HI16, + BFD_RELOC_OR1K_TLS_LDM_LO16, + BFD_RELOC_OR1K_TLS_LDM_PG21, + BFD_RELOC_OR1K_TLS_LDM_LO13, + BFD_RELOC_OR1K_TLS_LDO_HI16, + BFD_RELOC_OR1K_TLS_LDO_LO16, + BFD_RELOC_OR1K_TLS_IE_HI16, + BFD_RELOC_OR1K_TLS_IE_AHI16, + BFD_RELOC_OR1K_TLS_IE_LO16, + BFD_RELOC_OR1K_TLS_IE_PG21, + BFD_RELOC_OR1K_TLS_IE_LO13, + BFD_RELOC_OR1K_TLS_LE_HI16, + BFD_RELOC_OR1K_TLS_LE_AHI16, + BFD_RELOC_OR1K_TLS_LE_LO16, + BFD_RELOC_OR1K_TLS_LE_SLO16, + BFD_RELOC_OR1K_TLS_TPOFF, + BFD_RELOC_OR1K_TLS_DTPOFF, + BFD_RELOC_OR1K_TLS_DTPMOD, /* H8 elf Relocations. */ BFD_RELOC_H8_DIR16A8, @@ -4817,6 +5028,7 @@ a matching LO8XG part. */ BFD_RELOC_H8_DIR24A8, BFD_RELOC_H8_DIR24R8, BFD_RELOC_H8_DIR32A16, + BFD_RELOC_H8_DISP32A16, /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, @@ -4865,6 +5077,110 @@ a matching LO8XG part. */ BFD_RELOC_MSP430_16_BYTE, BFD_RELOC_MSP430_2X_PCREL, BFD_RELOC_MSP430_RL_PCREL, + BFD_RELOC_MSP430_ABS8, + BFD_RELOC_MSP430X_PCR20_EXT_SRC, + BFD_RELOC_MSP430X_PCR20_EXT_DST, + BFD_RELOC_MSP430X_PCR20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_EXT_SRC, + BFD_RELOC_MSP430X_ABS20_EXT_DST, + BFD_RELOC_MSP430X_ABS20_EXT_ODST, + BFD_RELOC_MSP430X_ABS20_ADR_SRC, + BFD_RELOC_MSP430X_ABS20_ADR_DST, + BFD_RELOC_MSP430X_PCR16, + BFD_RELOC_MSP430X_PCR20_CALL, + BFD_RELOC_MSP430X_ABS16, + BFD_RELOC_MSP430_ABS_HI16, + BFD_RELOC_MSP430_PREL31, + BFD_RELOC_MSP430_SYM_DIFF, + +/* Relocations used by the Altera Nios II core. */ + BFD_RELOC_NIOS2_S16, + BFD_RELOC_NIOS2_U16, + BFD_RELOC_NIOS2_CALL26, + BFD_RELOC_NIOS2_IMM5, + BFD_RELOC_NIOS2_CACHE_OPX, + BFD_RELOC_NIOS2_IMM6, + BFD_RELOC_NIOS2_IMM8, + BFD_RELOC_NIOS2_HI16, + BFD_RELOC_NIOS2_LO16, + BFD_RELOC_NIOS2_HIADJ16, + BFD_RELOC_NIOS2_GPREL, + BFD_RELOC_NIOS2_UJMP, + BFD_RELOC_NIOS2_CJMP, + BFD_RELOC_NIOS2_CALLR, + BFD_RELOC_NIOS2_ALIGN, + BFD_RELOC_NIOS2_GOT16, + BFD_RELOC_NIOS2_CALL16, + BFD_RELOC_NIOS2_GOTOFF_LO, + BFD_RELOC_NIOS2_GOTOFF_HA, + BFD_RELOC_NIOS2_PCREL_LO, + BFD_RELOC_NIOS2_PCREL_HA, + BFD_RELOC_NIOS2_TLS_GD16, + BFD_RELOC_NIOS2_TLS_LDM16, + BFD_RELOC_NIOS2_TLS_LDO16, + BFD_RELOC_NIOS2_TLS_IE16, + BFD_RELOC_NIOS2_TLS_LE16, + BFD_RELOC_NIOS2_TLS_DTPMOD, + BFD_RELOC_NIOS2_TLS_DTPREL, + BFD_RELOC_NIOS2_TLS_TPREL, + BFD_RELOC_NIOS2_COPY, + BFD_RELOC_NIOS2_GLOB_DAT, + BFD_RELOC_NIOS2_JUMP_SLOT, + BFD_RELOC_NIOS2_RELATIVE, + BFD_RELOC_NIOS2_GOTOFF, + BFD_RELOC_NIOS2_CALL26_NOAT, + BFD_RELOC_NIOS2_GOT_LO, + BFD_RELOC_NIOS2_GOT_HA, + BFD_RELOC_NIOS2_CALL_LO, + BFD_RELOC_NIOS2_CALL_HA, + BFD_RELOC_NIOS2_R2_S12, + BFD_RELOC_NIOS2_R2_I10_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_1_PCREL, + BFD_RELOC_NIOS2_R2_T1I7_2, + BFD_RELOC_NIOS2_R2_T2I4, + BFD_RELOC_NIOS2_R2_T2I4_1, + BFD_RELOC_NIOS2_R2_T2I4_2, + BFD_RELOC_NIOS2_R2_X1I7_2, + BFD_RELOC_NIOS2_R2_X2L5, + BFD_RELOC_NIOS2_R2_F1I5_2, + BFD_RELOC_NIOS2_R2_L5I4X1, + BFD_RELOC_NIOS2_R2_T1X1I6, + BFD_RELOC_NIOS2_R2_T1X1I6_2, + +/* PRU LDI 16-bit unsigned data-memory relocation. */ + BFD_RELOC_PRU_U16, + +/* PRU LDI 16-bit unsigned instruction-memory relocation. */ + BFD_RELOC_PRU_U16_PMEMIMM, + +/* PRU relocation for two consecutive LDI load instructions that load a +32 bit value into a register. If the higher bits are all zero, then +the second instruction may be relaxed. */ + BFD_RELOC_PRU_LDI32, + +/* PRU QBBx 10-bit signed PC-relative relocation. */ + BFD_RELOC_PRU_S10_PCREL, + +/* PRU 8-bit unsigned relocation used for the LOOP instruction. */ + BFD_RELOC_PRU_U8_PCREL, + +/* PRU Program Memory relocations. Used to convert from byte addressing to +32-bit word addressing. */ + BFD_RELOC_PRU_32_PMEM, + BFD_RELOC_PRU_16_PMEM, + +/* PRU relocations to mark the difference of two local symbols. +These are only needed to support linker relaxation and can be ignored +when not relaxing. The field is set to the value of the difference +assuming no relaxation. The relocation encodes the position of the +second symbol so the linker can determine whether to adjust the field +value. The PMEM variants encode the word difference, instead of byte +difference between symbols. */ + BFD_RELOC_PRU_GNU_DIFF8, + BFD_RELOC_PRU_GNU_DIFF16, + BFD_RELOC_PRU_GNU_DIFF32, + BFD_RELOC_PRU_GNU_DIFF16_PMEM, + BFD_RELOC_PRU_GNU_DIFF32_PMEM, /* IQ2000 Relocations. */ BFD_RELOC_IQ2000_OFFSET_16, @@ -4962,6 +5278,24 @@ BFD_RELOC_XTENSA_ASM_EXPAND. */ /* 8 bit signed offset in (ix+d) or (iy+d). */ BFD_RELOC_Z80_DISP8, +/* First 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE0, + +/* Second 8 bits of multibyte (32, 24 or 16 bit) value. */ + BFD_RELOC_Z80_BYTE1, + +/* Third 8 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_BYTE2, + +/* Fourth 8 bits of multibyte (32 bit) value. */ + BFD_RELOC_Z80_BYTE3, + +/* Lowest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD0, + +/* Highest 16 bits of multibyte (32 or 24 bit) value. */ + BFD_RELOC_Z80_WORD1, + /* DJNZ offset. */ BFD_RELOC_Z8K_DISP7, @@ -4992,6 +5326,12 @@ BFD_RELOC_MACH_O_PAIR. */ /* Pair of relocation. Contains the first symbol. */ BFD_RELOC_MACH_O_PAIR, +/* Symbol will be substracted. Must be followed by a BFD_RELOC_32. */ + BFD_RELOC_MACH_O_SUBTRACTOR32, + +/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ + BFD_RELOC_MACH_O_SUBTRACTOR64, + /* PCREL relocations. They are marked as branch to create PLT entry if required. */ BFD_RELOC_MACH_O_X86_64_BRANCH32, @@ -5004,12 +5344,6 @@ required. */ the linker could optimize the movq to a leaq if possible. */ BFD_RELOC_MACH_O_X86_64_GOT_LOAD, -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32, - -/* Symbol will be substracted. Must be followed by a BFD_RELOC_64. */ - BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64, - /* Same as BFD_RELOC_32_PCREL but with an implicit -1 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_1, @@ -5019,52 +5353,67 @@ the linker could optimize the movq to a leaq if possible. */ /* Same as BFD_RELOC_32_PCREL but with an implicit -4 addend. */ BFD_RELOC_MACH_O_X86_64_PCREL32_4, -/* This is a 32 bit reloc for the microblaze that stores the +/* Used when referencing a TLV entry. */ + BFD_RELOC_MACH_O_X86_64_TLV, + +/* Addend for PAGE or PAGEOFF. */ + BFD_RELOC_MACH_O_ARM64_ADDEND, + +/* Relative offset to page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21, + +/* Relative offset within page of GOT slot. */ + BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12, + +/* Address of a GOT entry. */ + BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT, + +/* This is a 32 bit reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO, -/* This is a 32 bit pc-relative reloc for the microblaze that +/* This is a 32 bit pc-relative reloc for the microblaze that stores the low 16 bits of a value */ BFD_RELOC_MICROBLAZE_32_LO_PCREL, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-only small data area anchor */ BFD_RELOC_MICROBLAZE_32_ROSDA, -/* This is a 32 bit reloc for the microblaze that stores a +/* This is a 32 bit reloc for the microblaze that stores a value relative to the read-write small data area anchor */ BFD_RELOC_MICROBLAZE_32_RWSDA, -/* This is a 32 bit reloc for the microblaze to handle +/* This is a 32 bit reloc for the microblaze to handle expressions of the form "Symbol Op Symbol" */ BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, -/* This is a 64 bit reloc that stores the 32 bit pc relative -value in two words (with an imm instruction). No relocation is +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). No relocation is done here - only used for relaxing */ BFD_RELOC_MICROBLAZE_64_NONE, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative GOT offset */ BFD_RELOC_MICROBLAZE_64_GOTPC, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is GOT offset */ BFD_RELOC_MICROBLAZE_64_GOT, -/* This is a 64 bit reloc that stores the 32 bit pc relative +/* This is a 64 bit reloc that stores the 32 bit pc relative value in two words (with an imm instruction). The relocation is PC-relative offset into PLT */ BFD_RELOC_MICROBLAZE_64_PLT, -/* This is a 64 bit reloc that stores the 32 bit GOT relative +/* This is a 64 bit reloc that stores the 32 bit GOT relative value in two words (with an imm instruction). The relocation is relative offset from _GLOBAL_OFFSET_TABLE_ */ BFD_RELOC_MICROBLAZE_64_GOTOFF, -/* This is a 32 bit reloc that stores the 32 bit GOT relative +/* This is a 32 bit reloc that stores the 32 bit GOT relative value in a word. The relocation is relative offset from */ BFD_RELOC_MICROBLAZE_32_GOTOFF, @@ -5072,14 +5421,152 @@ value in a word. The relocation is relative offset from */ the dynamic object into the runtime process image. */ BFD_RELOC_MICROBLAZE_COPY, -/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. -Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_ADD_LO12, +/* Unused Reloc */ + BFD_RELOC_MICROBLAZE_64_TLS, -/* Get to the page base of the global offset table entry for a symbol as -part of an ADRP instruction using a 21 bit PC relative value.Used in -conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ - BFD_RELOC_AARCH64_ADR_GOT_PAGE, +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS GD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSGD, + +/* This is a 64 bit reloc that stores the 32 bit GOT relative value +of the GOT TLS LD info entry in two words (with an imm instruction). The +relocation is GOT offset. */ + BFD_RELOC_MICROBLAZE_64_TLSLD, + +/* This is a 32 bit reloc that stores the Module ID to GOT(n). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPMOD, + +/* This is a 32 bit reloc that stores TLS offset to GOT(n+1). */ + BFD_RELOC_MICROBLAZE_32_TLSDTPREL, + +/* This is a 32 bit reloc for storing TLS offset to two words (uses imm +instruction) */ + BFD_RELOC_MICROBLAZE_64_TLSDTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSGOTTPREL, + +/* This is a 64 bit reloc that stores 32-bit thread pointer relative offset +to two words (uses imm instruction). */ + BFD_RELOC_MICROBLAZE_64_TLSTPREL, + +/* This is a 64 bit reloc that stores the 32 bit pc relative +value in two words (with an imm instruction). The relocation is +PC-relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTPCREL, + +/* This is a 64 bit reloc that stores the 32 bit offset +value in two words (with an imm instruction). The relocation is +relative offset from start of TEXT. */ + BFD_RELOC_MICROBLAZE_64_TEXTREL, + +/* AArch64 pseudo relocation code to mark the start of the AArch64 +relocation enumerators. N.B. the order of the enumerators is +important as several tables in the AArch64 bfd backend are indexed +by these enumerators; make sure they are all synced. */ + BFD_RELOC_AARCH64_RELOC_START, + +/* Deprecated AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NULL, + +/* AArch64 null relocation code. */ + BFD_RELOC_AARCH64_NONE, + +/* Basic absolute relocations of N bits. These are equivalent to +BFD_RELOC_N and they were added to assist the indexing of the howto +table. */ + BFD_RELOC_AARCH64_64, + BFD_RELOC_AARCH64_32, + BFD_RELOC_AARCH64_16, + +/* PC-relative relocations. These are equivalent to BFD_RELOC_N_PCREL +and they were added to assist the indexing of the howto table. */ + BFD_RELOC_AARCH64_64_PCREL, + BFD_RELOC_AARCH64_32_PCREL, + BFD_RELOC_AARCH64_16_PCREL, + +/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G0, + +/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of +an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G0_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G1, + +/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G1_NC, + +/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 +of an unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G2, + +/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 +of an address/value. No overflow checking. */ + BFD_RELOC_AARCH64_MOVW_G2_NC, + +/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 +of a signed or unsigned address/value. */ + BFD_RELOC_AARCH64_MOVW_G3, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G0_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G1_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_G2_S, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + +/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word +offset. The lowest two bits must be zero and are not stored in the +instruction, giving a 21 bit signed byte offset. */ + BFD_RELOC_AARCH64_LD_LO19_PCREL, + +/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ + BFD_RELOC_AARCH64_ADR_LO21_PCREL, /* AArch64 ADRP instruction, with bits 12 to 32 of a pc-relative page offset, giving a 4KB aligned page base address. */ @@ -5090,45 +5577,33 @@ offset, giving a 4KB aligned page base address, but with no overflow checking. */ BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL, -/* AArch64 ADR instruction, holding a simple 21 bit pc-relative byte offset. */ - BFD_RELOC_AARCH64_ADR_LO21_PCREL, +/* AArch64 ADD immediate instruction, holding bits 0 to 11 of the address. +Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_ADD_LO12, + +/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST8_LO12, + +/* AArch64 14 bit pc-relative test bit and branch. +The lowest two bits must be zero and are not stored in the instruction, +giving a 16 bit signed byte offset. */ + BFD_RELOC_AARCH64_TSTBR14, /* AArch64 19 bit pc-relative conditional branch and compare & branch. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ BFD_RELOC_AARCH64_BRANCH19, -/* AArch64 26 bit pc-relative unconditional branch and link. -The lowest two bits must be zero and are not stored in the instruction, -giving a 28 bit signed byte offset. */ - BFD_RELOC_AARCH64_CALL26, - -/* AArch64 pseudo relocation code to be used internally by the AArch64 -assembler and not (currently) written to any object files. */ - BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, - /* AArch64 26 bit pc-relative unconditional branch. The lowest two bits must be zero and are not stored in the instruction, giving a 28 bit signed byte offset. */ BFD_RELOC_AARCH64_JUMP26, -/* AArch64 Load Literal instruction, holding a 19 bit pc-relative word -offset. The lowest two bits must be zero and are not stored in the -instruction, giving a 21 bit signed byte offset. */ - BFD_RELOC_AARCH64_LD_LO19_PCREL, - -/* Unsigned 12 bit byte offset for 64 bit load/store from the page of -the GOT entry for this symbol. Used in conjunction with -BFD_RELOC_AARCH64_ADR_GOTPAGE. */ - BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, - -/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST_LO12, - -/* AArch64 8-bit load/store instruction, holding bits 0 to 11 of the -address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ - BFD_RELOC_AARCH64_LDST8_LO12, +/* AArch64 26 bit pc-relative unconditional branch and link. +The lowest two bits must be zero and are not stored in the instruction, +giving a 28 bit signed byte offset. */ + BFD_RELOC_AARCH64_CALL26, /* AArch64 16-bit load/store instruction, holding bits 0 to 11 of the address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ @@ -5146,86 +5621,45 @@ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ BFD_RELOC_AARCH64_LDST128_LO12, -/* AArch64 MOV[NZK] instruction with most significant bits 0 to 15 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G0, +/* AArch64 Load Literal instruction, holding a 19 bit PC relative word +offset of the global offset table entry for a symbol. The lowest two +bits must be zero and are not stored in the instruction, giving a 21 +bit signed byte offset. This relocation type requires signed overflow +checking. */ + BFD_RELOC_AARCH64_GOT_LD_PREL19, -/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G0_S, +/* Get to the page base of the global offset table entry for a symbol as +part of an ADRP instruction using a 21 bit PC relative value.Used in +conjunction with BFD_RELOC_AARCH64_LD64_GOT_LO12_NC. */ + BFD_RELOC_AARCH64_ADR_GOT_PAGE, -/* AArch64 MOV[NZK] instruction with less significant bits 0 to 15 of -an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G0_NC, +/* Unsigned 12 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with most significant bits 16 to 31 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G1, +/* Unsigned 12 bit byte offset for 32 bit load/store from the page of +the GOT entry for this symbol. Used in conjunction with +BFD_RELOC_AARCH64_ADR_GOT_PAGE. Valid in ILP32 ABI only. */ + BFD_RELOC_AARCH64_LD32_GOT_LO12_NC, -/* AArch64 MOV[NZK] instruction with less significant bits 16 to 31 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G1_NC, +/* Unsigned 16 bit byte offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC, -/* AArch64 MOV[NZ] instruction with most significant bits 16 to 31 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G1_S, +/* Unsigned 16 bit byte higher offset for 64 bit load/store from the GOT entry +for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_MOVW_GOTOFF_G1, -/* AArch64 MOV[NZK] instruction with most significant bits 32 to 47 -of an unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G2, +/* Unsigned 15 bit byte offset for 64 bit load/store from the page of +the GOT entry for this symbol. Valid in LP64 ABI only. */ + BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, -/* AArch64 MOV[NZK] instruction with less significant bits 32 to 47 -of an address/value. No overflow checking. */ - BFD_RELOC_AARCH64_MOVW_G2_NC, +/* Scaled 14 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14, -/* AArch64 MOV[NZ] instruction with most significant bits 32 to 47 -of a signed value. Changes instruction to MOVZ or MOVN depending on the -value's sign. */ - BFD_RELOC_AARCH64_MOVW_G2_S, - -/* AArch64 MOV[NZK] instruction with most signficant bits 48 to 64 -of a signed or unsigned address/value. */ - BFD_RELOC_AARCH64_MOVW_G3, - -/* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLSDESC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_CALL, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_LDR, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, - -/* AArch64 TLS DESC relocation. */ - BFD_RELOC_AARCH64_TLSDESC_OFF_G1, - -/* Unsigned 12 bit byte offset to global offset table entry for a symbols -tls_index structure. Used in conjunction with -BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ - BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, +/* Scaled 15 bit byte offset to the page base of the global offset table. */ + BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15, /* Get to the page base of the global offset table entry for a symbols tls_index structure as part of an adrp instruction using a 21 bit PC @@ -5233,14 +5667,31 @@ relative value. Used in conjunction with BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21, +/* AArch64 TLS General Dynamic */ + BFD_RELOC_AARCH64_TLSGD_ADR_PREL21, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC, + +/* AArch64 TLS General Dynamic relocation. */ + BFD_RELOC_AARCH64_TLSGD_MOVW_G1, + /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, + BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, /* AArch64 TLS INITIAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC, + BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC, + +/* AArch64 TLS INITIAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19, /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC, @@ -5248,6 +5699,85 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS INITIAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1, +/* bit[23:12] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, + +/* Unsigned 12 bit byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12. */ + BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC, + +/* Unsigned 12 bit byte offset to global offset table entry for a symbols +tls_index structure. Used in conjunction with +BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21. */ + BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC, + +/* GOT entry page address for AArch64 TLS Local Dynamic, used with ADRP +instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21, + +/* GOT entry address for AArch64 TLS Local Dynamic, used with ADR instruction. */ + BFD_RELOC_AARCH64_TLSLD_ADR_PREL21, + +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC, + +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC, + +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC, + +/* bit[15:0] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, + +/* bit[31:16] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, + +/* No overflow check version of BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1 */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, + +/* bit[47:32] of byte offset to module TLS base address. */ + BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, + +/* AArch64 TLS LOCAL EXEC relocation. */ + BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, + /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12, @@ -5257,34 +5787,136 @@ BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC. */ /* AArch64 TLS LOCAL EXEC relocation. */ BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0, +/* bit[11:1] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1, +/* bit[11:2] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC, +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC, -/* AArch64 TLS LOCAL EXEC relocation. */ - BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2, +/* bit[11:3] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC, + +/* bit[11:0] of byte offset to module TLS base address, encoded in ldst +instructions. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD_PREL19, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD64_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD_LO12, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G1, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_LDR, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_ADD, + +/* AArch64 TLS DESC relocation. */ + BFD_RELOC_AARCH64_TLSDESC_CALL, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPMOD64, + BFD_RELOC_AARCH64_COPY, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_DTPREL64, + BFD_RELOC_AARCH64_GLOB_DAT, /* AArch64 TLS relocation. */ - BFD_RELOC_AARCH64_TLS_TPREL64, + BFD_RELOC_AARCH64_JUMP_SLOT, -/* AArch64 14 bit pc-relative test bit and branch. -The lowest two bits must be zero and are not stored in the instruction, -giving a 16 bit signed byte offset. */ - BFD_RELOC_AARCH64_TSTBR14, +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_RELATIVE, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPMOD, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_DTPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLS_TPREL, + +/* AArch64 TLS relocation. */ + BFD_RELOC_AARCH64_TLSDESC, + +/* AArch64 support for STT_GNU_IFUNC. */ + BFD_RELOC_AARCH64_IRELATIVE, + +/* AArch64 pseudo relocation code to mark the end of the AArch64 +relocation enumerators that have direct mapping to ELF reloc codes. +There are a few more enumerators after this one; those are mainly +used by the AArch64 assembler for the internal fixup or to select +one of the above enumerators. */ + BFD_RELOC_AARCH64_RELOC_END, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_GAS_INTERNAL_FIXUP, + +/* AArch64 unspecified load/store instruction, holding bits 0 to 11 of the +address. Used in conjunction with BFD_RELOC_AARCH64_ADR_HI21_PCREL. */ + BFD_RELOC_AARCH64_LDST_LO12, + +/* AArch64 pseudo relocation code for TLS local dynamic mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLD_LDST_DTPREL_LO12_NC, + +/* AArch64 pseudo relocation code for TLS local exec mode. It's to be +used internally by the AArch64 assembler and not (currently) written to +any object files. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, + +/* Similar as BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12, but no overflow check. */ + BFD_RELOC_AARCH64_TLSLE_LDST_TPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_LD_GOT_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_LO12_NC, + +/* AArch64 pseudo relocation code to be used internally by the AArch64 +assembler and not (currently) written to any object files. */ + BFD_RELOC_AARCH64_TLSDESC_LD_LO12_NC, /* Tilera TILEPro Relocations. */ BFD_RELOC_TILEPRO_COPY, @@ -5425,10 +6057,18 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_GOT, BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_GOT, + BFD_RELOC_TILEGX_IMM16_X0_HW3_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW3_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_LE, @@ -5443,6 +6083,12 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_TLS_GD, BFD_RELOC_TILEGX_IMM16_X0_HW0_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_TLS_IE, + BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL, + BFD_RELOC_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL, BFD_RELOC_TILEGX_IMM16_X0_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X1_HW0_LAST_TLS_IE, BFD_RELOC_TILEGX_IMM16_X0_HW1_LAST_TLS_IE, @@ -5464,6 +6110,13 @@ giving a 16 bit signed byte offset. */ BFD_RELOC_TILEGX_IMM8_Y0_TLS_ADD, BFD_RELOC_TILEGX_IMM8_Y1_TLS_ADD, +/* Linux eBPF relocations. */ + BFD_RELOC_BPF_64, + BFD_RELOC_BPF_32, + BFD_RELOC_BPF_16, + BFD_RELOC_BPF_DISP16, + BFD_RELOC_BPF_DISP32, + /* Adapteva EPIPHANY - 8 bit signed pc-relative displacement */ BFD_RELOC_EPIPHANY_SIMM8, @@ -5484,7 +6137,99 @@ giving a 16 bit signed byte offset. */ /* Adapteva EPIPHANY - 8 bit immediate for 16 bit mov instruction. */ BFD_RELOC_EPIPHANY_IMM8, + +/* Visium Relocations. */ + BFD_RELOC_VISIUM_HI16, + BFD_RELOC_VISIUM_LO16, + BFD_RELOC_VISIUM_IM16, + BFD_RELOC_VISIUM_REL16, + BFD_RELOC_VISIUM_HI16_PCREL, + BFD_RELOC_VISIUM_LO16_PCREL, + BFD_RELOC_VISIUM_IM16_PCREL, + +/* WebAssembly relocations. */ + BFD_RELOC_WASM32_LEB128, + BFD_RELOC_WASM32_LEB128_GOT, + BFD_RELOC_WASM32_LEB128_GOT_CODE, + BFD_RELOC_WASM32_LEB128_PLT, + BFD_RELOC_WASM32_PLT_INDEX, + BFD_RELOC_WASM32_ABS32_CODE, + BFD_RELOC_WASM32_COPY, + BFD_RELOC_WASM32_CODE_POINTER, + BFD_RELOC_WASM32_INDEX, + BFD_RELOC_WASM32_PLT_SIG, + +/* C-SKY relocations. */ + BFD_RELOC_CKCORE_NONE, + BFD_RELOC_CKCORE_ADDR32, + BFD_RELOC_CKCORE_PCREL_IMM8BY4, + BFD_RELOC_CKCORE_PCREL_IMM11BY2, + BFD_RELOC_CKCORE_PCREL_IMM4BY2, + BFD_RELOC_CKCORE_PCREL32, + BFD_RELOC_CKCORE_PCREL_JSR_IMM11BY2, + BFD_RELOC_CKCORE_GNU_VTINHERIT, + BFD_RELOC_CKCORE_GNU_VTENTRY, + BFD_RELOC_CKCORE_RELATIVE, + BFD_RELOC_CKCORE_COPY, + BFD_RELOC_CKCORE_GLOB_DAT, + BFD_RELOC_CKCORE_JUMP_SLOT, + BFD_RELOC_CKCORE_GOTOFF, + BFD_RELOC_CKCORE_GOTPC, + BFD_RELOC_CKCORE_GOT32, + BFD_RELOC_CKCORE_PLT32, + BFD_RELOC_CKCORE_ADDRGOT, + BFD_RELOC_CKCORE_ADDRPLT, + BFD_RELOC_CKCORE_PCREL_IMM26BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY2, + BFD_RELOC_CKCORE_PCREL_IMM16BY4, + BFD_RELOC_CKCORE_PCREL_IMM10BY2, + BFD_RELOC_CKCORE_PCREL_IMM10BY4, + BFD_RELOC_CKCORE_ADDR_HI16, + BFD_RELOC_CKCORE_ADDR_LO16, + BFD_RELOC_CKCORE_GOTPC_HI16, + BFD_RELOC_CKCORE_GOTPC_LO16, + BFD_RELOC_CKCORE_GOTOFF_HI16, + BFD_RELOC_CKCORE_GOTOFF_LO16, + BFD_RELOC_CKCORE_GOT12, + BFD_RELOC_CKCORE_GOT_HI16, + BFD_RELOC_CKCORE_GOT_LO16, + BFD_RELOC_CKCORE_PLT12, + BFD_RELOC_CKCORE_PLT_HI16, + BFD_RELOC_CKCORE_PLT_LO16, + BFD_RELOC_CKCORE_ADDRGOT_HI16, + BFD_RELOC_CKCORE_ADDRGOT_LO16, + BFD_RELOC_CKCORE_ADDRPLT_HI16, + BFD_RELOC_CKCORE_ADDRPLT_LO16, + BFD_RELOC_CKCORE_PCREL_JSR_IMM26BY2, + BFD_RELOC_CKCORE_TOFFSET_LO16, + BFD_RELOC_CKCORE_DOFFSET_LO16, + BFD_RELOC_CKCORE_PCREL_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY2, + BFD_RELOC_CKCORE_DOFFSET_IMM18BY4, + BFD_RELOC_CKCORE_GOTOFF_IMM18, + BFD_RELOC_CKCORE_GOT_IMM18BY4, + BFD_RELOC_CKCORE_PLT_IMM18BY4, + BFD_RELOC_CKCORE_PCREL_IMM7BY4, + BFD_RELOC_CKCORE_TLS_LE32, + BFD_RELOC_CKCORE_TLS_IE32, + BFD_RELOC_CKCORE_TLS_GD32, + BFD_RELOC_CKCORE_TLS_LDM32, + BFD_RELOC_CKCORE_TLS_LDO32, + BFD_RELOC_CKCORE_TLS_DTPMOD32, + BFD_RELOC_CKCORE_TLS_DTPOFF32, + BFD_RELOC_CKCORE_TLS_TPOFF32, + BFD_RELOC_CKCORE_PCREL_FLRW_IMM8BY4, + BFD_RELOC_CKCORE_NOJSRI, + BFD_RELOC_CKCORE_CALLGRAPH, + BFD_RELOC_CKCORE_IRELATIVE, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM4BY4, + BFD_RELOC_CKCORE_PCREL_BLOOP_IMM12BY4, + +/* S12Z relocations. */ + BFD_RELOC_S12Z_OPR, BFD_RELOC_UNUSED }; + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; reloc_howto_type *bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); @@ -5518,97 +6263,98 @@ typedef struct bfd_symbol symvalue value; /* Attributes of a symbol. */ -#define BSF_NO_FLAGS 0x00 +#define BSF_NO_FLAGS 0 /* The symbol has local scope; <> in <>. The value is the offset into the section of the data. */ -#define BSF_LOCAL (1 << 0) +#define BSF_LOCAL (1 << 0) /* The symbol has global scope; initialized data in <>. The value is the offset into the section of the data. */ -#define BSF_GLOBAL (1 << 1) +#define BSF_GLOBAL (1 << 1) /* The symbol has global scope and is exported. The value is the offset into the section of the data. */ -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */ /* A normal C symbol would be one of: - <>, <>, <> or - <>. */ + <>, <> or <>. */ /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ -#define BSF_DEBUGGING (1 << 2) +#define BSF_DEBUGGING (1 << 2) /* The symbol denotes a function entry point. Used in ELF, perhaps others someday. */ -#define BSF_FUNCTION (1 << 3) +#define BSF_FUNCTION (1 << 3) /* Used by the linker. */ -#define BSF_KEEP (1 << 5) -#define BSF_KEEP_G (1 << 6) +#define BSF_KEEP (1 << 5) + + /* An ELF common symbol. */ +#define BSF_ELF_COMMON (1 << 6) /* A weak global symbol, overridable without warnings by a regular global symbol of the same name. */ -#define BSF_WEAK (1 << 7) +#define BSF_WEAK (1 << 7) /* This symbol was created to point to a section, e.g. ELF's STT_SECTION symbols. */ -#define BSF_SECTION_SYM (1 << 8) +#define BSF_SECTION_SYM (1 << 8) /* The symbol used to be a common symbol, but now it is allocated. */ -#define BSF_OLD_COMMON (1 << 9) +#define BSF_OLD_COMMON (1 << 9) /* In some files the type of a symbol sometimes alters its location in an output file - ie in coff a <> symbol which is also <> symbol appears where it was declared and not at the end of a section. This bit is set by the target BFD part to convey this information. */ -#define BSF_NOT_AT_END (1 << 10) +#define BSF_NOT_AT_END (1 << 10) /* Signal that the symbol is the label of constructor section. */ -#define BSF_CONSTRUCTOR (1 << 11) +#define BSF_CONSTRUCTOR (1 << 11) /* Signal that the symbol is a warning symbol. The name is a warning. The name of the next symbol is the one to warn about; if a reference is made to a symbol with the same name as the next symbol, a warning is issued by the linker. */ -#define BSF_WARNING (1 << 12) +#define BSF_WARNING (1 << 12) /* Signal that the symbol is indirect. This symbol is an indirect pointer to the symbol with the same name as the next symbol. */ -#define BSF_INDIRECT (1 << 13) +#define BSF_INDIRECT (1 << 13) /* BSF_FILE marks symbols that contain a file name. This is used for ELF STT_FILE symbols. */ -#define BSF_FILE (1 << 14) +#define BSF_FILE (1 << 14) /* Symbol is from dynamic linking information. */ -#define BSF_DYNAMIC (1 << 15) +#define BSF_DYNAMIC (1 << 15) /* The symbol denotes a data object. Used in ELF, and perhaps others someday. */ -#define BSF_OBJECT (1 << 16) +#define BSF_OBJECT (1 << 16) /* This symbol is a debugging symbol. The value is the offset into the section of the data. BSF_DEBUGGING should be set as well. */ -#define BSF_DEBUGGING_RELOC (1 << 17) +#define BSF_DEBUGGING_RELOC (1 << 17) /* This symbol is thread local. Used in ELF. */ -#define BSF_THREAD_LOCAL (1 << 18) +#define BSF_THREAD_LOCAL (1 << 18) /* This symbol represents a complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_RELC (1 << 19) +#define BSF_RELC (1 << 19) /* This symbol represents a signed complex relocation expression, with the expression tree serialized in the symbol name. */ -#define BSF_SRELC (1 << 20) +#define BSF_SRELC (1 << 20) /* This symbol was created by bfd_get_synthetic_symtab. */ -#define BSF_SYNTHETIC (1 << 21) +#define BSF_SYNTHETIC (1 << 21) /* This symbol is an indirect code object. Unrelated to BSF_INDIRECT. The dynamic linker will compute the value of this symbol by @@ -5618,7 +6364,7 @@ typedef struct bfd_symbol /* This symbol is a globally unique data object. The dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. BSF_OBJECT must also be set. */ -#define BSF_GNU_UNIQUE (1 << 23) +#define BSF_GNU_UNIQUE (1 << 23) flagword flags; @@ -5638,22 +6384,22 @@ typedef struct bfd_symbol asymbol; #define bfd_get_symtab_upper_bound(abfd) \ - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym); #define bfd_is_target_special_symbol(abfd, sym) \ - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) bfd_boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); @@ -5661,12 +6407,12 @@ bfd_boolean bfd_set_symtab void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) int bfd_decode_symclass (asymbol *symbol); @@ -5678,10 +6424,11 @@ bfd_boolean bfd_copy_private_symbol_data (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ + enum bfd_direction { no_direction = 0, @@ -5690,11 +6437,21 @@ enum bfd_direction both_direction = 3 }; +enum bfd_plugin_format + { + bfd_plugin_unknown = 0, + bfd_plugin_yes = 1, + bfd_plugin_no = 2 + }; + +struct bfd_build_id + { + bfd_size_type size; + bfd_byte data[1]; + }; + struct bfd { - /* A unique identifier of the BFD */ - unsigned int id; - /* The filename the application opened the BFD with. */ const char *filename; @@ -5710,21 +6467,22 @@ struct bfd least-recently-used list of BFDs. */ struct bfd *lru_prev, *lru_next; - /* When a file is closed by the caching routines, BFD retains - state information on the file here... */ + /* Track current file position (or current buffer offset for + in-memory BFDs). When a file is closed by the caching routines, + BFD retains state information on the file here. */ ufile_ptr where; /* File modified time, if mtime_set is TRUE. */ long mtime; - /* Reserved for an unimplemented file locking extension. */ - int ifd; + /* A unique identifier of the BFD */ + unsigned int id; /* The format which belongs to the BFD. (object, core, etc.) */ - bfd_format format; + ENUM_BITFIELD (bfd_format) format : 3; /* The direction with which the BFD was opened. */ - enum bfd_direction direction; + ENUM_BITFIELD (bfd_direction) direction : 2; /* Format_specific flags. */ flagword flags; @@ -5736,90 +6494,153 @@ struct bfd the object_flags values have mostly just been copied from backend to another, and are not necessarily correct). */ -#define BFD_NO_FLAGS 0x00 +#define BFD_NO_FLAGS 0x0 /* BFD contains relocation entries. */ -#define HAS_RELOC 0x01 +#define HAS_RELOC 0x1 /* BFD is directly executable. */ -#define EXEC_P 0x02 +#define EXEC_P 0x2 /* BFD has line number information (basically used for F_LNNO in a COFF header). */ -#define HAS_LINENO 0x04 +#define HAS_LINENO 0x4 /* BFD has debugging information. */ -#define HAS_DEBUG 0x08 +#define HAS_DEBUG 0x08 /* BFD has symbols. */ -#define HAS_SYMS 0x10 +#define HAS_SYMS 0x10 /* BFD has local symbols (basically used for F_LSYMS in a COFF header). */ -#define HAS_LOCALS 0x20 +#define HAS_LOCALS 0x20 /* BFD is a dynamic object. */ -#define DYNAMIC 0x40 +#define DYNAMIC 0x40 /* Text section is write protected (if D_PAGED is not set, this is like an a.out NMAGIC file) (the linker sets this by default, but clears it for -r or -N). */ -#define WP_TEXT 0x80 +#define WP_TEXT 0x80 /* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the linker sets this by default, but clears it for -r or -n or -N). */ -#define D_PAGED 0x100 +#define D_PAGED 0x100 /* BFD is relaxable (this means that bfd_relax_section may be able to do something) (sometimes bfd_relax_section can do something even if this is not set). */ -#define BFD_IS_RELAXABLE 0x200 +#define BFD_IS_RELAXABLE 0x200 /* This may be set before writing out a BFD to request using a traditional format. For example, this is used to request that when writing out an a.out object the symbols not be hashed to eliminate duplicates. */ -#define BFD_TRADITIONAL_FORMAT 0x400 +#define BFD_TRADITIONAL_FORMAT 0x400 /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ -#define BFD_IN_MEMORY 0x800 - - /* The sections in this BFD specify a memory page. */ -#define HAS_LOAD_PAGE 0x1000 +#define BFD_IN_MEMORY 0x800 /* This BFD has been created by the linker and doesn't correspond to any input file. */ -#define BFD_LINKER_CREATED 0x2000 - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that - will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 - +#define BFD_LINKER_CREATED 0x1000 /* This may be set before writing out a BFD to request that it be written using values for UIDs, GIDs, timestamps, etc. that will be consistent from run to run. */ -#define BFD_DETERMINISTIC_OUTPUT 0x4000 +#define BFD_DETERMINISTIC_OUTPUT 0x2000 /* Compress sections in this BFD. */ -#define BFD_COMPRESS 0x8000 +#define BFD_COMPRESS 0x4000 /* Decompress sections in this BFD. */ -#define BFD_DECOMPRESS 0x10000 +#define BFD_DECOMPRESS 0x8000 /* BFD is a dummy, for plugins. */ -#define BFD_PLUGIN 0x20000 +#define BFD_PLUGIN 0x10000 + + /* Compress sections in this BFD with SHF_COMPRESSED from gABI. */ +#define BFD_COMPRESS_GABI 0x20000 + + /* Convert ELF common symbol type to STT_COMMON or STT_OBJECT in this + BFD. */ +#define BFD_CONVERT_ELF_COMMON 0x40000 + + /* Use the ELF STT_COMMON type in this BFD. */ +#define BFD_USE_ELF_STT_COMMON 0x80000 + + /* Put pathnames into archives (non-POSIX). */ +#define BFD_ARCHIVE_FULL_PATH 0x100000 /* Flags bits to be saved in bfd_preserve_save. */ #define BFD_FLAGS_SAVED \ - (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_PLUGIN) + (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ + | BFD_PLUGIN | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON \ + | BFD_USE_ELF_STT_COMMON) /* Flags bits which are for BFD use only. */ #define BFD_FLAGS_FOR_BFD_USE_MASK \ (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \ - | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT) + | BFD_PLUGIN | BFD_TRADITIONAL_FORMAT | BFD_DETERMINISTIC_OUTPUT \ + | BFD_COMPRESS_GABI | BFD_CONVERT_ELF_COMMON | BFD_USE_ELF_STT_COMMON) + + /* Is the file descriptor being cached? That is, can it be closed as + needed, and re-opened when accessed later? */ + unsigned int cacheable : 1; + + /* Marks whether there was a default target specified when the + BFD was opened. This is used to select which matching algorithm + to use to choose the back end. */ + unsigned int target_defaulted : 1; + + /* ... and here: (``once'' means at least once). */ + unsigned int opened_once : 1; + + /* Set if we have a locally maintained mtime value, rather than + getting it from the file each time. */ + unsigned int mtime_set : 1; + + /* Flag set if symbols from this BFD should not be exported. */ + unsigned int no_export : 1; + + /* Remember when output has begun, to stop strange things + from happening. */ + unsigned int output_has_begun : 1; + + /* Have archive map. */ + unsigned int has_armap : 1; + + /* Set if this is a thin archive. */ + unsigned int is_thin_archive : 1; + + /* Set if this archive should not cache element positions. */ + unsigned int no_element_cache : 1; + + /* Set if only required symbols should be added in the link hash table for + this object. Used by VMS linkers. */ + unsigned int selective_search : 1; + + /* Set if this is the linker output BFD. */ + unsigned int is_linker_output : 1; + + /* Set if this is the linker input BFD. */ + unsigned int is_linker_input : 1; + + /* If this is an input for a compiler plug-in library. */ + ENUM_BITFIELD (bfd_plugin_format) plugin_format : 2; + + /* Set if this is a plugin output file. */ + unsigned int lto_output : 1; + + /* Set if this is a slim LTO object not loaded with a compiler plugin. */ + unsigned int lto_slim_object : 1; + + /* Set to dummy BFD created when claimed by a compiler plug-in + library. */ + bfd *plugin_dummy_bfd; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of @@ -5845,17 +6666,21 @@ struct bfd /* The number of sections. */ unsigned int section_count; + /* A field used by _bfd_generic_link_add_archive_symbols. This will + be used only for archive elements. */ + int archive_pass; + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; - /* Used for input and output. */ - unsigned int symcount; - /* Symbol table for output BFD (with symcount entries). Also used by the linker to cache input BFD symbols. */ struct bfd_symbol **outsymbols; + /* Used for input and output. */ + unsigned int symcount; + /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -5870,33 +6695,27 @@ struct bfd struct bfd *nested_archives; /* List of nested archive in a flattened thin archive. */ - /* A chain of BFD structures involved in a link. */ - struct bfd *link_next; - - /* A field used by _bfd_generic_link_add_archive_symbols. This will - be used only for archive elements. */ - int archive_pass; + union { + /* For input BFDs, a chain of BFDs involved in a link. */ + struct bfd *next; + /* For output BFD, the linker hash table. */ + struct bfd_link_hash_table *hash; + } link; /* Used by the back end to hold private data. */ union { struct aout_data_struct *aout_data; struct artdata *aout_ar_data; - struct _oasys_data *oasys_obj_data; - struct _oasys_ar_data *oasys_ar_data; struct coff_tdata *coff_obj_data; struct pe_tdata *pe_obj_data; struct xcoff_tdata *xcoff_obj_data; struct ecoff_tdata *ecoff_obj_data; - struct ieee_data_struct *ieee_data; - struct ieee_ar_data_struct *ieee_ar_data; struct srec_data_struct *srec_data; struct verilog_data_struct *verilog_data; struct ihex_data_struct *ihex_data; struct tekhex_data_struct *tekhex_data; struct elf_obj_tdata *elf_obj_data; - struct nlm_obj_tdata *nlm_obj_data; - struct bout_data_struct *bout_data; struct mmo_data_struct *mmo_data; struct sun_core_struct *sun_core_data; struct sco5_core_struct *sco5_core_data; @@ -5928,40 +6747,233 @@ struct bfd of objalloc.h. */ void *memory; - /* Is the file descriptor being cached? That is, can it be closed as - needed, and re-opened when accessed later? */ - unsigned int cacheable : 1; - - /* Marks whether there was a default target specified when the - BFD was opened. This is used to select which matching algorithm - to use to choose the back end. */ - unsigned int target_defaulted : 1; - - /* ... and here: (``once'' means at least once). */ - unsigned int opened_once : 1; - - /* Set if we have a locally maintained mtime value, rather than - getting it from the file each time. */ - unsigned int mtime_set : 1; - - /* Flag set if symbols from this BFD should not be exported. */ - unsigned int no_export : 1; - - /* Remember when output has begun, to stop strange things - from happening. */ - unsigned int output_has_begun : 1; - - /* Have archive map. */ - unsigned int has_armap : 1; - - /* Set if this is a thin archive. */ - unsigned int is_thin_archive : 1; - - /* Set if only required symbols should be added in the link hash table for - this object. Used by VMS linkers. */ - unsigned int selective_search : 1; + /* For input BFDs, the build ID, if the object has one. */ + const struct bfd_build_id *build_id; }; +static inline const char * +bfd_get_filename (const bfd *abfd) +{ + return abfd->filename; +} + +static inline bfd_boolean +bfd_get_cacheable (const bfd *abfd) +{ + return abfd->cacheable; +} + +static inline enum bfd_format +bfd_get_format (const bfd *abfd) +{ + return abfd->format; +} + +static inline flagword +bfd_get_file_flags (const bfd *abfd) +{ + return abfd->flags; +} + +static inline bfd_vma +bfd_get_start_address (const bfd *abfd) +{ + return abfd->start_address; +} + +static inline unsigned int +bfd_get_symcount (const bfd *abfd) +{ + return abfd->symcount; +} + +static inline unsigned int +bfd_get_dynamic_symcount (const bfd *abfd) +{ + return abfd->dynsymcount; +} + +static inline struct bfd_symbol ** +bfd_get_outsymbols (const bfd *abfd) +{ + return abfd->outsymbols; +} + +static inline unsigned int +bfd_count_sections (const bfd *abfd) +{ + return abfd->section_count; +} + +static inline bfd_boolean +bfd_has_map (const bfd *abfd) +{ + return abfd->has_armap; +} + +static inline bfd_boolean +bfd_is_thin_archive (const bfd *abfd) +{ + return abfd->is_thin_archive; +} + +static inline void * +bfd_usrdata (const bfd *abfd) +{ + return abfd->usrdata; +} + +/* See note beside bfd_set_section_userdata. */ +static inline bfd_boolean +bfd_set_cacheable (bfd * abfd, bfd_boolean val) +{ + abfd->cacheable = val; + return TRUE; +} + +static inline void +bfd_set_thin_archive (bfd *abfd, bfd_boolean val) +{ + abfd->is_thin_archive = val; +} + +static inline void +bfd_set_usrdata (bfd *abfd, void *val) +{ + abfd->usrdata = val; +} + +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + +static inline bfd_size_type +bfd_get_section_limit_octets (const bfd *abfd, const asection *sec) +{ + if (abfd->direction != write_direction && sec->rawsize != 0) + return sec->rawsize; + return sec->size; +} + +/* Find the address one past the end of SEC. */ +static inline bfd_size_type +bfd_get_section_limit (const bfd *abfd, const asection *sec) +{ + return (bfd_get_section_limit_octets (abfd, sec) + / bfd_octets_per_byte (abfd, sec)); +} + +/* Functions to handle insertion and deletion of a bfd's sections. These + only handle the list pointers, ie. do not adjust section_count, + target_index etc. */ +static inline void +bfd_section_list_remove (bfd *abfd, asection *s) +{ + asection *next = s->next; + asection *prev = s->prev; + if (prev) + prev->next = next; + else + abfd->sections = next; + if (next) + next->prev = prev; + else + abfd->section_last = prev; +} + +static inline void +bfd_section_list_append (bfd *abfd, asection *s) +{ + s->next = 0; + if (abfd->section_last) + { + s->prev = abfd->section_last; + abfd->section_last->next = s; + } + else + { + s->prev = 0; + abfd->sections = s; + } + abfd->section_last = s; +} + +static inline void +bfd_section_list_prepend (bfd *abfd, asection *s) +{ + s->prev = 0; + if (abfd->sections) + { + s->next = abfd->sections; + abfd->sections->prev = s; + } + else + { + s->next = 0; + abfd->section_last = s; + } + abfd->sections = s; +} + +static inline void +bfd_section_list_insert_after (bfd *abfd, asection *a, asection *s) +{ + asection *next = a->next; + s->next = next; + s->prev = a; + a->next = s; + if (next) + next->prev = s; + else + abfd->section_last = s; +} + +static inline void +bfd_section_list_insert_before (bfd *abfd, asection *b, asection *s) +{ + asection *prev = b->prev; + s->prev = prev; + s->next = b; + b->prev = s; + if (prev) + prev->next = s; + else + abfd->sections = s; +} + +static inline bfd_boolean +bfd_section_removed_from_list (const bfd *abfd, const asection *s) +{ + return s->next ? s->next->prev != s : abfd->section_last != s; +} + + typedef enum bfd_error { bfd_error_no_error = 0, @@ -5975,6 +6987,7 @@ typedef enum bfd_error bfd_error_no_armap, bfd_error_no_more_archived_files, bfd_error_malformed_archive, + bfd_error_missing_dso, bfd_error_file_not_recognized, bfd_error_file_ambiguously_recognized, bfd_error_no_contents, @@ -5983,6 +6996,7 @@ typedef enum bfd_error bfd_error_bad_value, bfd_error_file_truncated, bfd_error_file_too_big, + bfd_error_sorry, bfd_error_on_input, bfd_error_invalid_error_code } @@ -5990,19 +7004,23 @@ bfd_error_type; bfd_error_type bfd_get_error (void); -void bfd_set_error (bfd_error_type error_tag, ...); +void bfd_set_error (bfd_error_type error_tag); + +void bfd_set_input_error (bfd *input, bfd_error_type error_tag); const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); + +typedef void (*bfd_error_handler_type) (const char *, va_list); + +void _bfd_error_handler (const char *fmt, ...) ATTRIBUTE_PRINTF_1; bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, const char *bfd_version, @@ -6011,8 +7029,6 @@ typedef void (*bfd_assert_handler_type) (const char *bfd_formatmsg, bfd_assert_handler_type bfd_set_assert_handler (bfd_assert_handler_type); -bfd_assert_handler_type bfd_get_assert_handler (void); - long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); long bfd_canonicalize_reloc @@ -6021,6 +7037,8 @@ long bfd_canonicalize_reloc void bfd_set_reloc (bfd *abfd, asection *sec, arelent **rel, unsigned int count); +#define bfd_set_reloc(abfd, asect, location, count) \ + BFD_SEND (abfd, _bfd_set_reloc, (abfd, asect, location, count)) bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); int bfd_get_arch_size (bfd *abfd); @@ -6038,33 +7056,28 @@ bfd_vma bfd_scan_vma (const char *string, const char **end, int base); bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_header_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_header_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_header_data, \ + (ibfd, obfd)) bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ - (ibfd, obfd)) -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); - -#define bfd_merge_private_bfd_data(ibfd, obfd) \ - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ - (ibfd, obfd)) + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ + (ibfd, obfd)) bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, info) \ BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, \ - (abfd, sec, syms, off, file, func, line)) + (abfd, syms, sec, off, file, func, line, NULL)) #define bfd_find_nearest_line_discriminator(abfd, sec, syms, off, file, func, \ - line, disc) \ - BFD_SEND (abfd, _bfd_find_nearest_line_discriminator, \ - (abfd, sec, syms, off, file, func, line, disc)) + line, disc) \ + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, syms, sec, off, file, func, line, disc)) #define bfd_find_line(abfd, syms, sym, file, line) \ BFD_SEND (abfd, _bfd_find_line, \ @@ -6107,15 +7120,15 @@ bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_is_group_section(abfd, sec) \ BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec)) +#define bfd_group_name(abfd, sec) \ + BFD_SEND (abfd, _bfd_group_name, (abfd, sec)) + #define bfd_discard_group(abfd, sec) \ BFD_SEND (abfd, _bfd_discard_group, (abfd, sec)) #define bfd_link_hash_table_create(abfd) \ BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd)) -#define bfd_link_hash_table_free(abfd, hash) \ - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash)) - #define bfd_link_add_symbols(abfd, info) \ BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info)) @@ -6153,34 +7166,33 @@ extern bfd_byte *bfd_get_relocated_section_contents bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); -struct bfd_preserve -{ - void *marker; - void *tdata; - flagword flags; - const struct bfd_arch_info *arch_info; - struct bfd_section *sections; - struct bfd_section *section_last; - unsigned int section_count; - struct bfd_hash_table section_htab; -}; - -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); - -void bfd_preserve_restore (bfd *, struct bfd_preserve *); - -void bfd_preserve_finish (bfd *, struct bfd_preserve *); - bfd_vma bfd_emul_get_maxpagesize (const char *); void bfd_emul_set_maxpagesize (const char *, bfd_vma); -bfd_vma bfd_emul_get_commonpagesize (const char *); +bfd_vma bfd_emul_get_commonpagesize (const char *, bfd_boolean); void bfd_emul_set_commonpagesize (const char *, bfd_vma); char *bfd_demangle (bfd *, const char *, int); +void bfd_update_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec); + +bfd_boolean bfd_check_compression_header + (bfd *abfd, bfd_byte *contents, asection *sec, + bfd_size_type *uncompressed_size, + unsigned int *uncompressed_alignment_power); + +int bfd_get_compression_header_size (bfd *abfd, asection *sec); + +bfd_size_type bfd_convert_section_size + (bfd *ibfd, asection *isec, bfd *obfd, bfd_size_type size); + +bfd_boolean bfd_convert_section_contents + (bfd *ibfd, asection *isec, bfd *obfd, + bfd_byte **ptr, bfd_size_type *ptr_size); + /* Extracted from archive.c. */ symindex bfd_get_next_mapent (bfd *abfd, symindex previous, carsym **sym); @@ -6226,15 +7238,13 @@ bfd_boolean generic_core_file_matches_executable_p enum bfd_flavour { + /* N.B. Update bfd_flavour_name if you change this. */ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, bfd_target_xcoff_flavour, bfd_target_elf_flavour, - bfd_target_ieee_flavour, - bfd_target_nlm_flavour, - bfd_target_oasys_flavour, bfd_target_tekhex_flavour, bfd_target_srec_flavour, bfd_target_verilog_flavour, @@ -6263,7 +7273,7 @@ typedef struct flag_info flag_info; typedef struct bfd_target { /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */ - char *name; + const char *name; /* The "flavour" of a back end is a general indication about the contents of a file. */ @@ -6325,7 +7335,8 @@ typedef struct bfd_target within the target vector structure, one for each format to check. */ /* Check the format of a file being read. Return a <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); + const struct bfd_target * + (*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); @@ -6349,10 +7360,11 @@ typedef struct bfd_target /* Called when a new section is created. */ bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - bfd_boolean (*_bfd_get_section_contents) - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); - bfd_boolean (*_bfd_get_section_contents_in_window) - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents) (bfd *, sec_ptr, void *, file_ptr, + bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) (bfd *, sec_ptr, + bfd_window *, file_ptr, + bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ @@ -6370,25 +7382,26 @@ typedef struct bfd_target bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, struct bfd_link_info *); /* Called to initialize BFD private section data from one object file to another. */ #define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \ - BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info)) - bfd_boolean (*_bfd_init_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *); + BFD_SEND (obfd, _bfd_init_private_section_data, \ + (ibfd, isec, obfd, osec, link_info)) + bfd_boolean (*_bfd_init_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr, + struct bfd_link_info *); /* Called to copy BFD private section data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_section_data) - (bfd *, sec_ptr, bfd *, sec_ptr); + bfd_boolean (*_bfd_copy_private_section_data) (bfd *, sec_ptr, bfd *, + sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - bfd_boolean (*_bfd_copy_private_symbol_data) - (bfd *, asymbol *, bfd *, asymbol *); + bfd_boolean (*_bfd_copy_private_symbol_data) (bfd *, asymbol *, bfd *, + asymbol *); /* Called to copy BFD private header data from one object file to another. */ - bfd_boolean (*_bfd_copy_private_header_data) - (bfd *, bfd *); + bfd_boolean (*_bfd_copy_private_header_data) (bfd *, bfd *); /* Called to set private backend flags. */ bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); @@ -6423,15 +7436,17 @@ typedef struct bfd_target bfd_boolean (*_bfd_slurp_armap) (bfd *); bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); - bfd_boolean (*_bfd_construct_extended_name_table) - (bfd *, char **, bfd_size_type *, const char **); + bfd_boolean (*_bfd_construct_extended_name_table) (bfd *, char **, + bfd_size_type *, + const char **); void (*_bfd_truncate_arname) (bfd *, const char *, char *); - bfd_boolean (*write_armap) - (bfd *, unsigned int, struct orl *, unsigned int, int); + bfd_boolean (*write_armap) (bfd *, unsigned int, struct orl *, + unsigned int, int); void * (*_bfd_read_ar_hdr_fn) (bfd *); bfd_boolean (*_bfd_write_ar_hdr_fn) (bfd *, bfd *); bfd * (*openr_next_archived_file) (bfd *, bfd *); -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +#define bfd_get_elt_at_index(b,i) \ + BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); int (*_bfd_stat_arch_elt) (bfd *, struct stat *); bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); @@ -6443,82 +7458,85 @@ typedef struct bfd_target NAME##_make_empty_symbol, \ NAME##_print_symbol, \ NAME##_get_symbol_info, \ + NAME##_get_symbol_version_string, \ NAME##_bfd_is_local_label_name, \ NAME##_bfd_is_target_special_symbol, \ NAME##_get_lineno, \ NAME##_find_nearest_line, \ - _bfd_generic_find_nearest_line_discriminator, \ - _bfd_generic_find_line, \ + NAME##_find_line, \ NAME##_find_inliner_info, \ NAME##_bfd_make_debug_symbol, \ NAME##_read_minisymbols, \ NAME##_minisymbol_to_symbol long (*_bfd_get_symtab_upper_bound) (bfd *); - long (*_bfd_canonicalize_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_symtab) (bfd *, struct bfd_symbol **); struct bfd_symbol * (*_bfd_make_empty_symbol) (bfd *); - void (*_bfd_print_symbol) - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) - (bfd *, struct bfd_symbol *, symbol_info *); -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + void (*_bfd_print_symbol) (bfd *, void *, struct bfd_symbol *, + bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) \ + BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) (bfd *, struct bfd_symbol *, + symbol_info *); +#define bfd_get_symbol_info(b,p,e) \ + BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + const char *(*_bfd_get_symbol_version_string) (bfd *, struct bfd_symbol *, + bfd_boolean *); +#define bfd_get_symbol_version_string(b,s,h) \ + BFD_SEND (b, _bfd_get_symbol_version_string, (b,s,h)) bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *); alent * (*_get_lineno) (bfd *, struct bfd_symbol *); - bfd_boolean (*_bfd_find_nearest_line) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *); - bfd_boolean (*_bfd_find_nearest_line_discriminator) - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, - const char **, const char **, unsigned int *, unsigned int *); - bfd_boolean (*_bfd_find_line) - (bfd *, struct bfd_symbol **, struct bfd_symbol *, - const char **, unsigned int *); + bfd_boolean (*_bfd_find_nearest_line) (bfd *, struct bfd_symbol **, + struct bfd_section *, bfd_vma, + const char **, const char **, + unsigned int *, unsigned int *); + bfd_boolean (*_bfd_find_line) (bfd *, struct bfd_symbol **, + struct bfd_symbol *, const char **, + unsigned int *); bfd_boolean (*_bfd_find_inliner_info) (bfd *, const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol * (*_bfd_make_debug_symbol) - (bfd *, void *, unsigned long size); + asymbol * (*_bfd_make_debug_symbol) (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ - BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) - (bfd *, bfd_boolean, void **, unsigned int *); + BFD_SEND (b, _read_minisymbols, (b, d, m, s)) + long (*_read_minisymbols) (bfd *, bfd_boolean, void **, + unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol * (*_minisymbol_to_symbol) - (bfd *, bfd_boolean, const void *, asymbol *); + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) + asymbol * (*_minisymbol_to_symbol) (bfd *, bfd_boolean, const void *, + asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ NAME##_get_reloc_upper_bound, \ NAME##_canonicalize_reloc, \ + NAME##_set_reloc, \ NAME##_bfd_reloc_type_lookup, \ NAME##_bfd_reloc_name_lookup long (*_get_reloc_upper_bound) (bfd *, sec_ptr); - long (*_bfd_canonicalize_reloc) - (bfd *, sec_ptr, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_reloc) (bfd *, sec_ptr, arelent **, + struct bfd_symbol **); + void (*_bfd_set_reloc) (bfd *, sec_ptr, arelent **, unsigned int); /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); reloc_howto_type * (*reloc_name_lookup) (bfd *, const char *); - /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ NAME##_set_arch_mach, \ NAME##_set_section_contents - bfd_boolean (*_bfd_set_arch_mach) - (bfd *, enum bfd_architecture, unsigned long); - bfd_boolean (*_bfd_set_section_contents) - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_set_arch_mach) (bfd *, enum bfd_architecture, + unsigned long); + bfd_boolean (*_bfd_set_section_contents) (bfd *, sec_ptr, const void *, + file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ @@ -6526,47 +7544,51 @@ typedef struct bfd_target NAME##_bfd_get_relocated_section_contents, \ NAME##_bfd_relax_section, \ NAME##_bfd_link_hash_table_create, \ - NAME##_bfd_link_hash_table_free, \ NAME##_bfd_link_add_symbols, \ NAME##_bfd_link_just_syms, \ NAME##_bfd_copy_link_hash_symbol_type, \ NAME##_bfd_final_link, \ NAME##_bfd_link_split_section, \ + NAME##_bfd_link_check_relocs, \ NAME##_bfd_gc_sections, \ NAME##_bfd_lookup_section_flags, \ NAME##_bfd_merge_sections, \ NAME##_bfd_is_group_section, \ + NAME##_bfd_group_name, \ NAME##_bfd_discard_group, \ NAME##_section_already_linked, \ - NAME##_bfd_define_common_symbol + NAME##_bfd_define_common_symbol, \ + NAME##_bfd_link_hide_symbol, \ + NAME##_bfd_define_start_stop int (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *); - bfd_byte * (*_bfd_get_relocated_section_contents) - (bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, bfd_boolean, struct bfd_symbol **); + bfd_byte * (*_bfd_get_relocated_section_contents) (bfd *, + struct bfd_link_info *, + struct bfd_link_order *, + bfd_byte *, bfd_boolean, + struct bfd_symbol **); - bfd_boolean (*_bfd_relax_section) - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); + bfd_boolean (*_bfd_relax_section) (bfd *, struct bfd_section *, + struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ struct bfd_link_hash_table * (*_bfd_link_hash_table_create) (bfd *); - /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); - /* Add symbols from this object file into the hash table. */ bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); - /* Copy the symbol type of a linker hash table entry. */ + /* Copy the symbol type and other attributes for a linker script + assignment of one symbol to another. */ #define bfd_copy_link_hash_symbol_type(b, t, f) \ - BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) - void (*_bfd_copy_link_hash_symbol_type) - (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f)) + void (*_bfd_copy_link_hash_symbol_type) (bfd *, + struct bfd_link_hash_entry *, + struct bfd_link_hash_entry *); /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -6575,13 +7597,15 @@ typedef struct bfd_target /* Should this section be split up into smaller pieces during linking. */ bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); + /* Check the relocations in the bfd for validity. */ + bfd_boolean (* _bfd_link_check_relocs)(bfd *, struct bfd_link_info *); + /* Remove sections that are not referenced from the output. */ bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Sets the bitmask of allowed and disallowed section flags. */ bfd_boolean (*_bfd_lookup_section_flags) (struct bfd_link_info *, - struct flag_info *, - asection *); + struct flag_info *, asection *); /* Attempt to merge SEC_MERGE sections. */ bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); @@ -6589,6 +7613,9 @@ typedef struct bfd_target /* Is this section a member of a group? */ bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *); + /* The group name, if section is a member of a group. */ + const char *(*_bfd_group_name) (bfd *, const struct bfd_section *); + /* Discard members of a group. */ bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); @@ -6601,6 +7628,15 @@ typedef struct bfd_target bfd_boolean (*_bfd_define_common_symbol) (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); + /* Hide a symbol. */ + void (*_bfd_link_hide_symbol) (bfd *, struct bfd_link_info *, + struct bfd_link_hash_entry *); + + /* Define a __start, __stop, .startof. or .sizeof. symbol. */ + struct bfd_link_hash_entry * + (*_bfd_define_start_stop) (struct bfd_link_info *, const char *, + asection *); + /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ NAME##_get_dynamic_symtab_upper_bound, \ @@ -6612,20 +7648,19 @@ typedef struct bfd_target /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - (bfd *, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_symtab) (bfd *, struct bfd_symbol **); /* Create synthetized symbols. */ - long (*_bfd_get_synthetic_symtab) - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **, - struct bfd_symbol **); + long (*_bfd_get_synthetic_symtab) (bfd *, long, struct bfd_symbol **, + long, struct bfd_symbol **, + struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - (bfd *, arelent **, struct bfd_symbol **); + long (*_bfd_canonicalize_dynamic_reloc) (bfd *, arelent **, + struct bfd_symbol **); /* Opposite endian version of this target. */ - const struct bfd_target * alternative_target; + const struct bfd_target *alternative_target; /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ @@ -6633,6 +7668,74 @@ typedef struct bfd_target } bfd_target; +static inline const char * +bfd_get_target (const bfd *abfd) +{ + return abfd->xvec->name; +} + +static inline enum bfd_flavour +bfd_get_flavour (const bfd *abfd) +{ + return abfd->xvec->flavour; +} + +static inline flagword +bfd_applicable_file_flags (const bfd *abfd) +{ + return abfd->xvec->object_flags; +} + +static inline bfd_boolean +bfd_family_coff (const bfd *abfd) +{ + return (bfd_get_flavour (abfd) == bfd_target_coff_flavour + || bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); +} + +static inline bfd_boolean +bfd_big_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_BIG; +} +static inline bfd_boolean +bfd_little_endian (const bfd *abfd) +{ + return abfd->xvec->byteorder == BFD_ENDIAN_LITTLE; +} + +static inline bfd_boolean +bfd_header_big_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_BIG; +} + +static inline bfd_boolean +bfd_header_little_endian (const bfd *abfd) +{ + return abfd->xvec->header_byteorder == BFD_ENDIAN_LITTLE; +} + +static inline flagword +bfd_applicable_section_flags (const bfd *abfd) +{ + return abfd->xvec->section_flags; +} + +static inline char +bfd_get_symbol_leading_char (const bfd *abfd) +{ + return abfd->xvec->symbol_leading_char; +} + +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @@ -6644,9 +7747,11 @@ const bfd_target *bfd_get_target_info (const char *target_name, const char **def_target_arch); const char ** bfd_target_list (void); -const bfd_target *bfd_search_for_target - (int (*search_func) (const bfd_target *, void *), - void *); +const bfd_target *bfd_iterate_over_targets + (int (*func) (const bfd_target *, void *), + void *data); + +const char *bfd_flavour_name (enum bfd_flavour flavour); /* Extracted from format.c. */ bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @@ -6659,6 +7764,17 @@ bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); const char *bfd_format_string (bfd_format format); /* Extracted from linker.c. */ +/* Return TRUE if the symbol described by a linker hash entry H + is going to be absolute. Linker-script defined symbols can be + converted from absolute to section-relative ones late in the + link. Use this macro to correctly determine whether the symbol + will actually end up absolute in output. */ +#define bfd_is_abs_symbol(H) \ + (((H)->type == bfd_link_hash_defined \ + || (H)->type == bfd_link_hash_defweak) \ + && bfd_is_abs_section ((H)->u.def.section) \ + && !(H)->rel_from_abs) + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); #define bfd_link_split_section(abfd, sec) \ @@ -6678,6 +7794,20 @@ bfd_boolean bfd_generic_define_common_symbol #define bfd_define_common_symbol(output_bfd, info, h) \ BFD_SEND (output_bfd, _bfd_define_common_symbol, (output_bfd, info, h)) +void _bfd_generic_link_hide_symbol + (bfd *output_bfd, struct bfd_link_info *info, + struct bfd_link_hash_entry *h); + +#define bfd_link_hide_symbol(output_bfd, info, h) \ + BFD_SEND (output_bfd, _bfd_link_hide_symbol, (output_bfd, info, h)) + +struct bfd_link_hash_entry *bfd_generic_define_start_stop + (struct bfd_link_info *info, + const char *symbol, asection *sec); + +#define bfd_define_start_stop(output_bfd, info, symbol, sec) \ + BFD_SEND (output_bfd, _bfd_define_start_stop, (info, symbol, sec)) + struct bfd_elf_version_tree * bfd_find_version_for_sym (struct bfd_elf_version_tree *verdefs, const char *sym_name, bfd_boolean *hide); @@ -6685,18 +7815,35 @@ struct bfd_elf_version_tree * bfd_find_version_for_sym bfd_boolean bfd_hide_sym_by_version (struct bfd_elf_version_tree *verdefs, const char *sym_name); +bfd_boolean bfd_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean _bfd_generic_link_check_relocs + (bfd *abfd, struct bfd_link_info *info); + +bfd_boolean bfd_merge_private_bfd_data + (bfd *ibfd, struct bfd_link_info *info); + +#define bfd_merge_private_bfd_data(ibfd, info) \ + BFD_SEND ((info)->output_bfd, _bfd_merge_private_bfd_data, \ + (ibfd, info)) /* Extracted from simple.c. */ bfd_byte *bfd_simple_get_relocated_section_contents (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); /* Extracted from compress.c. */ -bfd_boolean bfd_compress_section_contents - (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer, - bfd_size_type uncompressed_size); - bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + +bfd_boolean bfd_is_section_compressed_with_header + (bfd *abfd, asection *section, + int *compression_header_size_p, + bfd_size_type *uncompressed_size_p, + unsigned int *uncompressed_alignment_power_p); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); @@ -6706,6 +7853,9 @@ bfd_boolean bfd_init_section_decompress_status bfd_boolean bfd_init_section_compress_status (bfd *abfd, asection *section); +bfd_boolean bfd_compress_section + (bfd *abfd, asection *section, bfd_byte *uncompressed_buffer); + #ifdef __cplusplus } #endif diff --git a/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h b/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h index c94fc2d86..a56ed21fc 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h +++ b/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h @@ -1,8 +1,8 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -/* generated for x86_64--netbsd-gcc (NetBSD nb1 20120916) 4.5.4 */ +/* generated for x86_64--netbsd-gcc (NetBSD nb1 20200311) 8.4.0 */ #ifndef GCC_GENERATED_STDINT_H #define GCC_GENERATED_STDINT_H 1 diff --git a/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h b/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h index 01f42b546..75bff1507 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h +++ b/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfdver.h @@ -1,8 +1,26 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#define BFD_VERSION_DATE 20130325 -#define BFD_VERSION 223020000 -#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.23.2" +/* The date below is automatically updated every day by a bot. During + development, we include the date in the tools' version strings + (visible in 'ld -v' etc.) because people build binutils from a + variety of sources - git, tarballs, distro sources - and we want + something that can easily identify the source they used when they + report bugs. The bfd version plus date is usually good enough for + that purpose. + + During development, this date ends up in libbfd and libopcodes + sonames because people naturally expect shared libraries with the + same soname to have compatible ABIs. We could bump the bfd version + on every ABI change, but that's just another thing contributors and + maintainers would need to remember. Instead, it's much easier for + all if the soname contains the date. This is not perfect but is + good enough. + + In releases, the date is not included in either version strings or + sonames. */ +#define BFD_VERSION_DATE 20200201 +#define BFD_VERSION 234000000 +#define BFD_VERSION_STRING "(NetBSD Binutils nb1) " "2.34" #define REPORT_BUGS_TO "" diff --git a/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h b/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h index ce31e69d8..4d0674f0b 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h +++ b/external/gpl3/binutils/lib/libbfd/arch/x86_64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -15,6 +15,10 @@ /* Name of host specific core header file to include in elf.c. */ /* #undef CORE_HEADER */ +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -22,6 +26,10 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `basename', and to 0 if you don't. */ #define HAVE_DECL_BASENAME 0 @@ -69,10 +77,18 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + /* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you don't. */ #define HAVE_DECL_VSNPRINTF 1 @@ -96,6 +112,9 @@ /* Define to 1 if you have the `fileno' function. */ #define HAVE_FILENO 1 +/* Define to 1 if you have the `fls' function. */ +/* #undef HAVE_FLS */ + /* Define to 1 if you have the `fopen64' function. */ /* #undef HAVE_FOPEN64 */ @@ -117,12 +136,24 @@ /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 +/* Define if your compiler supports hidden visibility. */ +#define HAVE_HIDDEN 1 + /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +/* Define to 1 if the system has the type `long double'. */ +#define HAVE_LONG_DOUBLE 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if has lwpstatus_t. */ /* #undef HAVE_LWPSTATUS_T */ @@ -236,9 +267,15 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_PROCFS_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 @@ -254,15 +291,18 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCTYPE_H 1 + /* Define if has win32_pstatus_t. */ /* #undef HAVE_WIN32_PSTATUS_T */ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -274,25 +314,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "bfd" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "bfd 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "bfd" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `char', as computed by sizeof. */ /* #undef SIZEOF_CHAR */ /* The size of `int', as computed by sizeof. */ -/* #undef SIZEOF_INT */ +#define SIZEOF_INT 4 /* The size of `long', as computed by sizeof. */ #define SIZEOF_LONG 8 @@ -321,6 +361,9 @@ /* Name of host specific header file to include in trad-core.c. */ /* #undef TRAD_HEADER */ +/* Define if 64-bit archives should always be used. */ +/* #undef USE_64_BIT_ARCHIVE */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -333,9 +376,6 @@ /* Define if we should default to creating read-only plt entries */ /* #undef USE_SECUREPLT */ -/* Define if we may generate symbols with ELF's STT_COMMON type */ -/* #undef USE_STT_COMMON */ - /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # define _ALL_SOURCE 1 @@ -359,7 +399,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/lib/libbfd/arch/x86_64/defs.mk b/external/gpl3/binutils/lib/libbfd/arch/x86_64/defs.mk index 0081bc840..dc846f5ad 100644 --- a/external/gpl3/binutils/lib/libbfd/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/lib/libbfd/arch/x86_64/defs.mk @@ -1,9 +1,10 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_libbfd_la_DEPENDENCIES=elf64-x86-64.lo elf-ifunc.lo elf-nacl.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo elf32-i386.lo elf-vxworks.lo elf32.lo i386netbsd.lo aout32.lo coff-i386.lo cofflink.lo pei-i386.lo peigen.lo pei-x86_64.lo pex64igen.lo elf64-gen.lo elf32-gen.lo cpu-i386.lo cpu-l1om.lo cpu-k1om.lo netbsd-core.lo archive64.lo ofiles -G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo compress.lo verilog.lo +G_libbfd_la_DEPENDENCIES=elf64-x86-64.lo elfxx-x86.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf64.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo elf32-i386.lo elf32.lo coff-i386.lo cofflink.lo coffgen.lo pei-i386.lo peigen.lo i386bsd.lo aout32.lo i386netbsd.lo pei-x86_64.lo pex64igen.lo elf64-gen.lo elf32-gen.lo plugin.lo cpu-i386.lo cpu-iamcu.lo cpu-l1om.lo cpu-k1om.lo netbsd-core.lo archive64.lo ofiles +G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo elf-properties.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H -G_INCLUDES=-DNETBSD_CORE -I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_bfd_elf64_x86_64_vec -DHAVE_bfd_elf32_i386_vec -DHAVE_i386netbsd_vec -DHAVE_i386coff_vec -DHAVE_i386pei_vec -DHAVE_x86_64pei_vec -DHAVE_bfd_elf64_l1om_vec -DHAVE_bfd_elf64_k1om_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -I./../intl -G_TDEFAULTS=-DDEFAULT_VECTOR=bfd_elf64_x86_64_vec -DSELECT_VECS='&bfd_elf64_x86_64_vec,&bfd_elf32_i386_vec,&i386netbsd_vec,&i386coff_vec,&i386pei_vec,&x86_64pei_vec,&bfd_elf64_l1om_vec,&bfd_elf64_k1om_vec,&bfd_elf64_little_generic_vec,&bfd_elf64_big_generic_vec,&bfd_elf32_little_generic_vec,&bfd_elf32_big_generic_vec' -DSELECT_ARCHITECTURES='&bfd_i386_arch,&bfd_l1om_arch,&bfd_k1om_arch' +G_INCLUDES= +G_TDEFAULTS=-DDEFAULT_VECTOR=x86_64_elf64_vec -DSELECT_VECS='&x86_64_elf64_vec,&i386_elf32_vec,&iamcu_elf32_vec,&i386_coff_vec,&i386_pei_vec,&i386_aout_bsd_vec,&i386_aout_nbsd_vec,&x86_64_pei_vec,&l1om_elf64_vec,&k1om_elf64_vec,&elf64_le_vec,&elf64_be_vec,&elf32_le_vec,&elf32_be_vec' -DSELECT_ARCHITECTURES='&bfd_i386_arch,&bfd_iamcu_arch,&bfd_l1om_arch,&bfd_k1om_arch' +G_HAVEVECS=-DHAVE_x86_64_elf64_vec -DHAVE_i386_elf32_vec -DHAVE_iamcu_elf32_vec -DHAVE_i386_coff_vec -DHAVE_i386_pei_vec -DHAVE_i386_aout_bsd_vec -DHAVE_i386_aout_nbsd_vec -DHAVE_x86_64_pei_vec -DHAVE_l1om_elf64_vec -DHAVE_k1om_elf64_vec -DHAVE_elf64_le_vec -DHAVE_elf64_be_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec diff --git a/external/gpl3/binutils/lib/libgnuctf/Makefile b/external/gpl3/binutils/lib/libgnuctf/Makefile new file mode 100644 index 000000000..00b791015 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/Makefile @@ -0,0 +1,47 @@ +# $NetBSD: Makefile,v 1.1 2020/04/04 01:34:30 christos Exp $ + +NOLINKLIB= # defined +NOLINT= # defined +NOMAN= # defined +NOPROFILE= # defined +NOCLANGERROR= # defined + +.include + +LIB= gnuctf + +BFD_MACHINE_ARCH?= ${MACHINE_ARCH:C/armv[4-7]/arm/} + +.if exists(${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk) +.include "${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk" + +.if defined(__MINIX) +# MINIX: make sure sources are fetched, even when tools not built earlier +GNUHOSTDIST= ${DIST} +.include "${.CURDIR}/../../../../../minix/Makefile.fetchgnu" +.endif # defined(__MINIX) + +SHLIB_MAJOR= 0 +SHLIB_MINOR= 0 + +GCPPFLAGS= ${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS} +CPPFLAGS+= -I${.CURDIR}/arch/${BFD_MACHINE_ARCH} \ + -I${.CURDIR}/../libbfd/arch/${BFD_MACHINE_ARCH} \ + -I${DIST}/include -I. -I${DIST}/libctf \ + -I${DIST}/bfd ${GCPPFLAGS:M-D*} \ + ${GCPPFLAGS:M-I*:N-I.*} + +SRCS= ${G_libctf_la_SOURCES} + +.PATH: ${DIST}/libctf + +.include + +.if defined(__MINIX) #&& ${USETOOLS} != "yes" +# Trigger the fetch phase, even when not building tools +${SRCS} realdepend realall realinstall: ${fetch_done} +.endif # defined(__MINIX) + +.else +.include # do nothing +.endif diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/aarch64/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/aarch64/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/aarch64eb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64eb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64eb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/aarch64eb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/aarch64eb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/alpha/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/alpha/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/alpha/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/alpha/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/alpha/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/alpha/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/arm/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/arm/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/arm/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/arm/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/arm/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/arm/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/armeb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/armeb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/armeb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/armeb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/armeb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/armeb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earm/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/earm/config.h new file mode 100644 index 000000000..b370457e5 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earm/config.h @@ -0,0 +1,164 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +#if !defined(__minix) +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 +#endif /* !defined(__minix) */ + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earm/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/earm/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earm/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earmeb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/earmeb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earmeb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earmeb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/earmeb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earmeb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earmhf/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/earmhf/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earmhf/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earmhf/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/earmhf/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earmhf/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earmhfeb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/earmhfeb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earmhfeb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/earmhfeb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/earmhfeb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/earmhfeb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/hppa/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/hppa/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/hppa/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/hppa/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/hppa/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/hppa/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/i386/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/i386/config.h new file mode 100644 index 000000000..605d0ca85 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/i386/config.h @@ -0,0 +1,164 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +#if !defined(__minix) +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 +#endif /* !defined(__minix) */ + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/i386/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/i386/defs.mk new file mode 100644 index 000000000..8adaefbb6 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/i386/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/ia64/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/ia64/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/ia64/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/ia64/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/ia64/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/ia64/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/m68000/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/m68000/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/m68000/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/m68000/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/m68000/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/m68000/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/m68k/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/m68k/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/m68k/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/m68k/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/m68k/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/m68k/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mips64eb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/mips64eb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mips64eb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mips64eb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/mips64eb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mips64eb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mips64el/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/mips64el/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mips64el/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mips64el/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/mips64el/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mips64el/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mipseb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/mipseb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mipseb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mipseb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/mipseb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mipseb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mipsel/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/mipsel/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mipsel/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/mipsel/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/mipsel/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/mipsel/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/powerpc/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/powerpc/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/powerpc64/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc64/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc64/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/powerpc64/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc64/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/powerpc64/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/riscv32/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/riscv32/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/riscv32/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/riscv32/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/riscv32/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/riscv32/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/riscv64/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/riscv64/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/riscv64/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/riscv64/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/riscv64/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/riscv64/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sh3eb/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/sh3eb/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sh3eb/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sh3eb/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/sh3eb/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sh3eb/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sh3el/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/sh3el/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sh3el/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sh3el/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/sh3el/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sh3el/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sparc/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/sparc/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sparc/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sparc/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/sparc/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sparc/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sparc64/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/sparc64/config.h new file mode 100644 index 000000000..a230d1a0a --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sparc64/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/sparc64/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/sparc64/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/sparc64/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/vax/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/vax/config.h new file mode 100644 index 000000000..55d958b07 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/vax/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/vax/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/vax/defs.mk new file mode 100644 index 000000000..d0de71f9f --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/vax/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/config.h b/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/config.h new file mode 100644 index 000000000..b5a862f20 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/config.h @@ -0,0 +1,162 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Whether libbfd was configured for an ELF target. */ +/* #undef HAVE_BFD_ELF */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Whether the platform has a definition of O_CLOEXEC. */ +#define HAVE_O_CLOEXEC 1 + +/* Define to 1 if you have the `pread' function. */ +#define HAVE_PREAD 1 + +/* Define to 1 if you have the `qsort_r' function. */ +/* #undef HAVE_QSORT_R */ + +/* Whether a qsort_r exists with a void *arg as its last arg. */ +/* #undef HAVE_QSORT_R_ARG_LAST */ + +/* Whether a qsort_r exists with the compar function as its last arg. */ +/* #undef HAVE_QSORT_R_COMPAR_LAST */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libctf-library" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libctf library" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libctf library 1.2.0-pre" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libctf-library" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.2.0-pre" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "1.2.0-pre" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/defs.mk b/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/defs.mk new file mode 100644 index 000000000..8adaefbb6 --- /dev/null +++ b/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/defs.mk @@ -0,0 +1,5 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_libctf_la_SOURCES=ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c ctf-hash.c ctf-labels.c ctf-link.c ctf-lookup.c ctf-open.c ctf-string.c ctf-subr.c ctf-types.c ctf-util.c ctf-qsort_r.c ctf-open-bfd.c diff --git a/external/gpl3/binutils/lib/libiberty/Makefile b/external/gpl3/binutils/lib/libiberty/Makefile index 23fcf9f3e..5391cd4f5 100644 --- a/external/gpl3/binutils/lib/libiberty/Makefile +++ b/external/gpl3/binutils/lib/libiberty/Makefile @@ -1,12 +1,13 @@ -# $NetBSD: Makefile,v 1.4 2013/08/06 05:35:57 matt Exp $ +# $NetBSD: Makefile,v 1.10 2016/11/04 15:31:45 christos Exp $ NOLINT= # defined NOPROFILE= # defined NOPIC= # defined NOLINKLIB= # defined NOCLANGERROR= # defined +NODEBUGLIB= # defined -.include +.include LIB= iberty @@ -19,8 +20,6 @@ COPTS.cp-demangle.c = -Wno-stack-protector COPTS.make-relative-prefix.c = -Wno-stack-protector COPTS.regex.c = -Wno-stack-protector -DIST= ${NETBSDSRCDIR}/external/gpl3/binutils/dist - .if defined(__MINIX) # MINIX: make sure sources are fetched, even when tools not built earlier GNUHOSTDIST= ${DIST} diff --git a/external/gpl3/binutils/lib/libiberty/arch/aarch64/config.h b/external/gpl3/binutils/lib/libiberty/arch/aarch64/config.h index ca7c59dcc..857296a29 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/aarch64/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/aarch64/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/aarch64/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/aarch64/defs.mk index 0535a0669..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/aarch64/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/aarch64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o vfork.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/aarch64eb/config.h b/external/gpl3/binutils/lib/libiberty/arch/aarch64eb/config.h new file mode 100644 index 000000000..0eacd6116 --- /dev/null +++ b/external/gpl3/binutils/lib/libiberty/arch/aarch64eb/config.h @@ -0,0 +1,582 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the `asprintf' function. */ +#define HAVE_ASPRINTF 1 + +/* Define to 1 if you have the `atexit' function. */ +#define HAVE_ATEXIT 1 + +/* Define to 1 if you have the `basename' function. */ +#define HAVE_BASENAME 1 + +/* Define to 1 if you have the `bcmp' function. */ +#define HAVE_BCMP 1 + +/* Define to 1 if you have the `bcopy' function. */ +#define HAVE_BCOPY 1 + +/* Define to 1 if you have the `bsearch' function. */ +#define HAVE_BSEARCH 1 + +/* Define to 1 if you have the `bzero' function. */ +#define HAVE_BZERO 1 + +/* Define to 1 if you have the `calloc' function. */ +#define HAVE_CALLOC 1 + +/* Define to 1 if you have the `canonicalize_file_name' function. */ +/* #undef HAVE_CANONICALIZE_FILE_NAME */ + +/* Define to 1 if you have the `clock' function. */ +#define HAVE_CLOCK 1 + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if + you don't. */ +#define HAVE_DECL_BASENAME 0 + +/* Define to 1 if you have the declaration of `calloc', and to 0 if you don't. + */ +#define HAVE_DECL_CALLOC 1 + +/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */ +#define HAVE_DECL_FFS 1 + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#define HAVE_DECL_GETENV 1 + +/* Define to 1 if you have the declaration of `getopt', and to 0 if you don't. + */ +#define HAVE_DECL_GETOPT 1 + +/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. + */ +#define HAVE_DECL_MALLOC 1 + +/* Define to 1 if you have the declaration of `realloc', and to 0 if you + don't. */ +#define HAVE_DECL_REALLOC 1 + +/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't. + */ +#define HAVE_DECL_SBRK 1 + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#define HAVE_DECL_SNPRINTF 1 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + +/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you + don't. */ +#define HAVE_DECL_STRVERSCMP 0 + +/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VASPRINTF 1 + +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VSNPRINTF 1 + +/* Define to 1 if you have the `dup3' function. */ +#define HAVE_DUP3 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `ffs' function. */ +#define HAVE_FFS 1 + +/* Define to 1 if you have the `fork' function. */ +#define HAVE_FORK 1 + +/* Define to 1 if you have the `getcwd' function. */ +#define HAVE_GETCWD 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `getrlimit' function. */ +#define HAVE_GETRLIMIT 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* Define to 1 if you have the `getsysinfo' function. */ +/* #undef HAVE_GETSYSINFO */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `index' function. */ +#define HAVE_INDEX 1 + +/* Define to 1 if you have the `insque' function. */ +#define HAVE_INSQUE 1 + +/* Define to 1 if the system has the type `intptr_t'. */ +#define HAVE_INTPTR_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MACHINE_HAL_SYSINFO_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the `memchr' function. */ +#define HAVE_MEMCHR 1 + +/* Define to 1 if you have the `memcmp' function. */ +#define HAVE_MEMCMP 1 + +/* Define to 1 if you have the `memcpy' function. */ +#define HAVE_MEMCPY 1 + +/* Define to 1 if you have the `memmem' function. */ +#define HAVE_MEMMEM 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the `mkstemps' function. */ +#define HAVE_MKSTEMPS 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `on_exit' function. */ +/* #undef HAVE_ON_EXIT */ + +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PROCESS_H */ + +/* Define to 1 if you have the `psignal' function. */ +#define HAVE_PSIGNAL 1 + +/* Define to 1 if you have the `pstat_getdynamic' function. */ +/* #undef HAVE_PSTAT_GETDYNAMIC */ + +/* Define to 1 if you have the `pstat_getstatic' function. */ +/* #undef HAVE_PSTAT_GETSTATIC */ + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `random' function. */ +#define HAVE_RANDOM 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `rename' function. */ +#define HAVE_RENAME 1 + +/* Define to 1 if you have the `rindex' function. */ +#define HAVE_RINDEX 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setenv' function. */ +#define HAVE_SETENV 1 + +/* Define to 1 if you have the `setproctitle' function. */ +#define HAVE_SETPROCTITLE 1 + +/* Define to 1 if you have the `setrlimit' function. */ +#define HAVE_SETRLIMIT 1 + +/* Define to 1 if you have the `sigsetmask' function. */ +#define HAVE_SIGSETMASK 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `spawnve' function. */ +/* #undef HAVE_SPAWNVE */ + +/* Define to 1 if you have the `spawnvpe' function. */ +/* #undef HAVE_SPAWNVPE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDIO_EXT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `stpcpy' function. */ +#define HAVE_STPCPY 1 + +/* Define to 1 if you have the `stpncpy' function. */ +#define HAVE_STPNCPY 1 + +/* Define to 1 if you have the `strcasecmp' function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strncasecmp' function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the `strndup' function. */ +#define HAVE_STRNDUP 1 + +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + +/* Define to 1 if you have the `strrchr' function. */ +#define HAVE_STRRCHR 1 + +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + +/* Define to 1 if you have the `strstr' function. */ +#define HAVE_STRSTR 1 + +/* Define to 1 if you have the `strtod' function. */ +#define HAVE_STRTOD 1 + +/* Define to 1 if you have the `strtol' function. */ +#define HAVE_STRTOL 1 + +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 + +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + +/* Define to 1 if you have the `strverscmp' function. */ +/* #undef HAVE_STRVERSCMP */ + +/* Define to 1 if you have the `sysconf' function. */ +#define HAVE_SYSCONF 1 + +/* Define to 1 if you have the `sysctl' function. */ +#define HAVE_SYSCTL 1 + +/* Define to 1 if you have the `sysmp' function. */ +/* #undef HAVE_SYSMP */ + +/* Define if you have the sys_errlist variable. */ +#define HAVE_SYS_ERRLIST 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_MMAN_H 1 + +/* Define if you have the sys_nerr variable. */ +#define HAVE_SYS_NERR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PRCTL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PSTAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_RESOURCE_H 1 + +/* Define if you have the sys_siglist variable. */ +#define HAVE_SYS_SIGLIST 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCTL_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSINFO_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSMP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SYSTEMCFG_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TABLE_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the `table' function. */ +/* #undef HAVE_TABLE */ + +/* Define to 1 if you have the `times' function. */ +#define HAVE_TIMES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the `tmpnam' function. */ +#define HAVE_TMPNAM 1 + +/* Define if you have the \`uintptr_t' type. */ +#define HAVE_UINTPTR_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `vasprintf' function. */ +#define HAVE_VASPRINTF 1 + +/* Define to 1 if you have the `vfork' function. */ +#define HAVE_VFORK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_VFORK_H */ + +/* Define to 1 if you have the `vfprintf' function. */ +#define HAVE_VFPRINTF 1 + +/* Define to 1 if you have the `vprintf' function. */ +#define HAVE_VPRINTF 1 + +/* Define to 1 if you have the `vsprintf' function. */ +#define HAVE_VSPRINTF 1 + +/* Define to 1 if you have the `wait3' function. */ +#define HAVE_WAIT3 1 + +/* Define to 1 if you have the `wait4' function. */ +#define HAVE_WAIT4 1 + +/* Define to 1 if you have the `waitpid' function. */ +#define HAVE_WAITPID 1 + +/* Define to 1 if `fork' works. */ +#define HAVE_WORKING_FORK 1 + +/* Define to 1 if `vfork' works. */ +#define HAVE_WORKING_VFORK 1 + +/* Define to 1 if you have the `_doprnt' function. */ +/* #undef HAVE__DOPRNT */ + +/* Define if you have the _system_configuration variable. */ +/* #undef HAVE__SYSTEM_CONFIGURATION */ + +/* Define to 1 if you have the `__fsetlocking' function. */ +/* #undef HAVE___FSETLOCKING */ + +/* Define if canonicalize_file_name is not declared in system header files. */ +#define NEED_DECLARATION_CANONICALIZE_FILE_NAME 1 + +/* Define if errno must be declared even when is included. */ +/* #undef NEED_DECLARATION_ERRNO */ + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + +/* Define if you know the direction of stack growth for your system; otherwise + it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows + toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#define STACK_DIRECTION 0 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to an unsigned 64-bit type available in the compiler. */ +#define UNSIGNED_64BIT_TYPE uint64_t + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to the type of a signed integer type wide enough to hold a pointer, + if such a type exists, and if the system does not define it. */ +/* #undef intptr_t */ + +/* Define to `int' if does not define. */ +/* #undef pid_t */ + +/* Define to `int' if does not define. */ +/* #undef ssize_t */ + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +/* #undef uintptr_t */ + +/* Define as `fork' if `vfork' does not work. */ +/* #undef vfork */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/aarch64eb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..eded0f77d --- /dev/null +++ b/external/gpl3/binutils/lib/libiberty/arch/aarch64eb/defs.mk @@ -0,0 +1,8 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_ALLOCA= +G_EXTRA_OFILES= +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/alpha/config.h b/external/gpl3/binutils/lib/libiberty/arch/alpha/config.h index ca7c59dcc..857296a29 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/alpha/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/alpha/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/alpha/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/alpha/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/alpha/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/alpha/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/arm/config.h b/external/gpl3/binutils/lib/libiberty/arch/arm/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/arm/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/arm/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/arm/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/arm/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/arm/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/arm/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/armeb/config.h b/external/gpl3/binutils/lib/libiberty/arch/armeb/config.h index ca7c59dcc..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/armeb/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/armeb/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -464,16 +530,31 @@ # endif #else # ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ +# define WORDS_BIGENDIAN 1 # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/armeb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/armeb/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/armeb/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/armeb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/coldfire/config.h b/external/gpl3/binutils/lib/libiberty/arch/coldfire/config.h index cb7d1a23a..c9c39fb1c 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/coldfire/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/coldfire/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,22 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +157,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +188,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -267,6 +286,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +304,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +469,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +493,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -474,6 +533,16 @@ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/coldfire/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/coldfire/defs.mk index 613d0e3a9..2ccd55609 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/coldfire/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/coldfire/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/earm/config.h b/external/gpl3/binutils/lib/libiberty/arch/earm/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earm/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/earm/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/earm/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/earm/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earm/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/earm/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/earmeb/config.h b/external/gpl3/binutils/lib/libiberty/arch/earmeb/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earmeb/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/earmeb/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/earmeb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/earmeb/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earmeb/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/earmeb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/earmhf/config.h b/external/gpl3/binutils/lib/libiberty/arch/earmhf/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earmhf/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/earmhf/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/earmhf/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/earmhf/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earmhf/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/earmhf/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/config.h b/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/earmhfeb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/hppa/config.h b/external/gpl3/binutils/lib/libiberty/arch/hppa/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/hppa/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/hppa/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/hppa/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/hppa/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/hppa/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/hppa/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/i386/config.h b/external/gpl3/binutils/lib/libiberty/arch/i386/config.h index ca7c59dcc..26146a75e 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/i386/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/i386/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/i386/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/i386/defs.mk index 613d0e3a9..efb273d2f 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/i386/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/i386/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/ia64/config.h b/external/gpl3/binutils/lib/libiberty/arch/ia64/config.h index a21525f49..857296a29 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/ia64/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/ia64/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -205,7 +231,7 @@ #define HAVE_RINDEX 1 /* Define to 1 if you have the `sbrk' function. */ -/* #undef HAVE_SBRK */ +#define HAVE_SBRK 1 /* Define to 1 if you have the `setenv' function. */ #define HAVE_SETENV 1 @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -373,7 +408,7 @@ #define HAVE_VASPRINTF 1 /* Define to 1 if you have the `vfork' function. */ -/* #undef HAVE_VFORK */ +#define HAVE_VFORK 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_VFORK_H */ @@ -400,7 +435,7 @@ #define HAVE_WORKING_FORK 1 /* Define to 1 if `vfork' works. */ -/* #undef HAVE_WORKING_VFORK */ +#define HAVE_WORKING_VFORK 1 /* Define to 1 if you have the `_doprnt' function. */ /* #undef HAVE__DOPRNT */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ @@ -498,4 +579,4 @@ /* #undef uintptr_t */ /* Define as `fork' if `vfork' does not work. */ -#define vfork fork +/* #undef vfork */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/ia64/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/ia64/defs.mk index ec41f5f1c..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/ia64/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/ia64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o vfork.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/m68000/config.h b/external/gpl3/binutils/lib/libiberty/arch/m68000/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/m68000/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/m68000/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/m68000/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/m68000/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/m68000/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/m68000/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/m68k/config.h b/external/gpl3/binutils/lib/libiberty/arch/m68k/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/m68k/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/m68k/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/m68k/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/m68k/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/m68k/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/m68k/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/mips64eb/config.h b/external/gpl3/binutils/lib/libiberty/arch/mips64eb/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mips64eb/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/mips64eb/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/mips64eb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/mips64eb/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mips64eb/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/mips64eb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/mips64el/config.h b/external/gpl3/binutils/lib/libiberty/arch/mips64el/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mips64el/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/mips64el/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/mips64el/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/mips64el/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mips64el/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/mips64el/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/mipseb/config.h b/external/gpl3/binutils/lib/libiberty/arch/mipseb/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mipseb/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/mipseb/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/mipseb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/mipseb/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mipseb/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/mipseb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/mipsel/config.h b/external/gpl3/binutils/lib/libiberty/arch/mipsel/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mipsel/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/mipsel/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/mipsel/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/mipsel/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/mipsel/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/mipsel/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/or1k/config.h b/external/gpl3/binutils/lib/libiberty/arch/or1k/config.h index cdf189d5a..c950bfd9f 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/or1k/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/or1k/config.h @@ -84,6 +84,22 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +157,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -267,6 +286,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +304,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +469,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +493,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -474,6 +533,16 @@ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/or1k/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/or1k/defs.mk index 8d89bb4ca..259187f3a 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/or1k/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/or1k/defs.mk @@ -5,4 +5,4 @@ G_ALLOCA= G_EXTRA_OFILES= G_LIBOBJS=mempcpy.o strverscmp.o vfork.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/powerpc/config.h b/external/gpl3/binutils/lib/libiberty/arch/powerpc/config.h index 7568539a6..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/powerpc/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/powerpc/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/powerpc/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/powerpc/defs.mk index 824c708fc..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/powerpc/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/powerpc/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= G_LIBOBJS=mempcpy.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/powerpc64/config.h b/external/gpl3/binutils/lib/libiberty/arch/powerpc64/config.h index 45a33c644..94188758d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/powerpc64/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/powerpc64/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/powerpc64/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/powerpc64/defs.mk index ea290a503..7f063ee32 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/powerpc64/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/powerpc64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o vfork.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o vfork.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/riscv32/config.h b/external/gpl3/binutils/lib/libiberty/arch/riscv32/config.h index 809169659..24c712bc9 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/riscv32/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/riscv32/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/riscv32/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/riscv32/defs.mk index 8d89bb4ca..7f063ee32 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/riscv32/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/riscv32/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= G_LIBOBJS=mempcpy.o strverscmp.o vfork.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/riscv64/config.h b/external/gpl3/binutils/lib/libiberty/arch/riscv64/config.h index 809169659..767d9cb0a 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/riscv64/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/riscv64/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/riscv64/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/riscv64/defs.mk index 8d89bb4ca..7f063ee32 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/riscv64/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/riscv64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= G_LIBOBJS=mempcpy.o strverscmp.o vfork.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/sh3eb/config.h b/external/gpl3/binutils/lib/libiberty/arch/sh3eb/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sh3eb/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/sh3eb/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/sh3eb/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/sh3eb/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sh3eb/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/sh3eb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/sh3el/config.h b/external/gpl3/binutils/lib/libiberty/arch/sh3el/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sh3el/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/sh3el/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/sh3el/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/sh3el/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sh3el/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/sh3el/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/sparc/config.h b/external/gpl3/binutils/lib/libiberty/arch/sparc/config.h index cb7d1a23a..047f379b7 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sparc/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/sparc/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/sparc/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/sparc/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sparc/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/sparc/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/sparc64/config.h b/external/gpl3/binutils/lib/libiberty/arch/sparc64/config.h index cb7d1a23a..0eacd6116 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sparc64/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/sparc64/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/sparc64/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/sparc64/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/sparc64/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/sparc64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/vax/config.h b/external/gpl3/binutils/lib/libiberty/arch/vax/config.h index ca7c59dcc..ccd6b8c56 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/vax/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/vax/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/vax/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/vax/defs.mk index 613d0e3a9..eded0f77d 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/vax/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/vax/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libiberty/arch/x86_64/config.h b/external/gpl3/binutils/lib/libiberty/arch/x86_64/config.h index ca7c59dcc..01e4b587f 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/x86_64/config.h +++ b/external/gpl3/binutils/lib/libiberty/arch/x86_64/config.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ /* config.in. Generated from configure.ac by autoheader. */ @@ -84,6 +84,26 @@ don't. */ #define HAVE_DECL_SNPRINTF 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't. + */ +#define HAVE_DECL_STRTOL 1 + +/* Define to 1 if you have the declaration of `strtoll', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOLL 1 + +/* Define to 1 if you have the declaration of `strtoul', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOUL 1 + +/* Define to 1 if you have the declaration of `strtoull', and to 0 if you + don't. */ +#define HAVE_DECL_STRTOULL 1 + /* Define to 1 if you have the declaration of `strverscmp', and to 0 if you don't. */ #define HAVE_DECL_STRVERSCMP 0 @@ -141,6 +161,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 +/* Define if you have the `long long' type. */ +#define HAVE_LONG_LONG 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_MACHINE_HAL_SYSINFO_H */ @@ -169,7 +192,7 @@ #define HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemps' function. */ -/* #undef HAVE_MKSTEMPS */ +#define HAVE_MKSTEMPS 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 @@ -177,6 +200,9 @@ /* Define to 1 if you have the `on_exit' function. */ /* #undef HAVE_ON_EXIT */ +/* Define to 1 if you have the `pipe2' function. */ +#define HAVE_PIPE2 1 + /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ @@ -267,6 +293,9 @@ /* Define to 1 if you have the `strndup' function. */ #define HAVE_STRNDUP 1 +/* Define to 1 if you have the `strnlen' function. */ +#define HAVE_STRNLEN 1 + /* Define to 1 if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -282,9 +311,15 @@ /* Define to 1 if you have the `strtol' function. */ #define HAVE_STRTOL 1 +/* Define to 1 if you have the `strtoll' function. */ +#define HAVE_STRTOLL 1 + /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 +/* Define to 1 if you have the `strtoull' function. */ +#define HAVE_STRTOULL 1 + /* Define to 1 if you have the `strverscmp' function. */ /* #undef HAVE_STRVERSCMP */ @@ -441,6 +476,15 @@ /* The size of `int', as computed by sizeof. */ #define SIZEOF_INT 4 +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 8 + /* Define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses @@ -456,6 +500,28 @@ /* Define to an unsigned 64-bit type available in the compiler. */ #define UNSIGNED_64BIT_TYPE uint64_t +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD @@ -468,12 +534,27 @@ # endif #endif +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files, on AIX-style hosts. */ /* #undef _LARGE_FILES */ +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ diff --git a/external/gpl3/binutils/lib/libiberty/arch/x86_64/defs.mk b/external/gpl3/binutils/lib/libiberty/arch/x86_64/defs.mk index 613d0e3a9..efb273d2f 100644 --- a/external/gpl3/binutils/lib/libiberty/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/lib/libiberty/arch/x86_64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_ALLOCA= G_EXTRA_OFILES= -G_LIBOBJS=mempcpy.o mkstemps.o strverscmp.o -G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o +G_LIBOBJS=mempcpy.o strverscmp.o +G_REQUIRED_OFILES=regex.o cplus-dem.o cp-demangle.o md5.o sha1.o alloca.o argv.o choose-temp.o concat.o cp-demint.o crc32.o d-demangle.o dwarfnames.o dyn-string.o fdmatch.o fibheap.o filedescriptor.o filename_cmp.o floatformat.o fnmatch.o fopen_unlocked.o getopt.o getopt1.o getpwd.o getruntime.o hashtab.o hex.o lbasename.o lrealpath.o make-relative-prefix.o make-temp-file.o objalloc.o obstack.o partition.o pexecute.o physmem.o pex-common.o pex-one.o pex-unix.o vprintf-support.o rust-demangle.o safe-ctype.o simple-object.o simple-object-coff.o simple-object-elf.o simple-object-mach-o.o simple-object-xcoff.o sort.o spaces.o splay-tree.o stack-limit.o strerror.o strsignal.o timeval-utils.o unlink-if-ordinary.o xasprintf.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o xstrerror.o xstrndup.o xvasprintf.o diff --git a/external/gpl3/binutils/lib/libopcodes/Makefile b/external/gpl3/binutils/lib/libopcodes/Makefile index 63c5e561b..fc99fc2ab 100644 --- a/external/gpl3/binutils/lib/libopcodes/Makefile +++ b/external/gpl3/binutils/lib/libopcodes/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2013/09/29 14:20:35 christos Exp $ +# $NetBSD: Makefile,v 1.12 2020/04/04 00:46:54 christos Exp $ NOLINKLIB= # defined NOLINT= # defined @@ -6,7 +6,7 @@ NOMAN= # defined NOPROFILE= # defined NOCLANGERROR= # defined -.include +.include LIB= opcodes @@ -15,15 +15,13 @@ BFD_MACHINE_ARCH?= ${MACHINE_ARCH:C/armv[4-7]/arm/} .if exists(${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk) .include "${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk" -DIST= ${NETBSDSRCDIR}/external/gpl3/binutils/dist - .if defined(__MINIX) # MINIX: make sure sources are fetched, even when tools not built earlier GNUHOSTDIST= ${DIST} .include "${.CURDIR}/../../../../../minix/Makefile.fetchgnu" .endif # defined(__MINIX) -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 10 SHLIB_MINOR= 0 GCPPFLAGS= ${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS} diff --git a/external/gpl3/binutils/lib/libopcodes/arch/aarch64/config.h b/external/gpl3/binutils/lib/libopcodes/arch/aarch64/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/aarch64/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/aarch64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/aarch64eb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/aarch64eb/config.h new file mode 100644 index 000000000..a8e838386 --- /dev/null +++ b/external/gpl3/binutils/lib/libopcodes/arch/aarch64eb/config.h @@ -0,0 +1,127 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Check that config.h is #included before system headers + (this works only for glibc, but that should be enough). */ +#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) +# error config.h must be #included before system headers +#endif +#define __CONFIG_H__ 1 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Define to 1 if you have the declaration of `basename', and to 0 if you + don't. */ +#define HAVE_DECL_BASENAME 0 + +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. + */ +#define HAVE_DECL_STPCPY 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "opcodes" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "opcodes" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "opcodes 2.34" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "opcodes" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.34" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +#define STRING_WITH_STRINGS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "2.34" + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/aarch64eb/defs.mk b/external/gpl3/binutils/lib/libopcodes/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..fadff7ed2 --- /dev/null +++ b/external/gpl3/binutils/lib/libopcodes/arch/aarch64eb/defs.mk @@ -0,0 +1,7 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# +G_archdefs=-DARCH_aarch64 -DARCH_arm +G_BFD_MACHINES=aarch64-asm.lo aarch64-dis.lo aarch64-opc.lo aarch64-asm-2.lo aarch64-dis-2.lo aarch64-opc-2.lo arm-dis.lo +G_libopcodes_la_SOURCES=dis-buf.c disassemble.c dis-init.c diff --git a/external/gpl3/binutils/lib/libopcodes/arch/alpha/config.h b/external/gpl3/binutils/lib/libopcodes/arch/alpha/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/alpha/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/alpha/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/arm/config.h b/external/gpl3/binutils/lib/libopcodes/arch/arm/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/arm/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/arm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/armeb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/armeb/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/armeb/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/armeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/coldfire/config.h b/external/gpl3/binutils/lib/libopcodes/arch/coldfire/config.h index beb23fa93..05f11b70e 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/coldfire/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/coldfire/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h b/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h index 157259f6a..a2a80e790 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/earm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -38,6 +38,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -70,19 +73,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -113,7 +116,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/earmeb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/earmeb/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/earmeb/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/earmeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/earmhf/config.h b/external/gpl3/binutils/lib/libopcodes/arch/earmhf/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/earmhf/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/earmhf/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/earmhfeb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/earmhfeb/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/earmhfeb/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/earmhfeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/hppa/config.h b/external/gpl3/binutils/lib/libopcodes/arch/hppa/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/hppa/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/hppa/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/i386/config.h b/external/gpl3/binutils/lib/libopcodes/arch/i386/config.h index 157259f6a..4d61f3237 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/i386/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/i386/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -38,6 +38,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -70,19 +73,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -113,7 +116,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/i386/defs.mk b/external/gpl3/binutils/lib/libopcodes/arch/i386/defs.mk index ce0f85c9d..530f60275 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/i386/defs.mk +++ b/external/gpl3/binutils/lib/libopcodes/arch/i386/defs.mk @@ -1,7 +1,7 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.5 2006/02/02 20:06:04 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # -G_archdefs=-DARCH_i386 +G_archdefs=-DARCH_i386 -DARCH_iamcu G_BFD_MACHINES=i386-dis.lo i386-opc.lo G_libopcodes_la_SOURCES=dis-buf.c disassemble.c dis-init.c diff --git a/external/gpl3/binutils/lib/libopcodes/arch/ia64/config.h b/external/gpl3/binutils/lib/libopcodes/arch/ia64/config.h index c556a5617..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/ia64/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/ia64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/m68000/config.h b/external/gpl3/binutils/lib/libopcodes/arch/m68000/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/m68000/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/m68000/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/m68k/config.h b/external/gpl3/binutils/lib/libopcodes/arch/m68k/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/m68k/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/m68k/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/mips64eb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/mips64eb/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/mips64eb/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/mips64eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/mips64el/config.h b/external/gpl3/binutils/lib/libopcodes/arch/mips64el/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/mips64el/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/mips64el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/mipseb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/mipseb/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/mipseb/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/mipseb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/mipsel/config.h b/external/gpl3/binutils/lib/libopcodes/arch/mipsel/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/mipsel/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/mipsel/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/or1k/config.h b/external/gpl3/binutils/lib/libopcodes/arch/or1k/config.h index c556a5617..05f11b70e 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/or1k/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/or1k/config.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/powerpc/config.h b/external/gpl3/binutils/lib/libopcodes/arch/powerpc/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/powerpc/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/powerpc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/powerpc64/config.h b/external/gpl3/binutils/lib/libopcodes/arch/powerpc64/config.h index 586c0847e..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/powerpc64/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/powerpc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/riscv32/config.h b/external/gpl3/binutils/lib/libopcodes/arch/riscv32/config.h index c556a5617..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/riscv32/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/riscv32/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/riscv64/config.h b/external/gpl3/binutils/lib/libopcodes/arch/riscv64/config.h index c556a5617..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/riscv64/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/riscv64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/sh3eb/config.h b/external/gpl3/binutils/lib/libopcodes/arch/sh3eb/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/sh3eb/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/sh3eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/sh3el/config.h b/external/gpl3/binutils/lib/libopcodes/arch/sh3el/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/sh3el/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/sh3el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/sparc/config.h b/external/gpl3/binutils/lib/libopcodes/arch/sparc/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/sparc/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/sparc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/sparc64/config.h b/external/gpl3/binutils/lib/libopcodes/arch/sparc64/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/sparc64/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/sparc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/vax/config.h b/external/gpl3/binutils/lib/libopcodes/arch/vax/config.h index beb23fa93..a8e838386 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/vax/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/vax/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h b/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h index beb23fa93..7ef5f0163 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h +++ b/external/gpl3/binutils/lib/libopcodes/arch/x86_64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -36,6 +36,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 +/* Define if sigsetjmp is available. */ +#define HAVE_SIGSETJMP 1 + /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 @@ -68,19 +71,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "opcodes" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "opcodes 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "opcodes" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -111,7 +114,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/external/gpl3/binutils/lib/libopcodes/arch/x86_64/defs.mk b/external/gpl3/binutils/lib/libopcodes/arch/x86_64/defs.mk index e9161af08..28071ab5e 100644 --- a/external/gpl3/binutils/lib/libopcodes/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/lib/libopcodes/arch/x86_64/defs.mk @@ -1,7 +1,7 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.15 2017/11/29 03:32:28 christos Exp # -G_archdefs=-DARCH_i386 -DARCH_l1om -DARCH_k1om +G_archdefs=-DARCH_i386 -DARCH_iamcu -DARCH_l1om -DARCH_k1om G_BFD_MACHINES=i386-dis.lo i386-opc.lo G_libopcodes_la_SOURCES=dis-buf.c disassemble.c dis-init.c diff --git a/external/gpl3/binutils/patches/0000-Base-NetBSD.patch b/external/gpl3/binutils/patches/0000-Base-NetBSD.patch new file mode 100644 index 000000000..d037730f6 --- /dev/null +++ b/external/gpl3/binutils/patches/0000-Base-NetBSD.patch @@ -0,0 +1,14319 @@ +diff -rNU3 a/bfd/aoutx.h b/bfd/aoutx.h +--- a/bfd/aoutx.h 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/aoutx.h 2021-03-30 17:47:59.502219000 -0300 +@@ -757,7 +757,7 @@ + break; + + case bfd_arch_arm: +- if (machine == 0) ++ if (machine == 0 || machine == 5) + arch_flags = M_ARM; + break; + +diff -rNU3 a/bfd/archive.c b/bfd/archive.c +--- a/bfd/archive.c 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/archive.c 2021-03-30 17:47:59.502219000 -0300 +@@ -162,6 +162,9 @@ + #define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen) + + #define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) ++ ++static const char * normalize (bfd *, const char *); ++ + #define arch_hdr(bfd) ((struct ar_hdr *) arch_eltdata (bfd)->arch_header) + + /* True iff NAME designated a BSD 4.4 extended name. */ +@@ -815,6 +818,16 @@ + { + filestart = last_file->proxy_origin; + if (! bfd_is_thin_archive (archive)) ++#if 0 ++/* OLD CODE */ ++ filestart += size; ++ /* Pad to an even boundary... ++ Note that last_file->origin can be odd in the case of ++ BSD-4.4-style element with a long odd size. */ ++ if (!strncmp(arch_hdr (last_file)->ar_name, "#1/", 3)) ++ size += strlen(normalize(last_file, last_file->filename)); ++ filestart += size % 2; ++#endif + { + bfd_size_type size = arelt_size (last_file); + +@@ -2175,11 +2188,22 @@ + current = current->archive_next) + { + char buffer[DEFAULT_BUFFERSIZE]; +- bfd_size_type remaining = arelt_size (current); ++ bfd_size_type saved_size = arelt_size (current); ++ bfd_size_type remaining = saved_size; ++ struct ar_hdr *hdr = arch_hdr (current); + + /* Write ar header. */ + if (!_bfd_write_ar_hdr (arch, current)) +- return FALSE; ++ return FALSE; ++ /* Write filename if it is a 4.4BSD extended file, and add to size. */ ++ if (!strncmp (hdr->ar_name, "#1/", 3)) ++ { ++ const char *normal = normalize (current, current->filename); ++ unsigned int thislen = strlen (normal); ++ if (bfd_write (normal, 1, thislen, arch) != thislen) ++ return FALSE; ++ saved_size += thislen; ++ } + if (bfd_is_thin_archive (arch)) + continue; + if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) +@@ -2510,11 +2534,19 @@ + { + do + { ++#if 1 ++ bfd_size_type size = arelt_size (current); ++ if (!strncmp(arch_hdr (current)->ar_name, "#1/", 3)) ++ size += strlen(normalize(current, current->filename)); ++ firstreal += size + sizeof (struct ar_hdr); ++ firstreal += size % 2; ++#else + struct areltdata *ared = arch_eltdata (current); + + firstreal += (ared->parsed_size + ared->extra_size + + sizeof (struct ar_hdr)); + firstreal += firstreal % 2; ++#endif + current = current->archive_next; + } + while (current != map[count].u.abfd); +diff -rNU3 a/bfd/archures.c b/bfd/archures.c +--- a/bfd/archures.c 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/archures.c 2021-03-30 17:47:59.502219000 -0300 +@@ -651,6 +651,7 @@ + extern const bfd_arch_info_type bfd_nfp_arch; + extern const bfd_arch_info_type bfd_nios2_arch; + extern const bfd_arch_info_type bfd_ns32k_arch; ++extern const bfd_arch_info_type bfd_openrisc_arch; + extern const bfd_arch_info_type bfd_or1k_arch; + extern const bfd_arch_info_type bfd_pdp11_arch; + extern const bfd_arch_info_type bfd_pj_arch; +@@ -741,6 +742,7 @@ + &bfd_nfp_arch, + &bfd_nios2_arch, + &bfd_ns32k_arch, ++ &bfd_openrisc_arch, + &bfd_or1k_arch, + &bfd_pdp11_arch, + &bfd_powerpc_arch, +diff -rNU3 a/bfd/coff-alpha.c b/bfd/coff-alpha.c +--- a/bfd/coff-alpha.c 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/coff-alpha.c 2021-03-30 17:47:59.512219000 -0300 +@@ -640,7 +640,9 @@ + case ALPHA_R_OP_STORE: + /* The STORE reloc needs the size and offset fields. We store + them in the addend. */ ++#if 0 + BFD_ASSERT (intern->r_offset <= 256); ++#endif + rptr->addend = (intern->r_offset << 8) + intern->r_size; + break; + +diff -rNU3 a/bfd/config.bfd b/bfd/config.bfd +--- a/bfd/config.bfd 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/config.bfd 2021-03-30 17:47:59.522219000 -0300 +@@ -179,6 +179,7 @@ + i[3-7]86) targ_archs=bfd_i386_arch ;; + ia16) targ_archs=bfd_i386_arch ;; + lm32) targ_archs=bfd_lm32_arch ;; ++m5200|m5407) targ_archs=bfd_m68k_arch ;; + m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;; + m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;; + m68*) targ_archs=bfd_m68k_arch ;; +@@ -252,12 +253,12 @@ + targ_selvecs=aarch64_elf64_be_cloudabi_vec + want64=true + ;; +- aarch64-*-linux*) ++ aarch64-*-linux* | aarch64-*-netbsd*) + targ_defvec=aarch64_elf64_le_vec + targ_selvecs="aarch64_elf64_be_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_le_vec arm_elf32_be_vec" + want64=true + ;; +- aarch64_be-*-linux*) ++ aarch64_be-*-linux* | aarch64_be-*-netbsd*) + targ_defvec=aarch64_elf64_be_vec + targ_selvecs="aarch64_elf64_le_vec aarch64_elf32_le_vec aarch64_elf32_be_vec arm_elf32_be_vec arm_elf32_le_vec" + want64=true +@@ -348,11 +349,11 @@ + targ64_selvecs="x86_64_elf32_nacl_vec x86_64_elf64_nacl_vec" + targ_archs="$targ_archs bfd_i386_arch" + ;; +- armeb-*-netbsdelf*) ++ arm*eb-*-netbsdelf*) + targ_defvec=arm_elf32_be_vec + targ_selvecs="arm_elf32_le_vec" + ;; +- arm-*-netbsdelf*) ++ arm*-*-netbsdelf*) + targ_defvec=arm_elf32_le_vec + targ_selvecs="arm_elf32_be_vec" + ;; +@@ -621,8 +622,8 @@ + ;; + i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu) + targ_defvec=i386_elf32_vec +- targ_selvecs="iamcu_elf32_vec" +- targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec" ++ targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec i386_aout_bsd_vec i386_aout_nbsd_vec" ++ targ64_selvecs="x86_64_elf64_vec l1om_elf64_vec k1om_elf64_vec x86_64_pei_vec" + ;; + i[3-7]86-*-netbsdpe*) + targ_defvec=i386_pe_vec +@@ -685,7 +686,7 @@ + ;; + x86_64-*-netbsd* | x86_64-*-openbsd*) + targ_defvec=x86_64_elf64_vec +- targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec" ++ targ_selvecs="i386_elf32_vec iamcu_elf32_vec i386_coff_vec i386_pei_vec i386_aout_bsd_vec i386_aout_nbsd_vec x86_64_pei_vec l1om_elf64_vec k1om_elf64_vec" + want64=true + ;; + x86_64-*-linux-*) +@@ -850,14 +851,6 @@ + ;; + + #ifdef BFD64 +- mips*el-*-netbsd*) +- targ_defvec=mips_elf32_trad_le_vec +- targ_selvecs="mips_elf32_trad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec" +- ;; +- mips*-*-netbsd*) +- targ_defvec=mips_elf32_trad_be_vec +- targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" +- ;; + mips*-*-irix6*) + targ_defvec=mips_elf32_n_be_vec + targ_selvecs="mips_elf32_n_le_vec mips_elf32_be_vec mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec" +@@ -898,6 +891,22 @@ + targ_defvec=mips_elf32_be_vec + targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec" + ;; ++ mips64*el-*-netbsd*) ++ targ_defvec=mips_elf32_ntrad_le_vec ++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec mips_ecoff_le_vec mips_ecoff_be_vec" ++ ;; ++ mips64*-*-netbsd*) ++ targ_defvec=mips_elf32_ntrad_be_vec ++ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" ++ ;; ++ mips*el-*-netbsd*) ++ targ_defvec=mips_elf32_trad_le_vec ++ targ_selvecs="mips_elf32_trad_be_vec mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec mips_ecoff_le_vec mips_ecoff_be_vec" ++ ;; ++ mips*-*-netbsd*) ++ targ_defvec=mips_elf32_trad_be_vec ++ targ_selvecs="mips_elf32_trad_le_vec mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec mips_ecoff_be_vec mips_ecoff_le_vec" ++ ;; + mips64*-*-openbsd*) + targ_defvec=mips_elf64_trad_be_vec + targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec" +@@ -1029,7 +1038,7 @@ + targ_selvecs=nios2_elf32_be_vec + ;; + +- or1k-*-elf | or1k-*-linux* | or1k-*-rtems*) ++ or1k-*-elf | or1k-*-linux* | or1k-*-rtems* | or1k*-*-netbsd*) + targ_defvec=or1k_elf32_vec + ;; + +@@ -1189,6 +1198,14 @@ + targ_underscore=yes + ;; + ++#ifdef BFD64 ++ riscv*-*-*) ++ targ_defvec=riscv_elf64_vec ++ targ_selvecs="riscv_elf32_vec riscv_elf64_vec" ++ want64=true ++ ;; ++#endif ++ + rx-*-elf) + targ_defvec=rx_elf32_le_vec + targ_selvecs="rx_elf32_be_vec rx_elf32_le_vec rx_elf32_be_ns_vec" +@@ -1241,9 +1258,10 @@ + targ_defvec=sh_elf32_nbsd_le_vec + targ_selvecs="sh_elf32_nbsd_vec sh_coff_vec sh_coff_le_vec" + ;; +- sh*-*-netbsdelf*) ++ sh-*-netbsdelf*) + targ_defvec=sh_elf32_nbsd_vec + targ_selvecs="sh_elf32_nbsd_le_vec sh_coff_vec sh_coff_le_vec" ++ want64=true + ;; + + shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*) +@@ -1287,6 +1305,10 @@ + targ_underscore=yes + ;; + ++ sparc-*-netbsdelf*) ++ targ_defvec=sparc_elf32_vec ++ want64=true ++ ;; + sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) + targ_defvec=sparc_elf32_sol2_vec + ;; +diff -rNU3 a/bfd/configure b/bfd/configure +--- a/bfd/configure 2021-03-30 23:12:40.094559932 -0300 ++++ b/bfd/configure 2021-03-30 17:47:59.522219000 -0300 +@@ -12461,7 +12461,7 @@ + *) as_fn_error $? "bad value ${enableval} for secureplt option" "$LINENO" 5 ;; + esac + else +- use_secureplt=true ++ use_secureplt=false + fi + if test $use_secureplt = true; then + +@@ -12523,10 +12523,10 @@ + withval=$with_pkgversion; case "$withval" in + yes) as_fn_error $? "package version not specified" "$LINENO" 5 ;; + no) PKGVERSION= ;; +- *) PKGVERSION="($withval) " ;; ++ *) PKGVERSION="($withval)\ " ;; + esac + else +- PKGVERSION="(GNU Binutils) " ++ PKGVERSION="(GNU Binutils)\ " + + fi + +@@ -14752,6 +14752,7 @@ + i386_aout_vec) tb="$tb i386aout.lo aout32.lo" ;; + i386_aout_bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; + i386_aout_lynx_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;; ++ i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; + i386_coff_vec) tb="$tb coff-i386.lo $coff" ;; + i386_coff_go32_vec) tb="$tb coff-go32.lo $coff" ;; + i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo $coff" ;; +@@ -15119,6 +15120,7 @@ + COREFILE=netbsd-core.lo + ;; + arm-*-riscix) COREFILE=trad-core.lo ;; ++ arm*-*-netbsd*) COREFILE=netbsd-core.lo ;; + hppa*-*-hpux*) COREFILE=hpux-core.lo ;; + hppa*-*-hiux*) COREFILE=hpux-core.lo ;; + hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; +diff -rNU3 a/bfd/configure.ac b/bfd/configure.ac +--- a/bfd/configure.ac 2021-03-30 23:12:40.097893265 -0300 ++++ b/bfd/configure.ac 2021-03-30 17:47:59.522219000 -0300 +@@ -86,7 +86,7 @@ + yes) use_secureplt=true ;; + no) use_secureplt=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for secureplt option) ;; +-esac],[use_secureplt=true])dnl ++esac],[use_secureplt=false])dnl + if test $use_secureplt = true; then + AC_DEFINE(USE_SECUREPLT, 1, + [Define if we should default to creating read-only plt entries]) +@@ -488,6 +488,7 @@ + i386_aout_vec) tb="$tb i386aout.lo aout32.lo" ;; + i386_aout_bsd_vec) tb="$tb i386bsd.lo aout32.lo" ;; + i386_aout_lynx_vec) tb="$tb i386lynx.lo lynx-core.lo aout32.lo" ;; ++ i386_aout_nbsd_vec) tb="$tb i386netbsd.lo aout32.lo" ;; + i386_coff_vec) tb="$tb coff-i386.lo $coff" ;; + i386_coff_go32_vec) tb="$tb coff-go32.lo $coff" ;; + i386_coff_go32stubbed_vec) tb="$tb coff-stgo32.lo $coff" ;; +diff -rNU3 a/bfd/configure.host b/bfd/configure.host +--- a/bfd/configure.host 2021-03-30 23:12:40.097893265 -0300 ++++ b/bfd/configure.host 2021-03-30 17:47:59.532219000 -0300 +@@ -72,6 +72,10 @@ + mips*-*-sysv*) HDEFINES="-G 4" ;; + mips*-*-riscos*) HDEFINES="-G 4" ;; + ++sparc64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;; ++ ++x86_64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;; ++ + # Some Solaris systems (osol0906 at least) have a libc that doesn't recognise + # the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the + # default code page used by windres/windmc when not specified by a commandline +diff -rNU3 a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in +--- a/bfd/doc/Makefile.in 2021-03-30 23:12:40.097893265 -0300 ++++ b/bfd/doc/Makefile.in 2021-03-30 17:47:59.552219000 -0300 +@@ -538,6 +538,8 @@ + -rm -rf .libs _libs + + bfd.info: bfd.texi $(bfd_TEXINFOS) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_bfd.info: bfd.texinfo $(bfd_TEXINFOS) + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ +diff -rNU3 a/bfd/doc/reloc.texi b/bfd/doc/reloc.texi +--- a/bfd/doc/reloc.texi 2021-03-30 23:12:40.097893265 -0300 ++++ b/bfd/doc/reloc.texi 2021-03-30 17:47:59.558886000 -0300 +@@ -557,6 +557,12 @@ + @deffnx {} BFD_RELOC_68K_TLS_LE8 + Relocations used by 68K ELF. + @end deffn ++@deffn {} BFD_RELOC_VAX_GLOB_DAT ++@deffnx {} BFD_RELOC_VAX_GLOB_REF ++@deffnx {} BFD_RELOC_VAX_JMP_SLOT ++@deffnx {} BFD_RELOC_VAX_RELATIVE ++Relocations used by VAX ELF. ++@end deffn + @deffn {} BFD_RELOC_32_BASEREL + @deffnx {} BFD_RELOC_16_BASEREL + @deffnx {} BFD_RELOC_LO16_BASEREL +diff -rNU3 a/bfd/elf32-arm.c b/bfd/elf32-arm.c +--- a/bfd/elf32-arm.c 2021-03-30 23:12:40.111226599 -0300 ++++ b/bfd/elf32-arm.c 2021-03-30 17:47:59.578886000 -0300 +@@ -3488,6 +3488,7 @@ + #endif + } + ++#if !defined (__NetBSD__) || (__NetBSD_Version__ < 600000000) + static inline int + elf32_arm_popcount (unsigned int mask) + { +@@ -3506,6 +3507,7 @@ + return sum; + #endif + } ++#endif + + static void elf32_arm_add_dynreloc (bfd *output_bfd, struct bfd_link_info *info, + asection *sreloc, Elf_Internal_Rela *rel); +diff -rNU3 a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c +--- a/bfd/elf32-hppa.c 2021-03-30 23:12:40.111226599 -0300 ++++ b/bfd/elf32-hppa.c 2021-03-30 17:47:59.598886000 -0300 +@@ -2095,7 +2095,6 @@ + info->callbacks->minfo + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), + sec->owner, eh->root.root.string, sec); +- + /* Not an error, just cut short the traversal. */ + return FALSE; + } +diff -rNU3 a/bfd/elf32-i386.c b/bfd/elf32-i386.c +--- a/bfd/elf32-i386.c 2021-03-30 23:12:40.114559932 -0300 ++++ b/bfd/elf32-i386.c 2021-03-30 17:47:59.602219000 -0300 +@@ -534,9 +534,14 @@ + one of the last functions. */ + + /* The size in bytes of an entry in the lazy procedure linkage table. */ +- + #define LAZY_PLT_ENTRY_SIZE 16 + ++/* The name of the dynamic interpreter. This is put in the .interp ++ section. */ ++ ++#define ELF_DYNAMIC_INTERPRETER "/libexec/ld.elf_so" ++ ++ + /* The size in bytes of an entry in the non-lazy procedure linkage + table. */ + +diff -rNU3 a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c +--- a/bfd/elf32-m68k.c 2021-03-30 23:12:40.114559932 -0300 ++++ b/bfd/elf32-m68k.c 2021-03-30 17:47:59.608886000 -0300 +@@ -2486,7 +2486,7 @@ + if (ind->got_entry_key != 0) + { + BFD_ASSERT (dir->got_entry_key == 0); +- /* Assert that GOTs aren't partioned yet. */ ++ /* Assert that GOTs aren't partitioned yet. */ + BFD_ASSERT (ind->glist == NULL); + + dir->got_entry_key = ind->got_entry_key; +@@ -2743,7 +2743,13 @@ + && !(ELF32_R_TYPE (rel->r_info) == R_68K_PC8 + || ELF32_R_TYPE (rel->r_info) == R_68K_PC16 + || ELF32_R_TYPE (rel->r_info) == R_68K_PC32)) +- info->flags |= DF_TEXTREL; ++ { ++ if (info->warn_shared_textrel) ++ (*_bfd_error_handler) ++ (_("warning: dynamic relocation to `%s' in readonly section `%s'"), ++ h->root.root.string, sec->name); ++ info->flags |= DF_TEXTREL; ++ } + + sreloc->size += sizeof (Elf32_External_Rela); + +@@ -2905,6 +2911,7 @@ + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && (h->needs_plt ++ || h->type == STT_GNU_IFUNC + || h->is_weakalias + || (h->def_dynamic + && h->ref_regular +@@ -2913,7 +2920,7 @@ + /* If this is a function, put it in the procedure linkage table. We + will fill in the contents of the procedure linkage table later, + when we know the address of the .got section. */ +- if (h->type == STT_FUNC ++ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) + || h->needs_plt) + { + if ((h->plt.refcount <= 0 +@@ -3234,6 +3241,10 @@ + s = s->next) + if ((s->section->flags & SEC_READONLY) != 0) + { ++ if (info->warn_shared_textrel) ++ (*_bfd_error_handler) ++ (_("warning: dynamic relocation to `%s' in readonly section `%s'"), ++ h->root.root.string, s->section->name); + info->flags |= DF_TEXTREL; + break; + } +diff -rNU3 a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c +--- a/bfd/elf32-ppc.c 2021-03-30 23:12:40.117893266 -0300 ++++ b/bfd/elf32-ppc.c 2021-03-30 17:47:59.625553000 -0300 +@@ -3017,7 +3017,7 @@ + sec->nomark_tls_get_addr = 1; + } + +- switch (r_type) ++ switch ((int)r_type) + { + case R_PPC_TLSGD: + case R_PPC_TLSLD: +@@ -5438,9 +5438,16 @@ + struct bfd_link_info *info = (struct bfd_link_info *) info_p; + + info->flags |= DF_TEXTREL; +- info->callbacks->minfo +- (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), +- sec->owner, h->root.root.string, sec); ++ /* xgettext:c-format */ ++ info->callbacks->minfo (_("%pB: dynamic relocation against `%pT' " ++ "in read-only section `%pA'\n"), ++ sec->owner, h->root.root.string, sec); ++ if ((info->warn_shared_textrel && bfd_link_pic (info)) ++ || info->error_textrel) ++ /* xgettext:c-format */ ++ info->callbacks->einfo (_("%P: %pB: warning: relocation against `%s' " ++ "in read-only section `%pA'\n"), ++ sec->owner, h->root.root.string, sec); + + /* Not an error, just cut short the traversal. */ + return FALSE; +diff -rNU3 a/bfd/elf32-sh.c b/bfd/elf32-sh.c +--- a/bfd/elf32-sh.c 2021-03-30 23:12:40.124559932 -0300 ++++ b/bfd/elf32-sh.c 2021-03-30 17:47:59.638886000 -0300 +@@ -2526,6 +2526,7 @@ + /* Make sure we know what is going on here. */ + BFD_ASSERT (htab->root.dynobj != NULL + && (h->needs_plt ++ || h->type == STT_GNU_IFUNC + || h->is_weakalias + || (h->def_dynamic + && h->ref_regular +@@ -2534,7 +2535,7 @@ + /* If this is a function, put it in the procedure linkage table. We + will fill in the contents of the procedure linkage table later, + when we know the address of the .got section. */ +- if (h->type == STT_FUNC ++ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) + || h->needs_plt) + { + if (h->plt.refcount <= 0 +diff -rNU3 a/bfd/elf32-vax.c b/bfd/elf32-vax.c +--- a/bfd/elf32-vax.c 2021-03-30 23:12:40.124559932 -0300 ++++ b/bfd/elf32-vax.c 2021-03-30 17:47:59.642219000 -0300 +@@ -497,6 +497,24 @@ + return TRUE; + } + ++/* Copy vax-specific data from one module to another */ ++static bfd_boolean ++elf32_vax_copy_private_bfd_data (bfd *ibfd, bfd *obfd) ++{ ++ flagword in_flags; ++ ++ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour ++ || bfd_get_flavour (obfd) != bfd_target_elf_flavour) ++ return TRUE; ++ ++ in_flags = elf_elfheader (ibfd)->e_flags; ++ ++ elf_elfheader (obfd)->e_flags = in_flags; ++ elf_flags_init (obfd) = TRUE; ++ ++ return TRUE; ++} ++ + /* Merge backend specific data from an object file to the output + object file when linking. */ + static bfd_boolean +@@ -729,7 +747,13 @@ + return FALSE; + + if (sec->flags & SEC_READONLY) +- info->flags |= DF_TEXTREL; ++ { ++ if (info->warn_shared_textrel) ++ (*_bfd_error_handler) ++ (_("warning: dynamic relocation to `%s' in readonly section `%s'"), ++ h ? h->root.root.string : "?", sec->name); ++ info->flags |= DF_TEXTREL; ++ } + } + + sreloc->size += sizeof (Elf32_External_Rela); +@@ -834,6 +858,7 @@ + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && (h->needs_plt ++ || h->type == STT_GNU_IFUNC + || h->is_weakalias + || (h->def_dynamic + && h->ref_regular +@@ -842,7 +867,7 @@ + /* If this is a function, put it in the procedure linkage table. We + will fill in the contents of the procedure linkage table later, + when we know the address of the .got section. */ +- if (h->type == STT_FUNC ++ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) + || h->needs_plt) + { + if (h->plt.refcount <= 0 +@@ -1244,8 +1269,12 @@ + } + + /* Allocate space in the .got and .rela.got sections. */ +- sgot->size += 4; +- srelgot->size += sizeof (Elf32_External_Rela); ++ if (bfd_link_pic (info) || WILL_CALL_FINISH_DYNAMIC_SYMBOL ( ++ elf_hash_table (info)->dynamic_sections_created, 0, h)) ++ { ++ sgot->size += 4; ++ srelgot->size += sizeof (Elf32_External_Rela); ++ } + } + + return TRUE; +@@ -1515,9 +1544,9 @@ + { + relocate = TRUE; + outrel.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE); +- BFD_ASSERT (bfd_get_signed_32 (input_bfd, +- &contents[rel->r_offset]) == 0); +- outrel.r_addend = relocation + rel->r_addend; ++ outrel.r_addend = bfd_get_signed_32(input_bfd, ++ &contents[rel->r_offset]) ++ + relocation + rel->r_addend; + } + else + { +@@ -1556,6 +1585,9 @@ + } + } + ++ if (input_section->flags & SEC_CODE) ++ info->flags |= DF_TEXTREL; ++ + if ((input_section->flags & SEC_CODE) != 0 + || (ELF32_R_TYPE (outrel.r_info) != R_VAX_32 + && ELF32_R_TYPE (outrel.r_info) != R_VAX_RELATIVE +@@ -1905,12 +1937,15 @@ + #define TARGET_LITTLE_SYM vax_elf32_vec + #define TARGET_LITTLE_NAME "elf32-vax" + #define ELF_MACHINE_CODE EM_VAX +-#define ELF_MAXPAGESIZE 0x1000 ++#define ELF_MAXPAGESIZE 0x10000 + + #define elf_backend_create_dynamic_sections \ + _bfd_elf_create_dynamic_sections + #define bfd_elf32_bfd_link_hash_table_create \ + elf_vax_link_hash_table_create ++#define bfd_elf32_bfd_copy_private_bfd_data \ ++ elf32_vax_copy_private_bfd_data ++ + #define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link + + #define elf_backend_check_relocs elf_vax_check_relocs +diff -rNU3 a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c +--- a/bfd/elf64-alpha.c 2021-03-30 23:12:40.124559932 -0300 ++++ b/bfd/elf64-alpha.c 2021-03-30 17:47:59.648886000 -0300 +@@ -99,6 +99,11 @@ + #define PLT_ENTRY_SIZE \ + (elf64_alpha_use_secureplt ? NEW_PLT_ENTRY_SIZE : OLD_PLT_ENTRY_SIZE) + ++/* ld --traditional-format uses this older format instead. */ ++#define OLD_PLT_ENTRY_WORD1 0x279f0000 /* ldah $28, 0($31) */ ++#define OLD_PLT_ENTRY_WORD2 0x239c0000 /* lda $28, 0($28) */ ++#define OLD_PLT_ENTRY_WORD3 0xc3e00000 /* br $31, plt0 */ ++ + #define MAX_GOT_SIZE (64*1024) + + #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so" +@@ -4857,6 +4862,32 @@ + plt_index = ((gotent->plt_offset - NEW_PLT_HEADER_SIZE) + / NEW_PLT_ENTRY_SIZE); + } ++ else if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) ++ { ++ long hi, lo; ++ ++ /* decompose the reloc offset for the plt for ldah+lda */ ++ hi = plt_index * sizeof(Elf64_External_Rela); ++ lo = ((hi & 0xffff) ^ 0x8000) - 0x8000; ++ hi = (hi - lo) >> 16; ++ ++ insn = INSN_ABO (INSN_LDAH, 28, 31, hi); ++ bfd_put_32 (output_bfd, insn, ++ splt->contents + gotent->plt_offset); ++ ++ insn = INSN_ABO (INSN_LDA, 28, 28, lo); ++ bfd_put_32 (output_bfd, insn, ++ splt->contents + gotent->plt_offset + 4); ++ ++ disp = -(gotent->plt_offset + 12); ++ insn = INSN_AD (INSN_BR, 31, disp); ++ ++ bfd_put_32 (output_bfd, insn, ++ splt->contents + gotent->plt_offset + 8); ++ ++ plt_index = ((gotent->plt_offset - OLD_PLT_HEADER_SIZE) ++ / OLD_PLT_ENTRY_SIZE); ++ } + else + { + disp = -(gotent->plt_offset + 4); +diff -rNU3 a/bfd/elf64-mips.c b/bfd/elf64-mips.c +--- a/bfd/elf64-mips.c 2021-03-30 23:12:40.127893266 -0300 ++++ b/bfd/elf64-mips.c 2021-03-30 17:47:59.652219000 -0300 +@@ -111,6 +111,8 @@ + (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *); + static bfd_boolean mips_elf64_object_p + (bfd *); ++static bfd_boolean mips_elf64_is_local_label_name ++ (bfd *, const char *); + static irix_compat_t elf64_mips_irix_compat + (bfd *); + static bfd_boolean elf64_mips_grok_prstatus +@@ -4531,7 +4533,18 @@ + bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach); + return TRUE; + } ++ ++/* MIPS ELF local labels start with "$L". */ ++static bfd_boolean ++mips_elf64_is_local_label_name (bfd *abfd, const char *name) ++{ ++ if (name[0] == '$' && name[1] == 'L') ++ return TRUE; + ++ /* We accept the generic ELF local label syntax as well. */ ++ return _bfd_elf_is_local_label_name (abfd, name); ++} ++ + /* Depending on the target vector we generate some version of Irix + executables or "normal" MIPS ELF ABI executables. */ + static irix_compat_t +@@ -4800,9 +4813,8 @@ + #define elf_backend_write_section _bfd_mips_elf_write_section + #define elf_backend_sort_relocs_p _bfd_mips_elf_sort_relocs_p + +-/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit +- MIPS-specific function only applies to IRIX5, which had no 64-bit +- ABI. */ ++#define bfd_elf64_bfd_is_local_label_name \ ++ mips_elf64_is_local_label_name + #define bfd_elf64_bfd_is_target_special_symbol \ + _bfd_mips_elf_is_target_special_symbol + #define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line +diff -rNU3 a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c +--- a/bfd/elf64-ppc.c 2021-03-30 23:12:40.131226599 -0300 ++++ b/bfd/elf64-ppc.c 2021-03-30 17:47:59.662219000 -0300 +@@ -9790,7 +9790,13 @@ + srel = htab->elf.irelplt; + srel->size += p->count * sizeof (Elf64_External_Rela); + if ((p->sec->output_section->flags & SEC_READONLY) != 0) +- info->flags |= DF_TEXTREL; ++ { ++ if (info->warn_shared_textrel) ++ (*_bfd_error_handler) ++ (_("warning: dynamic relocation in readonly section `%s'"), ++ p->sec->output_section->name); ++ info->flags |= DF_TEXTREL; ++ } + } + } + } +@@ -15228,6 +15234,11 @@ + can_plt_call = TRUE; + } + } ++ else ++ { ++ /* Tail calls don't need to worry about restoring TOC. */ ++ can_plt_call = TRUE; ++ } + } + + if (!can_plt_call && h != NULL) +@@ -15247,7 +15258,7 @@ + } + } + +- if (!can_plt_call) ++ if (!can_plt_call && h != NULL) + { + /* g++ as of 20130507 emits self-calls without a + following nop. This is arguably wrong since we +diff -rNU3 a/bfd/elf.c b/bfd/elf.c +--- a/bfd/elf.c 2021-03-30 23:12:40.104559932 -0300 ++++ b/bfd/elf.c 2021-03-30 17:47:59.575553000 -0300 +@@ -296,7 +296,8 @@ + /* Allocate and clear an extra byte at the end, to prevent crashes + in case the string table is not terminated. */ + if (shstrtabsize + 1 <= 1 +- || shstrtabsize > bfd_get_file_size (abfd) ++ || (bfd_get_file_size (abfd) > 0 /* not a character device */ ++ && shstrtabsize > bfd_get_file_size (abfd)) + || bfd_seek (abfd, offset, SEEK_SET) != 0 + || (shstrtab = (bfd_byte *) bfd_alloc (abfd, shstrtabsize + 1)) == NULL) + shstrtab = NULL; +@@ -4396,7 +4397,7 @@ + get_program_header_size (bfd *abfd, struct bfd_link_info *info) + { + size_t segs; +- asection *s; ++ asection *s, *s2; + const struct elf_backend_data *bed; + + /* Assume we will need exactly two PT_LOAD segments: one for text +@@ -4404,21 +4405,28 @@ + segs = 2; + + s = bfd_get_section_by_name (abfd, ".interp"); ++ s2 = bfd_get_section_by_name (abfd, ".dynamic"); + if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->size != 0) + { +- /* If we have a loadable interpreter section, we need a +- PT_INTERP segment. In this case, assume we also need a +- PT_PHDR segment, although that may not be true for all +- targets. */ +- segs += 2; ++ ++segs; + } + +- if (bfd_get_section_by_name (abfd, ".dynamic") != NULL) ++ if (s2 != NULL && (s2->flags & SEC_LOAD) != 0) + { + /* We need a PT_DYNAMIC segment. */ + ++segs; + } + ++ if ((s != NULL && (s->flags & SEC_LOAD) != 0) || ++ (s2 != NULL && (s2->flags & SEC_LOAD) != 0)) ++ { ++ /* ++ * If either a PT_INTERP or PT_DYNAMIC segment is created, ++ * also create a PT_PHDR segment. ++ */ ++ ++segs; ++ } ++ + if (info != NULL && info->relro) + { + /* We need a PT_GNU_RELRO segment. */ +@@ -4744,7 +4752,14 @@ + the program headers and a PT_INTERP segment for the .interp + section. */ + s = bfd_get_section_by_name (abfd, ".interp"); ++ if (s != NULL && (s->flags & SEC_LOAD) == 0) + if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->size != 0) ++ s = NULL; ++ dynsec = bfd_get_section_by_name (abfd, ".dynamic"); ++ if (dynsec != NULL && (dynsec->flags & SEC_LOAD) == 0) ++ dynsec = NULL; ++ ++ if (s != NULL || dynsec != NULL) + { + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); +@@ -4758,7 +4773,10 @@ + phdr_in_segment = TRUE; + *pm = m; + pm = &m->next; ++ } + ++ if (s != NULL) ++ { + amt = sizeof (struct elf_segment_map); + m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + if (m == NULL) +@@ -4780,10 +4798,6 @@ + hdr_index = 0; + writable = FALSE; + executable = FALSE; +- dynsec = bfd_get_section_by_name (abfd, ".dynamic"); +- if (dynsec != NULL +- && (dynsec->flags & SEC_LOAD) == 0) +- dynsec = NULL; + + if ((abfd->flags & D_PAGED) == 0) + phdr_in_segment = FALSE; +@@ -5934,7 +5948,11 @@ + _bfd_error_handler (_("%pB: error: PHDR segment not covered" + " by LOAD segment"), + abfd); +- return FALSE; ++ if (link_info == NULL) ++ return FALSE; ++ /* Arrange for the linker to exit with an error, deleting ++ the output file unless --noinhibit-exec is given. */ ++ link_info->callbacks->info ("%X"); + } + + /* Check that all sections are in a PT_LOAD segment. +@@ -10659,6 +10677,7 @@ + note); + } + ++ + static bfd_boolean + elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) + { +diff -rNU3 a/bfd/elflink.c b/bfd/elflink.c +--- a/bfd/elflink.c 2021-03-30 23:12:40.134559933 -0300 ++++ b/bfd/elflink.c 2021-03-30 17:47:59.665553000 -0300 +@@ -2913,6 +2913,8 @@ + if (h->is_weakalias) + { + struct elf_link_hash_entry *def = weakdef (h); ++ while (def->root.type == bfd_link_hash_indirect) ++ def = (struct elf_link_hash_entry *) def->root.u.i.link; + + /* If the real definition is defined by a regular object file, + don't do anything special. See the longer description in +@@ -11490,7 +11492,14 @@ + if (bed->s->arch_size == 32) + irel[0].r_info = ELF32_R_INFO (indx, howto->type); + else +- irel[0].r_info = ELF64_R_INFO (indx, howto->type); ++#ifdef BFD64 ++ { ++ bfd_uint64_t indx64 = indx; ++ irel[0].r_info = ELF64_R_INFO (indx64, howto->type); ++ } ++#else ++ BFD_FAIL(); ++#endif + + rel_hdr = reldata->hdr; + erel = rel_hdr->contents; +diff -rNU3 a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c +--- a/bfd/elfn32-mips.c 2021-03-30 23:12:40.134559933 -0300 ++++ b/bfd/elfn32-mips.c 2021-03-30 17:47:59.665553000 -0300 +@@ -78,6 +78,8 @@ + (bfd *, Elf_Internal_Note *); + static bfd_boolean elf32_mips_grok_psinfo + (bfd *, Elf_Internal_Note *); ++static bfd_boolean mips_elf_n32_is_local_label_name ++ (bfd *, const char *); + static bfd_boolean elf_n32_mips_grok_freebsd_prstatus + (bfd *, Elf_Internal_Note *); + static irix_compat_t elf_n32_mips_irix_compat +@@ -4018,6 +4020,17 @@ + } + } + ++/* MIPS ELF local labels start with "$L". */ ++static bfd_boolean ++mips_elf_n32_is_local_label_name (bfd *abfd, const char *name) ++{ ++ if (name[0] == '$' && name[1] == 'L') ++ return TRUE; ++ ++ /* We accept the generic ELF local label syntax as well. */ ++ return _bfd_elf_is_local_label_name (abfd, name); ++} ++ + /* Depending on the target vector we generate some version of Irix + executables or "normal" MIPS ELF ABI executables. */ + static irix_compat_t +@@ -4162,6 +4175,9 @@ + #define elf_backend_write_section _bfd_mips_elf_write_section + #define elf_backend_mips_irix_compat elf_n32_mips_irix_compat + #define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto ++ ++#define bfd_elf32_bfd_is_local_label_name \ ++ mips_elf_n32_is_local_label_name + #define bfd_elf32_bfd_is_target_special_symbol \ + _bfd_mips_elf_is_target_special_symbol + #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line +diff -rNU3 a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c +--- a/bfd/elfxx-mips.c 2021-03-30 23:12:40.144559933 -0300 ++++ b/bfd/elfxx-mips.c 2021-03-30 17:47:59.678886000 -0300 +@@ -9026,10 +9026,30 @@ + reloc types into the output file as R_MIPS_REL32 + relocs. Make room for this reloc in .rel(a).dyn. */ + mips_elf_allocate_dynamic_relocations (dynobj, info, 1); +- if (MIPS_ELF_READONLY_SECTION (sec)) +- /* We tell the dynamic linker that there are +- relocations against the text segment. */ +- info->flags |= DF_TEXTREL; ++ /* In the N32 and 64-bit ABIs there may be multiple ++ consecutive relocations for the same offset. If we have ++ a R_MIPS_GPREL32 followed by a R_MIPS_64 then that ++ relocation is complete and needs no futher adjustment. ++ ++ Silently ignore absolute relocations in the .eh_frame ++ section, they will be dropped latter. ++ */ ++ if ((rel == relocs ++ || rel[-1].r_offset != rel->r_offset ++ || r_type != R_MIPS_64 ++ || ELF_R_TYPE(abfd, rel[-1].r_info) != R_MIPS_GPREL32) ++ && MIPS_ELF_READONLY_SECTION (sec) ++ && !((r_type == R_MIPS_32 || r_type == R_MIPS_64) ++ && strcmp(sec->name, ".eh_frame") == 0)) ++ { ++ /* We tell the dynamic linker that there are ++ relocations against the text segment. */ ++ info->flags |= DF_TEXTREL; ++ info->callbacks->warning ++ (info, ++ _("relocation emitted against readonly section"), ++ NULL, abfd, sec, rel->r_offset); ++ } + } + else + { +@@ -9307,6 +9327,7 @@ + /* Make sure we know what is going on here. */ + BFD_ASSERT (dynobj != NULL + && (h->needs_plt ++ || h->type == STT_GNU_IFUNC + || h->is_weakalias + || (h->def_dynamic + && h->ref_regular +diff -rNU3 a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c +--- a/bfd/elfxx-sparc.c 2021-03-30 23:12:40.144559933 -0300 ++++ b/bfd/elfxx-sparc.c 2021-03-30 17:47:59.682219000 -0300 +@@ -3565,6 +3565,23 @@ + tls_type = _bfd_sparc_elf_hash_entry (h)->tls_type; + else if (local_got_offsets) + tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx]; ++ else if (h != NULL) ++ { ++ tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type; ++ if (!bfd_link_dll (info) ++ && h->dynindx == -1 ++ && tls_type == GOT_TLS_IE) ++ switch (SPARC_ELF_R_TYPE (rel->r_info)) ++ { ++ case R_SPARC_TLS_GD_HI22: ++ case R_SPARC_TLS_IE_HI22: ++ r_type = R_SPARC_TLS_LE_HIX22; ++ break; ++ default: ++ r_type = R_SPARC_TLS_LE_LOX10; ++ break; ++ } ++ } + else + tls_type = GOT_UNKNOWN; + if (tls_type == GOT_TLS_IE) +@@ -3746,6 +3763,8 @@ + tls_type = _bfd_sparc_elf_hash_entry (h)->tls_type; + else if (local_got_offsets) + tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx]; ++ else if (h != NULL) ++ tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type; + else + tls_type = GOT_UNKNOWN; + /* GD -> IE or LE */ +diff -rNU3 a/bfd/i386netbsd.c b/bfd/i386netbsd.c +--- a/bfd/i386netbsd.c 1969-12-31 21:00:00.000000000 -0300 ++++ b/bfd/i386netbsd.c 2021-03-30 17:47:59.688886000 -0300 +@@ -0,0 +1,38 @@ ++/* BFD back-end for NetBSD/386 a.out-ish binaries. ++ Copyright (C) 1990-2016 Free Software Foundation, Inc. ++ ++ This file is part of BFD, the Binary File Descriptor library. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, ++ MA 02110-1301, USA. */ ++ ++#define BYTES_IN_WORD 4 ++#undef TARGET_IS_BIG_ENDIAN_P ++ ++#define TARGET_PAGE_SIZE 4096 ++#define SEGMENT_SIZE TARGET_PAGE_SIZE ++ ++#define DEFAULT_ARCH bfd_arch_i386 ++#define DEFAULT_MID M_386_NETBSD ++ ++/* Do not "beautify" the CONCAT* macro args. Traditional C will not ++ remove whitespace added here, and thus will fail to concatenate ++ the tokens. */ ++#define MY(OP) CONCAT2 (i386_aout_nbsd_,OP) ++ ++/* This needs to start with a.out so GDB knows it is an a.out variant. */ ++#define TARGETNAME "a.out-i386-netbsd" ++ ++#include "netbsd.h" +diff -rNU3 a/bfd/libbfd.h b/bfd/libbfd.h +--- a/bfd/libbfd.h 2021-03-30 23:12:40.144559933 -0300 ++++ b/bfd/libbfd.h 2021-03-30 17:47:59.688886000 -0300 +@@ -2721,6 +2721,7 @@ + "BFD_RELOC_XC16X_SEG", + "BFD_RELOC_XC16X_SOF", + "BFD_RELOC_VAX_GLOB_DAT", ++ "BFD_RELOC_VAX_GLOB_REF", + "BFD_RELOC_VAX_JMP_SLOT", + "BFD_RELOC_VAX_RELATIVE", + "BFD_RELOC_MT_PC16", +diff -rNU3 a/bfd/Makefile.am b/bfd/Makefile.am +--- a/bfd/Makefile.am 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/Makefile.am 2021-03-30 17:47:59.498886000 -0300 +@@ -363,6 +363,7 @@ + i386bsd.lo \ + i386lynx.lo \ + i386msdos.lo \ ++ i386netbsd.lo \ + mach-o.lo \ + mach-o-i386.lo \ + mach-o-arm.lo \ +@@ -499,6 +500,7 @@ + i386bsd.c \ + i386lynx.c \ + i386msdos.c \ ++ i386netbsd.c \ + mach-o.c \ + mach-o-i386.c \ + mach-o-arm.c \ +diff -rNU3 a/bfd/Makefile.in b/bfd/Makefile.in +--- a/bfd/Makefile.in 2021-03-30 23:12:40.087893265 -0300 ++++ b/bfd/Makefile.in 2021-03-30 17:47:59.498886000 -0300 +@@ -565,6 +565,7 @@ + cpu-nfp.lo \ + cpu-nios2.lo \ + cpu-ns32k.lo \ ++ cpu-openrisc.lo \ + cpu-or1k.lo \ + cpu-pdp11.lo \ + cpu-pj.lo \ +@@ -649,6 +650,7 @@ + cpu-nds32.c \ + cpu-nfp.c \ + cpu-ns32k.c \ ++ cpu-openrisc.c \ + cpu-nios2.c \ + cpu-or1k.c \ + cpu-pdp11.c \ +@@ -695,6 +697,7 @@ + coff-go32.lo \ + coff-i386.lo \ + coff-mips.lo \ ++ coff-or1k.lo \ + coff-rs6000.lo \ + coff-sh.lo \ + coff-stgo32.lo \ +@@ -758,6 +761,7 @@ + elf32-mt.lo \ + elf32-nds32.lo \ + elf32-nios2.lo \ ++ elf32-openrisc.lo \ + elf32-or1k.lo \ + elf32-pj.lo \ + elf32-ppc.lo \ +@@ -788,6 +792,7 @@ + i386bsd.lo \ + i386lynx.lo \ + i386msdos.lo \ ++ i386netbsd.lo \ + mach-o.lo \ + mach-o-i386.lo \ + mach-o-arm.lo \ +@@ -831,6 +836,7 @@ + coff-go32.c \ + coff-i386.c \ + coff-mips.c \ ++ coff-or1k.c \ + coff-rs6000.c \ + coff-sh.c \ + coff-stgo32.c \ +@@ -894,6 +900,7 @@ + elf32-mt.c \ + elf32-nds32.c \ + elf32-nios2.c \ ++ elf32-openrisc.c \ + elf32-or1k.c \ + elf32-pj.c \ + elf32-ppc.c \ +@@ -924,6 +931,7 @@ + i386bsd.c \ + i386lynx.c \ + i386msdos.c \ ++ i386netbsd.c \ + mach-o.c \ + mach-o-i386.c \ + mach-o-arm.c \ +@@ -1315,6 +1323,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-go32.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-i386.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-mips.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-or1k.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-rs6000.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sh.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-stgo32.Plo@am__quote@ +@@ -1379,6 +1388,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nfp.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-nios2.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-openrisc.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or1k.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pdp11.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pj.Plo@am__quote@ +@@ -1465,8 +1475,10 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-moxie.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-msp430.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-mt.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or1k.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nds32.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-nios2.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-openrisc.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or1k.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-pj.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-ppc.Plo@am__quote@ +@@ -1527,6 +1539,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386bsd.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386lynx.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386msdos.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386netbsd.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ihex.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/irix-core.Plo@am__quote@ +diff -rNU3 a/bfd/reloc.c b/bfd/reloc.c +--- a/bfd/reloc.c 2021-03-30 23:12:40.144559933 -0300 ++++ b/bfd/reloc.c 2021-03-30 17:47:59.782219000 -0300 +@@ -1711,6 +1711,17 @@ + Relocations used by 68K ELF. + + ENUM ++ BFD_RELOC_VAX_GLOB_DAT ++ENUMX ++ BFD_RELOC_VAX_GLOB_REF ++ENUMX ++ BFD_RELOC_VAX_JMP_SLOT ++ENUMX ++ BFD_RELOC_VAX_RELATIVE ++ENUMDOC ++ Relocations used by VAX ELF. ++ ++ENUM + BFD_RELOC_32_BASEREL + ENUMX + BFD_RELOC_16_BASEREL +diff -rNU3 a/bfd/targets.c b/bfd/targets.c +--- a/bfd/targets.c 2021-03-30 23:12:40.151226599 -0300 ++++ b/bfd/targets.c 2021-03-30 17:47:59.782219000 -0300 +@@ -727,6 +727,7 @@ + extern const bfd_target i386_aout_vec; + extern const bfd_target i386_aout_bsd_vec; + extern const bfd_target i386_aout_lynx_vec; ++extern const bfd_target i386_aout_nbsd_vec; + extern const bfd_target i386_coff_vec; + extern const bfd_target i386_coff_go32_vec; + extern const bfd_target i386_coff_go32stubbed_vec; +diff -rNU3 a/binutils/bucomm.c b/binutils/bucomm.c +--- a/binutils/bucomm.c 2021-03-30 23:12:40.151226599 -0300 ++++ b/binutils/bucomm.c 2021-03-30 17:47:59.825553000 -0300 +@@ -619,7 +619,14 @@ + else if (S_ISDIR (statbuf.st_mode)) + non_fatal (_("Warning: '%s' is a directory"), file_name); + else if (! S_ISREG (statbuf.st_mode)) +- non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); ++ { ++ if (!S_ISCHR(statbuf.st_mode)) ++ { ++ non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); ++ return 0; ++ } ++ return statbuf.st_size ? statbuf.st_size : 1; ++ } + else if (statbuf.st_size < 0) + non_fatal (_("Warning: '%s' has negative size, probably it is too large"), + file_name); +diff -rNU3 a/binutils/doc/addr2line.1 b/binutils/doc/addr2line.1 +--- a/binutils/doc/addr2line.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/addr2line.1 2021-03-30 17:47:59.835553000 -0300 +@@ -0,0 +1,349 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "ADDR2LINE 1" ++.TH ADDR2LINE 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++addr2line \- convert addresses into file names and line numbers ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++addr2line [\fB\-a\fR|\fB\-\-addresses\fR] ++ [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] ++ [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] ++ [\fB\-r\fR|\fB\-\-no\-recurse\-limit\fR] ++ [\fB\-R\fR|\fB\-\-recurse\-limit\fR] ++ [\fB\-e\fR \fIfilename\fR|\fB\-\-exe=\fR\fIfilename\fR] ++ [\fB\-f\fR|\fB\-\-functions\fR] [\fB\-s\fR|\fB\-\-basename\fR] ++ [\fB\-i\fR|\fB\-\-inlines\fR] ++ [\fB\-p\fR|\fB\-\-pretty\-print\fR] ++ [\fB\-j\fR|\fB\-\-section=\fR\fIname\fR] ++ [\fB\-H\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] ++ [addr addr ...] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBaddr2line\fR translates addresses into file names and line numbers. ++Given an address in an executable or an offset in a section of a relocatable ++object, it uses the debugging information to figure out which file name and ++line number are associated with it. ++.PP ++The executable or relocatable object to use is specified with the \fB\-e\fR ++option. The default is the file \fIa.out\fR. The section in the relocatable ++object to use is specified with the \fB\-j\fR option. ++.PP ++\&\fBaddr2line\fR has two modes of operation. ++.PP ++In the first, hexadecimal addresses are specified on the command line, ++and \fBaddr2line\fR displays the file name and line number for each ++address. ++.PP ++In the second, \fBaddr2line\fR reads hexadecimal addresses from ++standard input, and prints the file name and line number for each ++address on standard output. In this mode, \fBaddr2line\fR may be used ++in a pipe to convert dynamically chosen addresses. ++.PP ++The format of the output is \fB\s-1FILENAME:LINENO\s0\fR. By default ++each input address generates one line of output. ++.PP ++Two options can generate additional lines before each ++\&\fB\s-1FILENAME:LINENO\s0\fR line (in that order). ++.PP ++If the \fB\-a\fR option is used then a line with the input address ++is displayed. ++.PP ++If the \fB\-f\fR option is used, then a line with the ++\&\fB\s-1FUNCTIONNAME\s0\fR is displayed. This is the name of the function ++containing the address. ++.PP ++One option can generate additional lines after the ++\&\fB\s-1FILENAME:LINENO\s0\fR line. ++.PP ++If the \fB\-i\fR option is used and the code at the given address is ++present there because of inlining by the compiler then additional ++lines are displayed afterwards. One or two extra lines (if the ++\&\fB\-f\fR option is used) are displayed for each inlined function. ++.PP ++Alternatively if the \fB\-p\fR option is used then each input ++address generates a single, long, output line containing the address, ++the function name, the file name and the line number. If the ++\&\fB\-i\fR option has also been used then any inlined functions will ++be displayed in the same manner, but on separate lines, and prefixed ++by the text \fB(inlined by)\fR. ++.PP ++If the file name or function name can not be determined, ++\&\fBaddr2line\fR will print two question marks in their place. If the ++line number can not be determined, \fBaddr2line\fR will print 0. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The long and short forms of options, shown here as alternatives, are ++equivalent. ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-addresses\fR" 4 ++.IX Item "--addresses" ++.PD ++Display the address before the function name, file and line number ++information. The address is printed with a \fB0x\fR prefix to easily ++identify it. ++.IP "\fB\-b\fR \fIbfdname\fR" 4 ++.IX Item "-b bfdname" ++.PD 0 ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++.PD ++Specify that the object-code format for the object files is ++\&\fIbfdname\fR. ++.IP "\fB\-C\fR" 4 ++.IX Item "-C" ++.PD 0 ++.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 ++.IX Item "--demangle[=style]" ++.PD ++Decode (\fIdemangle\fR) low-level symbol names into user-level names. ++Besides removing any initial underscore prepended by the system, this ++makes \*(C+ function names readable. Different compilers have different ++mangling styles. The optional demangling style argument can be used to ++choose an appropriate demangling style for your compiler. ++.IP "\fB\-e\fR \fIfilename\fR" 4 ++.IX Item "-e filename" ++.PD 0 ++.IP "\fB\-\-exe=\fR\fIfilename\fR" 4 ++.IX Item "--exe=filename" ++.PD ++Specify the name of the executable for which addresses should be ++translated. The default file is \fIa.out\fR. ++.IP "\fB\-f\fR" 4 ++.IX Item "-f" ++.PD 0 ++.IP "\fB\-\-functions\fR" 4 ++.IX Item "--functions" ++.PD ++Display function names as well as file and line number information. ++.IP "\fB\-s\fR" 4 ++.IX Item "-s" ++.PD 0 ++.IP "\fB\-\-basenames\fR" 4 ++.IX Item "--basenames" ++.PD ++Display only the base of each file name. ++.IP "\fB\-i\fR" 4 ++.IX Item "-i" ++.PD 0 ++.IP "\fB\-\-inlines\fR" 4 ++.IX Item "--inlines" ++.PD ++If the address belongs to a function that was inlined, the source ++information for all enclosing scopes back to the first non-inlined ++function will also be printed. For example, if \f(CW\*(C`main\*(C'\fR inlines ++\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from ++\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR ++will also be printed. ++.IP "\fB\-j\fR" 4 ++.IX Item "-j" ++.PD 0 ++.IP "\fB\-\-section\fR" 4 ++.IX Item "--section" ++.PD ++Read offsets relative to the specified section instead of absolute addresses. ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-pretty\-print\fR" 4 ++.IX Item "--pretty-print" ++.PD ++Make the output more human friendly: each location are printed on one line. ++If option \fB\-i\fR is specified, lines for all enclosing scopes are ++prefixed with \fB(inlined by)\fR. ++.IP "\fB\-r\fR" 4 ++.IX Item "-r" ++.PD 0 ++.IP "\fB\-R\fR" 4 ++.IX Item "-R" ++.IP "\fB\-\-recurse\-limit\fR" 4 ++.IX Item "--recurse-limit" ++.IP "\fB\-\-no\-recurse\-limit\fR" 4 ++.IX Item "--no-recurse-limit" ++.IP "\fB\-\-recursion\-limit\fR" 4 ++.IX Item "--recursion-limit" ++.IP "\fB\-\-no\-recursion\-limit\fR" 4 ++.IX Item "--no-recursion-limit" ++.PD ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++.Sp ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++.Sp ++The \fB\-r\fR option is a synonym for the ++\&\fB\-\-no\-recurse\-limit\fR option. The \fB\-R\fR option is a ++synonym for the \fB\-\-recurse\-limit\fR option. ++.Sp ++Note this option is only effective if the \fB\-C\fR or ++\&\fB\-\-demangle\fR option has been enabled. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/ar.1 b/binutils/doc/ar.1 +--- a/binutils/doc/ar.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/ar.1 2021-03-30 17:47:59.835553000 -0300 +@@ -0,0 +1,523 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "AR 1" ++.TH AR 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++ar \- create, modify, and extract from archives ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++ar [\fB\-X32_64\fR] [\fB\-\fR]\fIp\fR[\fImod\fR] [\fB\-\-plugin\fR \fIname\fR] [\fB\-\-target\fR \fIbfdname\fR] [\fB\-\-output\fR \fIdirname\fR] [\fIrelpos\fR] [\fIcount\fR] \fIarchive\fR [\fImember\fR...] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++The \s-1GNU\s0 \fBar\fR program creates, modifies, and extracts from ++archives. An \fIarchive\fR is a single file holding a collection of ++other files in a structure that makes it possible to retrieve ++the original individual files (called \fImembers\fR of the archive). ++.PP ++The original files' contents, mode (permissions), timestamp, owner, and ++group are preserved in the archive, and can be restored on ++extraction. ++.PP ++\&\s-1GNU\s0 \fBar\fR can maintain archives whose members have names of any ++length; however, depending on how \fBar\fR is configured on your ++system, a limit on member-name length may be imposed for compatibility ++with archive formats maintained with other tools. If it exists, the ++limit is often 15 characters (typical of formats related to a.out) or 16 ++characters (typical of formats related to coff). ++.PP ++\&\fBar\fR is considered a binary utility because archives of this sort ++are most often used as \fIlibraries\fR holding commonly needed ++subroutines. ++.PP ++\&\fBar\fR creates an index to the symbols defined in relocatable ++object modules in the archive when you specify the modifier \fBs\fR. ++Once created, this index is updated in the archive whenever \fBar\fR ++makes a change to its contents (save for the \fBq\fR update operation). ++An archive with such an index speeds up linking to the library, and ++allows routines in the library to call each other without regard to ++their placement in the archive. ++.PP ++You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index ++table. If an archive lacks the table, another form of \fBar\fR called ++\&\fBranlib\fR can be used to add just the table. ++.PP ++\&\s-1GNU\s0 \fBar\fR can optionally create a \fIthin\fR archive, ++which contains a symbol index and references to the original copies ++of the member files of the archive. This is useful for building ++libraries for use within a local build tree, where the relocatable ++objects are expected to remain available, and copying the contents of ++each object would only waste time and space. ++.PP ++An archive can either be \fIthin\fR or it can be normal. It cannot ++be both at the same time. Once an archive is created its format ++cannot be changed without first deleting it and then creating a new ++archive in its place. ++.PP ++Thin archives are also \fIflattened\fR, so that adding one thin ++archive to another thin archive does not nest it, as would happen with ++a normal archive. Instead the elements of the first archive are added ++individually to the second archive. ++.PP ++The paths to the elements of the archive are stored relative to the ++archive itself. ++.PP ++\&\s-1GNU\s0 \fBar\fR is designed to be compatible with two different ++facilities. You can control its activity using command-line options, ++like the different varieties of \fBar\fR on Unix systems; or, if you ++specify the single command-line option \fB\-M\fR, you can control it ++with a script supplied via standard input, like the \s-1MRI\s0 \*(L"librarian\*(R" ++program. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++\&\s-1GNU\s0 \fBar\fR allows you to mix the operation code \fIp\fR and modifier ++flags \fImod\fR in any order, within the first command-line argument. ++.PP ++If you wish, you may begin the first command-line argument with a ++dash. ++.PP ++The \fIp\fR keyletter specifies what operation to execute; it may be ++any of the following, but you must specify only one of them: ++.IP "\fBd\fR" 4 ++.IX Item "d" ++\&\fIDelete\fR modules from the archive. Specify the names of modules to ++be deleted as \fImember\fR...; the archive is untouched if you ++specify no files to delete. ++.Sp ++If you specify the \fBv\fR modifier, \fBar\fR lists each module ++as it is deleted. ++.IP "\fBm\fR" 4 ++.IX Item "m" ++Use this operation to \fImove\fR members in an archive. ++.Sp ++The ordering of members in an archive can make a difference in how ++programs are linked using the library, if a symbol is defined in more ++than one member. ++.Sp ++If no modifiers are used with \f(CW\*(C`m\*(C'\fR, any members you name in the ++\&\fImember\fR arguments are moved to the \fIend\fR of the archive; ++you can use the \fBa\fR, \fBb\fR, or \fBi\fR modifiers to move them to a ++specified place instead. ++.IP "\fBp\fR" 4 ++.IX Item "p" ++\&\fIPrint\fR the specified members of the archive, to the standard ++output file. If the \fBv\fR modifier is specified, show the member ++name before copying its contents to standard output. ++.Sp ++If you specify no \fImember\fR arguments, all the files in the archive are ++printed. ++.IP "\fBq\fR" 4 ++.IX Item "q" ++\&\fIQuick append\fR; Historically, add the files \fImember\fR... to the end of ++\&\fIarchive\fR, without checking for replacement. ++.Sp ++The modifiers \fBa\fR, \fBb\fR, and \fBi\fR do \fInot\fR affect this ++operation; new members are always placed at the end of the archive. ++.Sp ++The modifier \fBv\fR makes \fBar\fR list each file as it is appended. ++.Sp ++Since the point of this operation is speed, implementations of ++\&\fBar\fR have the option of not updating the archive's symbol ++table if one exists. Too many different systems however assume that ++symbol tables are always up-to-date, so \s-1GNU\s0 \fBar\fR will ++rebuild the table even with a quick append. ++.Sp ++Note \- \s-1GNU\s0 \fBar\fR treats the command \fBqs\fR as a ++synonym for \fBr\fR \- replacing already existing files in the ++archive and appending new ones at the end. ++.IP "\fBr\fR" 4 ++.IX Item "r" ++Insert the files \fImember\fR... into \fIarchive\fR (with ++\&\fIreplacement\fR). This operation differs from \fBq\fR in that any ++previously existing members are deleted if their names match those being ++added. ++.Sp ++If one of the files named in \fImember\fR... does not exist, \fBar\fR ++displays an error message, and leaves undisturbed any existing members ++of the archive matching that name. ++.Sp ++By default, new members are added at the end of the file; but you may ++use one of the modifiers \fBa\fR, \fBb\fR, or \fBi\fR to request ++placement relative to some existing member. ++.Sp ++The modifier \fBv\fR used with this operation elicits a line of ++output for each file inserted, along with one of the letters \fBa\fR or ++\&\fBr\fR to indicate whether the file was appended (no old member ++deleted) or replaced. ++.IP "\fBs\fR" 4 ++.IX Item "s" ++Add an index to the archive, or update it if it already exists. Note ++this command is an exception to the rule that there can only be one ++command letter, as it is possible to use it as either a command or a ++modifier. In either case it does the same thing. ++.IP "\fBt\fR" 4 ++.IX Item "t" ++Display a \fItable\fR listing the contents of \fIarchive\fR, or those ++of the files listed in \fImember\fR... that are present in the ++archive. Normally only the member name is shown, but if the modifier ++\&\fBO\fR is specified, then the corresponding offset of the member is also ++displayed. Finally, in order to see the modes (permissions), timestamp, ++owner, group, and size the \fBv\fR modifier should be included. ++.Sp ++If you do not specify a \fImember\fR, all files in the archive ++are listed. ++.Sp ++If there is more than one file with the same name (say, \fBfie\fR) in ++an archive (say \fBb.a\fR), \fBar t b.a fie\fR lists only the ++first instance; to see them all, you must ask for a complete ++listing\-\-\-in our example, \fBar t b.a\fR. ++.IP "\fBx\fR" 4 ++.IX Item "x" ++\&\fIExtract\fR members (named \fImember\fR) from the archive. You can ++use the \fBv\fR modifier with this operation, to request that ++\&\fBar\fR list each name as it extracts it. ++.Sp ++If you do not specify a \fImember\fR, all files in the archive ++are extracted. ++.Sp ++Files cannot be extracted from a thin archive, and there are ++restrictions on extracting from archives created with \fBP\fR: The ++paths must not be absolute, may not contain \f(CW\*(C`..\*(C'\fR, and any ++subdirectories in the paths must exist. If it is desired to avoid ++these restrictions then used the \fB\-\-output\fR option to specify ++an output directory. ++.PP ++A number of modifiers (\fImod\fR) may immediately follow the \fIp\fR ++keyletter, to specify variations on an operation's behavior: ++.IP "\fBa\fR" 4 ++.IX Item "a" ++Add new files \fIafter\fR an existing member of the ++archive. If you use the modifier \fBa\fR, the name of an existing archive ++member must be present as the \fIrelpos\fR argument, before the ++\&\fIarchive\fR specification. ++.IP "\fBb\fR" 4 ++.IX Item "b" ++Add new files \fIbefore\fR an existing member of the ++archive. If you use the modifier \fBb\fR, the name of an existing archive ++member must be present as the \fIrelpos\fR argument, before the ++\&\fIarchive\fR specification. (same as \fBi\fR). ++.IP "\fBc\fR" 4 ++.IX Item "c" ++\&\fICreate\fR the archive. The specified \fIarchive\fR is always ++created if it did not exist, when you request an update. But a warning is ++issued unless you specify in advance that you expect to create it, by ++using this modifier. ++.IP "\fBD\fR" 4 ++.IX Item "D" ++Operate in \fIdeterministic\fR mode. When adding files and the archive ++index use zero for UIDs, GIDs, timestamps, and use consistent file modes ++for all files. When this option is used, if \fBar\fR is used with ++identical options and identical input files, multiple runs will create ++identical output files regardless of the input files' owners, groups, ++file modes, or modification times. ++.Sp ++If \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default. ++It can be disabled with the \fBU\fR modifier, below. ++.IP "\fBf\fR" 4 ++.IX Item "f" ++Truncate names in the archive. \s-1GNU\s0 \fBar\fR will normally permit file ++names of any length. This will cause it to create archives which are ++not compatible with the native \fBar\fR program on some systems. If ++this is a concern, the \fBf\fR modifier may be used to truncate file ++names when putting them in the archive. ++.IP "\fBi\fR" 4 ++.IX Item "i" ++Insert new files \fIbefore\fR an existing member of the ++archive. If you use the modifier \fBi\fR, the name of an existing archive ++member must be present as the \fIrelpos\fR argument, before the ++\&\fIarchive\fR specification. (same as \fBb\fR). ++.IP "\fBl\fR" 4 ++.IX Item "l" ++This modifier is accepted but not used. ++.IP "\fBN\fR" 4 ++.IX Item "N" ++Uses the \fIcount\fR parameter. This is used if there are multiple ++entries in the archive with the same name. Extract or delete instance ++\&\fIcount\fR of the given name from the archive. ++.IP "\fBo\fR" 4 ++.IX Item "o" ++Preserve the \fIoriginal\fR dates of members when extracting them. If ++you do not specify this modifier, files extracted from the archive ++are stamped with the time of extraction. ++.IP "\fBO\fR" 4 ++.IX Item "O" ++Display member offsets inside the archive. Use together with the \fBt\fR ++option. ++.IP "\fBP\fR" 4 ++.IX Item "P" ++Use the full path name when matching or storing names in the archive. ++Archives created with full path names are not \s-1POSIX\s0 compliant, and ++thus may not work with tools other than up to date \s-1GNU\s0 tools. ++Modifying such archives with \s-1GNU\s0 \fBar\fR without using ++\&\fBP\fR will remove the full path names unless the archive is a ++thin archive. Note that \fBP\fR may be useful when adding files to ++a thin archive since \fBr\fR without \fBP\fR ignores the path ++when choosing which element to replace. Thus ++.Sp ++.Vb 1 ++\& ar rcST archive.a subdir/file1 subdir/file2 file1 ++.Ve ++.Sp ++will result in the first \f(CW\*(C`subdir/file1\*(C'\fR being replaced with ++\&\f(CW\*(C`file1\*(C'\fR from the current directory. Adding \fBP\fR will ++prevent this replacement. ++.IP "\fBs\fR" 4 ++.IX Item "s" ++Write an object-file index into the archive, or update an existing one, ++even if no other change is made to the archive. You may use this modifier ++flag either with any operation, or alone. Running \fBar s\fR on an ++archive is equivalent to running \fBranlib\fR on it. ++.IP "\fBS\fR" 4 ++.IX Item "S" ++Do not generate an archive symbol table. This can speed up building a ++large library in several steps. The resulting archive can not be used ++with the linker. In order to build a symbol table, you must omit the ++\&\fBS\fR modifier on the last execution of \fBar\fR, or you must run ++\&\fBranlib\fR on the archive. ++.IP "\fBT\fR" 4 ++.IX Item "T" ++Make the specified \fIarchive\fR a \fIthin\fR archive. If it already ++exists and is a regular archive, the existing members must be present ++in the same directory as \fIarchive\fR. ++.IP "\fBu\fR" 4 ++.IX Item "u" ++Normally, \fBar r\fR... inserts all files ++listed into the archive. If you would like to insert \fIonly\fR those ++of the files you list that are newer than existing members of the same ++names, use this modifier. The \fBu\fR modifier is allowed only for the ++operation \fBr\fR (replace). In particular, the combination \fBqu\fR is ++not allowed, since checking the timestamps would lose any speed ++advantage from the operation \fBq\fR. ++.IP "\fBU\fR" 4 ++.IX Item "U" ++Do \fInot\fR operate in \fIdeterministic\fR mode. This is the inverse ++of the \fBD\fR modifier, above: added files and the archive index will ++get their actual \s-1UID, GID,\s0 timestamp, and file mode values. ++.Sp ++This is the default unless \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR. ++.IP "\fBv\fR" 4 ++.IX Item "v" ++This modifier requests the \fIverbose\fR version of an operation. Many ++operations display additional information, such as filenames processed, ++when the modifier \fBv\fR is appended. ++.IP "\fBV\fR" 4 ++.IX Item "V" ++This modifier shows the version number of \fBar\fR. ++.PP ++The \fBar\fR program also supports some command-line options which ++are neither modifiers nor actions, but which do change its behaviour ++in specific ways: ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++Displays the list of command-line options supported by \fBar\fR ++and then exits. ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++Displays the version information of \fBar\fR and then exits. ++.IP "\fB\-X32_64\fR" 4 ++.IX Item "-X32_64" ++\&\fBar\fR ignores an initial option spelled \fB\-X32_64\fR, for ++compatibility with \s-1AIX.\s0 The behaviour produced by this option is the ++default for \s-1GNU\s0 \fBar\fR. \fBar\fR does not support any ++of the other \fB\-X\fR options; in particular, it does not support ++\&\fB\-X32\fR which is the default for \s-1AIX\s0 \fBar\fR. ++.IP "\fB\-\-plugin\fR \fIname\fR" 4 ++.IX Item "--plugin name" ++The optional command-line switch \fB\-\-plugin\fR \fIname\fR causes ++\&\fBar\fR to load the plugin called \fIname\fR which adds support ++for more file formats, including object files with link-time ++optimization information. ++.Sp ++This option is only available if the toolchain has been built with ++plugin support enabled. ++.Sp ++If \fB\-\-plugin\fR is not provided, but plugin support has been ++enabled then \fBar\fR iterates over the files in ++\&\fI${libdir}/bfd\-plugins\fR in alphabetic order and the first ++plugin that claims the object in question is used. ++.Sp ++Please note that this plugin search directory is \fInot\fR the one ++used by \fBld\fR's \fB\-plugin\fR option. In order to make ++\&\fBar\fR use the linker plugin it must be copied into the ++\&\fI${libdir}/bfd\-plugins\fR directory. For \s-1GCC\s0 based compilations ++the linker plugin is called \fIliblto_plugin.so.0.0.0\fR. For Clang ++based compilations it is called \fILLVMgold.so\fR. The \s-1GCC\s0 plugin ++is always backwards compatible with earlier versions, so it is ++sufficient to just copy the newest one. ++.IP "\fB\-\-target\fR \fItarget\fR" 4 ++.IX Item "--target target" ++The optional command-line switch \fB\-\-target\fR \fIbfdname\fR ++specifies that the archive members are in an object code format ++different from your system's default format. See ++.IP "\fB\-\-output\fR \fIdirname\fR" 4 ++.IX Item "--output dirname" ++The \fB\-\-output\fR option can be used to specify a path to a ++directory into which archive members should be extracted. If this ++option is not specified then the current directory will be used. ++.Sp ++Note \- although the presence of this option does imply a \fBx\fR ++extraction operation that option must still be included on the command ++line. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBnm\fR\|(1), \fBranlib\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/cxxfilt.man b/binutils/doc/cxxfilt.man +--- a/binutils/doc/cxxfilt.man 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/cxxfilt.man 2021-03-30 17:47:59.835553000 -0300 +@@ -0,0 +1,376 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "C++FILT 1" ++.TH C++FILT 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++cxxfilt \- demangle C++ and Java symbols ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++c++filt [\fB\-_\fR|\fB\-\-strip\-underscore\fR] ++ [\fB\-n\fR|\fB\-\-no\-strip\-underscore\fR] ++ [\fB\-p\fR|\fB\-\-no\-params\fR] ++ [\fB\-t\fR|\fB\-\-types\fR] ++ [\fB\-i\fR|\fB\-\-no\-verbose\fR] ++ [\fB\-r\fR|\fB\-\-no\-recurse\-limit\fR] ++ [\fB\-R\fR|\fB\-\-recurse\-limit\fR] ++ [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR] ++ [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++The \*(C+ and Java languages provide function overloading, which means ++that you can write many functions with the same name, providing that ++each function takes parameters of different types. In order to be ++able to distinguish these similarly named functions \*(C+ and Java ++encode them into a low-level assembler name which uniquely identifies ++each different version. This process is known as \fImangling\fR. The ++\&\fBc++filt\fR ++[1] ++program does the inverse mapping: it decodes (\fIdemangles\fR) low-level ++names into user-level names so that they can be read. ++.PP ++Every alphanumeric word (consisting of letters, digits, underscores, ++dollars, or periods) seen in the input is a potential mangled name. ++If the name decodes into a \*(C+ name, the \*(C+ name replaces the ++low-level name in the output, otherwise the original word is output. ++In this way you can pass an entire assembler source file, containing ++mangled names, through \fBc++filt\fR and see the same source file ++containing demangled names. ++.PP ++You can also use \fBc++filt\fR to decipher individual symbols by ++passing them on the command line: ++.PP ++.Vb 1 ++\& c++filt ++.Ve ++.PP ++If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol ++names from the standard input instead. All the results are printed on ++the standard output. The difference between reading names from the ++command line versus reading names from the standard input is that ++command-line arguments are expected to be just mangled names and no ++checking is performed to separate them from surrounding text. Thus ++for example: ++.PP ++.Vb 1 ++\& c++filt \-n _Z1fv ++.Ve ++.PP ++will work and demangle the name to \*(L"f()\*(R" whereas: ++.PP ++.Vb 1 ++\& c++filt \-n _Z1fv, ++.Ve ++.PP ++will not work. (Note the extra comma at the end of the mangled ++name which makes it invalid). This command however will work: ++.PP ++.Vb 1 ++\& echo _Z1fv, | c++filt \-n ++.Ve ++.PP ++and will display \*(L"f(),\*(R", i.e., the demangled name followed by a ++trailing comma. This behaviour is because when the names are read ++from the standard input it is expected that they might be part of an ++assembler source file where there might be extra, extraneous ++characters trailing after a mangled name. For example: ++.PP ++.Vb 1 ++\& .type _Z1fv, @function ++.Ve ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fB\-_\fR" 4 ++.IX Item "-_" ++.PD 0 ++.IP "\fB\-\-strip\-underscore\fR" 4 ++.IX Item "--strip-underscore" ++.PD ++On some systems, both the C and \*(C+ compilers put an underscore in front ++of every name. For example, the C name \f(CW\*(C`foo\*(C'\fR gets the low-level ++name \f(CW\*(C`_foo\*(C'\fR. This option removes the initial underscore. Whether ++\&\fBc++filt\fR removes the underscore by default is target dependent. ++.IP "\fB\-n\fR" 4 ++.IX Item "-n" ++.PD 0 ++.IP "\fB\-\-no\-strip\-underscore\fR" 4 ++.IX Item "--no-strip-underscore" ++.PD ++Do not remove the initial underscore. ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-no\-params\fR" 4 ++.IX Item "--no-params" ++.PD ++When demangling the name of a function, do not display the types of ++the function's parameters. ++.IP "\fB\-t\fR" 4 ++.IX Item "-t" ++.PD 0 ++.IP "\fB\-\-types\fR" 4 ++.IX Item "--types" ++.PD ++Attempt to demangle types as well as function names. This is disabled ++by default since mangled types are normally only used internally in ++the compiler, and they can be confused with non-mangled names. For example, ++a function called \*(L"a\*(R" treated as a mangled type name would be ++demangled to \*(L"signed char\*(R". ++.IP "\fB\-i\fR" 4 ++.IX Item "-i" ++.PD 0 ++.IP "\fB\-\-no\-verbose\fR" 4 ++.IX Item "--no-verbose" ++.PD ++Do not include implementation details (if any) in the demangled ++output. ++.IP "\fB\-r\fR" 4 ++.IX Item "-r" ++.PD 0 ++.IP "\fB\-R\fR" 4 ++.IX Item "-R" ++.IP "\fB\-\-recurse\-limit\fR" 4 ++.IX Item "--recurse-limit" ++.IP "\fB\-\-no\-recurse\-limit\fR" 4 ++.IX Item "--no-recurse-limit" ++.IP "\fB\-\-recursion\-limit\fR" 4 ++.IX Item "--recursion-limit" ++.IP "\fB\-\-no\-recursion\-limit\fR" 4 ++.IX Item "--no-recursion-limit" ++.PD ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++.Sp ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++.Sp ++The \fB\-r\fR option is a synonym for the ++\&\fB\-\-no\-recurse\-limit\fR option. The \fB\-R\fR option is a ++synonym for the \fB\-\-recurse\-limit\fR option. ++.IP "\fB\-s\fR \fIformat\fR" 4 ++.IX Item "-s format" ++.PD 0 ++.IP "\fB\-\-format=\fR\fIformat\fR" 4 ++.IX Item "--format=format" ++.PD ++\&\fBc++filt\fR can decode various methods of mangling, used by ++different compilers. The argument to this option selects which ++method it uses: ++.RS 4 ++.ie n .IP """auto""" 4 ++.el .IP "\f(CWauto\fR" 4 ++.IX Item "auto" ++Automatic selection based on executable (the default method) ++.ie n .IP """gnu""" 4 ++.el .IP "\f(CWgnu\fR" 4 ++.IX Item "gnu" ++the one used by the \s-1GNU \*(C+\s0 compiler (g++) ++.ie n .IP """lucid""" 4 ++.el .IP "\f(CWlucid\fR" 4 ++.IX Item "lucid" ++the one used by the Lucid compiler (lcc) ++.ie n .IP """arm""" 4 ++.el .IP "\f(CWarm\fR" 4 ++.IX Item "arm" ++the one specified by the \*(C+ Annotated Reference Manual ++.ie n .IP """hp""" 4 ++.el .IP "\f(CWhp\fR" 4 ++.IX Item "hp" ++the one used by the \s-1HP\s0 compiler (aCC) ++.ie n .IP """edg""" 4 ++.el .IP "\f(CWedg\fR" 4 ++.IX Item "edg" ++the one used by the \s-1EDG\s0 compiler ++.ie n .IP """gnu\-v3""" 4 ++.el .IP "\f(CWgnu\-v3\fR" 4 ++.IX Item "gnu-v3" ++the one used by the \s-1GNU \*(C+\s0 compiler (g++) with the V3 \s-1ABI.\s0 ++.ie n .IP """java""" 4 ++.el .IP "\f(CWjava\fR" 4 ++.IX Item "java" ++the one used by the \s-1GNU\s0 Java compiler (gcj) ++.ie n .IP """gnat""" 4 ++.el .IP "\f(CWgnat\fR" 4 ++.IX Item "gnat" ++the one used by the \s-1GNU\s0 Ada compiler (\s-1GNAT\s0). ++.RE ++.RS 4 ++.RE ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++Print a summary of the options to \fBc++filt\fR and exit. ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++Print the version number of \fBc++filt\fR and exit. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "FOOTNOTES" ++.IX Header "FOOTNOTES" ++.IP "1." 4 ++MS-DOS does not allow \f(CW\*(C`+\*(C'\fR characters in file names, so on ++MS-DOS this program is named \fB\s-1CXXFILT\s0\fR. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/dlltool.1 b/binutils/doc/dlltool.1 +--- a/binutils/doc/dlltool.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/dlltool.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,542 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "DLLTOOL 1" ++.TH DLLTOOL 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++dlltool \- create files needed to build and use DLLs ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++dlltool [\fB\-d\fR|\fB\-\-input\-def\fR \fIdef-file-name\fR] ++ [\fB\-b\fR|\fB\-\-base\-file\fR \fIbase-file-name\fR] ++ [\fB\-e\fR|\fB\-\-output\-exp\fR \fIexports-file-name\fR] ++ [\fB\-z\fR|\fB\-\-output\-def\fR \fIdef-file-name\fR] ++ [\fB\-l\fR|\fB\-\-output\-lib\fR \fIlibrary-file-name\fR] ++ [\fB\-y\fR|\fB\-\-output\-delaylib\fR \fIlibrary-file-name\fR] ++ [\fB\-\-export\-all\-symbols\fR] [\fB\-\-no\-export\-all\-symbols\fR] ++ [\fB\-\-exclude\-symbols\fR \fIlist\fR] ++ [\fB\-\-no\-default\-excludes\fR] ++ [\fB\-S\fR|\fB\-\-as\fR \fIpath-to-assembler\fR] [\fB\-f\fR|\fB\-\-as\-flags\fR \fIoptions\fR] ++ [\fB\-D\fR|\fB\-\-dllname\fR \fIname\fR] [\fB\-m\fR|\fB\-\-machine\fR \fImachine\fR] ++ [\fB\-a\fR|\fB\-\-add\-indirect\fR] ++ [\fB\-U\fR|\fB\-\-add\-underscore\fR] [\fB\-\-add\-stdcall\-underscore\fR] ++ [\fB\-k\fR|\fB\-\-kill\-at\fR] [\fB\-A\fR|\fB\-\-add\-stdcall\-alias\fR] ++ [\fB\-p\fR|\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR] ++ [\fB\-x\fR|\fB\-\-no\-idata4\fR] [\fB\-c\fR|\fB\-\-no\-idata5\fR] ++ [\fB\-\-use\-nul\-prefixed\-import\-tables\fR] ++ [\fB\-I\fR|\fB\-\-identify\fR \fIlibrary-file-name\fR] [\fB\-\-identify\-strict\fR] ++ [\fB\-i\fR|\fB\-\-interwork\fR] ++ [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-t\fR|\fB\-\-temp\-prefix\fR \fIprefix\fR] ++ [\fB\-v\fR|\fB\-\-verbose\fR] ++ [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] ++ [\fB\-\-no\-leading\-underscore\fR] [\fB\-\-leading\-underscore\fR] ++ [object\-file ...] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBdlltool\fR reads its inputs, which can come from the \fB\-d\fR and ++\&\fB\-b\fR options as well as object files specified on the command ++line. It then processes these inputs and if the \fB\-e\fR option has ++been specified it creates a exports file. If the \fB\-l\fR option ++has been specified it creates a library file and if the \fB\-z\fR option ++has been specified it creates a def file. Any or all of the \fB\-e\fR, ++\&\fB\-l\fR and \fB\-z\fR options can be present in one invocation of ++dlltool. ++.PP ++When creating a \s-1DLL,\s0 along with the source for the \s-1DLL,\s0 it is necessary ++to have three other files. \fBdlltool\fR can help with the creation of ++these files. ++.PP ++The first file is a \fI.def\fR file which specifies which functions are ++exported from the \s-1DLL,\s0 which functions the \s-1DLL\s0 imports, and so on. This ++is a text file and can be created by hand, or \fBdlltool\fR can be used ++to create it using the \fB\-z\fR option. In this case \fBdlltool\fR ++will scan the object files specified on its command line looking for ++those functions which have been specially marked as being exported and ++put entries for them in the \fI.def\fR file it creates. ++.PP ++In order to mark a function as being exported from a \s-1DLL,\s0 it needs to ++have an \fB\-export:\fR entry in the \fB.drectve\fR ++section of the object file. This can be done in C by using the ++\&\fBasm()\fR operator: ++.PP ++.Vb 2 ++\& asm (".section .drectve"); ++\& asm (".ascii \e"\-export:my_func\e""); ++\& ++\& int my_func (void) { ... } ++.Ve ++.PP ++The second file needed for \s-1DLL\s0 creation is an exports file. This file ++is linked with the object files that make up the body of the \s-1DLL\s0 and it ++handles the interface between the \s-1DLL\s0 and the outside world. This is a ++binary file and it can be created by giving the \fB\-e\fR option to ++\&\fBdlltool\fR when it is creating or reading in a \fI.def\fR file. ++.PP ++The third file needed for \s-1DLL\s0 creation is the library file that programs ++will link with in order to access the functions in the \s-1DLL\s0 (an `import ++library'). This file can be created by giving the \fB\-l\fR option to ++dlltool when it is creating or reading in a \fI.def\fR file. ++.PP ++If the \fB\-y\fR option is specified, dlltool generates a delay-import ++library that can be used instead of the normal import library to allow ++a program to link to the dll only as soon as an imported function is ++called for the first time. The resulting executable will need to be ++linked to the static delayimp library containing _\|\fB_delayLoadHelper2()\fR, ++which in turn will import LoadLibraryA and GetProcAddress from kernel32. ++.PP ++\&\fBdlltool\fR builds the library file by hand, but it builds the ++exports file by creating temporary files containing assembler statements ++and then assembling these. The \fB\-S\fR command-line option can be ++used to specify the path to the assembler that dlltool will use, ++and the \fB\-f\fR option can be used to pass specific flags to that ++assembler. The \fB\-n\fR can be used to prevent dlltool from deleting ++these temporary assembler files when it is done, and if \fB\-n\fR is ++specified twice then this will prevent dlltool from deleting the ++temporary object files it used to build the library. ++.PP ++Here is an example of creating a \s-1DLL\s0 from a source file \fBdll.c\fR and ++also creating a program (from an object file called \fBprogram.o\fR) ++that uses that \s-1DLL:\s0 ++.PP ++.Vb 4 ++\& gcc \-c dll.c ++\& dlltool \-e exports.o \-l dll.lib dll.o ++\& gcc dll.o exports.o \-o dll.dll ++\& gcc program.o dll.lib \-o program ++.Ve ++.PP ++\&\fBdlltool\fR may also be used to query an existing import library ++to determine the name of the \s-1DLL\s0 to which it is associated. See the ++description of the \fB\-I\fR or \fB\-\-identify\fR option. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The command-line options have the following meanings: ++.IP "\fB\-d\fR \fIfilename\fR" 4 ++.IX Item "-d filename" ++.PD 0 ++.IP "\fB\-\-input\-def\fR \fIfilename\fR" 4 ++.IX Item "--input-def filename" ++.PD ++Specifies the name of a \fI.def\fR file to be read in and processed. ++.IP "\fB\-b\fR \fIfilename\fR" 4 ++.IX Item "-b filename" ++.PD 0 ++.IP "\fB\-\-base\-file\fR \fIfilename\fR" 4 ++.IX Item "--base-file filename" ++.PD ++Specifies the name of a base file to be read in and processed. The ++contents of this file will be added to the relocation section in the ++exports file generated by dlltool. ++.IP "\fB\-e\fR \fIfilename\fR" 4 ++.IX Item "-e filename" ++.PD 0 ++.IP "\fB\-\-output\-exp\fR \fIfilename\fR" 4 ++.IX Item "--output-exp filename" ++.PD ++Specifies the name of the export file to be created by dlltool. ++.IP "\fB\-z\fR \fIfilename\fR" 4 ++.IX Item "-z filename" ++.PD 0 ++.IP "\fB\-\-output\-def\fR \fIfilename\fR" 4 ++.IX Item "--output-def filename" ++.PD ++Specifies the name of the \fI.def\fR file to be created by dlltool. ++.IP "\fB\-l\fR \fIfilename\fR" 4 ++.IX Item "-l filename" ++.PD 0 ++.IP "\fB\-\-output\-lib\fR \fIfilename\fR" 4 ++.IX Item "--output-lib filename" ++.PD ++Specifies the name of the library file to be created by dlltool. ++.IP "\fB\-y\fR \fIfilename\fR" 4 ++.IX Item "-y filename" ++.PD 0 ++.IP "\fB\-\-output\-delaylib\fR \fIfilename\fR" 4 ++.IX Item "--output-delaylib filename" ++.PD ++Specifies the name of the delay-import library file to be created by dlltool. ++.IP "\fB\-\-export\-all\-symbols\fR" 4 ++.IX Item "--export-all-symbols" ++Treat all global and weak defined symbols found in the input object ++files as symbols to be exported. There is a small list of symbols which ++are not exported by default; see the \fB\-\-no\-default\-excludes\fR ++option. You may add to the list of symbols to not export by using the ++\&\fB\-\-exclude\-symbols\fR option. ++.IP "\fB\-\-no\-export\-all\-symbols\fR" 4 ++.IX Item "--no-export-all-symbols" ++Only export symbols explicitly listed in an input \fI.def\fR file or in ++\&\fB.drectve\fR sections in the input object files. This is the default ++behaviour. The \fB.drectve\fR sections are created by \fBdllexport\fR ++attributes in the source code. ++.IP "\fB\-\-exclude\-symbols\fR \fIlist\fR" 4 ++.IX Item "--exclude-symbols list" ++Do not export the symbols in \fIlist\fR. This is a list of symbol names ++separated by comma or colon characters. The symbol names should not ++contain a leading underscore. This is only meaningful when ++\&\fB\-\-export\-all\-symbols\fR is used. ++.IP "\fB\-\-no\-default\-excludes\fR" 4 ++.IX Item "--no-default-excludes" ++When \fB\-\-export\-all\-symbols\fR is used, it will by default avoid ++exporting certain special symbols. The current list of symbols to avoid ++exporting is \fBDllMain@12\fR, \fBDllEntryPoint@0\fR, ++\&\fBimpure_ptr\fR. You may use the \fB\-\-no\-default\-excludes\fR option ++to go ahead and export these special symbols. This is only meaningful ++when \fB\-\-export\-all\-symbols\fR is used. ++.IP "\fB\-S\fR \fIpath\fR" 4 ++.IX Item "-S path" ++.PD 0 ++.IP "\fB\-\-as\fR \fIpath\fR" 4 ++.IX Item "--as path" ++.PD ++Specifies the path, including the filename, of the assembler to be used ++to create the exports file. ++.IP "\fB\-f\fR \fIoptions\fR" 4 ++.IX Item "-f options" ++.PD 0 ++.IP "\fB\-\-as\-flags\fR \fIoptions\fR" 4 ++.IX Item "--as-flags options" ++.PD ++Specifies any specific command-line options to be passed to the ++assembler when building the exports file. This option will work even if ++the \fB\-S\fR option is not used. This option only takes one argument, ++and if it occurs more than once on the command line, then later ++occurrences will override earlier occurrences. So if it is necessary to ++pass multiple options to the assembler they should be enclosed in ++double quotes. ++.IP "\fB\-D\fR \fIname\fR" 4 ++.IX Item "-D name" ++.PD 0 ++.IP "\fB\-\-dll\-name\fR \fIname\fR" 4 ++.IX Item "--dll-name name" ++.PD ++Specifies the name to be stored in the \fI.def\fR file as the name of ++the \s-1DLL\s0 when the \fB\-e\fR option is used. If this option is not ++present, then the filename given to the \fB\-e\fR option will be ++used as the name of the \s-1DLL.\s0 ++.IP "\fB\-m\fR \fImachine\fR" 4 ++.IX Item "-m machine" ++.PD 0 ++.IP "\fB\-machine\fR \fImachine\fR" 4 ++.IX Item "-machine machine" ++.PD ++Specifies the type of machine for which the library file should be ++built. \fBdlltool\fR has a built in default type, depending upon how ++it was created, but this option can be used to override that. This is ++normally only useful when creating DLLs for an \s-1ARM\s0 processor, when the ++contents of the \s-1DLL\s0 are actually encode using Thumb instructions. ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-add\-indirect\fR" 4 ++.IX Item "--add-indirect" ++.PD ++Specifies that when \fBdlltool\fR is creating the exports file it ++should add a section which allows the exported functions to be ++referenced without using the import library. Whatever the hell that ++means! ++.IP "\fB\-U\fR" 4 ++.IX Item "-U" ++.PD 0 ++.IP "\fB\-\-add\-underscore\fR" 4 ++.IX Item "--add-underscore" ++.PD ++Specifies that when \fBdlltool\fR is creating the exports file it ++should prepend an underscore to the names of \fIall\fR exported symbols. ++.IP "\fB\-\-no\-leading\-underscore\fR" 4 ++.IX Item "--no-leading-underscore" ++.PD 0 ++.IP "\fB\-\-leading\-underscore\fR" 4 ++.IX Item "--leading-underscore" ++.PD ++Specifies whether standard symbol should be forced to be prefixed, or ++not. ++.IP "\fB\-\-add\-stdcall\-underscore\fR" 4 ++.IX Item "--add-stdcall-underscore" ++Specifies that when \fBdlltool\fR is creating the exports file it ++should prepend an underscore to the names of exported \fIstdcall\fR ++functions. Variable names and non-stdcall function names are not modified. ++This option is useful when creating GNU-compatible import libs for third ++party DLLs that were built with MS-Windows tools. ++.IP "\fB\-k\fR" 4 ++.IX Item "-k" ++.PD 0 ++.IP "\fB\-\-kill\-at\fR" 4 ++.IX Item "--kill-at" ++.PD ++Specifies that \fB@\fR suffixes should be omitted from the names ++of stdcall functions that will be imported from the \s-1DLL.\s0 This is ++useful when creating an import library for a \s-1DLL\s0 which exports stdcall ++functions but without the usual \fB@\fR symbol name suffix. ++.Sp ++This does not change the naming of symbols provided by the import library ++to programs linked against it, but only the entries in the import table ++(ie the .idata section). ++.IP "\fB\-A\fR" 4 ++.IX Item "-A" ++.PD 0 ++.IP "\fB\-\-add\-stdcall\-alias\fR" 4 ++.IX Item "--add-stdcall-alias" ++.PD ++Specifies that when \fBdlltool\fR is creating the exports file it ++should add aliases for stdcall symbols without \fB@ \fR ++in addition to the symbols with \fB@ \fR. ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-ext\-prefix\-alias\fR \fIprefix\fR" 4 ++.IX Item "--ext-prefix-alias prefix" ++.PD ++Causes \fBdlltool\fR to create external aliases for all \s-1DLL\s0 ++imports with the specified prefix. The aliases are created for both ++external and import symbols with no leading underscore. ++.IP "\fB\-x\fR" 4 ++.IX Item "-x" ++.PD 0 ++.IP "\fB\-\-no\-idata4\fR" 4 ++.IX Item "--no-idata4" ++.PD ++Specifies that when \fBdlltool\fR is creating the exports and library ++files it should omit the \f(CW\*(C`.idata4\*(C'\fR section. This is for compatibility ++with certain operating systems. ++.IP "\fB\-\-use\-nul\-prefixed\-import\-tables\fR" 4 ++.IX Item "--use-nul-prefixed-import-tables" ++Specifies that when \fBdlltool\fR is creating the exports and library ++files it should prefix the \f(CW\*(C`.idata4\*(C'\fR and \f(CW\*(C`.idata5\*(C'\fR by zero an ++element. This emulates old gnu import library generation of ++\&\f(CW\*(C`dlltool\*(C'\fR. By default this option is turned off. ++.IP "\fB\-c\fR" 4 ++.IX Item "-c" ++.PD 0 ++.IP "\fB\-\-no\-idata5\fR" 4 ++.IX Item "--no-idata5" ++.PD ++Specifies that when \fBdlltool\fR is creating the exports and library ++files it should omit the \f(CW\*(C`.idata5\*(C'\fR section. This is for compatibility ++with certain operating systems. ++.IP "\fB\-I\fR \fIfilename\fR" 4 ++.IX Item "-I filename" ++.PD 0 ++.IP "\fB\-\-identify\fR \fIfilename\fR" 4 ++.IX Item "--identify filename" ++.PD ++Specifies that \fBdlltool\fR should inspect the import library ++indicated by \fIfilename\fR and report, on \f(CW\*(C`stdout\*(C'\fR, the name(s) ++of the associated \s-1DLL\s0(s). This can be performed in addition to any ++other operations indicated by the other options and arguments. ++\&\fBdlltool\fR fails if the import library does not exist or is not ++actually an import library. See also \fB\-\-identify\-strict\fR. ++.IP "\fB\-\-identify\-strict\fR" 4 ++.IX Item "--identify-strict" ++Modifies the behavior of the \fB\-\-identify\fR option, such ++that an error is reported if \fIfilename\fR is associated with ++more than one \s-1DLL.\s0 ++.IP "\fB\-i\fR" 4 ++.IX Item "-i" ++.PD 0 ++.IP "\fB\-\-interwork\fR" 4 ++.IX Item "--interwork" ++.PD ++Specifies that \fBdlltool\fR should mark the objects in the library ++file and exports file that it produces as supporting interworking ++between \s-1ARM\s0 and Thumb code. ++.IP "\fB\-n\fR" 4 ++.IX Item "-n" ++.PD 0 ++.IP "\fB\-\-nodelete\fR" 4 ++.IX Item "--nodelete" ++.PD ++Makes \fBdlltool\fR preserve the temporary assembler files it used to ++create the exports file. If this option is repeated then dlltool will ++also preserve the temporary object files it uses to create the library ++file. ++.IP "\fB\-t\fR \fIprefix\fR" 4 ++.IX Item "-t prefix" ++.PD 0 ++.IP "\fB\-\-temp\-prefix\fR \fIprefix\fR" 4 ++.IX Item "--temp-prefix prefix" ++.PD ++Makes \fBdlltool\fR use \fIprefix\fR when constructing the names of ++temporary assembler and object files. By default, the temp file prefix ++is generated from the pid. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-\-verbose\fR" 4 ++.IX Item "--verbose" ++.PD ++Make dlltool describe what it is doing. ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Displays a list of command-line options and then exits. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Displays dlltool's version number and then exits. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++The Info pages for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/elfedit.1 b/binutils/doc/elfedit.1 +--- a/binutils/doc/elfedit.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/elfedit.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,260 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "ELFEDIT 1" ++.TH ELFEDIT 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++elfedit \- update ELF header and program property of ELF files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++elfedit [\fB\-\-input\-mach=\fR\fImachine\fR] ++ [\fB\-\-input\-type=\fR\fItype\fR] ++ [\fB\-\-input\-osabi=\fR\fIosabi\fR] ++ \fB\-\-output\-mach=\fR\fImachine\fR ++ \fB\-\-output\-type=\fR\fItype\fR ++ \fB\-\-output\-osabi=\fR\fIosabi\fR ++ \fB\-\-enable\-x86\-feature=\fR\fIfeature\fR ++ \fB\-\-disable\-x86\-feature=\fR\fIfeature\fR ++ [\fB\-v\fR|\fB\-\-version\fR] ++ [\fB\-h\fR|\fB\-\-help\fR] ++ \fIelffile\fR... ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBelfedit\fR updates the \s-1ELF\s0 header and program property of \s-1ELF\s0 ++files which have the matching \s-1ELF\s0 machine and file types. The options ++control how and which fields in the \s-1ELF\s0 header and program property ++should be updated. ++.PP ++\&\fIelffile\fR... are the \s-1ELF\s0 files to be updated. 32\-bit and ++64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The long and short forms of options, shown here as alternatives, are ++equivalent. At least one of the \fB\-\-output\-mach\fR, ++\&\fB\-\-output\-type\fR, \fB\-\-output\-osabi\fR, ++\&\fB\-\-enable\-x86\-feature\fR and \fB\-\-disable\-x86\-feature\fR ++options must be given. ++.IP "\fB\-\-input\-mach=\fR\fImachine\fR" 4 ++.IX Item "--input-mach=machine" ++Set the matching input \s-1ELF\s0 machine type to \fImachine\fR. If ++\&\fB\-\-input\-mach\fR isn't specified, it will match any \s-1ELF\s0 ++machine types. ++.Sp ++The supported \s-1ELF\s0 machine types are, \fIi386\fR, \fI\s-1IAMCU\s0\fR, \fIL1OM\fR, ++\&\fIK1OM\fR and \fIx86\-64\fR. ++.IP "\fB\-\-output\-mach=\fR\fImachine\fR" 4 ++.IX Item "--output-mach=machine" ++Change the \s-1ELF\s0 machine type in the \s-1ELF\s0 header to \fImachine\fR. The ++supported \s-1ELF\s0 machine types are the same as \fB\-\-input\-mach\fR. ++.IP "\fB\-\-input\-type=\fR\fItype\fR" 4 ++.IX Item "--input-type=type" ++Set the matching input \s-1ELF\s0 file type to \fItype\fR. If ++\&\fB\-\-input\-type\fR isn't specified, it will match any \s-1ELF\s0 file types. ++.Sp ++The supported \s-1ELF\s0 file types are, \fIrel\fR, \fIexec\fR and \fIdyn\fR. ++.IP "\fB\-\-output\-type=\fR\fItype\fR" 4 ++.IX Item "--output-type=type" ++Change the \s-1ELF\s0 file type in the \s-1ELF\s0 header to \fItype\fR. The ++supported \s-1ELF\s0 types are the same as \fB\-\-input\-type\fR. ++.IP "\fB\-\-input\-osabi=\fR\fIosabi\fR" 4 ++.IX Item "--input-osabi=osabi" ++Set the matching input \s-1ELF\s0 file \s-1OSABI\s0 to \fIosabi\fR. If ++\&\fB\-\-input\-osabi\fR isn't specified, it will match any \s-1ELF\s0 OSABIs. ++.Sp ++The supported \s-1ELF\s0 OSABIs are, \fInone\fR, \fI\s-1HPUX\s0\fR, \fINetBSD\fR, ++\&\fI\s-1GNU\s0\fR, \fILinux\fR (alias for \fI\s-1GNU\s0\fR), ++\&\fISolaris\fR, \fI\s-1AIX\s0\fR, \fIIrix\fR, ++\&\fIFreeBSD\fR, \fI\s-1TRU64\s0\fR, \fIModesto\fR, \fIOpenBSD\fR, \fIOpenVMS\fR, ++\&\fI\s-1NSK\s0\fR, \fI\s-1AROS\s0\fR and \fIFenixOS\fR. ++.IP "\fB\-\-output\-osabi=\fR\fIosabi\fR" 4 ++.IX Item "--output-osabi=osabi" ++Change the \s-1ELF OSABI\s0 in the \s-1ELF\s0 header to \fIosabi\fR. The ++supported \s-1ELF OSABI\s0 are the same as \fB\-\-input\-osabi\fR. ++.IP "\fB\-\-enable\-x86\-feature=\fR\fIfeature\fR" 4 ++.IX Item "--enable-x86-feature=feature" ++Set the \fIfeature\fR bit in program property in \fIexec\fR or \fIdyn\fR ++\&\s-1ELF\s0 files with machine types of \fIi386\fR or \fIx86\-64\fR. The ++supported features are, \fIibt\fR and \fIshstk\fR. ++.IP "\fB\-\-disable\-x86\-feature=\fR\fIfeature\fR" 4 ++.IX Item "--disable-x86-feature=feature" ++Clear the \fIfeature\fR bit in program property in \fIexec\fR or ++\&\fIdyn\fR \s-1ELF\s0 files with machine types of \fIi386\fR or \fIx86\-64\fR. ++The supported features are the same as \fB\-\-enable\-x86\-feature\fR. ++.Sp ++Note: \fB\-\-enable\-x86\-feature\fR and \fB\-\-disable\-x86\-feature\fR ++are available only on hosts with \fBmmap\fR support. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Display the version number of \fBelfedit\fR. ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Display the command-line options understood by \fBelfedit\fR. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/Makefile.am b/binutils/doc/Makefile.am +--- a/binutils/doc/Makefile.am 2021-03-30 23:12:40.154559932 -0300 ++++ b/binutils/doc/Makefile.am 2021-03-30 17:47:59.835553000 -0300 +@@ -58,6 +58,8 @@ + + # Man page generation from texinfo + addr2line.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_addr2line.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod + -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -65,6 +67,8 @@ + rm -f addr2line.pod + + ar.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ar.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod + -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -72,6 +76,8 @@ + rm -f ar.pod + + dlltool.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_dlltool.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod + -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -79,6 +85,8 @@ + rm -f dlltool.pod + + nm.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_nm.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod + -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -86,6 +94,8 @@ + rm -f nm.pod + + objcopy.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_objcopy.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod + -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -93,6 +103,8 @@ + rm -f objcopy.pod + + objdump.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_objdump.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod + -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -100,6 +112,8 @@ + rm -f objdump.pod + + ranlib.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ranlib.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod + -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -107,6 +121,8 @@ + rm -f ranlib.pod + + readelf.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_readelf.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod + -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -114,6 +130,8 @@ + rm -f readelf.pod + + size.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_size.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod + -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -121,6 +139,8 @@ + rm -f size.pod + + strings.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_strings.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod + -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -128,6 +148,8 @@ + rm -f strings.pod + + strip.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_strip.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod + -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -142,6 +164,8 @@ + rm -f elfedit.pod + + windres.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_windres.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod + -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -149,6 +173,8 @@ + rm -f windres.pod + + windmc.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_windmc.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod + -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -156,6 +182,8 @@ + rm -f windmc.pod + + cxxfilt.man: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_cxxfilt.man: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod + -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +diff -rNU3 a/binutils/doc/Makefile.in b/binutils/doc/Makefile.in +--- a/binutils/doc/Makefile.in 2021-03-30 23:12:40.154559932 -0300 ++++ b/binutils/doc/Makefile.in 2021-03-30 17:47:59.835553000 -0300 +@@ -370,6 +370,7 @@ + libexecdir = @libexecdir@ + localedir = @localedir@ + localstatedir = @localstatedir@ ++lt_ECHO = @lt_ECHO@ + mandir = @mandir@ + mkdir_p = @mkdir_p@ + oldincludedir = @oldincludedir@ +@@ -471,6 +472,8 @@ + -rm -rf .libs _libs + + binutils.info: binutils.texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_binutils.info: binutils.texi + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ +@@ -908,6 +911,8 @@ + + # Man page generation from texinfo + addr2line.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_addr2line.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod + -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -915,6 +920,8 @@ + rm -f addr2line.pod + + ar.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ar.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod + -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -922,6 +929,8 @@ + rm -f ar.pod + + dlltool.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_dlltool.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod + -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -929,6 +938,8 @@ + rm -f dlltool.pod + + nm.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_nm.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod + -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -936,6 +947,8 @@ + rm -f nm.pod + + objcopy.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_objcopy.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod + -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -943,6 +956,8 @@ + rm -f objcopy.pod + + objdump.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_objdump.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod + -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -950,6 +965,8 @@ + rm -f objdump.pod + + ranlib.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ranlib.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod + -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -957,6 +974,8 @@ + rm -f ranlib.pod + + readelf.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_readelf.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod + -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -964,6 +983,8 @@ + rm -f readelf.pod + + size.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_size.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod + -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -971,6 +992,8 @@ + rm -f size.pod + + strings.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_strings.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod + -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -978,6 +1001,8 @@ + rm -f strings.pod + + strip.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_strip.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod + -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -985,6 +1010,8 @@ + rm -f strip.pod + + elfedit.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_elfedit.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Delfedit < $(binutils_TEXI) > elfedit.pod + -($(POD2MAN) elfedit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -992,6 +1019,8 @@ + rm -f elfedit.pod + + windres.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_windres.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod + -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -999,6 +1028,8 @@ + rm -f windres.pod + + windmc.1: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_windmc.1: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod + -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +@@ -1006,6 +1037,8 @@ + rm -f windmc.pod + + cxxfilt.man: $(binutils_TEXI) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_cxxfilt.man: + touch $@ + -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod + -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +diff -rNU3 a/binutils/doc/nm.1 b/binutils/doc/nm.1 +--- a/binutils/doc/nm.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/nm.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,602 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "NM 1" ++.TH NM 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++nm \- list symbols from object files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++nm [\fB\-A\fR|\fB\-o\fR|\fB\-\-print\-file\-name\fR] [\fB\-a\fR|\fB\-\-debug\-syms\fR] ++ [\fB\-B\fR|\fB\-\-format=bsd\fR] [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR]] ++ [\fB\-D\fR|\fB\-\-dynamic\fR] [\fB\-f\fR\fIformat\fR|\fB\-\-format=\fR\fIformat\fR] ++ [\fB\-g\fR|\fB\-\-extern\-only\fR] [\fB\-h\fR|\fB\-\-help\fR] ++ [\fB\-l\fR|\fB\-\-line\-numbers\fR] [\fB\-\-inlines\fR] ++ [\fB\-n\fR|\fB\-v\fR|\fB\-\-numeric\-sort\fR] ++ [\fB\-P\fR|\fB\-\-portability\fR] [\fB\-p\fR|\fB\-\-no\-sort\fR] ++ [\fB\-r\fR|\fB\-\-reverse\-sort\fR] [\fB\-S\fR|\fB\-\-print\-size\fR] ++ [\fB\-s\fR|\fB\-\-print\-armap\fR] [\fB\-t\fR \fIradix\fR|\fB\-\-radix=\fR\fIradix\fR] ++ [\fB\-u\fR|\fB\-\-undefined\-only\fR] [\fB\-V\fR|\fB\-\-version\fR] ++ [\fB\-X 32_64\fR] [\fB\-\-defined\-only\fR] [\fB\-\-no\-demangle\fR] ++ [\fB\-\-plugin\fR \fIname\fR] ++ [\fB\-\-no\-recurse\-limit\fR|\fB\-\-recurse\-limit\fR]] ++ [\fB\-\-size\-sort\fR] [\fB\-\-special\-syms\fR] ++ [\fB\-\-synthetic\fR] [\fB\-\-with\-symbol\-versions\fR] [\fB\-\-target=\fR\fIbfdname\fR] ++ [\fIobjfile\fR...] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\s-1GNU\s0 \fBnm\fR lists the symbols from object files \fIobjfile\fR.... ++If no object files are listed as arguments, \fBnm\fR assumes the file ++\&\fIa.out\fR. ++.PP ++For each symbol, \fBnm\fR shows: ++.IP "\(bu" 4 ++The symbol value, in the radix selected by options (see below), or ++hexadecimal by default. ++.IP "\(bu" 4 ++The symbol type. At least the following types are used; others are, as ++well, depending on the object file format. If lowercase, the symbol is ++usually local; if uppercase, the symbol is global (external). There ++are however a few lowercase symbols that are shown for special global ++symbols (\f(CW\*(C`u\*(C'\fR, \f(CW\*(C`v\*(C'\fR and \f(CW\*(C`w\*(C'\fR). ++.RS 4 ++.ie n .IP """A""" 4 ++.el .IP "\f(CWA\fR" 4 ++.IX Item "A" ++The symbol's value is absolute, and will not be changed by further ++linking. ++.ie n .IP """B""" 4 ++.el .IP "\f(CWB\fR" 4 ++.IX Item "B" ++.PD 0 ++.ie n .IP """b""" 4 ++.el .IP "\f(CWb\fR" 4 ++.IX Item "b" ++.PD ++The symbol is in the \s-1BSS\s0 data section. This section typically ++contains zero-initialized or uninitialized data, although the exact ++behavior is system dependent. ++.ie n .IP """C""" 4 ++.el .IP "\f(CWC\fR" 4 ++.IX Item "C" ++The symbol is common. Common symbols are uninitialized data. When ++linking, multiple common symbols may appear with the same name. If the ++symbol is defined anywhere, the common symbols are treated as undefined ++references. ++.ie n .IP """D""" 4 ++.el .IP "\f(CWD\fR" 4 ++.IX Item "D" ++.PD 0 ++.ie n .IP """d""" 4 ++.el .IP "\f(CWd\fR" 4 ++.IX Item "d" ++.PD ++The symbol is in the initialized data section. ++.ie n .IP """G""" 4 ++.el .IP "\f(CWG\fR" 4 ++.IX Item "G" ++.PD 0 ++.ie n .IP """g""" 4 ++.el .IP "\f(CWg\fR" 4 ++.IX Item "g" ++.PD ++The symbol is in an initialized data section for small objects. Some ++object file formats permit more efficient access to small data objects, ++such as a global int variable as opposed to a large global array. ++.ie n .IP """i""" 4 ++.el .IP "\f(CWi\fR" 4 ++.IX Item "i" ++For \s-1PE\s0 format files this indicates that the symbol is in a section ++specific to the implementation of DLLs. For \s-1ELF\s0 format files this ++indicates that the symbol is an indirect function. This is a \s-1GNU\s0 ++extension to the standard set of \s-1ELF\s0 symbol types. It indicates a ++symbol which if referenced by a relocation does not evaluate to its ++address, but instead must be invoked at runtime. The runtime ++execution will then return the value to be used in the relocation. ++.ie n .IP """I""" 4 ++.el .IP "\f(CWI\fR" 4 ++.IX Item "I" ++The symbol is an indirect reference to another symbol. ++.ie n .IP """N""" 4 ++.el .IP "\f(CWN\fR" 4 ++.IX Item "N" ++The symbol is a debugging symbol. ++.ie n .IP """n""" 4 ++.el .IP "\f(CWn\fR" 4 ++.IX Item "n" ++The symbol is in the read-only data section. ++.ie n .IP """p""" 4 ++.el .IP "\f(CWp\fR" 4 ++.IX Item "p" ++The symbol is in a stack unwind section. ++.ie n .IP """R""" 4 ++.el .IP "\f(CWR\fR" 4 ++.IX Item "R" ++.PD 0 ++.ie n .IP """r""" 4 ++.el .IP "\f(CWr\fR" 4 ++.IX Item "r" ++.PD ++The symbol is in a read only data section. ++.ie n .IP """S""" 4 ++.el .IP "\f(CWS\fR" 4 ++.IX Item "S" ++.PD 0 ++.ie n .IP """s""" 4 ++.el .IP "\f(CWs\fR" 4 ++.IX Item "s" ++.PD ++The symbol is in an uninitialized or zero-initialized data section ++for small objects. ++.ie n .IP """T""" 4 ++.el .IP "\f(CWT\fR" 4 ++.IX Item "T" ++.PD 0 ++.ie n .IP """t""" 4 ++.el .IP "\f(CWt\fR" 4 ++.IX Item "t" ++.PD ++The symbol is in the text (code) section. ++.ie n .IP """U""" 4 ++.el .IP "\f(CWU\fR" 4 ++.IX Item "U" ++The symbol is undefined. ++.ie n .IP """u""" 4 ++.el .IP "\f(CWu\fR" 4 ++.IX Item "u" ++The symbol is a unique global symbol. This is a \s-1GNU\s0 extension to the ++standard set of \s-1ELF\s0 symbol bindings. For such a symbol the dynamic linker ++will make sure that in the entire process there is just one symbol with ++this name and type in use. ++.ie n .IP """V""" 4 ++.el .IP "\f(CWV\fR" 4 ++.IX Item "V" ++.PD 0 ++.ie n .IP """v""" 4 ++.el .IP "\f(CWv\fR" 4 ++.IX Item "v" ++.PD ++The symbol is a weak object. When a weak defined symbol is linked with ++a normal defined symbol, the normal defined symbol is used with no error. ++When a weak undefined symbol is linked and the symbol is not defined, ++the value of the weak symbol becomes zero with no error. On some ++systems, uppercase indicates that a default value has been specified. ++.ie n .IP """W""" 4 ++.el .IP "\f(CWW\fR" 4 ++.IX Item "W" ++.PD 0 ++.ie n .IP """w""" 4 ++.el .IP "\f(CWw\fR" 4 ++.IX Item "w" ++.PD ++The symbol is a weak symbol that has not been specifically tagged as a ++weak object symbol. When a weak defined symbol is linked with a normal ++defined symbol, the normal defined symbol is used with no error. ++When a weak undefined symbol is linked and the symbol is not defined, ++the value of the symbol is determined in a system-specific manner without ++error. On some systems, uppercase indicates that a default value has been ++specified. ++.ie n .IP """\-""" 4 ++.el .IP "\f(CW\-\fR" 4 ++.IX Item "-" ++The symbol is a stabs symbol in an a.out object file. In this case, the ++next values printed are the stabs other field, the stabs desc field, and ++the stab type. Stabs symbols are used to hold debugging information. ++.ie n .IP """?""" 4 ++.el .IP "\f(CW?\fR" 4 ++.IX Item "?" ++The symbol type is unknown, or object file format specific. ++.RE ++.RS 4 ++.RE ++.IP "\(bu" 4 ++The symbol name. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The long and short forms of options, shown here as alternatives, are ++equivalent. ++.IP "\fB\-A\fR" 4 ++.IX Item "-A" ++.PD 0 ++.IP "\fB\-o\fR" 4 ++.IX Item "-o" ++.IP "\fB\-\-print\-file\-name\fR" 4 ++.IX Item "--print-file-name" ++.PD ++Precede each symbol by the name of the input file (or archive member) ++in which it was found, rather than identifying the input file once only, ++before all of its symbols. ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-debug\-syms\fR" 4 ++.IX Item "--debug-syms" ++.PD ++Display all symbols, even debugger-only symbols; normally these are not ++listed. ++.IP "\fB\-B\fR" 4 ++.IX Item "-B" ++The same as \fB\-\-format=bsd\fR (for compatibility with the \s-1MIPS\s0 \fBnm\fR). ++.IP "\fB\-C\fR" 4 ++.IX Item "-C" ++.PD 0 ++.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 ++.IX Item "--demangle[=style]" ++.PD ++Decode (\fIdemangle\fR) low-level symbol names into user-level names. ++Besides removing any initial underscore prepended by the system, this ++makes \*(C+ function names readable. Different compilers have different ++mangling styles. The optional demangling style argument can be used to ++choose an appropriate demangling style for your compiler. ++.IP "\fB\-\-no\-demangle\fR" 4 ++.IX Item "--no-demangle" ++Do not demangle low-level symbol names. This is the default. ++.IP "\fB\-\-recurse\-limit\fR" 4 ++.IX Item "--recurse-limit" ++.PD 0 ++.IP "\fB\-\-no\-recurse\-limit\fR" 4 ++.IX Item "--no-recurse-limit" ++.IP "\fB\-\-recursion\-limit\fR" 4 ++.IX Item "--recursion-limit" ++.IP "\fB\-\-no\-recursion\-limit\fR" 4 ++.IX Item "--no-recursion-limit" ++.PD ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++.Sp ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++.IP "\fB\-D\fR" 4 ++.IX Item "-D" ++.PD 0 ++.IP "\fB\-\-dynamic\fR" 4 ++.IX Item "--dynamic" ++.PD ++Display the dynamic symbols rather than the normal symbols. This is ++only meaningful for dynamic objects, such as certain types of shared ++libraries. ++.IP "\fB\-f\fR \fIformat\fR" 4 ++.IX Item "-f format" ++.PD 0 ++.IP "\fB\-\-format=\fR\fIformat\fR" 4 ++.IX Item "--format=format" ++.PD ++Use the output format \fIformat\fR, which can be \f(CW\*(C`bsd\*(C'\fR, ++\&\f(CW\*(C`sysv\*(C'\fR, or \f(CW\*(C`posix\*(C'\fR. The default is \f(CW\*(C`bsd\*(C'\fR. ++Only the first character of \fIformat\fR is significant; it can be ++either upper or lower case. ++.IP "\fB\-g\fR" 4 ++.IX Item "-g" ++.PD 0 ++.IP "\fB\-\-extern\-only\fR" 4 ++.IX Item "--extern-only" ++.PD ++Display only external symbols. ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Show a summary of the options to \fBnm\fR and exit. ++.IP "\fB\-l\fR" 4 ++.IX Item "-l" ++.PD 0 ++.IP "\fB\-\-line\-numbers\fR" 4 ++.IX Item "--line-numbers" ++.PD ++For each symbol, use debugging information to try to find a filename and ++line number. For a defined symbol, look for the line number of the ++address of the symbol. For an undefined symbol, look for the line ++number of a relocation entry which refers to the symbol. If line number ++information can be found, print it after the other symbol information. ++.IP "\fB\-\-inlines\fR" 4 ++.IX Item "--inlines" ++When option \fB\-l\fR is active, if the address belongs to a ++function that was inlined, then this option causes the source ++information for all enclosing scopes back to the first non-inlined ++function to be printed as well. For example, if \f(CW\*(C`main\*(C'\fR inlines ++\&\f(CW\*(C`callee1\*(C'\fR which inlines \f(CW\*(C`callee2\*(C'\fR, and address is from ++\&\f(CW\*(C`callee2\*(C'\fR, the source information for \f(CW\*(C`callee1\*(C'\fR and \f(CW\*(C`main\*(C'\fR ++will also be printed. ++.IP "\fB\-n\fR" 4 ++.IX Item "-n" ++.PD 0 ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.IP "\fB\-\-numeric\-sort\fR" 4 ++.IX Item "--numeric-sort" ++.PD ++Sort symbols numerically by their addresses, rather than alphabetically ++by their names. ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-no\-sort\fR" 4 ++.IX Item "--no-sort" ++.PD ++Do not bother to sort the symbols in any order; print them in the order ++encountered. ++.IP "\fB\-P\fR" 4 ++.IX Item "-P" ++.PD 0 ++.IP "\fB\-\-portability\fR" 4 ++.IX Item "--portability" ++.PD ++Use the \s-1POSIX.2\s0 standard output format instead of the default format. ++Equivalent to \fB\-f posix\fR. ++.IP "\fB\-r\fR" 4 ++.IX Item "-r" ++.PD 0 ++.IP "\fB\-\-reverse\-sort\fR" 4 ++.IX Item "--reverse-sort" ++.PD ++Reverse the order of the sort (whether numeric or alphabetic); let the ++last come first. ++.IP "\fB\-S\fR" 4 ++.IX Item "-S" ++.PD 0 ++.IP "\fB\-\-print\-size\fR" 4 ++.IX Item "--print-size" ++.PD ++Print both value and size of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output style. ++This option has no effect for object formats that do not record symbol ++sizes, unless \fB\-\-size\-sort\fR is also used in which case a ++calculated size is displayed. ++.IP "\fB\-s\fR" 4 ++.IX Item "-s" ++.PD 0 ++.IP "\fB\-\-print\-armap\fR" 4 ++.IX Item "--print-armap" ++.PD ++When listing symbols from archive members, include the index: a mapping ++(stored in the archive by \fBar\fR or \fBranlib\fR) of which modules ++contain definitions for which names. ++.IP "\fB\-t\fR \fIradix\fR" 4 ++.IX Item "-t radix" ++.PD 0 ++.IP "\fB\-\-radix=\fR\fIradix\fR" 4 ++.IX Item "--radix=radix" ++.PD ++Use \fIradix\fR as the radix for printing the symbol values. It must be ++\&\fBd\fR for decimal, \fBo\fR for octal, or \fBx\fR for hexadecimal. ++.IP "\fB\-u\fR" 4 ++.IX Item "-u" ++.PD 0 ++.IP "\fB\-\-undefined\-only\fR" 4 ++.IX Item "--undefined-only" ++.PD ++Display only undefined symbols (those external to each object file). ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Show the version number of \fBnm\fR and exit. ++.IP "\fB\-X\fR" 4 ++.IX Item "-X" ++This option is ignored for compatibility with the \s-1AIX\s0 version of ++\&\fBnm\fR. It takes one parameter which must be the string ++\&\fB32_64\fR. The default mode of \s-1AIX\s0 \fBnm\fR corresponds ++to \fB\-X 32\fR, which is not supported by \s-1GNU\s0 \fBnm\fR. ++.IP "\fB\-\-defined\-only\fR" 4 ++.IX Item "--defined-only" ++Display only defined symbols for each object file. ++.IP "\fB\-\-plugin\fR \fIname\fR" 4 ++.IX Item "--plugin name" ++Load the plugin called \fIname\fR to add support for extra target ++types. This option is only available if the toolchain has been built ++with plugin support enabled. ++.Sp ++If \fB\-\-plugin\fR is not provided, but plugin support has been ++enabled then \fBnm\fR iterates over the files in ++\&\fI${libdir}/bfd\-plugins\fR in alphabetic order and the first ++plugin that claims the object in question is used. ++.Sp ++Please note that this plugin search directory is \fInot\fR the one ++used by \fBld\fR's \fB\-plugin\fR option. In order to make ++\&\fBnm\fR use the linker plugin it must be copied into the ++\&\fI${libdir}/bfd\-plugins\fR directory. For \s-1GCC\s0 based compilations ++the linker plugin is called \fIliblto_plugin.so.0.0.0\fR. For Clang ++based compilations it is called \fILLVMgold.so\fR. The \s-1GCC\s0 plugin ++is always backwards compatible with earlier versions, so it is ++sufficient to just copy the newest one. ++.IP "\fB\-\-size\-sort\fR" 4 ++.IX Item "--size-sort" ++Sort symbols by size. For \s-1ELF\s0 objects symbol sizes are read from the ++\&\s-1ELF,\s0 for other object types the symbol sizes are computed as the ++difference between the value of the symbol and the value of the symbol ++with the next higher value. If the \f(CW\*(C`bsd\*(C'\fR output format is used ++the size of the symbol is printed, rather than the value, and ++\&\fB\-S\fR must be used in order both size and value to be printed. ++.IP "\fB\-\-special\-syms\fR" 4 ++.IX Item "--special-syms" ++Display symbols which have a target-specific special meaning. These ++symbols are usually used by the target for some special processing and ++are not normally helpful when included in the normal symbol lists. ++For example for \s-1ARM\s0 targets this option would skip the mapping symbols ++used to mark transitions between \s-1ARM\s0 code, \s-1THUMB\s0 code and data. ++.IP "\fB\-\-synthetic\fR" 4 ++.IX Item "--synthetic" ++Include synthetic symbols in the output. These are special symbols ++created by the linker for various purposes. They are not shown by ++default since they are not part of the binary's original source code. ++.IP "\fB\-\-with\-symbol\-versions\fR" 4 ++.IX Item "--with-symbol-versions" ++Enables the display of symbol version information if any exists. The ++version string is displayed as a suffix to the symbol name, preceeded by ++an @ character. For example \fBfoo@VER_1\fR. If the version is ++the default version to be used when resolving unversioned references ++to the symbol then it is displayed as a suffix preceeded by two @ ++characters. For example \fBfoo@@VER_2\fR. ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++Specify an object code format other than your system's default format. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBar\fR\|(1), \fBobjdump\fR\|(1), \fBranlib\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/objcopy.1 b/binutils/doc/objcopy.1 +--- a/binutils/doc/objcopy.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/objcopy.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,1233 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "OBJCOPY 1" ++.TH OBJCOPY 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++objcopy \- copy and translate object files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] ++ [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] ++ [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] ++ [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR] ++ [\fB\-S\fR|\fB\-\-strip\-all\fR] ++ [\fB\-g\fR|\fB\-\-strip\-debug\fR] ++ [\fB\-\-strip\-unneeded\fR] ++ [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-\-localize\-hidden\fR] ++ [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-\-globalize\-symbols=\fR\fIfilename\fR] ++ [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-w\fR|\fB\-\-wildcard\fR] ++ [\fB\-x\fR|\fB\-\-discard\-all\fR] ++ [\fB\-X\fR|\fB\-\-discard\-locals\fR] ++ [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR] ++ [\fB\-i\fR [\fIbreadth\fR]|\fB\-\-interleave\fR[=\fIbreadth\fR]] ++ [\fB\-\-interleave\-width=\fR\fIwidth\fR] ++ [\fB\-j\fR \fIsectionpattern\fR|\fB\-\-only\-section=\fR\fIsectionpattern\fR] ++ [\fB\-R\fR \fIsectionpattern\fR|\fB\-\-remove\-section=\fR\fIsectionpattern\fR] ++ [\fB\-\-keep\-section=\fR\fIsectionpattern\fR] ++ [\fB\-\-remove\-relocations=\fR\fIsectionpattern\fR] ++ [\fB\-p\fR|\fB\-\-preserve\-dates\fR] ++ [\fB\-D\fR|\fB\-\-enable\-deterministic\-archives\fR] ++ [\fB\-U\fR|\fB\-\-disable\-deterministic\-archives\fR] ++ [\fB\-\-debugging\fR] ++ [\fB\-\-gap\-fill=\fR\fIval\fR] ++ [\fB\-\-pad\-to=\fR\fIaddress\fR] ++ [\fB\-\-set\-start=\fR\fIval\fR] ++ [\fB\-\-adjust\-start=\fR\fIincr\fR] ++ [\fB\-\-change\-addresses=\fR\fIincr\fR] ++ [\fB\-\-change\-section\-address\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR] ++ [\fB\-\-change\-section\-lma\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR] ++ [\fB\-\-change\-section\-vma\fR \fIsectionpattern\fR{=,+,\-}\fIval\fR] ++ [\fB\-\-change\-warnings\fR] [\fB\-\-no\-change\-warnings\fR] ++ [\fB\-\-set\-section\-flags\fR \fIsectionpattern\fR=\fIflags\fR] ++ [\fB\-\-set\-section\-alignment\fR \fIsectionpattern\fR=\fIalign\fR] ++ [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR] ++ [\fB\-\-dump\-section\fR \fIsectionname\fR=\fIfilename\fR] ++ [\fB\-\-update\-section\fR \fIsectionname\fR=\fIfilename\fR] ++ [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]] ++ [\fB\-\-long\-section\-names\fR {enable,disable,keep}] ++ [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR] ++ [\fB\-\-reverse\-bytes=\fR\fInum\fR] ++ [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR] ++ [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR] ++ [\fB\-\-redefine\-syms=\fR\fIfilename\fR] ++ [\fB\-\-weaken\fR] ++ [\fB\-\-keep\-symbols=\fR\fIfilename\fR] ++ [\fB\-\-strip\-symbols=\fR\fIfilename\fR] ++ [\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR] ++ [\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR] ++ [\fB\-\-localize\-symbols=\fR\fIfilename\fR] ++ [\fB\-\-weaken\-symbols=\fR\fIfilename\fR] ++ [\fB\-\-add\-symbol\fR \fIname\fR=[\fIsection\fR:]\fIvalue\fR[,\fIflags\fR]] ++ [\fB\-\-alt\-machine\-code=\fR\fIindex\fR] ++ [\fB\-\-prefix\-symbols=\fR\fIstring\fR] ++ [\fB\-\-prefix\-sections=\fR\fIstring\fR] ++ [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR] ++ [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR] ++ [\fB\-\-keep\-file\-symbols\fR] ++ [\fB\-\-only\-keep\-debug\fR] ++ [\fB\-\-strip\-dwo\fR] ++ [\fB\-\-extract\-dwo\fR] ++ [\fB\-\-extract\-symbol\fR] ++ [\fB\-\-writable\-text\fR] ++ [\fB\-\-readonly\-text\fR] ++ [\fB\-\-pure\fR] ++ [\fB\-\-impure\fR] ++ [\fB\-\-file\-alignment=\fR\fInum\fR] ++ [\fB\-\-heap=\fR\fIsize\fR] ++ [\fB\-\-image\-base=\fR\fIaddress\fR] ++ [\fB\-\-section\-alignment=\fR\fInum\fR] ++ [\fB\-\-stack=\fR\fIsize\fR] ++ [\fB\-\-subsystem=\fR\fIwhich\fR:\fImajor\fR.\fIminor\fR] ++ [\fB\-\-compress\-debug\-sections\fR] ++ [\fB\-\-decompress\-debug\-sections\fR] ++ [\fB\-\-elf\-stt\-common=\fR\fIval\fR] ++ [\fB\-\-merge\-notes\fR] ++ [\fB\-\-no\-merge\-notes\fR] ++ [\fB\-\-verilog\-data\-width=\fR\fIval\fR] ++ [\fB\-v\fR|\fB\-\-verbose\fR] ++ [\fB\-V\fR|\fB\-\-version\fR] ++ [\fB\-\-help\fR] [\fB\-\-info\fR] ++ \fIinfile\fR [\fIoutfile\fR] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++The \s-1GNU\s0 \fBobjcopy\fR utility copies the contents of an object ++file to another. \fBobjcopy\fR uses the \s-1GNU BFD\s0 Library to ++read and write the object files. It can write the destination object ++file in a format different from that of the source object file. The ++exact behavior of \fBobjcopy\fR is controlled by command-line options. ++Note that \fBobjcopy\fR should be able to copy a fully linked file ++between any two formats. However, copying a relocatable object file ++between any two formats may not work as expected. ++.PP ++\&\fBobjcopy\fR creates temporary files to do its translations and ++deletes them afterward. \fBobjcopy\fR uses \s-1BFD\s0 to do all its ++translation work; it has access to all the formats described in \s-1BFD\s0 ++and thus is able to recognize most formats without being told ++explicitly. ++.PP ++\&\fBobjcopy\fR can be used to generate S\-records by using an output ++target of \fBsrec\fR (e.g., use \fB\-O srec\fR). ++.PP ++\&\fBobjcopy\fR can be used to generate a raw binary file by using an ++output target of \fBbinary\fR (e.g., use \fB\-O binary\fR). When ++\&\fBobjcopy\fR generates a raw binary file, it will essentially produce ++a memory dump of the contents of the input object file. All symbols and ++relocation information will be discarded. The memory dump will start at ++the load address of the lowest section copied into the output file. ++.PP ++When generating an S\-record or a raw binary file, it may be helpful to ++use \fB\-S\fR to remove sections containing debugging information. In ++some cases \fB\-R\fR will be useful to remove sections which contain ++information that is not needed by the binary file. ++.PP ++Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input ++files. If the input format has an endianness (some formats do not), ++\&\fBobjcopy\fR can only copy the inputs into file formats that have the ++same endianness or which have no endianness (e.g., \fBsrec\fR). ++(However, see the \fB\-\-reverse\-bytes\fR option.) ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fIinfile\fR" 4 ++.IX Item "infile" ++.PD 0 ++.IP "\fIoutfile\fR" 4 ++.IX Item "outfile" ++.PD ++The input and output files, respectively. ++If you do not specify \fIoutfile\fR, \fBobjcopy\fR creates a ++temporary file and destructively renames the result with ++the name of \fIinfile\fR. ++.IP "\fB\-I\fR \fIbfdname\fR" 4 ++.IX Item "-I bfdname" ++.PD 0 ++.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--input-target=bfdname" ++.PD ++Consider the source file's object format to be \fIbfdname\fR, rather than ++attempting to deduce it. ++.IP "\fB\-O\fR \fIbfdname\fR" 4 ++.IX Item "-O bfdname" ++.PD 0 ++.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--output-target=bfdname" ++.PD ++Write the output file using the object format \fIbfdname\fR. ++.IP "\fB\-F\fR \fIbfdname\fR" 4 ++.IX Item "-F bfdname" ++.PD 0 ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++.PD ++Use \fIbfdname\fR as the object format for both the input and the output ++file; i.e., simply transfer data from source to destination with no ++translation. ++.IP "\fB\-B\fR \fIbfdarch\fR" 4 ++.IX Item "-B bfdarch" ++.PD 0 ++.IP "\fB\-\-binary\-architecture=\fR\fIbfdarch\fR" 4 ++.IX Item "--binary-architecture=bfdarch" ++.PD ++Useful when transforming a architecture-less input file into an object file. ++In this case the output architecture can be set to \fIbfdarch\fR. This ++option will be ignored if the input file has a known \fIbfdarch\fR. You ++can access this binary data inside a program by referencing the special ++symbols that are created by the conversion process. These symbols are ++called _binary_\fIobjfile\fR_start, _binary_\fIobjfile\fR_end and ++_binary_\fIobjfile\fR_size. e.g. you can transform a picture file into ++an object file and then access it in your code using these symbols. ++.IP "\fB\-j\fR \fIsectionpattern\fR" 4 ++.IX Item "-j sectionpattern" ++.PD 0 ++.IP "\fB\-\-only\-section=\fR\fIsectionpattern\fR" 4 ++.IX Item "--only-section=sectionpattern" ++.PD ++Copy only the indicated sections from the input file to the output file. ++This option may be given more than once. Note that using this option ++inappropriately may make the output file unusable. Wildcard ++characters are accepted in \fIsectionpattern\fR. ++.Sp ++If the first character of \fIsectionpattern\fR is the exclamation ++point (!) then matching sections will not be copied, even if earlier ++use of \fB\-\-only\-section\fR on the same command line would ++otherwise copy it. For example: ++.Sp ++.Vb 1 ++\& \-\-only\-section=.text.* \-\-only\-section=!.text.foo ++.Ve ++.Sp ++will copy all sectinos maching '.text.*' but not the section ++\&'.text.foo'. ++.IP "\fB\-R\fR \fIsectionpattern\fR" 4 ++.IX Item "-R sectionpattern" ++.PD 0 ++.IP "\fB\-\-remove\-section=\fR\fIsectionpattern\fR" 4 ++.IX Item "--remove-section=sectionpattern" ++.PD ++Remove any section matching \fIsectionpattern\fR from the output file. ++This option may be given more than once. Note that using this option ++inappropriately may make the output file unusable. Wildcard ++characters are accepted in \fIsectionpattern\fR. Using both the ++\&\fB\-j\fR and \fB\-R\fR options together results in undefined ++behaviour. ++.Sp ++If the first character of \fIsectionpattern\fR is the exclamation ++point (!) then matching sections will not be removed even if an ++earlier use of \fB\-\-remove\-section\fR on the same command line ++would otherwise remove it. For example: ++.Sp ++.Vb 1 ++\& \-\-remove\-section=.text.* \-\-remove\-section=!.text.foo ++.Ve ++.Sp ++will remove all sections matching the pattern '.text.*', but will not ++remove the section '.text.foo'. ++.IP "\fB\-\-keep\-section=\fR\fIsectionpattern\fR" 4 ++.IX Item "--keep-section=sectionpattern" ++When removing sections from the output file, keep sections that match ++\&\fIsectionpattern\fR. ++.IP "\fB\-\-remove\-relocations=\fR\fIsectionpattern\fR" 4 ++.IX Item "--remove-relocations=sectionpattern" ++Remove non-dynamic relocations from the output file for any section ++matching \fIsectionpattern\fR. This option may be given more than ++once. Note that using this option inappropriately may make the output ++file unusable, and attempting to remove a dynamic relocation section ++such as \fB.rela.plt\fR from an executable or shared library with ++\&\fB\-\-remove\-relocations=.plt\fR will not work. Wildcard characters ++are accepted in \fIsectionpattern\fR. ++For example: ++.Sp ++.Vb 1 ++\& \-\-remove\-relocations=.text.* ++.Ve ++.Sp ++will remove the relocations for all sections matching the pattern ++\&'.text.*'. ++.Sp ++If the first character of \fIsectionpattern\fR is the exclamation ++point (!) then matching sections will not have their relocation ++removed even if an earlier use of \fB\-\-remove\-relocations\fR on the ++same command line would otherwise cause the relocations to be removed. ++For example: ++.Sp ++.Vb 1 ++\& \-\-remove\-relocations=.text.* \-\-remove\-relocations=!.text.foo ++.Ve ++.Sp ++will remove all relocations for sections matching the pattern ++\&'.text.*', but will not remove relocations for the section ++\&'.text.foo'. ++.IP "\fB\-S\fR" 4 ++.IX Item "-S" ++.PD 0 ++.IP "\fB\-\-strip\-all\fR" 4 ++.IX Item "--strip-all" ++.PD ++Do not copy relocation and symbol information from the source file. ++.IP "\fB\-g\fR" 4 ++.IX Item "-g" ++.PD 0 ++.IP "\fB\-\-strip\-debug\fR" 4 ++.IX Item "--strip-debug" ++.PD ++Do not copy debugging symbols or sections from the source file. ++.IP "\fB\-\-strip\-unneeded\fR" 4 ++.IX Item "--strip-unneeded" ++Strip all symbols that are not needed for relocation processing. ++.IP "\fB\-K\fR \fIsymbolname\fR" 4 ++.IX Item "-K symbolname" ++.PD 0 ++.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--keep-symbol=symbolname" ++.PD ++When stripping symbols, keep symbol \fIsymbolname\fR even if it would ++normally be stripped. This option may be given more than once. ++.IP "\fB\-N\fR \fIsymbolname\fR" 4 ++.IX Item "-N symbolname" ++.PD 0 ++.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--strip-symbol=symbolname" ++.PD ++Do not copy symbol \fIsymbolname\fR from the source file. This option ++may be given more than once. ++.IP "\fB\-\-strip\-unneeded\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--strip-unneeded-symbol=symbolname" ++Do not copy symbol \fIsymbolname\fR from the source file unless it is needed ++by a relocation. This option may be given more than once. ++.IP "\fB\-G\fR \fIsymbolname\fR" 4 ++.IX Item "-G symbolname" ++.PD 0 ++.IP "\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--keep-global-symbol=symbolname" ++.PD ++Keep only symbol \fIsymbolname\fR global. Make all other symbols local ++to the file, so that they are not visible externally. This option may ++be given more than once. Note: this option cannot be used in ++conjunction with the \fB\-\-globalize\-symbol\fR or ++\&\fB\-\-globalize\-symbols\fR options. ++.IP "\fB\-\-localize\-hidden\fR" 4 ++.IX Item "--localize-hidden" ++In an \s-1ELF\s0 object, mark all symbols that have hidden or internal visibility ++as local. This option applies on top of symbol-specific localization options ++such as \fB\-L\fR. ++.IP "\fB\-L\fR \fIsymbolname\fR" 4 ++.IX Item "-L symbolname" ++.PD 0 ++.IP "\fB\-\-localize\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--localize-symbol=symbolname" ++.PD ++Convert a global or weak symbol called \fIsymbolname\fR into a local ++symbol, so that it is not visible externally. This option may be ++given more than once. Note \- unique symbols are not converted. ++.IP "\fB\-W\fR \fIsymbolname\fR" 4 ++.IX Item "-W symbolname" ++.PD 0 ++.IP "\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--weaken-symbol=symbolname" ++.PD ++Make symbol \fIsymbolname\fR weak. This option may be given more than once. ++.IP "\fB\-\-globalize\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--globalize-symbol=symbolname" ++Give symbol \fIsymbolname\fR global scoping so that it is visible ++outside of the file in which it is defined. This option may be given ++more than once. Note: this option cannot be used in conjunction with ++the \fB\-G\fR or \fB\-\-keep\-global\-symbol\fR options. ++.IP "\fB\-w\fR" 4 ++.IX Item "-w" ++.PD 0 ++.IP "\fB\-\-wildcard\fR" 4 ++.IX Item "--wildcard" ++.PD ++Permit regular expressions in \fIsymbolname\fRs used in other command ++line options. The question mark (?), asterisk (*), backslash (\e) and ++square brackets ([]) operators can be used anywhere in the symbol ++name. If the first character of the symbol name is the exclamation ++point (!) then the sense of the switch is reversed for that symbol. ++For example: ++.Sp ++.Vb 1 ++\& \-w \-W !foo \-W fo* ++.Ve ++.Sp ++would cause objcopy to weaken all symbols that start with \*(L"fo\*(R" ++except for the symbol \*(L"foo\*(R". ++.IP "\fB\-x\fR" 4 ++.IX Item "-x" ++.PD 0 ++.IP "\fB\-\-discard\-all\fR" 4 ++.IX Item "--discard-all" ++.PD ++Do not copy non-global symbols from the source file. ++.IP "\fB\-X\fR" 4 ++.IX Item "-X" ++.PD 0 ++.IP "\fB\-\-discard\-locals\fR" 4 ++.IX Item "--discard-locals" ++.PD ++Do not copy compiler-generated local symbols. ++(These usually start with \fBL\fR or \fB.\fR.) ++.IP "\fB\-b\fR \fIbyte\fR" 4 ++.IX Item "-b byte" ++.PD 0 ++.IP "\fB\-\-byte=\fR\fIbyte\fR" 4 ++.IX Item "--byte=byte" ++.PD ++If interleaving has been enabled via the \fB\-\-interleave\fR option ++then start the range of bytes to keep at the \fIbyte\fRth byte. ++\&\fIbyte\fR can be in the range from 0 to \fIbreadth\fR\-1, where ++\&\fIbreadth\fR is the value given by the \fB\-\-interleave\fR option. ++.IP "\fB\-i [\fR\fIbreadth\fR\fB]\fR" 4 ++.IX Item "-i [breadth]" ++.PD 0 ++.IP "\fB\-\-interleave[=\fR\fIbreadth\fR\fB]\fR" 4 ++.IX Item "--interleave[=breadth]" ++.PD ++Only copy a range out of every \fIbreadth\fR bytes. (Header data is ++not affected). Select which byte in the range begins the copy with ++the \fB\-\-byte\fR option. Select the width of the range with the ++\&\fB\-\-interleave\-width\fR option. ++.Sp ++This option is useful for creating files to program \s-1ROM.\s0 It is ++typically used with an \f(CW\*(C`srec\*(C'\fR output target. Note that ++\&\fBobjcopy\fR will complain if you do not specify the ++\&\fB\-\-byte\fR option as well. ++.Sp ++The default interleave breadth is 4, so with \fB\-\-byte\fR set to 0, ++\&\fBobjcopy\fR would copy the first byte out of every four bytes ++from the input to the output. ++.IP "\fB\-\-interleave\-width=\fR\fIwidth\fR" 4 ++.IX Item "--interleave-width=width" ++When used with the \fB\-\-interleave\fR option, copy \fIwidth\fR ++bytes at a time. The start of the range of bytes to be copied is set ++by the \fB\-\-byte\fR option, and the extent of the range is set with ++the \fB\-\-interleave\fR option. ++.Sp ++The default value for this option is 1. The value of \fIwidth\fR plus ++the \fIbyte\fR value set by the \fB\-\-byte\fR option must not exceed ++the interleave breadth set by the \fB\-\-interleave\fR option. ++.Sp ++This option can be used to create images for two 16\-bit flashes interleaved ++in a 32\-bit bus by passing \fB\-b 0 \-i 4 \-\-interleave\-width=2\fR ++and \fB\-b 2 \-i 4 \-\-interleave\-width=2\fR to two \fBobjcopy\fR ++commands. If the input was '12345678' then the outputs would be ++\&'1256' and '3478' respectively. ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-preserve\-dates\fR" 4 ++.IX Item "--preserve-dates" ++.PD ++Set the access and modification dates of the output file to be the same ++as those of the input file. ++.IP "\fB\-D\fR" 4 ++.IX Item "-D" ++.PD 0 ++.IP "\fB\-\-enable\-deterministic\-archives\fR" 4 ++.IX Item "--enable-deterministic-archives" ++.PD ++Operate in \fIdeterministic\fR mode. When copying archive members ++and writing the archive index, use zero for UIDs, GIDs, timestamps, ++and use consistent file modes for all files. ++.Sp ++If \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default. ++It can be disabled with the \fB\-U\fR option, below. ++.IP "\fB\-U\fR" 4 ++.IX Item "-U" ++.PD 0 ++.IP "\fB\-\-disable\-deterministic\-archives\fR" 4 ++.IX Item "--disable-deterministic-archives" ++.PD ++Do \fInot\fR operate in \fIdeterministic\fR mode. This is the ++inverse of the \fB\-D\fR option, above: when copying archive members ++and writing the archive index, use their actual \s-1UID, GID,\s0 timestamp, ++and file mode values. ++.Sp ++This is the default unless \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR. ++.IP "\fB\-\-debugging\fR" 4 ++.IX Item "--debugging" ++Convert debugging information, if possible. This is not the default ++because only certain debugging formats are supported, and the ++conversion process can be time consuming. ++.IP "\fB\-\-gap\-fill\fR \fIval\fR" 4 ++.IX Item "--gap-fill val" ++Fill gaps between sections with \fIval\fR. This operation applies to ++the \fIload address\fR (\s-1LMA\s0) of the sections. It is done by increasing ++the size of the section with the lower address, and filling in the extra ++space created with \fIval\fR. ++.IP "\fB\-\-pad\-to\fR \fIaddress\fR" 4 ++.IX Item "--pad-to address" ++Pad the output file up to the load address \fIaddress\fR. This is ++done by increasing the size of the last section. The extra space is ++filled in with the value specified by \fB\-\-gap\-fill\fR (default zero). ++.IP "\fB\-\-set\-start\fR \fIval\fR" 4 ++.IX Item "--set-start val" ++Set the start address of the new file to \fIval\fR. Not all object file ++formats support setting the start address. ++.IP "\fB\-\-change\-start\fR \fIincr\fR" 4 ++.IX Item "--change-start incr" ++.PD 0 ++.IP "\fB\-\-adjust\-start\fR \fIincr\fR" 4 ++.IX Item "--adjust-start incr" ++.PD ++Change the start address by adding \fIincr\fR. Not all object file ++formats support setting the start address. ++.IP "\fB\-\-change\-addresses\fR \fIincr\fR" 4 ++.IX Item "--change-addresses incr" ++.PD 0 ++.IP "\fB\-\-adjust\-vma\fR \fIincr\fR" 4 ++.IX Item "--adjust-vma incr" ++.PD ++Change the \s-1VMA\s0 and \s-1LMA\s0 addresses of all sections, as well as the start ++address, by adding \fIincr\fR. Some object file formats do not permit ++section addresses to be changed arbitrarily. Note that this does not ++relocate the sections; if the program expects sections to be loaded at a ++certain address, and this option is used to change the sections such ++that they are loaded at a different address, the program may fail. ++.IP "\fB\-\-change\-section\-address\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 ++.IX Item "--change-section-address sectionpattern{=,+,-}val" ++.PD 0 ++.IP "\fB\-\-adjust\-section\-vma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 ++.IX Item "--adjust-section-vma sectionpattern{=,+,-}val" ++.PD ++Set or change both the \s-1VMA\s0 address and the \s-1LMA\s0 address of any section ++matching \fIsectionpattern\fR. If \fB=\fR is used, the section ++address is set to \fIval\fR. Otherwise, \fIval\fR is added to or ++subtracted from the section address. See the comments under ++\&\fB\-\-change\-addresses\fR, above. If \fIsectionpattern\fR does not ++match any sections in the input file, a warning will be issued, unless ++\&\fB\-\-no\-change\-warnings\fR is used. ++.IP "\fB\-\-change\-section\-lma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 ++.IX Item "--change-section-lma sectionpattern{=,+,-}val" ++Set or change the \s-1LMA\s0 address of any sections matching ++\&\fIsectionpattern\fR. The \s-1LMA\s0 address is the address where the ++section will be loaded into memory at program load time. Normally ++this is the same as the \s-1VMA\s0 address, which is the address of the ++section at program run time, but on some systems, especially those ++where a program is held in \s-1ROM,\s0 the two can be different. If \fB=\fR ++is used, the section address is set to \fIval\fR. Otherwise, ++\&\fIval\fR is added to or subtracted from the section address. See the ++comments under \fB\-\-change\-addresses\fR, above. If ++\&\fIsectionpattern\fR does not match any sections in the input file, a ++warning will be issued, unless \fB\-\-no\-change\-warnings\fR is used. ++.IP "\fB\-\-change\-section\-vma\fR \fIsectionpattern\fR\fB{=,+,\-}\fR\fIval\fR" 4 ++.IX Item "--change-section-vma sectionpattern{=,+,-}val" ++Set or change the \s-1VMA\s0 address of any section matching ++\&\fIsectionpattern\fR. The \s-1VMA\s0 address is the address where the ++section will be located once the program has started executing. ++Normally this is the same as the \s-1LMA\s0 address, which is the address ++where the section will be loaded into memory, but on some systems, ++especially those where a program is held in \s-1ROM,\s0 the two can be ++different. If \fB=\fR is used, the section address is set to ++\&\fIval\fR. Otherwise, \fIval\fR is added to or subtracted from the ++section address. See the comments under \fB\-\-change\-addresses\fR, ++above. If \fIsectionpattern\fR does not match any sections in the ++input file, a warning will be issued, unless ++\&\fB\-\-no\-change\-warnings\fR is used. ++.IP "\fB\-\-change\-warnings\fR" 4 ++.IX Item "--change-warnings" ++.PD 0 ++.IP "\fB\-\-adjust\-warnings\fR" 4 ++.IX Item "--adjust-warnings" ++.PD ++If \fB\-\-change\-section\-address\fR or \fB\-\-change\-section\-lma\fR or ++\&\fB\-\-change\-section\-vma\fR is used, and the section pattern does not ++match any sections, issue a warning. This is the default. ++.IP "\fB\-\-no\-change\-warnings\fR" 4 ++.IX Item "--no-change-warnings" ++.PD 0 ++.IP "\fB\-\-no\-adjust\-warnings\fR" 4 ++.IX Item "--no-adjust-warnings" ++.PD ++Do not issue a warning if \fB\-\-change\-section\-address\fR or ++\&\fB\-\-adjust\-section\-lma\fR or \fB\-\-adjust\-section\-vma\fR is used, even ++if the section pattern does not match any sections. ++.IP "\fB\-\-set\-section\-flags\fR \fIsectionpattern\fR\fB=\fR\fIflags\fR" 4 ++.IX Item "--set-section-flags sectionpattern=flags" ++Set the flags for any sections matching \fIsectionpattern\fR. The ++\&\fIflags\fR argument is a comma separated string of flag names. The ++recognized names are \fBalloc\fR, \fBcontents\fR, \fBload\fR, ++\&\fBnoload\fR, \fBreadonly\fR, \fBcode\fR, \fBdata\fR, \fBrom\fR, ++\&\fBshare\fR, and \fBdebug\fR. You can set the \fBcontents\fR flag ++for a section which does not have contents, but it is not meaningful ++to clear the \fBcontents\fR flag of a section which does have ++contents\*(--just remove the section instead. Not all flags are ++meaningful for all object file formats. ++.IP "\fB\-\-set\-section\-alignment\fR \fIsectionpattern\fR\fB=\fR\fIalign\fR" 4 ++.IX Item "--set-section-alignment sectionpattern=align" ++Set the alignment for any sections matching \fIsectionpattern\fR. ++\&\fIalign\fR specifies the alignment in bytes and must be a power of ++two, i.e. 1, 2, 4, 8.... ++.IP "\fB\-\-add\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4 ++.IX Item "--add-section sectionname=filename" ++Add a new section named \fIsectionname\fR while copying the file. The ++contents of the new section are taken from the file \fIfilename\fR. The ++size of the section will be the size of the file. This option only ++works on file formats which can support sections with arbitrary names. ++Note \- it may be necessary to use the \fB\-\-set\-section\-flags\fR ++option to set the attributes of the newly created section. ++.IP "\fB\-\-dump\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4 ++.IX Item "--dump-section sectionname=filename" ++Place the contents of section named \fIsectionname\fR into the file ++\&\fIfilename\fR, overwriting any contents that may have been there ++previously. This option is the inverse of \fB\-\-add\-section\fR. ++This option is similar to the \fB\-\-only\-section\fR option except ++that it does not create a formatted file, it just dumps the contents ++as raw binary data, without applying any relocations. The option can ++be specified more than once. ++.IP "\fB\-\-update\-section\fR \fIsectionname\fR\fB=\fR\fIfilename\fR" 4 ++.IX Item "--update-section sectionname=filename" ++Replace the existing contents of a section named \fIsectionname\fR ++with the contents of file \fIfilename\fR. The size of the section ++will be adjusted to the size of the file. The section flags for ++\&\fIsectionname\fR will be unchanged. For \s-1ELF\s0 format files the section ++to segment mapping will also remain unchanged, something which is not ++possible using \fB\-\-remove\-section\fR followed by ++\&\fB\-\-add\-section\fR. The option can be specified more than once. ++.Sp ++Note \- it is possible to use \fB\-\-rename\-section\fR and ++\&\fB\-\-update\-section\fR to both update and rename a section from one ++command line. In this case, pass the original section name to ++\&\fB\-\-update\-section\fR, and the original and new section names to ++\&\fB\-\-rename\-section\fR. ++.IP "\fB\-\-add\-symbol\fR \fIname\fR\fB=[\fR\fIsection\fR\fB:]\fR\fIvalue\fR\fB[,\fR\fIflags\fR\fB]\fR" 4 ++.IX Item "--add-symbol name=[section:]value[,flags]" ++Add a new symbol named \fIname\fR while copying the file. This option may be ++specified multiple times. If the \fIsection\fR is given, the symbol will be ++associated with and relative to that section, otherwise it will be an \s-1ABS\s0 ++symbol. Specifying an undefined section will result in a fatal error. There ++is no check for the value, it will be taken as specified. Symbol flags can ++be specified and not all flags will be meaningful for all object file ++formats. By default, the symbol will be global. The special flag ++\&'before=\fIothersym\fR' will insert the new symbol in front of the specified ++\&\fIothersym\fR, otherwise the symbol(s) will be added at the end of the ++symbol table in the order they appear. ++.IP "\fB\-\-rename\-section\fR \fIoldname\fR\fB=\fR\fInewname\fR\fB[,\fR\fIflags\fR\fB]\fR" 4 ++.IX Item "--rename-section oldname=newname[,flags]" ++Rename a section from \fIoldname\fR to \fInewname\fR, optionally ++changing the section's flags to \fIflags\fR in the process. This has ++the advantage over using a linker script to perform the rename in that ++the output stays as an object file and does not become a linked ++executable. ++.Sp ++This option is particularly helpful when the input format is binary, ++since this will always create a section called .data. If for example, ++you wanted instead to create a section called .rodata containing binary ++data you could use the following command line to achieve it: ++.Sp ++.Vb 3 ++\& objcopy \-I binary \-O \-B \e ++\& \-\-rename\-section .data=.rodata,alloc,load,readonly,data,contents \e ++\& ++.Ve ++.IP "\fB\-\-long\-section\-names {enable,disable,keep}\fR" 4 ++.IX Item "--long-section-names {enable,disable,keep}" ++Controls the handling of long section names when processing \f(CW\*(C`COFF\*(C'\fR ++and \f(CW\*(C`PE\-COFF\*(C'\fR object formats. The default behaviour, \fBkeep\fR, ++is to preserve long section names if any are present in the input file. ++The \fBenable\fR and \fBdisable\fR options forcibly enable or disable ++the use of long section names in the output object; when \fBdisable\fR ++is in effect, any long section names in the input object will be truncated. ++The \fBenable\fR option will only emit long section names if any are ++present in the inputs; this is mostly the same as \fBkeep\fR, but it ++is left undefined whether the \fBenable\fR option might force the ++creation of an empty string table in the output file. ++.IP "\fB\-\-change\-leading\-char\fR" 4 ++.IX Item "--change-leading-char" ++Some object file formats use special characters at the start of ++symbols. The most common such character is underscore, which compilers ++often add before every symbol. This option tells \fBobjcopy\fR to ++change the leading character of every symbol when it converts between ++object file formats. If the object file formats use the same leading ++character, this option has no effect. Otherwise, it will add a ++character, or remove a character, or change a character, as ++appropriate. ++.IP "\fB\-\-remove\-leading\-char\fR" 4 ++.IX Item "--remove-leading-char" ++If the first character of a global symbol is a special symbol leading ++character used by the object file format, remove the character. The ++most common symbol leading character is underscore. This option will ++remove a leading underscore from all global symbols. This can be useful ++if you want to link together objects of different file formats with ++different conventions for symbol names. This is different from ++\&\fB\-\-change\-leading\-char\fR because it always changes the symbol name ++when appropriate, regardless of the object file format of the output ++file. ++.IP "\fB\-\-reverse\-bytes=\fR\fInum\fR" 4 ++.IX Item "--reverse-bytes=num" ++Reverse the bytes in a section with output contents. A section length must ++be evenly divisible by the value given in order for the swap to be able to ++take place. Reversing takes place before the interleaving is performed. ++.Sp ++This option is used typically in generating \s-1ROM\s0 images for problematic ++target systems. For example, on some target boards, the 32\-bit words ++fetched from 8\-bit ROMs are re-assembled in little-endian byte order ++regardless of the \s-1CPU\s0 byte order. Depending on the programming model, the ++endianness of the \s-1ROM\s0 may need to be modified. ++.Sp ++Consider a simple file with a section containing the following eight ++bytes: \f(CW12345678\fR. ++.Sp ++Using \fB\-\-reverse\-bytes=2\fR for the above example, the bytes in the ++output file would be ordered \f(CW21436587\fR. ++.Sp ++Using \fB\-\-reverse\-bytes=4\fR for the above example, the bytes in the ++output file would be ordered \f(CW43218765\fR. ++.Sp ++By using \fB\-\-reverse\-bytes=2\fR for the above example, followed by ++\&\fB\-\-reverse\-bytes=4\fR on the output file, the bytes in the second ++output file would be ordered \f(CW34127856\fR. ++.IP "\fB\-\-srec\-len=\fR\fIival\fR" 4 ++.IX Item "--srec-len=ival" ++Meaningful only for srec output. Set the maximum length of the Srecords ++being produced to \fIival\fR. This length covers both address, data and ++crc fields. ++.IP "\fB\-\-srec\-forceS3\fR" 4 ++.IX Item "--srec-forceS3" ++Meaningful only for srec output. Avoid generation of S1/S2 records, ++creating S3\-only record format. ++.IP "\fB\-\-redefine\-sym\fR \fIold\fR\fB=\fR\fInew\fR" 4 ++.IX Item "--redefine-sym old=new" ++Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful ++when one is trying link two things together for which you have no ++source, and there are name collisions. ++.IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4 ++.IX Item "--redefine-syms=filename" ++Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR" ++listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file, ++with one symbol pair per line. Line comments may be introduced by the hash ++character. This option may be given more than once. ++.IP "\fB\-\-weaken\fR" 4 ++.IX Item "--weaken" ++Change all global symbols in the file to be weak. This can be useful ++when building an object which will be linked against other objects using ++the \fB\-R\fR option to the linker. This option is only effective when ++using an object file format which supports weak symbols. ++.IP "\fB\-\-keep\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--keep-symbols=filename" ++Apply \fB\-\-keep\-symbol\fR option to each symbol listed in the file ++\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++.IP "\fB\-\-strip\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--strip-symbols=filename" ++Apply \fB\-\-strip\-symbol\fR option to each symbol listed in the file ++\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++.IP "\fB\-\-strip\-unneeded\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--strip-unneeded-symbols=filename" ++Apply \fB\-\-strip\-unneeded\-symbol\fR option to each symbol listed in ++the file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one ++symbol name per line. Line comments may be introduced by the hash ++character. This option may be given more than once. ++.IP "\fB\-\-keep\-global\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--keep-global-symbols=filename" ++Apply \fB\-\-keep\-global\-symbol\fR option to each symbol listed in the ++file \fIfilename\fR. \fIfilename\fR is simply a flat file, with one ++symbol name per line. Line comments may be introduced by the hash ++character. This option may be given more than once. ++.IP "\fB\-\-localize\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--localize-symbols=filename" ++Apply \fB\-\-localize\-symbol\fR option to each symbol listed in the file ++\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++.IP "\fB\-\-globalize\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--globalize-symbols=filename" ++Apply \fB\-\-globalize\-symbol\fR option to each symbol listed in the file ++\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. Note: this option cannot be ++used in conjunction with the \fB\-G\fR or \fB\-\-keep\-global\-symbol\fR ++options. ++.IP "\fB\-\-weaken\-symbols=\fR\fIfilename\fR" 4 ++.IX Item "--weaken-symbols=filename" ++Apply \fB\-\-weaken\-symbol\fR option to each symbol listed in the file ++\&\fIfilename\fR. \fIfilename\fR is simply a flat file, with one symbol ++name per line. Line comments may be introduced by the hash character. ++This option may be given more than once. ++.IP "\fB\-\-alt\-machine\-code=\fR\fIindex\fR" 4 ++.IX Item "--alt-machine-code=index" ++If the output architecture has alternate machine codes, use the ++\&\fIindex\fRth code instead of the default one. This is useful in case ++a machine is assigned an official code and the tool-chain adopts the ++new code, but other applications still depend on the original code ++being used. For \s-1ELF\s0 based architectures if the \fIindex\fR ++alternative does not exist then the value is treated as an absolute ++number to be stored in the e_machine field of the \s-1ELF\s0 header. ++.IP "\fB\-\-writable\-text\fR" 4 ++.IX Item "--writable-text" ++Mark the output text as writable. This option isn't meaningful for all ++object file formats. ++.IP "\fB\-\-readonly\-text\fR" 4 ++.IX Item "--readonly-text" ++Make the output text write protected. This option isn't meaningful for all ++object file formats. ++.IP "\fB\-\-pure\fR" 4 ++.IX Item "--pure" ++Mark the output file as demand paged. This option isn't meaningful for all ++object file formats. ++.IP "\fB\-\-impure\fR" 4 ++.IX Item "--impure" ++Mark the output file as impure. This option isn't meaningful for all ++object file formats. ++.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4 ++.IX Item "--prefix-symbols=string" ++Prefix all symbols in the output file with \fIstring\fR. ++.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4 ++.IX Item "--prefix-sections=string" ++Prefix all section names in the output file with \fIstring\fR. ++.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4 ++.IX Item "--prefix-alloc-sections=string" ++Prefix all the names of all allocated sections in the output file with ++\&\fIstring\fR. ++.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4 ++.IX Item "--add-gnu-debuglink=path-to-file" ++Creates a .gnu_debuglink section which contains a reference to ++\&\fIpath-to-file\fR and adds it to the output file. Note: the file at ++\&\fIpath-to-file\fR must exist. Part of the process of adding the ++\&.gnu_debuglink section involves embedding a checksum of the contents ++of the debug info file into the section. ++.Sp ++If the debug info file is built in one location but it is going to be ++installed at a later time into a different location then do not use ++the path to the installed location. The \fB\-\-add\-gnu\-debuglink\fR ++option will fail because the installed file does not exist yet. ++Instead put the debug info file in the current directory and use the ++\&\fB\-\-add\-gnu\-debuglink\fR option without any directory components, ++like this: ++.Sp ++.Vb 1 ++\& objcopy \-\-add\-gnu\-debuglink=foo.debug ++.Ve ++.Sp ++At debug time the debugger will attempt to look for the separate debug ++info file in a set of known locations. The exact set of these ++locations varies depending upon the distribution being used, but it ++typically includes: ++.RS 4 ++.ie n .IP """* The same directory as the executable.""" 4 ++.el .IP "\f(CW* The same directory as the executable.\fR" 4 ++.IX Item "* The same directory as the executable." ++.PD 0 ++.ie n .IP """* A sub\-directory of the directory containing the executable""" 4 ++.el .IP "\f(CW* A sub\-directory of the directory containing the executable\fR" 4 ++.IX Item "* A sub-directory of the directory containing the executable" ++.PD ++called .debug ++.ie n .IP """* A global debug directory such as /usr/lib/debug.""" 4 ++.el .IP "\f(CW* A global debug directory such as /usr/lib/debug.\fR" 4 ++.IX Item "* A global debug directory such as /usr/lib/debug." ++.RE ++.RS 4 ++.Sp ++As long as the debug info file has been installed into one of these ++locations before the debugger is run everything should work ++correctly. ++.RE ++.IP "\fB\-\-keep\-file\-symbols\fR" 4 ++.IX Item "--keep-file-symbols" ++When stripping a file, perhaps with \fB\-\-strip\-debug\fR or ++\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, ++which would otherwise get stripped. ++.IP "\fB\-\-only\-keep\-debug\fR" 4 ++.IX Item "--only-keep-debug" ++Strip a file, removing contents of any sections that would not be ++stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections ++intact. In \s-1ELF\s0 files, this preserves all note sections in the output. ++.Sp ++Note \- the section headers of the stripped sections are preserved, ++including their sizes, but the contents of the section are discarded. ++The section headers are preserved so that other tools can match up the ++debuginfo file with the real executable, even if that executable has ++been relocated to a different address space. ++.Sp ++The intention is that this option will be used in conjunction with ++\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a ++stripped binary which will occupy less space in \s-1RAM\s0 and in a ++distribution and the second a debugging information file which is only ++needed if debugging abilities are required. The suggested procedure ++to create these files is as follows: ++.RS 4 ++.IP "1." 4 ++.IX Item "1." ++\&\f(CW\*(C`foo\*(C'\fR then... ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++create a file containing the debugging info. ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++stripped executable. ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++to add a link to the debugging info into the stripped executable. ++.RE ++.RS 4 ++.Sp ++Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info ++file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is ++optional. You could instead do this: ++.IP "1." 4 ++.IX Item "1." ++.PD 0 ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++.RE ++.RS 4 ++.PD ++.Sp ++i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the ++full executable. It does not have to be a file created by the ++\&\fB\-\-only\-keep\-debug\fR switch. ++.Sp ++Note\-\-\-this switch is only intended for use on fully linked files. It ++does not make sense to use it on object files where the debugging ++information may be incomplete. Besides the gnu_debuglink feature ++currently only supports the presence of one filename containing ++debugging information, not multiple filenames on a one-per-object-file ++basis. ++.RE ++.IP "\fB\-\-strip\-dwo\fR" 4 ++.IX Item "--strip-dwo" ++Remove the contents of all \s-1DWARF\s0 .dwo sections, leaving the ++remaining debugging sections and all symbols intact. ++This option is intended for use by the compiler as part of ++the \fB\-gsplit\-dwarf\fR option, which splits debug information ++between the .o file and a separate .dwo file. The compiler ++generates all debug information in the same file, then uses ++the \fB\-\-extract\-dwo\fR option to copy the .dwo sections to ++the .dwo file, then the \fB\-\-strip\-dwo\fR option to remove ++those sections from the original .o file. ++.IP "\fB\-\-extract\-dwo\fR" 4 ++.IX Item "--extract-dwo" ++Extract the contents of all \s-1DWARF\s0 .dwo sections. See the ++\&\fB\-\-strip\-dwo\fR option for more information. ++.IP "\fB\-\-file\-alignment\fR \fInum\fR" 4 ++.IX Item "--file-alignment num" ++Specify the file alignment. Sections in the file will always begin at ++file offsets which are multiples of this number. This defaults to ++512. ++[This option is specific to \s-1PE\s0 targets.] ++.IP "\fB\-\-heap\fR \fIreserve\fR" 4 ++.IX Item "--heap reserve" ++.PD 0 ++.IP "\fB\-\-heap\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4 ++.IX Item "--heap reserve,commit" ++.PD ++Specify the number of bytes of memory to reserve (and optionally commit) ++to be used as heap for this program. ++[This option is specific to \s-1PE\s0 targets.] ++.IP "\fB\-\-image\-base\fR \fIvalue\fR" 4 ++.IX Item "--image-base value" ++Use \fIvalue\fR as the base address of your program or dll. This is ++the lowest memory location that will be used when your program or dll ++is loaded. To reduce the need to relocate and improve performance of ++your dlls, each should have a unique base address and not overlap any ++other dlls. The default is 0x400000 for executables, and 0x10000000 ++for dlls. ++[This option is specific to \s-1PE\s0 targets.] ++.IP "\fB\-\-section\-alignment\fR \fInum\fR" 4 ++.IX Item "--section-alignment num" ++Sets the section alignment field in the \s-1PE\s0 header. Sections in memory ++will always begin at addresses which are a multiple of this number. ++Defaults to 0x1000. ++[This option is specific to \s-1PE\s0 targets.] ++.IP "\fB\-\-stack\fR \fIreserve\fR" 4 ++.IX Item "--stack reserve" ++.PD 0 ++.IP "\fB\-\-stack\fR \fIreserve\fR\fB,\fR\fIcommit\fR" 4 ++.IX Item "--stack reserve,commit" ++.PD ++Specify the number of bytes of memory to reserve (and optionally commit) ++to be used as stack for this program. ++[This option is specific to \s-1PE\s0 targets.] ++.IP "\fB\-\-subsystem\fR \fIwhich\fR" 4 ++.IX Item "--subsystem which" ++.PD 0 ++.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR" 4 ++.IX Item "--subsystem which:major" ++.IP "\fB\-\-subsystem\fR \fIwhich\fR\fB:\fR\fImajor\fR\fB.\fR\fIminor\fR" 4 ++.IX Item "--subsystem which:major.minor" ++.PD ++Specifies the subsystem under which your program will execute. The ++legal values for \fIwhich\fR are \f(CW\*(C`native\*(C'\fR, \f(CW\*(C`windows\*(C'\fR, ++\&\f(CW\*(C`console\*(C'\fR, \f(CW\*(C`posix\*(C'\fR, \f(CW\*(C`efi\-app\*(C'\fR, \f(CW\*(C`efi\-bsd\*(C'\fR, ++\&\f(CW\*(C`efi\-rtd\*(C'\fR, \f(CW\*(C`sal\-rtd\*(C'\fR, and \f(CW\*(C`xbox\*(C'\fR. You may optionally set ++the subsystem version also. Numeric values are also accepted for ++\&\fIwhich\fR. ++[This option is specific to \s-1PE\s0 targets.] ++.IP "\fB\-\-extract\-symbol\fR" 4 ++.IX Item "--extract-symbol" ++Keep the file's section flags and symbols but remove all section data. ++Specifically, the option: ++.RS 4 ++.IP "*" 4 ++.IX Item "*" ++.PD 0 ++.IP "*" 4 ++.IX Item "*" ++.IP "*" 4 ++.IX Item "*" ++.RE ++.RS 4 ++.PD ++.Sp ++This option is used to build a \fI.sym\fR file for a VxWorks kernel. ++It can also be a useful way of reducing the size of a \fB\-\-just\-symbols\fR ++linker input file. ++.RE ++.IP "\fB\-\-compress\-debug\-sections\fR" 4 ++.IX Item "--compress-debug-sections" ++Compress \s-1DWARF\s0 debug sections using zlib with \s-1SHF_COMPRESSED\s0 from the ++\&\s-1ELF ABI.\s0 Note \- if compression would actually make a section ++\&\fIlarger\fR, then it is not compressed. ++.IP "\fB\-\-compress\-debug\-sections=none\fR" 4 ++.IX Item "--compress-debug-sections=none" ++.PD 0 ++.IP "\fB\-\-compress\-debug\-sections=zlib\fR" 4 ++.IX Item "--compress-debug-sections=zlib" ++.IP "\fB\-\-compress\-debug\-sections=zlib\-gnu\fR" 4 ++.IX Item "--compress-debug-sections=zlib-gnu" ++.IP "\fB\-\-compress\-debug\-sections=zlib\-gabi\fR" 4 ++.IX Item "--compress-debug-sections=zlib-gabi" ++.PD ++For \s-1ELF\s0 files, these options control how \s-1DWARF\s0 debug sections are ++compressed. \fB\-\-compress\-debug\-sections=none\fR is equivalent ++to \fB\-\-decompress\-debug\-sections\fR. ++\&\fB\-\-compress\-debug\-sections=zlib\fR and ++\&\fB\-\-compress\-debug\-sections=zlib\-gabi\fR are equivalent to ++\&\fB\-\-compress\-debug\-sections\fR. ++\&\fB\-\-compress\-debug\-sections=zlib\-gnu\fR compresses \s-1DWARF\s0 debug ++sections using zlib. The debug sections are renamed to begin with ++\&\fB.zdebug\fR instead of \fB.debug\fR. Note \- if compression would ++actually make a section \fIlarger\fR, then it is not compressed nor ++renamed. ++.IP "\fB\-\-decompress\-debug\-sections\fR" 4 ++.IX Item "--decompress-debug-sections" ++Decompress \s-1DWARF\s0 debug sections using zlib. The original section ++names of the compressed sections are restored. ++.IP "\fB\-\-elf\-stt\-common=yes\fR" 4 ++.IX Item "--elf-stt-common=yes" ++.PD 0 ++.IP "\fB\-\-elf\-stt\-common=no\fR" 4 ++.IX Item "--elf-stt-common=no" ++.PD ++For \s-1ELF\s0 files, these options control whether common symbols should be ++converted to the \f(CW\*(C`STT_COMMON\*(C'\fR or \f(CW\*(C`STT_OBJECT\*(C'\fR type. ++\&\fB\-\-elf\-stt\-common=yes\fR converts common symbol type to ++\&\f(CW\*(C`STT_COMMON\*(C'\fR. \fB\-\-elf\-stt\-common=no\fR converts common symbol ++type to \f(CW\*(C`STT_OBJECT\*(C'\fR. ++.IP "\fB\-\-merge\-notes\fR" 4 ++.IX Item "--merge-notes" ++.PD 0 ++.IP "\fB\-\-no\-merge\-notes\fR" 4 ++.IX Item "--no-merge-notes" ++.PD ++For \s-1ELF\s0 files, attempt (or do not attempt) to reduce the size of any ++\&\s-1SHT_NOTE\s0 type sections by removing duplicate notes. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Show the version number of \fBobjcopy\fR. ++.IP "\fB\-\-verilog\-data\-width=\fR\fIbytes\fR" 4 ++.IX Item "--verilog-data-width=bytes" ++For Verilog output, this options controls the number of bytes ++converted for each output data element. The input target controls the ++endianness of the conversion. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-\-verbose\fR" 4 ++.IX Item "--verbose" ++.PD ++Verbose output: list all object files modified. In the case of ++archives, \fBobjcopy \-V\fR lists all members of the archive. ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++Show a summary of the options to \fBobjcopy\fR. ++.IP "\fB\-\-info\fR" 4 ++.IX Item "--info" ++Display a list showing all architectures and object formats available. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBld\fR\|(1), \fBobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/objdump.1 b/binutils/doc/objdump.1 +--- a/binutils/doc/objdump.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/objdump.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,1310 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "OBJDUMP 1" ++.TH OBJDUMP 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++objdump \- display information from object files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++objdump [\fB\-a\fR|\fB\-\-archive\-headers\fR] ++ [\fB\-b\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] ++ [\fB\-C\fR|\fB\-\-demangle\fR[=\fIstyle\fR] ] ++ [\fB\-d\fR|\fB\-\-disassemble\fR[=\fIsymbol\fR]] ++ [\fB\-D\fR|\fB\-\-disassemble\-all\fR] ++ [\fB\-z\fR|\fB\-\-disassemble\-zeroes\fR] ++ [\fB\-EB\fR|\fB\-EL\fR|\fB\-\-endian=\fR{big | little }] ++ [\fB\-f\fR|\fB\-\-file\-headers\fR] ++ [\fB\-F\fR|\fB\-\-file\-offsets\fR] ++ [\fB\-\-file\-start\-context\fR] ++ [\fB\-g\fR|\fB\-\-debugging\fR] ++ [\fB\-e\fR|\fB\-\-debugging\-tags\fR] ++ [\fB\-h\fR|\fB\-\-section\-headers\fR|\fB\-\-headers\fR] ++ [\fB\-i\fR|\fB\-\-info\fR] ++ [\fB\-j\fR \fIsection\fR|\fB\-\-section=\fR\fIsection\fR] ++ [\fB\-l\fR|\fB\-\-line\-numbers\fR] ++ [\fB\-S\fR|\fB\-\-source\fR] ++ [\fB\-\-source\-comment\fR[=\fItext\fR]] ++ [\fB\-m\fR \fImachine\fR|\fB\-\-architecture=\fR\fImachine\fR] ++ [\fB\-M\fR \fIoptions\fR|\fB\-\-disassembler\-options=\fR\fIoptions\fR] ++ [\fB\-p\fR|\fB\-\-private\-headers\fR] ++ [\fB\-P\fR \fIoptions\fR|\fB\-\-private=\fR\fIoptions\fR] ++ [\fB\-r\fR|\fB\-\-reloc\fR] ++ [\fB\-R\fR|\fB\-\-dynamic\-reloc\fR] ++ [\fB\-s\fR|\fB\-\-full\-contents\fR] ++ [\fB\-W[lLiaprmfFsoRtUuTgAckK]\fR| ++ \fB\-\-dwarf\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow\-links]] ++ [\fB\-\-ctf=\fR\fIsection\fR] ++ [\fB\-G\fR|\fB\-\-stabs\fR] ++ [\fB\-t\fR|\fB\-\-syms\fR] ++ [\fB\-T\fR|\fB\-\-dynamic\-syms\fR] ++ [\fB\-x\fR|\fB\-\-all\-headers\fR] ++ [\fB\-w\fR|\fB\-\-wide\fR] ++ [\fB\-\-start\-address=\fR\fIaddress\fR] ++ [\fB\-\-stop\-address=\fR\fIaddress\fR] ++ [\fB\-\-prefix\-addresses\fR] ++ [\fB\-\-[no\-]show\-raw\-insn\fR] ++ [\fB\-\-adjust\-vma=\fR\fIoffset\fR] ++ [\fB\-\-dwarf\-depth=\fR\fIn\fR] ++ [\fB\-\-dwarf\-start=\fR\fIn\fR] ++ [\fB\-\-ctf\-parent=\fR\fIsection\fR] ++ [\fB\-\-no\-recurse\-limit\fR|\fB\-\-recurse\-limit\fR] ++ [\fB\-\-special\-syms\fR] ++ [\fB\-\-prefix=\fR\fIprefix\fR] ++ [\fB\-\-prefix\-strip=\fR\fIlevel\fR] ++ [\fB\-\-insn\-width=\fR\fIwidth\fR] ++ [\fB\-\-visualize\-jumps[=color|=extended\-color|=off]\fR ++ [\fB\-V\fR|\fB\-\-version\fR] ++ [\fB\-H\fR|\fB\-\-help\fR] ++ \fIobjfile\fR... ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBobjdump\fR displays information about one or more object files. ++The options control what particular information to display. This ++information is mostly useful to programmers who are working on the ++compilation tools, as opposed to programmers who just want their ++program to compile and work. ++.PP ++\&\fIobjfile\fR... are the object files to be examined. When you ++specify archives, \fBobjdump\fR shows information on each of the member ++object files. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The long and short forms of options, shown here as alternatives, are ++equivalent. At least one option from the list ++\&\fB\-a,\-d,\-D,\-e,\-f,\-g,\-G,\-h,\-H,\-p,\-P,\-r,\-R,\-s,\-S,\-t,\-T,\-V,\-x\fR must be given. ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-archive\-header\fR" 4 ++.IX Item "--archive-header" ++.PD ++If any of the \fIobjfile\fR files are archives, display the archive ++header information (in a format similar to \fBls \-l\fR). Besides the ++information you could list with \fBar tv\fR, \fBobjdump \-a\fR shows ++the object file format of each archive member. ++.IP "\fB\-\-adjust\-vma=\fR\fIoffset\fR" 4 ++.IX Item "--adjust-vma=offset" ++When dumping information, first add \fIoffset\fR to all the section ++addresses. This is useful if the section addresses do not correspond to ++the symbol table, which can happen when putting sections at particular ++addresses when using a format which can not represent section addresses, ++such as a.out. ++.IP "\fB\-b\fR \fIbfdname\fR" 4 ++.IX Item "-b bfdname" ++.PD 0 ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++.PD ++Specify that the object-code format for the object files is ++\&\fIbfdname\fR. This option may not be necessary; \fIobjdump\fR can ++automatically recognize many formats. ++.Sp ++For example, ++.Sp ++.Vb 1 ++\& objdump \-b oasys \-m vax \-h fu.o ++.Ve ++.Sp ++displays summary information from the section headers (\fB\-h\fR) of ++\&\fIfu.o\fR, which is explicitly identified (\fB\-m\fR) as a \s-1VAX\s0 object ++file in the format produced by Oasys compilers. You can list the ++formats available with the \fB\-i\fR option. ++.IP "\fB\-C\fR" 4 ++.IX Item "-C" ++.PD 0 ++.IP "\fB\-\-demangle[=\fR\fIstyle\fR\fB]\fR" 4 ++.IX Item "--demangle[=style]" ++.PD ++Decode (\fIdemangle\fR) low-level symbol names into user-level names. ++Besides removing any initial underscore prepended by the system, this ++makes \*(C+ function names readable. Different compilers have different ++mangling styles. The optional demangling style argument can be used to ++choose an appropriate demangling style for your compiler. ++.IP "\fB\-\-recurse\-limit\fR" 4 ++.IX Item "--recurse-limit" ++.PD 0 ++.IP "\fB\-\-no\-recurse\-limit\fR" 4 ++.IX Item "--no-recurse-limit" ++.IP "\fB\-\-recursion\-limit\fR" 4 ++.IX Item "--recursion-limit" ++.IP "\fB\-\-no\-recursion\-limit\fR" 4 ++.IX Item "--no-recursion-limit" ++.PD ++Enables or disables a limit on the amount of recursion performed ++whilst demangling strings. Since the name mangling formats allow for ++an inifinite level of recursion it is possible to create strings whose ++decoding will exhaust the amount of stack space available on the host ++machine, triggering a memory fault. The limit tries to prevent this ++from happening by restricting recursion to 2048 levels of nesting. ++.Sp ++The default is for this limit to be enabled, but disabling it may be ++necessary in order to demangle truly complicated names. Note however ++that if the recursion limit is disabled then stack exhaustion is ++possible and any bug reports about such an event will be rejected. ++.IP "\fB\-g\fR" 4 ++.IX Item "-g" ++.PD 0 ++.IP "\fB\-\-debugging\fR" 4 ++.IX Item "--debugging" ++.PD ++Display debugging information. This attempts to parse \s-1STABS\s0 ++debugging format information stored in the file and print it out using ++a C like syntax. If no \s-1STABS\s0 debuging was found this option ++falls back on the \fB\-W\fR option to print any \s-1DWARF\s0 information in ++the file. ++.IP "\fB\-e\fR" 4 ++.IX Item "-e" ++.PD 0 ++.IP "\fB\-\-debugging\-tags\fR" 4 ++.IX Item "--debugging-tags" ++.PD ++Like \fB\-g\fR, but the information is generated in a format compatible ++with ctags tool. ++.IP "\fB\-d\fR" 4 ++.IX Item "-d" ++.PD 0 ++.IP "\fB\-\-disassemble\fR" 4 ++.IX Item "--disassemble" ++.IP "\fB\-\-disassemble=\fR\fIsymbol\fR" 4 ++.IX Item "--disassemble=symbol" ++.PD ++Display the assembler mnemonics for the machine instructions from the ++input file. This option only disassembles those sections which are ++expected to contain instructions. If the optional \fIsymbol\fR ++argument is given, then display the assembler mnemonics starting at ++\&\fIsymbol\fR. If \fIsymbol\fR is a function name then disassembly ++will stop at the end of the function, otherwise it will stop when the ++next symbol is encountered. If there are no matches for \fIsymbol\fR ++then nothing will be displayed. ++.Sp ++Note if the \fB\-\-dwarf=follow\-links\fR option has also been enabled ++then any symbol tables in linked debug info files will be read in and ++used when disassembling. ++.IP "\fB\-D\fR" 4 ++.IX Item "-D" ++.PD 0 ++.IP "\fB\-\-disassemble\-all\fR" 4 ++.IX Item "--disassemble-all" ++.PD ++Like \fB\-d\fR, but disassemble the contents of all sections, not just ++those expected to contain instructions. ++.Sp ++This option also has a subtle effect on the disassembly of ++instructions in code sections. When option \fB\-d\fR is in effect ++objdump will assume that any symbols present in a code section occur ++on the boundary between instructions and it will refuse to disassemble ++across such a boundary. When option \fB\-D\fR is in effect however ++this assumption is supressed. This means that it is possible for the ++output of \fB\-d\fR and \fB\-D\fR to differ if, for example, data ++is stored in code sections. ++.Sp ++If the target is an \s-1ARM\s0 architecture this switch also has the effect ++of forcing the disassembler to decode pieces of data found in code ++sections as if they were instructions. ++.Sp ++Note if the \fB\-\-dwarf=follow\-links\fR option has also been enabled ++then any symbol tables in linked debug info files will be read in and ++used when disassembling. ++.IP "\fB\-\-prefix\-addresses\fR" 4 ++.IX Item "--prefix-addresses" ++When disassembling, print the complete address on each line. This is ++the older disassembly format. ++.IP "\fB\-EB\fR" 4 ++.IX Item "-EB" ++.PD 0 ++.IP "\fB\-EL\fR" 4 ++.IX Item "-EL" ++.IP "\fB\-\-endian={big|little}\fR" 4 ++.IX Item "--endian={big|little}" ++.PD ++Specify the endianness of the object files. This only affects ++disassembly. This can be useful when disassembling a file format which ++does not describe endianness information, such as S\-records. ++.IP "\fB\-f\fR" 4 ++.IX Item "-f" ++.PD 0 ++.IP "\fB\-\-file\-headers\fR" 4 ++.IX Item "--file-headers" ++.PD ++Display summary information from the overall header of ++each of the \fIobjfile\fR files. ++.IP "\fB\-F\fR" 4 ++.IX Item "-F" ++.PD 0 ++.IP "\fB\-\-file\-offsets\fR" 4 ++.IX Item "--file-offsets" ++.PD ++When disassembling sections, whenever a symbol is displayed, also ++display the file offset of the region of data that is about to be ++dumped. If zeroes are being skipped, then when disassembly resumes, ++tell the user how many zeroes were skipped and the file offset of the ++location from where the disassembly resumes. When dumping sections, ++display the file offset of the location from where the dump starts. ++.IP "\fB\-\-file\-start\-context\fR" 4 ++.IX Item "--file-start-context" ++Specify that when displaying interlisted source code/disassembly ++(assumes \fB\-S\fR) from a file that has not yet been displayed, extend the ++context to the start of the file. ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-\-section\-headers\fR" 4 ++.IX Item "--section-headers" ++.IP "\fB\-\-headers\fR" 4 ++.IX Item "--headers" ++.PD ++Display summary information from the section headers of the ++object file. ++.Sp ++File segments may be relocated to nonstandard addresses, for example by ++using the \fB\-Ttext\fR, \fB\-Tdata\fR, or \fB\-Tbss\fR options to ++\&\fBld\fR. However, some object file formats, such as a.out, do not ++store the starting address of the file segments. In those situations, ++although \fBld\fR relocates the sections correctly, using \fBobjdump ++\&\-h\fR to list the file section headers cannot show the correct addresses. ++Instead, it shows the usual addresses, which are implicit for the ++target. ++.Sp ++Note, in some cases it is possible for a section to have both the ++\&\s-1READONLY\s0 and the \s-1NOREAD\s0 attributes set. In such cases the \s-1NOREAD\s0 ++attribute takes precedence, but \fBobjdump\fR will report both ++since the exact setting of the flag bits might be important. ++.IP "\fB\-H\fR" 4 ++.IX Item "-H" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Print a summary of the options to \fBobjdump\fR and exit. ++.IP "\fB\-i\fR" 4 ++.IX Item "-i" ++.PD 0 ++.IP "\fB\-\-info\fR" 4 ++.IX Item "--info" ++.PD ++Display a list showing all architectures and object formats available ++for specification with \fB\-b\fR or \fB\-m\fR. ++.IP "\fB\-j\fR \fIname\fR" 4 ++.IX Item "-j name" ++.PD 0 ++.IP "\fB\-\-section=\fR\fIname\fR" 4 ++.IX Item "--section=name" ++.PD ++Display information only for section \fIname\fR. ++.IP "\fB\-l\fR" 4 ++.IX Item "-l" ++.PD 0 ++.IP "\fB\-\-line\-numbers\fR" 4 ++.IX Item "--line-numbers" ++.PD ++Label the display (using debugging information) with the filename and ++source line numbers corresponding to the object code or relocs shown. ++Only useful with \fB\-d\fR, \fB\-D\fR, or \fB\-r\fR. ++.IP "\fB\-m\fR \fImachine\fR" 4 ++.IX Item "-m machine" ++.PD 0 ++.IP "\fB\-\-architecture=\fR\fImachine\fR" 4 ++.IX Item "--architecture=machine" ++.PD ++Specify the architecture to use when disassembling object files. This ++can be useful when disassembling object files which do not describe ++architecture information, such as S\-records. You can list the available ++architectures with the \fB\-i\fR option. ++.Sp ++If the target is an \s-1ARM\s0 architecture then this switch has an ++additional effect. It restricts the disassembly to only those ++instructions supported by the architecture specified by \fImachine\fR. ++If it is necessary to use this switch because the input file does not ++contain any architecture information, but it is also desired to ++disassemble all the instructions use \fB\-marm\fR. ++.IP "\fB\-M\fR \fIoptions\fR" 4 ++.IX Item "-M options" ++.PD 0 ++.IP "\fB\-\-disassembler\-options=\fR\fIoptions\fR" 4 ++.IX Item "--disassembler-options=options" ++.PD ++Pass target specific information to the disassembler. Only supported on ++some targets. If it is necessary to specify more than one ++disassembler option then multiple \fB\-M\fR options can be used or ++can be placed together into a comma separated list. ++.Sp ++For \s-1ARC,\s0 \fBdsp\fR controls the printing of \s-1DSP\s0 instructions, ++\&\fBspfp\fR selects the printing of \s-1FPX\s0 single precision \s-1FP\s0 ++instructions, \fBdpfp\fR selects the printing of \s-1FPX\s0 double ++precision \s-1FP\s0 instructions, \fBquarkse_em\fR selects the printing of ++special QuarkSE-EM instructions, \fBfpuda\fR selects the printing ++of double precision assist instructions, \fBfpus\fR selects the ++printing of \s-1FPU\s0 single precision \s-1FP\s0 instructions, while \fBfpud\fR ++selects the printing of \s-1FPU\s0 double precision \s-1FP\s0 instructions. ++Additionally, one can choose to have all the immediates printed in ++hexadecimal using \fBhex\fR. By default, the short immediates are ++printed using the decimal representation, while the long immediate ++values are printed as hexadecimal. ++.Sp ++\&\fBcpu=...\fR allows to enforce a particular \s-1ISA\s0 when disassembling ++instructions, overriding the \fB\-m\fR value or whatever is in the \s-1ELF\s0 file. ++This might be useful to select \s-1ARC EM\s0 or \s-1HS ISA,\s0 because architecture is same ++for those and disassembler relies on private \s-1ELF\s0 header data to decide if code ++is for \s-1EM\s0 or \s-1HS.\s0 This option might be specified multiple times \- only the ++latest value will be used. Valid values are same as for the assembler ++\&\fB\-mcpu=...\fR option. ++.Sp ++If the target is an \s-1ARM\s0 architecture then this switch can be used to ++select which register name set is used during disassembler. Specifying ++\&\fB\-M reg-names-std\fR (the default) will select the register names as ++used in \s-1ARM\s0's instruction set documentation, but with register 13 called ++\&'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying ++\&\fB\-M reg-names-apcs\fR will select the name set used by the \s-1ARM\s0 ++Procedure Call Standard, whilst specifying \fB\-M reg-names-raw\fR will ++just use \fBr\fR followed by the register number. ++.Sp ++There are also two variants on the \s-1APCS\s0 register naming scheme enabled ++by \fB\-M reg-names-atpcs\fR and \fB\-M reg-names-special-atpcs\fR which ++use the ARM/Thumb Procedure Call Standard naming conventions. (Either ++with the normal register names or the special register names). ++.Sp ++This option can also be used for \s-1ARM\s0 architectures to force the ++disassembler to interpret all instructions as Thumb instructions by ++using the switch \fB\-\-disassembler\-options=force\-thumb\fR. This can be ++useful when attempting to disassemble thumb code produced by other ++compilers. ++.Sp ++For AArch64 targets this switch can be used to set whether instructions are ++disassembled as the most general instruction using the \fB\-M no-aliases\fR ++option or whether instruction notes should be generated as comments in the ++disasssembly using \fB\-M notes\fR. ++.Sp ++For the x86, some of the options duplicate functions of the \fB\-m\fR ++switch, but allow finer grained control. Multiple selections from the ++following may be specified as a comma separated string. ++.RS 4 ++.ie n .IP """x86\-64""" 4 ++.el .IP "\f(CWx86\-64\fR" 4 ++.IX Item "x86-64" ++.PD 0 ++.ie n .IP """i386""" 4 ++.el .IP "\f(CWi386\fR" 4 ++.IX Item "i386" ++.ie n .IP """i8086""" 4 ++.el .IP "\f(CWi8086\fR" 4 ++.IX Item "i8086" ++.PD ++Select disassembly for the given architecture. ++.ie n .IP """intel""" 4 ++.el .IP "\f(CWintel\fR" 4 ++.IX Item "intel" ++.PD 0 ++.ie n .IP """att""" 4 ++.el .IP "\f(CWatt\fR" 4 ++.IX Item "att" ++.PD ++Select between intel syntax mode and \s-1AT&T\s0 syntax mode. ++.ie n .IP """amd64""" 4 ++.el .IP "\f(CWamd64\fR" 4 ++.IX Item "amd64" ++.PD 0 ++.ie n .IP """intel64""" 4 ++.el .IP "\f(CWintel64\fR" 4 ++.IX Item "intel64" ++.PD ++Select between \s-1AMD64 ISA\s0 and Intel64 \s-1ISA.\s0 ++.ie n .IP """intel\-mnemonic""" 4 ++.el .IP "\f(CWintel\-mnemonic\fR" 4 ++.IX Item "intel-mnemonic" ++.PD 0 ++.ie n .IP """att\-mnemonic""" 4 ++.el .IP "\f(CWatt\-mnemonic\fR" 4 ++.IX Item "att-mnemonic" ++.PD ++Select between intel mnemonic mode and \s-1AT&T\s0 mnemonic mode. ++Note: \f(CW\*(C`intel\-mnemonic\*(C'\fR implies \f(CW\*(C`intel\*(C'\fR and ++\&\f(CW\*(C`att\-mnemonic\*(C'\fR implies \f(CW\*(C`att\*(C'\fR. ++.ie n .IP """addr64""" 4 ++.el .IP "\f(CWaddr64\fR" 4 ++.IX Item "addr64" ++.PD 0 ++.ie n .IP """addr32""" 4 ++.el .IP "\f(CWaddr32\fR" 4 ++.IX Item "addr32" ++.ie n .IP """addr16""" 4 ++.el .IP "\f(CWaddr16\fR" 4 ++.IX Item "addr16" ++.ie n .IP """data32""" 4 ++.el .IP "\f(CWdata32\fR" 4 ++.IX Item "data32" ++.ie n .IP """data16""" 4 ++.el .IP "\f(CWdata16\fR" 4 ++.IX Item "data16" ++.PD ++Specify the default address size and operand size. These five options ++will be overridden if \f(CW\*(C`x86\-64\*(C'\fR, \f(CW\*(C`i386\*(C'\fR or \f(CW\*(C`i8086\*(C'\fR ++appear later in the option string. ++.ie n .IP """suffix""" 4 ++.el .IP "\f(CWsuffix\fR" 4 ++.IX Item "suffix" ++When in \s-1AT&T\s0 mode, instructs the disassembler to print a mnemonic ++suffix even when the suffix could be inferred by the operands. ++.RE ++.RS 4 ++.Sp ++For PowerPC, the \fB\-M\fR argument \fBraw\fR selects ++disasssembly of hardware insns rather than aliases. For example, you ++will see \f(CW\*(C`rlwinm\*(C'\fR rather than \f(CW\*(C`clrlwi\*(C'\fR, and \f(CW\*(C`addi\*(C'\fR ++rather than \f(CW\*(C`li\*(C'\fR. All of the \fB\-m\fR arguments for ++\&\fBgas\fR that select a \s-1CPU\s0 are supported. These are: ++\&\fB403\fR, \fB405\fR, \fB440\fR, \fB464\fR, \fB476\fR, ++\&\fB601\fR, \fB603\fR, \fB604\fR, \fB620\fR, \fB7400\fR, ++\&\fB7410\fR, \fB7450\fR, \fB7455\fR, \fB750cl\fR, ++\&\fB821\fR, \fB850\fR, \fB860\fR, \fBa2\fR, \fBbooke\fR, ++\&\fBbooke32\fR, \fBcell\fR, \fBcom\fR, \fBe200z4\fR, ++\&\fBe300\fR, \fBe500\fR, \fBe500mc\fR, \fBe500mc64\fR, ++\&\fBe500x2\fR, \fBe5500\fR, \fBe6500\fR, \fBefs\fR, ++\&\fBpower4\fR, \fBpower5\fR, \fBpower6\fR, \fBpower7\fR, ++\&\fBpower8\fR, \fBpower9\fR, \fBppc\fR, \fBppc32\fR, ++\&\fBppc64\fR, \fBppc64bridge\fR, \fBppcps\fR, \fBpwr\fR, ++\&\fBpwr2\fR, \fBpwr4\fR, \fBpwr5\fR, \fBpwr5x\fR, ++\&\fBpwr6\fR, \fBpwr7\fR, \fBpwr8\fR, \fBpwr9\fR, ++\&\fBpwrx\fR, \fBtitan\fR, and \fBvle\fR. ++\&\fB32\fR and \fB64\fR modify the default or a prior \s-1CPU\s0 ++selection, disabling and enabling 64\-bit insns respectively. In ++addition, \fBaltivec\fR, \fBany\fR, \fBhtm\fR, \fBvsx\fR, ++and \fBspe\fR add capabilities to a previous \fIor later\fR \s-1CPU\s0 ++selection. \fBany\fR will disassemble any opcode known to ++binutils, but in cases where an opcode has two different meanings or ++different arguments, you may not see the disassembly you expect. ++If you disassemble without giving a \s-1CPU\s0 selection, a default will be ++chosen from information gleaned by \s-1BFD\s0 from the object files headers, ++but the result again may not be as you expect. ++.Sp ++For \s-1MIPS,\s0 this option controls the printing of instruction mnemonic ++names and register names in disassembled instructions. Multiple ++selections from the following may be specified as a comma separated ++string, and invalid options are ignored: ++.ie n .IP """no\-aliases""" 4 ++.el .IP "\f(CWno\-aliases\fR" 4 ++.IX Item "no-aliases" ++Print the 'raw' instruction mnemonic instead of some pseudo ++instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', ++\&'sll' instead of 'nop', etc. ++.ie n .IP """msa""" 4 ++.el .IP "\f(CWmsa\fR" 4 ++.IX Item "msa" ++Disassemble \s-1MSA\s0 instructions. ++.ie n .IP """virt""" 4 ++.el .IP "\f(CWvirt\fR" 4 ++.IX Item "virt" ++Disassemble the virtualization \s-1ASE\s0 instructions. ++.ie n .IP """xpa""" 4 ++.el .IP "\f(CWxpa\fR" 4 ++.IX Item "xpa" ++Disassemble the eXtended Physical Address (\s-1XPA\s0) \s-1ASE\s0 instructions. ++.ie n .IP """gpr\-names=\fIABI\fP""" 4 ++.el .IP "\f(CWgpr\-names=\f(CIABI\f(CW\fR" 4 ++.IX Item "gpr-names=ABI" ++Print \s-1GPR\s0 (general-purpose register) names as appropriate ++for the specified \s-1ABI.\s0 By default, \s-1GPR\s0 names are selected according to ++the \s-1ABI\s0 of the binary being disassembled. ++.ie n .IP """fpr\-names=\fIABI\fP""" 4 ++.el .IP "\f(CWfpr\-names=\f(CIABI\f(CW\fR" 4 ++.IX Item "fpr-names=ABI" ++Print \s-1FPR\s0 (floating-point register) names as ++appropriate for the specified \s-1ABI.\s0 By default, \s-1FPR\s0 numbers are printed ++rather than names. ++.ie n .IP """cp0\-names=\fIARCH\fP""" 4 ++.el .IP "\f(CWcp0\-names=\f(CIARCH\f(CW\fR" 4 ++.IX Item "cp0-names=ARCH" ++Print \s-1CP0\s0 (system control coprocessor; coprocessor 0) register names ++as appropriate for the \s-1CPU\s0 or architecture specified by ++\&\fI\s-1ARCH\s0\fR. By default, \s-1CP0\s0 register names are selected according to ++the architecture and \s-1CPU\s0 of the binary being disassembled. ++.ie n .IP """hwr\-names=\fIARCH\fP""" 4 ++.el .IP "\f(CWhwr\-names=\f(CIARCH\f(CW\fR" 4 ++.IX Item "hwr-names=ARCH" ++Print \s-1HWR\s0 (hardware register, used by the \f(CW\*(C`rdhwr\*(C'\fR instruction) names ++as appropriate for the \s-1CPU\s0 or architecture specified by ++\&\fI\s-1ARCH\s0\fR. By default, \s-1HWR\s0 names are selected according to ++the architecture and \s-1CPU\s0 of the binary being disassembled. ++.ie n .IP """reg\-names=\fIABI\fP""" 4 ++.el .IP "\f(CWreg\-names=\f(CIABI\f(CW\fR" 4 ++.IX Item "reg-names=ABI" ++Print \s-1GPR\s0 and \s-1FPR\s0 names as appropriate for the selected \s-1ABI.\s0 ++.ie n .IP """reg\-names=\fIARCH\fP""" 4 ++.el .IP "\f(CWreg\-names=\f(CIARCH\f(CW\fR" 4 ++.IX Item "reg-names=ARCH" ++Print CPU-specific register names (\s-1CP0\s0 register and \s-1HWR\s0 names) ++as appropriate for the selected \s-1CPU\s0 or architecture. ++.RE ++.RS 4 ++.Sp ++For any of the options listed above, \fI\s-1ABI\s0\fR or ++\&\fI\s-1ARCH\s0\fR may be specified as \fBnumeric\fR to have numbers printed ++rather than names, for the selected types of registers. ++You can list the available values of \fI\s-1ABI\s0\fR and \fI\s-1ARCH\s0\fR using ++the \fB\-\-help\fR option. ++.Sp ++For \s-1VAX,\s0 you can specify function entry addresses with \fB\-M ++entry:0xf00ba\fR. You can use this multiple times to properly ++disassemble \s-1VAX\s0 binary files that don't contain symbol tables (like ++\&\s-1ROM\s0 dumps). In these cases, the function entry mask would otherwise ++be decoded as \s-1VAX\s0 instructions, which would probably lead the rest ++of the function being wrongly disassembled. ++.RE ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-private\-headers\fR" 4 ++.IX Item "--private-headers" ++.PD ++Print information that is specific to the object file format. The exact ++information printed depends upon the object file format. For some ++object file formats, no additional information is printed. ++.IP "\fB\-P\fR \fIoptions\fR" 4 ++.IX Item "-P options" ++.PD 0 ++.IP "\fB\-\-private=\fR\fIoptions\fR" 4 ++.IX Item "--private=options" ++.PD ++Print information that is specific to the object file format. The ++argument \fIoptions\fR is a comma separated list that depends on the ++format (the lists of options is displayed with the help). ++.Sp ++For \s-1XCOFF,\s0 the available options are: ++.RS 4 ++.ie n .IP """header""" 4 ++.el .IP "\f(CWheader\fR" 4 ++.IX Item "header" ++.PD 0 ++.ie n .IP """aout""" 4 ++.el .IP "\f(CWaout\fR" 4 ++.IX Item "aout" ++.ie n .IP """sections""" 4 ++.el .IP "\f(CWsections\fR" 4 ++.IX Item "sections" ++.ie n .IP """syms""" 4 ++.el .IP "\f(CWsyms\fR" 4 ++.IX Item "syms" ++.ie n .IP """relocs""" 4 ++.el .IP "\f(CWrelocs\fR" 4 ++.IX Item "relocs" ++.ie n .IP """lineno,""" 4 ++.el .IP "\f(CWlineno,\fR" 4 ++.IX Item "lineno," ++.ie n .IP """loader""" 4 ++.el .IP "\f(CWloader\fR" 4 ++.IX Item "loader" ++.ie n .IP """except""" 4 ++.el .IP "\f(CWexcept\fR" 4 ++.IX Item "except" ++.ie n .IP """typchk""" 4 ++.el .IP "\f(CWtypchk\fR" 4 ++.IX Item "typchk" ++.ie n .IP """traceback""" 4 ++.el .IP "\f(CWtraceback\fR" 4 ++.IX Item "traceback" ++.ie n .IP """toc""" 4 ++.el .IP "\f(CWtoc\fR" 4 ++.IX Item "toc" ++.ie n .IP """ldinfo""" 4 ++.el .IP "\f(CWldinfo\fR" 4 ++.IX Item "ldinfo" ++.RE ++.RS 4 ++.PD ++.Sp ++Not all object formats support this option. In particular the \s-1ELF\s0 ++format does not use it. ++.RE ++.IP "\fB\-r\fR" 4 ++.IX Item "-r" ++.PD 0 ++.IP "\fB\-\-reloc\fR" 4 ++.IX Item "--reloc" ++.PD ++Print the relocation entries of the file. If used with \fB\-d\fR or ++\&\fB\-D\fR, the relocations are printed interspersed with the ++disassembly. ++.IP "\fB\-R\fR" 4 ++.IX Item "-R" ++.PD 0 ++.IP "\fB\-\-dynamic\-reloc\fR" 4 ++.IX Item "--dynamic-reloc" ++.PD ++Print the dynamic relocation entries of the file. This is only ++meaningful for dynamic objects, such as certain types of shared ++libraries. As for \fB\-r\fR, if used with \fB\-d\fR or ++\&\fB\-D\fR, the relocations are printed interspersed with the ++disassembly. ++.IP "\fB\-s\fR" 4 ++.IX Item "-s" ++.PD 0 ++.IP "\fB\-\-full\-contents\fR" 4 ++.IX Item "--full-contents" ++.PD ++Display the full contents of any sections requested. By default all ++non-empty sections are displayed. ++.IP "\fB\-S\fR" 4 ++.IX Item "-S" ++.PD 0 ++.IP "\fB\-\-source\fR" 4 ++.IX Item "--source" ++.PD ++Display source code intermixed with disassembly, if possible. Implies ++\&\fB\-d\fR. ++.IP "\fB\-\-source\-comment[=\fR\fItxt\fR\fB]\fR" 4 ++.IX Item "--source-comment[=txt]" ++Like the \fB\-S\fR option, but all source code lines are displayed ++with a prefix of \fItxt\fR. Typically \fItxt\fR will be a comment ++string which can be used to distinguish the assembler code from the ++source code. If \fItxt\fR is not provided then a default string of ++\&\fI\*(L"# \*(R"\fR (hash followed by a space), will be used. ++.IP "\fB\-\-prefix=\fR\fIprefix\fR" 4 ++.IX Item "--prefix=prefix" ++Specify \fIprefix\fR to add to the absolute paths when used with ++\&\fB\-S\fR. ++.IP "\fB\-\-prefix\-strip=\fR\fIlevel\fR" 4 ++.IX Item "--prefix-strip=level" ++Indicate how many initial directory names to strip off the hardwired ++absolute paths. It has no effect without \fB\-\-prefix=\fR\fIprefix\fR. ++.IP "\fB\-\-show\-raw\-insn\fR" 4 ++.IX Item "--show-raw-insn" ++When disassembling instructions, print the instruction in hex as well as ++in symbolic form. This is the default except when ++\&\fB\-\-prefix\-addresses\fR is used. ++.IP "\fB\-\-no\-show\-raw\-insn\fR" 4 ++.IX Item "--no-show-raw-insn" ++When disassembling instructions, do not print the instruction bytes. ++This is the default when \fB\-\-prefix\-addresses\fR is used. ++.IP "\fB\-\-insn\-width=\fR\fIwidth\fR" 4 ++.IX Item "--insn-width=width" ++Display \fIwidth\fR bytes on a single line when disassembling ++instructions. ++.IP "\fB\-\-visualize\-jumps[=color|=extended\-color|=off]\fR" 4 ++.IX Item "--visualize-jumps[=color|=extended-color|=off]" ++Visualize jumps that stay inside a function by drawing \s-1ASCII\s0 art between ++the start and target addresses. The optional \fB=color\fR argument ++adds color to the output using simple terminal colors. Alternatively ++the \fB=extended\-color\fR argument will add color using 8bit ++colors, but these might not work on all terminals. ++.Sp ++If it is necessary to disable the \fBvisualize-jumps\fR option ++after it has previously been enabled then use ++\&\fBvisualize\-jumps=off\fR. ++.IP "\fB\-W[lLiaprmfFsoRtUuTgAckK]\fR" 4 ++.IX Item "-W[lLiaprmfFsoRtUuTgAckK]" ++.PD 0 ++.IP "\fB\-\-dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow\-links]\fR" 4 ++.IX Item "--dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]" ++.PD ++Displays the contents of the \s-1DWARF\s0 debug sections in the file, if any ++are present. Compressed debug sections are automatically decompressed ++(temporarily) before they are displayed. If one or more of the ++optional letters or words follows the switch then only those type(s) ++of data will be dumped. The letters and words refer to the following ++information: ++.RS 4 ++.ie n .IP """a""" 4 ++.el .IP "\f(CWa\fR" 4 ++.IX Item "a" ++.PD 0 ++.ie n .IP """=abbrev""" 4 ++.el .IP "\f(CW=abbrev\fR" 4 ++.IX Item "=abbrev" ++.PD ++Displays the contents of the \fB.debug_abbrev\fR section. ++.ie n .IP """A""" 4 ++.el .IP "\f(CWA\fR" 4 ++.IX Item "A" ++.PD 0 ++.ie n .IP """=addr""" 4 ++.el .IP "\f(CW=addr\fR" 4 ++.IX Item "=addr" ++.PD ++Displays the contents of the \fB.debug_addr\fR section. ++.ie n .IP """c""" 4 ++.el .IP "\f(CWc\fR" 4 ++.IX Item "c" ++.PD 0 ++.ie n .IP """=cu_index""" 4 ++.el .IP "\f(CW=cu_index\fR" 4 ++.IX Item "=cu_index" ++.PD ++Displays the contents of the \fB.debug_cu_index\fR and/or ++\&\fB.debug_tu_index\fR sections. ++.ie n .IP """f""" 4 ++.el .IP "\f(CWf\fR" 4 ++.IX Item "f" ++.PD 0 ++.ie n .IP """=frames""" 4 ++.el .IP "\f(CW=frames\fR" 4 ++.IX Item "=frames" ++.PD ++Display the raw contents of a \fB.debug_frame\fR section. ++.ie n .IP """F""" 4 ++.el .IP "\f(CWF\fR" 4 ++.IX Item "F" ++.PD 0 ++.ie n .IP """=frame\-interp""" 4 ++.el .IP "\f(CW=frame\-interp\fR" 4 ++.IX Item "=frame-interp" ++.PD ++Display the interpreted contents of a \fB.debug_frame\fR section. ++.ie n .IP """g""" 4 ++.el .IP "\f(CWg\fR" 4 ++.IX Item "g" ++.PD 0 ++.ie n .IP """=gdb_index""" 4 ++.el .IP "\f(CW=gdb_index\fR" 4 ++.IX Item "=gdb_index" ++.PD ++Displays the contents of the \fB.gdb_index\fR and/or ++\&\fB.debug_names\fR sections. ++.ie n .IP """i""" 4 ++.el .IP "\f(CWi\fR" 4 ++.IX Item "i" ++.PD 0 ++.ie n .IP """=info""" 4 ++.el .IP "\f(CW=info\fR" 4 ++.IX Item "=info" ++.PD ++Displays the contents of the \fB.debug_info\fR section. Note: the ++output from this option can also be restricted by the use of the ++\&\fB\-\-dwarf\-depth\fR and \fB\-\-dwarf\-start\fR options. ++.ie n .IP """k""" 4 ++.el .IP "\f(CWk\fR" 4 ++.IX Item "k" ++.PD 0 ++.ie n .IP """=links""" 4 ++.el .IP "\f(CW=links\fR" 4 ++.IX Item "=links" ++.PD ++Displays the contents of the \fB.gnu_debuglink\fR and/or ++\&\fB.gnu_debugaltlink\fR sections. Also displays any links to ++separate dwarf object files (dwo), if they are specified by the ++DW_AT_GNU_dwo_name or DW_AT_dwo_name attributes in the ++\&\fB.debug_info\fR section. ++.ie n .IP """K""" 4 ++.el .IP "\f(CWK\fR" 4 ++.IX Item "K" ++.PD 0 ++.ie n .IP """=follow\-links""" 4 ++.el .IP "\f(CW=follow\-links\fR" 4 ++.IX Item "=follow-links" ++.PD ++Display the contents of any selected debug sections that are found in ++linked, separate debug info file(s). This can result in multiple ++versions of the same debug section being displayed if it exists in ++more than one file. ++.Sp ++In addition, when displaying \s-1DWARF\s0 attributes, if a form is found that ++references the separate debug info file, then the referenced contents ++will also be displayed. ++.ie n .IP """l""" 4 ++.el .IP "\f(CWl\fR" 4 ++.IX Item "l" ++.PD 0 ++.ie n .IP """=rawline""" 4 ++.el .IP "\f(CW=rawline\fR" 4 ++.IX Item "=rawline" ++.PD ++Displays the contents of the \fB.debug_line\fR section in a raw ++format. ++.ie n .IP """L""" 4 ++.el .IP "\f(CWL\fR" 4 ++.IX Item "L" ++.PD 0 ++.ie n .IP """=decodedline""" 4 ++.el .IP "\f(CW=decodedline\fR" 4 ++.IX Item "=decodedline" ++.PD ++Displays the interpreted contents of the \fB.debug_line\fR section. ++.ie n .IP """m""" 4 ++.el .IP "\f(CWm\fR" 4 ++.IX Item "m" ++.PD 0 ++.ie n .IP """=macro""" 4 ++.el .IP "\f(CW=macro\fR" 4 ++.IX Item "=macro" ++.PD ++Displays the contents of the \fB.debug_macro\fR and/or ++\&\fB.debug_macinfo\fR sections. ++.ie n .IP """o""" 4 ++.el .IP "\f(CWo\fR" 4 ++.IX Item "o" ++.PD 0 ++.ie n .IP """=loc""" 4 ++.el .IP "\f(CW=loc\fR" 4 ++.IX Item "=loc" ++.PD ++Displays the contents of the \fB.debug_loc\fR and/or ++\&\fB.debug_loclists\fR sections. ++.ie n .IP """p""" 4 ++.el .IP "\f(CWp\fR" 4 ++.IX Item "p" ++.PD 0 ++.ie n .IP """=pubnames""" 4 ++.el .IP "\f(CW=pubnames\fR" 4 ++.IX Item "=pubnames" ++.PD ++Displays the contents of the \fB.debug_pubnames\fR and/or ++\&\fB.debug_gnu_pubnames\fR sections. ++.ie n .IP """r""" 4 ++.el .IP "\f(CWr\fR" 4 ++.IX Item "r" ++.PD 0 ++.ie n .IP """=aranges""" 4 ++.el .IP "\f(CW=aranges\fR" 4 ++.IX Item "=aranges" ++.PD ++Displays the contents of the \fB.debug_aranges\fR section. ++.ie n .IP """R""" 4 ++.el .IP "\f(CWR\fR" 4 ++.IX Item "R" ++.PD 0 ++.ie n .IP """=Ranges""" 4 ++.el .IP "\f(CW=Ranges\fR" 4 ++.IX Item "=Ranges" ++.PD ++Displays the contents of the \fB.debug_ranges\fR and/or ++\&\fB.debug_rnglists\fR sections. ++.ie n .IP """s""" 4 ++.el .IP "\f(CWs\fR" 4 ++.IX Item "s" ++.PD 0 ++.ie n .IP """=str""" 4 ++.el .IP "\f(CW=str\fR" 4 ++.IX Item "=str" ++.PD ++Displays the contents of the \fB.debug_str\fR, \fB.debug_line_str\fR ++and/or \fB.debug_str_offsets\fR sections. ++.ie n .IP """t""" 4 ++.el .IP "\f(CWt\fR" 4 ++.IX Item "t" ++.PD 0 ++.ie n .IP """=pubtype""" 4 ++.el .IP "\f(CW=pubtype\fR" 4 ++.IX Item "=pubtype" ++.PD ++Displays the contents of the \fB.debug_pubtypes\fR and/or ++\&\fB.debug_gnu_pubtypes\fR sections. ++.ie n .IP """T""" 4 ++.el .IP "\f(CWT\fR" 4 ++.IX Item "T" ++.PD 0 ++.ie n .IP """=trace_aranges""" 4 ++.el .IP "\f(CW=trace_aranges\fR" 4 ++.IX Item "=trace_aranges" ++.PD ++Displays the contents of the \fB.trace_aranges\fR section. ++.ie n .IP """u""" 4 ++.el .IP "\f(CWu\fR" 4 ++.IX Item "u" ++.PD 0 ++.ie n .IP """=trace_abbrev""" 4 ++.el .IP "\f(CW=trace_abbrev\fR" 4 ++.IX Item "=trace_abbrev" ++.PD ++Displays the contents of the \fB.trace_abbrev\fR section. ++.ie n .IP """U""" 4 ++.el .IP "\f(CWU\fR" 4 ++.IX Item "U" ++.PD 0 ++.ie n .IP """=trace_info""" 4 ++.el .IP "\f(CW=trace_info\fR" 4 ++.IX Item "=trace_info" ++.PD ++Displays the contents of the \fB.trace_info\fR section. ++.RE ++.RS 4 ++.Sp ++Note: displaying the contents of \fB.debug_static_funcs\fR, ++\&\fB.debug_static_vars\fR and \fBdebug_weaknames\fR sections is not ++currently supported. ++.RE ++.IP "\fB\-\-dwarf\-depth=\fR\fIn\fR" 4 ++.IX Item "--dwarf-depth=n" ++Limit the dump of the \f(CW\*(C`.debug_info\*(C'\fR section to \fIn\fR children. ++This is only useful with \fB\-\-debug\-dump=info\fR. The default is ++to print all DIEs; the special value 0 for \fIn\fR will also have this ++effect. ++.Sp ++With a non-zero value for \fIn\fR, DIEs at or deeper than \fIn\fR ++levels will not be printed. The range for \fIn\fR is zero-based. ++.IP "\fB\-\-dwarf\-start=\fR\fIn\fR" 4 ++.IX Item "--dwarf-start=n" ++Print only DIEs beginning with the \s-1DIE\s0 numbered \fIn\fR. This is only ++useful with \fB\-\-debug\-dump=info\fR. ++.Sp ++If specified, this option will suppress printing of any header ++information and all DIEs before the \s-1DIE\s0 numbered \fIn\fR. Only ++siblings and children of the specified \s-1DIE\s0 will be printed. ++.Sp ++This can be used in conjunction with \fB\-\-dwarf\-depth\fR. ++.IP "\fB\-\-dwarf\-check\fR" 4 ++.IX Item "--dwarf-check" ++Enable additional checks for consistency of Dwarf information. ++.IP "\fB\-\-ctf=\fR\fIsection\fR" 4 ++.IX Item "--ctf=section" ++Display the contents of the specified \s-1CTF\s0 section. \s-1CTF\s0 sections themselves ++contain many subsections, all of which are displayed in order. ++.IP "\fB\-\-ctf\-parent=\fR\fIsection\fR" 4 ++.IX Item "--ctf-parent=section" ++Specify the name of another section from which the \s-1CTF\s0 dictionary can inherit ++types. (If none is specified, we assume the \s-1CTF\s0 dictionary inherits types ++from the default-named member of the archive contained within this section.) ++.IP "\fB\-G\fR" 4 ++.IX Item "-G" ++.PD 0 ++.IP "\fB\-\-stabs\fR" 4 ++.IX Item "--stabs" ++.PD ++Display the full contents of any sections requested. Display the ++contents of the .stab and .stab.index and .stab.excl sections from an ++\&\s-1ELF\s0 file. This is only useful on systems (such as Solaris 2.0) in which ++\&\f(CW\*(C`.stab\*(C'\fR debugging symbol-table entries are carried in an \s-1ELF\s0 ++section. In most other file formats, debugging symbol-table entries are ++interleaved with linkage symbols, and are visible in the \fB\-\-syms\fR ++output. ++.IP "\fB\-\-start\-address=\fR\fIaddress\fR" 4 ++.IX Item "--start-address=address" ++Start displaying data at the specified address. This affects the output ++of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. ++.IP "\fB\-\-stop\-address=\fR\fIaddress\fR" 4 ++.IX Item "--stop-address=address" ++Stop displaying data at the specified address. This affects the output ++of the \fB\-d\fR, \fB\-r\fR and \fB\-s\fR options. ++.IP "\fB\-t\fR" 4 ++.IX Item "-t" ++.PD 0 ++.IP "\fB\-\-syms\fR" 4 ++.IX Item "--syms" ++.PD ++Print the symbol table entries of the file. ++This is similar to the information provided by the \fBnm\fR program, ++although the display format is different. The format of the output ++depends upon the format of the file being dumped, but there are two main ++types. One looks like this: ++.Sp ++.Vb 2 ++\& [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss ++\& [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred ++.Ve ++.Sp ++where the number inside the square brackets is the number of the entry ++in the symbol table, the \fIsec\fR number is the section number, the ++\&\fIfl\fR value are the symbol's flag bits, the \fIty\fR number is the ++symbol's type, the \fIscl\fR number is the symbol's storage class and ++the \fInx\fR value is the number of auxilary entries associated with ++the symbol. The last two fields are the symbol's value and its name. ++.Sp ++The other common output format, usually seen with \s-1ELF\s0 based files, ++looks like this: ++.Sp ++.Vb 2 ++\& 00000000 l d .bss 00000000 .bss ++\& 00000000 g .text 00000000 fred ++.Ve ++.Sp ++Here the first number is the symbol's value (sometimes refered to as ++its address). The next field is actually a set of characters and ++spaces indicating the flag bits that are set on the symbol. These ++characters are described below. Next is the section with which the ++symbol is associated or \fI*ABS*\fR if the section is absolute (ie ++not connected with any section), or \fI*UND*\fR if the section is ++referenced in the file being dumped, but not defined there. ++.Sp ++After the section name comes another field, a number, which for common ++symbols is the alignment and for other symbol is the size. Finally ++the symbol's name is displayed. ++.Sp ++The flag characters are divided into 7 groups as follows: ++.RS 4 ++.ie n .IP """l""" 4 ++.el .IP "\f(CWl\fR" 4 ++.IX Item "l" ++.PD 0 ++.ie n .IP """g""" 4 ++.el .IP "\f(CWg\fR" 4 ++.IX Item "g" ++.ie n .IP """u""" 4 ++.el .IP "\f(CWu\fR" 4 ++.IX Item "u" ++.ie n .IP """!""" 4 ++.el .IP "\f(CW!\fR" 4 ++.IX Item "!" ++.PD ++The symbol is a local (l), global (g), unique global (u), neither ++global nor local (a space) or both global and local (!). A ++symbol can be neither local or global for a variety of reasons, e.g., ++because it is used for debugging, but it is probably an indication of ++a bug if it is ever both local and global. Unique global symbols are ++a \s-1GNU\s0 extension to the standard set of \s-1ELF\s0 symbol bindings. For such ++a symbol the dynamic linker will make sure that in the entire process ++there is just one symbol with this name and type in use. ++.ie n .IP """w""" 4 ++.el .IP "\f(CWw\fR" 4 ++.IX Item "w" ++The symbol is weak (w) or strong (a space). ++.ie n .IP """C""" 4 ++.el .IP "\f(CWC\fR" 4 ++.IX Item "C" ++The symbol denotes a constructor (C) or an ordinary symbol (a space). ++.ie n .IP """W""" 4 ++.el .IP "\f(CWW\fR" 4 ++.IX Item "W" ++The symbol is a warning (W) or a normal symbol (a space). A warning ++symbol's name is a message to be displayed if the symbol following the ++warning symbol is ever referenced. ++.ie n .IP """I""" 4 ++.el .IP "\f(CWI\fR" 4 ++.IX Item "I" ++.PD 0 ++.ie n .IP """i""" 4 ++.el .IP "\f(CWi\fR" 4 ++.IX Item "i" ++.PD ++The symbol is an indirect reference to another symbol (I), a function ++to be evaluated during reloc processing (i) or a normal symbol (a ++space). ++.ie n .IP """d""" 4 ++.el .IP "\f(CWd\fR" 4 ++.IX Item "d" ++.PD 0 ++.ie n .IP """D""" 4 ++.el .IP "\f(CWD\fR" 4 ++.IX Item "D" ++.PD ++The symbol is a debugging symbol (d) or a dynamic symbol (D) or a ++normal symbol (a space). ++.ie n .IP """F""" 4 ++.el .IP "\f(CWF\fR" 4 ++.IX Item "F" ++.PD 0 ++.ie n .IP """f""" 4 ++.el .IP "\f(CWf\fR" 4 ++.IX Item "f" ++.ie n .IP """O""" 4 ++.el .IP "\f(CWO\fR" 4 ++.IX Item "O" ++.PD ++The symbol is the name of a function (F) or a file (f) or an object ++(O) or just a normal symbol (a space). ++.RE ++.RS 4 ++.RE ++.IP "\fB\-T\fR" 4 ++.IX Item "-T" ++.PD 0 ++.IP "\fB\-\-dynamic\-syms\fR" 4 ++.IX Item "--dynamic-syms" ++.PD ++Print the dynamic symbol table entries of the file. This is only ++meaningful for dynamic objects, such as certain types of shared ++libraries. This is similar to the information provided by the \fBnm\fR ++program when given the \fB\-D\fR (\fB\-\-dynamic\fR) option. ++.Sp ++The output format is similar to that produced by the \fB\-\-syms\fR ++option, except that an extra field is inserted before the symbol's ++name, giving the version information associated with the symbol. ++If the version is the default version to be used when resolving ++unversioned references to the symbol then it's displayed as is, ++otherwise it's put into parentheses. ++.IP "\fB\-\-special\-syms\fR" 4 ++.IX Item "--special-syms" ++When displaying symbols include those which the target considers to be ++special in some way and which would not normally be of interest to the ++user. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Print the version number of \fBobjdump\fR and exit. ++.IP "\fB\-x\fR" 4 ++.IX Item "-x" ++.PD 0 ++.IP "\fB\-\-all\-headers\fR" 4 ++.IX Item "--all-headers" ++.PD ++Display all available header information, including the symbol table and ++relocation entries. Using \fB\-x\fR is equivalent to specifying all of ++\&\fB\-a \-f \-h \-p \-r \-t\fR. ++.IP "\fB\-w\fR" 4 ++.IX Item "-w" ++.PD 0 ++.IP "\fB\-\-wide\fR" 4 ++.IX Item "--wide" ++.PD ++Format some lines for output devices that have more than 80 columns. ++Also do not truncate symbol names when they are displayed. ++.IP "\fB\-z\fR" 4 ++.IX Item "-z" ++.PD 0 ++.IP "\fB\-\-disassemble\-zeroes\fR" 4 ++.IX Item "--disassemble-zeroes" ++.PD ++Normally the disassembly output will skip blocks of zeroes. This ++option directs the disassembler to disassemble those blocks, just like ++any other data. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBnm\fR\|(1), \fBreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/ranlib.1 b/binutils/doc/ranlib.1 +--- a/binutils/doc/ranlib.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/ranlib.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,227 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "RANLIB 1" ++.TH RANLIB 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++ranlib \- generate an index to an archive ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++ranlib [\fB\-\-plugin\fR \fIname\fR] [\fB\-DhHvVt\fR] \fIarchive\fR ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBranlib\fR generates an index to the contents of an archive and ++stores it in the archive. The index lists each symbol defined by a ++member of an archive that is a relocatable object file. ++.PP ++You may use \fBnm \-s\fR or \fBnm \-\-print\-armap\fR to list this index. ++.PP ++An archive with such an index speeds up linking to the library and ++allows routines in the library to call each other without regard to ++their placement in the archive. ++.PP ++The \s-1GNU\s0 \fBranlib\fR program is another form of \s-1GNU\s0 \fBar\fR; running ++\&\fBranlib\fR is completely equivalent to executing \fBar \-s\fR. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-H\fR" 4 ++.IX Item "-H" ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Show usage information for \fBranlib\fR. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Show the version number of \fBranlib\fR. ++.IP "\fB\-D\fR" 4 ++.IX Item "-D" ++Operate in \fIdeterministic\fR mode. The symbol map archive member's ++header will show zero for the \s-1UID, GID,\s0 and timestamp. When this ++option is used, multiple runs will produce identical output files. ++.Sp ++If \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by ++default. It can be disabled with the \fB\-U\fR option, described ++below. ++.IP "\fB\-t\fR" 4 ++.IX Item "-t" ++Update the timestamp of the symbol map of an archive. ++.IP "\fB\-U\fR" 4 ++.IX Item "-U" ++Do \fInot\fR operate in \fIdeterministic\fR mode. This is the ++inverse of the \fB\-D\fR option, above: the archive index will get ++actual \s-1UID, GID,\s0 timestamp, and file mode values. ++.Sp ++If \fIbinutils\fR was configured \fIwithout\fR ++\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by ++default. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBar\fR\|(1), \fBnm\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/readelf.1 b/binutils/doc/readelf.1 +--- a/binutils/doc/readelf.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/readelf.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,720 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "READELF 1" ++.TH READELF 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++readelf \- display information about ELF files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++readelf [\fB\-a\fR|\fB\-\-all\fR] ++ [\fB\-h\fR|\fB\-\-file\-header\fR] ++ [\fB\-l\fR|\fB\-\-program\-headers\fR|\fB\-\-segments\fR] ++ [\fB\-S\fR|\fB\-\-section\-headers\fR|\fB\-\-sections\fR] ++ [\fB\-g\fR|\fB\-\-section\-groups\fR] ++ [\fB\-t\fR|\fB\-\-section\-details\fR] ++ [\fB\-e\fR|\fB\-\-headers\fR] ++ [\fB\-s\fR|\fB\-\-syms\fR|\fB\-\-symbols\fR] ++ [\fB\-\-dyn\-syms\fR] ++ [\fB\-n\fR|\fB\-\-notes\fR] ++ [\fB\-r\fR|\fB\-\-relocs\fR] ++ [\fB\-u\fR|\fB\-\-unwind\fR] ++ [\fB\-d\fR|\fB\-\-dynamic\fR] ++ [\fB\-V\fR|\fB\-\-version\-info\fR] ++ [\fB\-A\fR|\fB\-\-arch\-specific\fR] ++ [\fB\-D\fR|\fB\-\-use\-dynamic\fR] ++ [\fB\-x\fR |\fB\-\-hex\-dump=\fR] ++ [\fB\-p\fR |\fB\-\-string\-dump=\fR] ++ [\fB\-R\fR |\fB\-\-relocated\-dump=\fR] ++ [\fB\-z\fR|\fB\-\-decompress\fR] ++ [\fB\-c\fR|\fB\-\-archive\-index\fR] ++ [\fB\-w[lLiaprmfFsoRtUuTgAckK]\fR| ++ \fB\-\-debug\-dump\fR[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow\-links]] ++ [\fB\-\-dwarf\-depth=\fR\fIn\fR] ++ [\fB\-\-dwarf\-start=\fR\fIn\fR] ++ [\fB\-\-ctf=\fR\fIsection\fR] ++ [\fB\-\-ctf\-parent=\fR\fIsection\fR] ++ [\fB\-\-ctf\-symbols=\fR\fIsection\fR] ++ [\fB\-\-ctf\-strings=\fR\fIsection\fR] ++ [\fB\-I\fR|\fB\-\-histogram\fR] ++ [\fB\-v\fR|\fB\-\-version\fR] ++ [\fB\-W\fR|\fB\-\-wide\fR] ++ [\fB\-H\fR|\fB\-\-help\fR] ++ \fIelffile\fR... ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object ++files. The options control what particular information to display. ++.PP ++\&\fIelffile\fR... are the object files to be examined. 32\-bit and ++64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files. ++.PP ++This program performs a similar function to \fBobjdump\fR but it ++goes into more detail and it exists independently of the \s-1BFD\s0 ++library, so if there is a bug in \s-1BFD\s0 then readelf will not be ++affected. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The long and short forms of options, shown here as alternatives, are ++equivalent. At least one option besides \fB\-v\fR or \fB\-H\fR must be ++given. ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-all\fR" 4 ++.IX Item "--all" ++.PD ++Equivalent to specifying \fB\-\-file\-header\fR, ++\&\fB\-\-program\-headers\fR, \fB\-\-sections\fR, \fB\-\-symbols\fR, ++\&\fB\-\-relocs\fR, \fB\-\-dynamic\fR, \fB\-\-notes\fR, ++\&\fB\-\-version\-info\fR, \fB\-\-arch\-specific\fR, \fB\-\-unwind\fR, ++\&\fB\-\-section\-groups\fR and \fB\-\-histogram\fR. ++.Sp ++Note \- this option does not enable \fB\-\-use\-dynamic\fR itself, so ++if that option is not present on the command line then dynamic symbols ++and dynamic relocs will not be displayed. ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-\-file\-header\fR" 4 ++.IX Item "--file-header" ++.PD ++Displays the information contained in the \s-1ELF\s0 header at the start of the ++file. ++.IP "\fB\-l\fR" 4 ++.IX Item "-l" ++.PD 0 ++.IP "\fB\-\-program\-headers\fR" 4 ++.IX Item "--program-headers" ++.IP "\fB\-\-segments\fR" 4 ++.IX Item "--segments" ++.PD ++Displays the information contained in the file's segment headers, if it ++has any. ++.IP "\fB\-S\fR" 4 ++.IX Item "-S" ++.PD 0 ++.IP "\fB\-\-sections\fR" 4 ++.IX Item "--sections" ++.IP "\fB\-\-section\-headers\fR" 4 ++.IX Item "--section-headers" ++.PD ++Displays the information contained in the file's section headers, if it ++has any. ++.IP "\fB\-g\fR" 4 ++.IX Item "-g" ++.PD 0 ++.IP "\fB\-\-section\-groups\fR" 4 ++.IX Item "--section-groups" ++.PD ++Displays the information contained in the file's section groups, if it ++has any. ++.IP "\fB\-t\fR" 4 ++.IX Item "-t" ++.PD 0 ++.IP "\fB\-\-section\-details\fR" 4 ++.IX Item "--section-details" ++.PD ++Displays the detailed section information. Implies \fB\-S\fR. ++.IP "\fB\-s\fR" 4 ++.IX Item "-s" ++.PD 0 ++.IP "\fB\-\-symbols\fR" 4 ++.IX Item "--symbols" ++.IP "\fB\-\-syms\fR" 4 ++.IX Item "--syms" ++.PD ++Displays the entries in symbol table section of the file, if it has one. ++If a symbol has version information associated with it then this is ++displayed as well. The version string is displayed as a suffix to the ++symbol name, preceeded by an @ character. For example ++\&\fBfoo@VER_1\fR. If the version is the default version to be used ++when resolving unversioned references to the symbol then it is ++displayed as a suffix preceeded by two @ characters. For example ++\&\fBfoo@@VER_2\fR. ++.IP "\fB\-\-dyn\-syms\fR" 4 ++.IX Item "--dyn-syms" ++Displays the entries in dynamic symbol table section of the file, if it ++has one. The output format is the same as the format used by the ++\&\fB\-\-syms\fR option. ++.IP "\fB\-e\fR" 4 ++.IX Item "-e" ++.PD 0 ++.IP "\fB\-\-headers\fR" 4 ++.IX Item "--headers" ++.PD ++Display all the headers in the file. Equivalent to \fB\-h \-l \-S\fR. ++.IP "\fB\-n\fR" 4 ++.IX Item "-n" ++.PD 0 ++.IP "\fB\-\-notes\fR" 4 ++.IX Item "--notes" ++.PD ++Displays the contents of the \s-1NOTE\s0 segments and/or sections, if any. ++.IP "\fB\-r\fR" 4 ++.IX Item "-r" ++.PD 0 ++.IP "\fB\-\-relocs\fR" 4 ++.IX Item "--relocs" ++.PD ++Displays the contents of the file's relocation section, if it has one. ++.IP "\fB\-u\fR" 4 ++.IX Item "-u" ++.PD 0 ++.IP "\fB\-\-unwind\fR" 4 ++.IX Item "--unwind" ++.PD ++Displays the contents of the file's unwind section, if it has one. Only ++the unwind sections for \s-1IA64 ELF\s0 files, as well as \s-1ARM\s0 unwind tables ++(\f(CW\*(C`.ARM.exidx\*(C'\fR / \f(CW\*(C`.ARM.extab\*(C'\fR) are currently supported. If ++support is not yet implemented for your architecture you could try ++dumping the contents of the \fI.eh_frames\fR section using the ++\&\fB\-\-debug\-dump=frames\fR or \fB\-\-debug\-dump=frames\-interp\fR ++options. ++.IP "\fB\-d\fR" 4 ++.IX Item "-d" ++.PD 0 ++.IP "\fB\-\-dynamic\fR" 4 ++.IX Item "--dynamic" ++.PD ++Displays the contents of the file's dynamic section, if it has one. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\-info\fR" 4 ++.IX Item "--version-info" ++.PD ++Displays the contents of the version sections in the file, it they ++exist. ++.IP "\fB\-A\fR" 4 ++.IX Item "-A" ++.PD 0 ++.IP "\fB\-\-arch\-specific\fR" 4 ++.IX Item "--arch-specific" ++.PD ++Displays architecture-specific information in the file, if there ++is any. ++.IP "\fB\-D\fR" 4 ++.IX Item "-D" ++.PD 0 ++.IP "\fB\-\-use\-dynamic\fR" 4 ++.IX Item "--use-dynamic" ++.PD ++When displaying symbols, this option makes \fBreadelf\fR use the ++symbol hash tables in the file's dynamic section, rather than the ++symbol table sections. ++.Sp ++When displaying relocations, this option makes \fBreadelf\fR ++display the dynamic relocations rather than the static relocations. ++.IP "\fB\-x \fR" 4 ++.IX Item "-x " ++.PD 0 ++.IP "\fB\-\-hex\-dump=\fR" 4 ++.IX Item "--hex-dump=" ++.PD ++Displays the contents of the indicated section as a hexadecimal bytes. ++A number identifies a particular section by index in the section table; ++any other string identifies all sections with that name in the object file. ++.IP "\fB\-R \fR" 4 ++.IX Item "-R " ++.PD 0 ++.IP "\fB\-\-relocated\-dump=\fR" 4 ++.IX Item "--relocated-dump=" ++.PD ++Displays the contents of the indicated section as a hexadecimal ++bytes. A number identifies a particular section by index in the ++section table; any other string identifies all sections with that name ++in the object file. The contents of the section will be relocated ++before they are displayed. ++.IP "\fB\-p \fR" 4 ++.IX Item "-p " ++.PD 0 ++.IP "\fB\-\-string\-dump=\fR" 4 ++.IX Item "--string-dump=" ++.PD ++Displays the contents of the indicated section as printable strings. ++A number identifies a particular section by index in the section table; ++any other string identifies all sections with that name in the object file. ++.IP "\fB\-z\fR" 4 ++.IX Item "-z" ++.PD 0 ++.IP "\fB\-\-decompress\fR" 4 ++.IX Item "--decompress" ++.PD ++Requests that the section(s) being dumped by \fBx\fR, \fBR\fR or ++\&\fBp\fR options are decompressed before being displayed. If the ++section(s) are not compressed then they are displayed as is. ++.IP "\fB\-c\fR" 4 ++.IX Item "-c" ++.PD 0 ++.IP "\fB\-\-archive\-index\fR" 4 ++.IX Item "--archive-index" ++.PD ++Displays the file symbol index information contained in the header part ++of binary archives. Performs the same function as the \fBt\fR ++command to \fBar\fR, but without using the \s-1BFD\s0 library. ++.IP "\fB\-w[lLiaprmfFsoRtUuTgAckK]\fR" 4 ++.IX Item "-w[lLiaprmfFsoRtUuTgAckK]" ++.PD 0 ++.IP "\fB\-\-debug\-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames\-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow\-links]\fR" 4 ++.IX Item "--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links]" ++.PD ++Displays the contents of the \s-1DWARF\s0 debug sections in the file, if any ++are present. Compressed debug sections are automatically decompressed ++(temporarily) before they are displayed. If one or more of the ++optional letters or words follows the switch then only those type(s) ++of data will be dumped. The letters and words refer to the following ++information: ++.RS 4 ++.ie n .IP """a""" 4 ++.el .IP "\f(CWa\fR" 4 ++.IX Item "a" ++.PD 0 ++.ie n .IP """=abbrev""" 4 ++.el .IP "\f(CW=abbrev\fR" 4 ++.IX Item "=abbrev" ++.PD ++Displays the contents of the \fB.debug_abbrev\fR section. ++.ie n .IP """A""" 4 ++.el .IP "\f(CWA\fR" 4 ++.IX Item "A" ++.PD 0 ++.ie n .IP """=addr""" 4 ++.el .IP "\f(CW=addr\fR" 4 ++.IX Item "=addr" ++.PD ++Displays the contents of the \fB.debug_addr\fR section. ++.ie n .IP """c""" 4 ++.el .IP "\f(CWc\fR" 4 ++.IX Item "c" ++.PD 0 ++.ie n .IP """=cu_index""" 4 ++.el .IP "\f(CW=cu_index\fR" 4 ++.IX Item "=cu_index" ++.PD ++Displays the contents of the \fB.debug_cu_index\fR and/or ++\&\fB.debug_tu_index\fR sections. ++.ie n .IP """f""" 4 ++.el .IP "\f(CWf\fR" 4 ++.IX Item "f" ++.PD 0 ++.ie n .IP """=frames""" 4 ++.el .IP "\f(CW=frames\fR" 4 ++.IX Item "=frames" ++.PD ++Display the raw contents of a \fB.debug_frame\fR section. ++.ie n .IP """F""" 4 ++.el .IP "\f(CWF\fR" 4 ++.IX Item "F" ++.PD 0 ++.ie n .IP """=frame\-interp""" 4 ++.el .IP "\f(CW=frame\-interp\fR" 4 ++.IX Item "=frame-interp" ++.PD ++Display the interpreted contents of a \fB.debug_frame\fR section. ++.ie n .IP """g""" 4 ++.el .IP "\f(CWg\fR" 4 ++.IX Item "g" ++.PD 0 ++.ie n .IP """=gdb_index""" 4 ++.el .IP "\f(CW=gdb_index\fR" 4 ++.IX Item "=gdb_index" ++.PD ++Displays the contents of the \fB.gdb_index\fR and/or ++\&\fB.debug_names\fR sections. ++.ie n .IP """i""" 4 ++.el .IP "\f(CWi\fR" 4 ++.IX Item "i" ++.PD 0 ++.ie n .IP """=info""" 4 ++.el .IP "\f(CW=info\fR" 4 ++.IX Item "=info" ++.PD ++Displays the contents of the \fB.debug_info\fR section. Note: the ++output from this option can also be restricted by the use of the ++\&\fB\-\-dwarf\-depth\fR and \fB\-\-dwarf\-start\fR options. ++.ie n .IP """k""" 4 ++.el .IP "\f(CWk\fR" 4 ++.IX Item "k" ++.PD 0 ++.ie n .IP """=links""" 4 ++.el .IP "\f(CW=links\fR" 4 ++.IX Item "=links" ++.PD ++Displays the contents of the \fB.gnu_debuglink\fR and/or ++\&\fB.gnu_debugaltlink\fR sections. Also displays any links to ++separate dwarf object files (dwo), if they are specified by the ++DW_AT_GNU_dwo_name or DW_AT_dwo_name attributes in the ++\&\fB.debug_info\fR section. ++.ie n .IP """K""" 4 ++.el .IP "\f(CWK\fR" 4 ++.IX Item "K" ++.PD 0 ++.ie n .IP """=follow\-links""" 4 ++.el .IP "\f(CW=follow\-links\fR" 4 ++.IX Item "=follow-links" ++.PD ++Display the contents of any selected debug sections that are found in ++linked, separate debug info file(s). This can result in multiple ++versions of the same debug section being displayed if it exists in ++more than one file. ++.Sp ++In addition, when displaying \s-1DWARF\s0 attributes, if a form is found that ++references the separate debug info file, then the referenced contents ++will also be displayed. ++.ie n .IP """l""" 4 ++.el .IP "\f(CWl\fR" 4 ++.IX Item "l" ++.PD 0 ++.ie n .IP """=rawline""" 4 ++.el .IP "\f(CW=rawline\fR" 4 ++.IX Item "=rawline" ++.PD ++Displays the contents of the \fB.debug_line\fR section in a raw ++format. ++.ie n .IP """L""" 4 ++.el .IP "\f(CWL\fR" 4 ++.IX Item "L" ++.PD 0 ++.ie n .IP """=decodedline""" 4 ++.el .IP "\f(CW=decodedline\fR" 4 ++.IX Item "=decodedline" ++.PD ++Displays the interpreted contents of the \fB.debug_line\fR section. ++.ie n .IP """m""" 4 ++.el .IP "\f(CWm\fR" 4 ++.IX Item "m" ++.PD 0 ++.ie n .IP """=macro""" 4 ++.el .IP "\f(CW=macro\fR" 4 ++.IX Item "=macro" ++.PD ++Displays the contents of the \fB.debug_macro\fR and/or ++\&\fB.debug_macinfo\fR sections. ++.ie n .IP """o""" 4 ++.el .IP "\f(CWo\fR" 4 ++.IX Item "o" ++.PD 0 ++.ie n .IP """=loc""" 4 ++.el .IP "\f(CW=loc\fR" 4 ++.IX Item "=loc" ++.PD ++Displays the contents of the \fB.debug_loc\fR and/or ++\&\fB.debug_loclists\fR sections. ++.ie n .IP """p""" 4 ++.el .IP "\f(CWp\fR" 4 ++.IX Item "p" ++.PD 0 ++.ie n .IP """=pubnames""" 4 ++.el .IP "\f(CW=pubnames\fR" 4 ++.IX Item "=pubnames" ++.PD ++Displays the contents of the \fB.debug_pubnames\fR and/or ++\&\fB.debug_gnu_pubnames\fR sections. ++.ie n .IP """r""" 4 ++.el .IP "\f(CWr\fR" 4 ++.IX Item "r" ++.PD 0 ++.ie n .IP """=aranges""" 4 ++.el .IP "\f(CW=aranges\fR" 4 ++.IX Item "=aranges" ++.PD ++Displays the contents of the \fB.debug_aranges\fR section. ++.ie n .IP """R""" 4 ++.el .IP "\f(CWR\fR" 4 ++.IX Item "R" ++.PD 0 ++.ie n .IP """=Ranges""" 4 ++.el .IP "\f(CW=Ranges\fR" 4 ++.IX Item "=Ranges" ++.PD ++Displays the contents of the \fB.debug_ranges\fR and/or ++\&\fB.debug_rnglists\fR sections. ++.ie n .IP """s""" 4 ++.el .IP "\f(CWs\fR" 4 ++.IX Item "s" ++.PD 0 ++.ie n .IP """=str""" 4 ++.el .IP "\f(CW=str\fR" 4 ++.IX Item "=str" ++.PD ++Displays the contents of the \fB.debug_str\fR, \fB.debug_line_str\fR ++and/or \fB.debug_str_offsets\fR sections. ++.ie n .IP """t""" 4 ++.el .IP "\f(CWt\fR" 4 ++.IX Item "t" ++.PD 0 ++.ie n .IP """=pubtype""" 4 ++.el .IP "\f(CW=pubtype\fR" 4 ++.IX Item "=pubtype" ++.PD ++Displays the contents of the \fB.debug_pubtypes\fR and/or ++\&\fB.debug_gnu_pubtypes\fR sections. ++.ie n .IP """T""" 4 ++.el .IP "\f(CWT\fR" 4 ++.IX Item "T" ++.PD 0 ++.ie n .IP """=trace_aranges""" 4 ++.el .IP "\f(CW=trace_aranges\fR" 4 ++.IX Item "=trace_aranges" ++.PD ++Displays the contents of the \fB.trace_aranges\fR section. ++.ie n .IP """u""" 4 ++.el .IP "\f(CWu\fR" 4 ++.IX Item "u" ++.PD 0 ++.ie n .IP """=trace_abbrev""" 4 ++.el .IP "\f(CW=trace_abbrev\fR" 4 ++.IX Item "=trace_abbrev" ++.PD ++Displays the contents of the \fB.trace_abbrev\fR section. ++.ie n .IP """U""" 4 ++.el .IP "\f(CWU\fR" 4 ++.IX Item "U" ++.PD 0 ++.ie n .IP """=trace_info""" 4 ++.el .IP "\f(CW=trace_info\fR" 4 ++.IX Item "=trace_info" ++.PD ++Displays the contents of the \fB.trace_info\fR section. ++.RE ++.RS 4 ++.Sp ++Note: displaying the contents of \fB.debug_static_funcs\fR, ++\&\fB.debug_static_vars\fR and \fBdebug_weaknames\fR sections is not ++currently supported. ++.RE ++.IP "\fB\-\-dwarf\-depth=\fR\fIn\fR" 4 ++.IX Item "--dwarf-depth=n" ++Limit the dump of the \f(CW\*(C`.debug_info\*(C'\fR section to \fIn\fR children. ++This is only useful with \fB\-\-debug\-dump=info\fR. The default is ++to print all DIEs; the special value 0 for \fIn\fR will also have this ++effect. ++.Sp ++With a non-zero value for \fIn\fR, DIEs at or deeper than \fIn\fR ++levels will not be printed. The range for \fIn\fR is zero-based. ++.IP "\fB\-\-dwarf\-start=\fR\fIn\fR" 4 ++.IX Item "--dwarf-start=n" ++Print only DIEs beginning with the \s-1DIE\s0 numbered \fIn\fR. This is only ++useful with \fB\-\-debug\-dump=info\fR. ++.Sp ++If specified, this option will suppress printing of any header ++information and all DIEs before the \s-1DIE\s0 numbered \fIn\fR. Only ++siblings and children of the specified \s-1DIE\s0 will be printed. ++.Sp ++This can be used in conjunction with \fB\-\-dwarf\-depth\fR. ++.IP "\fB\-\-ctf=\fR\fIsection\fR" 4 ++.IX Item "--ctf=section" ++Display the contents of the specified \s-1CTF\s0 section. \s-1CTF\s0 sections themselves ++contain many subsections, all of which are displayed in order. ++.IP "\fB\-\-ctf\-parent=\fR\fIsection\fR" 4 ++.IX Item "--ctf-parent=section" ++Specify the name of another section from which the \s-1CTF\s0 dictionary can inherit ++types. (If none is specified, we assume the \s-1CTF\s0 dictionary inherits types ++from the default-named member of the archive contained within this section.) ++.IP "\fB\-\-ctf\-symbols=\fR\fIsection\fR" 4 ++.IX Item "--ctf-symbols=section" ++.PD 0 ++.IP "\fB\-\-ctf\-strings=\fR\fIsection\fR" 4 ++.IX Item "--ctf-strings=section" ++.PD ++Specify the name of another section from which the \s-1CTF\s0 file can inherit ++strings and symbols. By default, the \f(CW\*(C`.symtab\*(C'\fR and its linked ++string table are used. ++.Sp ++If either of \fB\-\-ctf\-symbols\fR or \fB\-\-ctf\-strings\fR is specified, the ++other must be specified as well. ++.IP "\fB\-I\fR" 4 ++.IX Item "-I" ++.PD 0 ++.IP "\fB\-\-histogram\fR" 4 ++.IX Item "--histogram" ++.PD ++Display a histogram of bucket list lengths when displaying the contents ++of the symbol tables. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Display the version number of readelf. ++.IP "\fB\-W\fR" 4 ++.IX Item "-W" ++.PD 0 ++.IP "\fB\-\-wide\fR" 4 ++.IX Item "--wide" ++.PD ++Don't break output lines to fit into 80 columns. By default ++\&\fBreadelf\fR breaks section header and segment listing lines for ++64\-bit \s-1ELF\s0 files, so that they fit into 80 columns. This option causes ++\&\fBreadelf\fR to print each section header resp. each segment one a ++single line, which is far more readable on terminals wider than 80 columns. ++.IP "\fB\-H\fR" 4 ++.IX Item "-H" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Display the command-line options understood by \fBreadelf\fR. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/size.1 b/binutils/doc/size.1 +--- a/binutils/doc/size.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/size.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,297 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "SIZE 1" ++.TH SIZE 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++size \- list section sizes and total size of binary files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++size [\fB\-A\fR|\fB\-B\fR|\fB\-G\fR|\fB\-\-format=\fR\fIcompatibility\fR] ++ [\fB\-\-help\fR] ++ [\fB\-d\fR|\fB\-o\fR|\fB\-x\fR|\fB\-\-radix=\fR\fInumber\fR] ++ [\fB\-\-common\fR] ++ [\fB\-t\fR|\fB\-\-totals\fR] ++ [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-V\fR|\fB\-\-version\fR] ++ [\fIobjfile\fR...] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++The \s-1GNU\s0 \fBsize\fR utility lists the section sizes and the total ++size for each of the binary files \fIobjfile\fR on its argument list. ++By default, one line of output is generated for each file or each ++module if the file is an archive. ++.PP ++\&\fIobjfile\fR... are the files to be examined. If none are ++specified, the file \f(CW\*(C`a.out\*(C'\fR will be used instead. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++The command-line options have the following meanings: ++.IP "\fB\-A\fR" 4 ++.IX Item "-A" ++.PD 0 ++.IP "\fB\-B\fR" 4 ++.IX Item "-B" ++.IP "\fB\-G\fR" 4 ++.IX Item "-G" ++.IP "\fB\-\-format=\fR\fIcompatibility\fR" 4 ++.IX Item "--format=compatibility" ++.PD ++Using one of these options, you can choose whether the output from \s-1GNU\s0 ++\&\fBsize\fR resembles output from System V \fBsize\fR (using \fB\-A\fR, ++or \fB\-\-format=sysv\fR), or Berkeley \fBsize\fR (using \fB\-B\fR, or ++\&\fB\-\-format=berkeley\fR). The default is the one-line format similar to ++Berkeley's. Alternatively, you can choose the \s-1GNU\s0 format output ++(using \fB\-G\fR, or \fB\-\-format=gnu\fR), this is similar to ++Berkeley's output format, but sizes are counted differently. ++.Sp ++Here is an example of the Berkeley (default) format of output from ++\&\fBsize\fR: ++.Sp ++.Vb 4 ++\& $ size \-\-format=Berkeley ranlib size ++\& text data bss dec hex filename ++\& 294880 81920 11592 388392 5ed28 ranlib ++\& 294880 81920 11888 388688 5ee50 size ++.Ve ++.Sp ++The Berkeley style output counts read only data in the \f(CW\*(C`text\*(C'\fR ++column, not in the \f(CW\*(C`data\*(C'\fR column, the \f(CW\*(C`dec\*(C'\fR and \f(CW\*(C`hex\*(C'\fR ++columns both display the sum of the \f(CW\*(C`text\*(C'\fR, \f(CW\*(C`data\*(C'\fR, and ++\&\f(CW\*(C`bss\*(C'\fR columns in decimal and hexadecimal respectively. ++.Sp ++The \s-1GNU\s0 format counts read only data in the \f(CW\*(C`data\*(C'\fR column, not ++the \f(CW\*(C`text\*(C'\fR column, and only displays the sum of the \f(CW\*(C`text\*(C'\fR, ++\&\f(CW\*(C`data\*(C'\fR, and \f(CW\*(C`bss\*(C'\fR columns once, in the \f(CW\*(C`total\*(C'\fR column. ++The \fB\-\-radix\fR option can be used to change the number base for ++all columns. Here is the same data displayed with \s-1GNU\s0 conventions: ++.Sp ++.Vb 4 ++\& $ size \-\-format=GNU ranlib size ++\& text data bss total filename ++\& 279880 96920 11592 388392 ranlib ++\& 279880 96920 11888 388688 size ++.Ve ++.Sp ++This is the same data, but displayed closer to System V conventions: ++.Sp ++.Vb 7 ++\& $ size \-\-format=SysV ranlib size ++\& ranlib : ++\& section size addr ++\& .text 294880 8192 ++\& .data 81920 303104 ++\& .bss 11592 385024 ++\& Total 388392 ++\& ++\& ++\& size : ++\& section size addr ++\& .text 294880 8192 ++\& .data 81920 303104 ++\& .bss 11888 385024 ++\& Total 388688 ++.Ve ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++Show a summary of acceptable arguments and options. ++.IP "\fB\-d\fR" 4 ++.IX Item "-d" ++.PD 0 ++.IP "\fB\-o\fR" 4 ++.IX Item "-o" ++.IP "\fB\-x\fR" 4 ++.IX Item "-x" ++.IP "\fB\-\-radix=\fR\fInumber\fR" 4 ++.IX Item "--radix=number" ++.PD ++Using one of these options, you can control whether the size of each ++section is given in decimal (\fB\-d\fR, or \fB\-\-radix=10\fR); octal ++(\fB\-o\fR, or \fB\-\-radix=8\fR); or hexadecimal (\fB\-x\fR, or ++\&\fB\-\-radix=16\fR). In \fB\-\-radix=\fR\fInumber\fR, only the three ++values (8, 10, 16) are supported. The total size is always given in two ++radices; decimal and hexadecimal for \fB\-d\fR or \fB\-x\fR output, or ++octal and hexadecimal if you're using \fB\-o\fR. ++.IP "\fB\-\-common\fR" 4 ++.IX Item "--common" ++Print total size of common symbols in each file. When using Berkeley ++or \s-1GNU\s0 format these are included in the bss size. ++.IP "\fB\-t\fR" 4 ++.IX Item "-t" ++.PD 0 ++.IP "\fB\-\-totals\fR" 4 ++.IX Item "--totals" ++.PD ++Show totals of all objects listed (Berkeley or \s-1GNU\s0 format mode only). ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++Specify that the object-code format for \fIobjfile\fR is ++\&\fIbfdname\fR. This option may not be necessary; \fBsize\fR can ++automatically recognize many formats. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Display the version number of \fBsize\fR. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBar\fR\|(1), \fBobjdump\fR\|(1), \fBreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/strings.1 b/binutils/doc/strings.1 +--- a/binutils/doc/strings.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/strings.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,315 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "STRINGS 1" ++.TH STRINGS 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++strings \- print the sequences of printable characters in files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++strings [\fB\-afovV\fR] [\fB\-\fR\fImin-len\fR] ++ [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR] ++ [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR] ++ [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR] ++ [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR] ++ [\fB\-T\fR \fIbfdname\fR] [\fB\-\-target=\fR\fIbfdname\fR] ++ [\fB\-w\fR] [\fB\-\-include\-all\-whitespace\fR] ++ [\fB\-s\fR] [\fB\-\-output\-separator\fR\fIsep_string\fR] ++ [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR... ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++For each \fIfile\fR given, \s-1GNU\s0 \fBstrings\fR prints the ++printable character sequences that are at least 4 characters long (or ++the number given with the options below) and are followed by an ++unprintable character. ++.PP ++Depending upon how the strings program was configured it will default ++to either displaying all the printable sequences that it can find in ++each file, or only those sequences that are in loadable, initialized ++data sections. If the file type in unrecognizable, or if strings is ++reading from stdin then it will always display all of the printable ++sequences that it can find. ++.PP ++For backwards compatibility any file that occurs after a command-line ++option of just \fB\-\fR will also be scanned in full, regardless of ++the presence of any \fB\-d\fR option. ++.PP ++\&\fBstrings\fR is mainly useful for determining the contents of ++non-text files. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-all\fR" 4 ++.IX Item "--all" ++.IP "\fB\-\fR" 4 ++.IX Item "-" ++.PD ++Scan the whole file, regardless of what sections it contains or ++whether those sections are loaded or initialized. Normally this is ++the default behaviour, but strings can be configured so that the ++\&\fB\-d\fR is the default instead. ++.Sp ++The \fB\-\fR option is position dependent and forces strings to ++perform full scans of any file that is mentioned after the \fB\-\fR ++on the command line, even if the \fB\-d\fR option has been ++specified. ++.IP "\fB\-d\fR" 4 ++.IX Item "-d" ++.PD 0 ++.IP "\fB\-\-data\fR" 4 ++.IX Item "--data" ++.PD ++Only print strings from initialized, loaded data sections in the ++file. This may reduce the amount of garbage in the output, but it ++also exposes the strings program to any security flaws that may be ++present in the \s-1BFD\s0 library used to scan and load sections. Strings ++can be configured so that this option is the default behaviour. In ++such cases the \fB\-a\fR option can be used to avoid using the \s-1BFD\s0 ++library and instead just print all of the strings found in the file. ++.IP "\fB\-f\fR" 4 ++.IX Item "-f" ++.PD 0 ++.IP "\fB\-\-print\-file\-name\fR" 4 ++.IX Item "--print-file-name" ++.PD ++Print the name of the file before each string. ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++Print a summary of the program usage on the standard output and exit. ++.IP "\fB\-\fR\fImin-len\fR" 4 ++.IX Item "-min-len" ++.PD 0 ++.IP "\fB\-n\fR \fImin-len\fR" 4 ++.IX Item "-n min-len" ++.IP "\fB\-\-bytes=\fR\fImin-len\fR" 4 ++.IX Item "--bytes=min-len" ++.PD ++Print sequences of characters that are at least \fImin-len\fR characters ++long, instead of the default 4. ++.IP "\fB\-o\fR" 4 ++.IX Item "-o" ++Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR ++act like \fB\-t d\fR instead. Since we can not be compatible with both ++ways, we simply chose one. ++.IP "\fB\-t\fR \fIradix\fR" 4 ++.IX Item "-t radix" ++.PD 0 ++.IP "\fB\-\-radix=\fR\fIradix\fR" 4 ++.IX Item "--radix=radix" ++.PD ++Print the offset within the file before each string. The single ++character argument specifies the radix of the offset\-\-\-\fBo\fR for ++octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal. ++.IP "\fB\-e\fR \fIencoding\fR" 4 ++.IX Item "-e encoding" ++.PD 0 ++.IP "\fB\-\-encoding=\fR\fIencoding\fR" 4 ++.IX Item "--encoding=encoding" ++.PD ++Select the character encoding of the strings that are to be found. ++Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte ++characters (\s-1ASCII, ISO 8859,\s0 etc., default), \fBS\fR = ++single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = ++16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit ++littleendian. Useful for finding wide character strings. (\fBl\fR ++and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings). ++.IP "\fB\-T\fR \fIbfdname\fR" 4 ++.IX Item "-T bfdname" ++.PD 0 ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++.PD ++Specify an object code format other than your system's default format. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Print the program version number on the standard output and exit. ++.IP "\fB\-w\fR" 4 ++.IX Item "-w" ++.PD 0 ++.IP "\fB\-\-include\-all\-whitespace\fR" 4 ++.IX Item "--include-all-whitespace" ++.PD ++By default tab and space characters are included in the strings that ++are displayed, but other whitespace characters, such a newlines and ++carriage returns, are not. The \fB\-w\fR option changes this so ++that all whitespace characters are considered to be part of a string. ++.IP "\fB\-s\fR" 4 ++.IX Item "-s" ++.PD 0 ++.IP "\fB\-\-output\-separator\fR" 4 ++.IX Item "--output-separator" ++.PD ++By default, output strings are delimited by a new-line. This option ++allows you to supply any string to be used as the output record ++separator. Useful with \-\-include\-all\-whitespace where strings ++may contain new-lines internally. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++\&\fBar\fR\|(1), \fBnm\fR\|(1), \fBobjdump\fR\|(1), \fBranlib\fR\|(1), \fBreadelf\fR\|(1) ++and the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/strip.1 b/binutils/doc/strip.1 +--- a/binutils/doc/strip.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/strip.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,502 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "STRIP 1" ++.TH STRIP 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++strip \- discard symbols and other data from object files ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR] ++ [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR] ++ [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR] ++ [\fB\-s\fR|\fB\-\-strip\-all\fR] ++ [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR] ++ [\fB\-\-strip\-dwo\fR] ++ [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-M\fR|\fB\-\-merge\-notes\fR][\fB\-\-no\-merge\-notes\fR] ++ [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] ++ [\fB\-w\fR|\fB\-\-wildcard\fR] ++ [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR] ++ [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR] ++ [\fB\-\-keep\-section=\fR\fIsectionpattern\fR] ++ [\fB\-\-remove\-relocations=\fR\fIsectionpattern\fR] ++ [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] ++ [\fB\-D\fR|\fB\-\-enable\-deterministic\-archives\fR] ++ [\fB\-U\fR|\fB\-\-disable\-deterministic\-archives\fR] ++ [\fB\-\-keep\-file\-symbols\fR] ++ [\fB\-\-only\-keep\-debug\fR] ++ [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] ++ [\fB\-\-help\fR] [\fB\-\-info\fR] ++ \fIobjfile\fR... ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\s-1GNU\s0 \fBstrip\fR discards all symbols from object files ++\&\fIobjfile\fR. The list of object files may include archives. ++At least one object file must be given. ++.PP ++\&\fBstrip\fR modifies the files named in its argument, ++rather than writing modified copies under different names. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fB\-F\fR \fIbfdname\fR" 4 ++.IX Item "-F bfdname" ++.PD 0 ++.IP "\fB\-\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--target=bfdname" ++.PD ++Treat the original \fIobjfile\fR as a file with the object ++code format \fIbfdname\fR, and rewrite it in the same format. ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++Show a summary of the options to \fBstrip\fR and exit. ++.IP "\fB\-\-info\fR" 4 ++.IX Item "--info" ++Display a list showing all architectures and object formats available. ++.IP "\fB\-I\fR \fIbfdname\fR" 4 ++.IX Item "-I bfdname" ++.PD 0 ++.IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--input-target=bfdname" ++.PD ++Treat the original \fIobjfile\fR as a file with the object ++code format \fIbfdname\fR. ++.IP "\fB\-O\fR \fIbfdname\fR" 4 ++.IX Item "-O bfdname" ++.PD 0 ++.IP "\fB\-\-output\-target=\fR\fIbfdname\fR" 4 ++.IX Item "--output-target=bfdname" ++.PD ++Replace \fIobjfile\fR with a file in the output format \fIbfdname\fR. ++.IP "\fB\-R\fR \fIsectionname\fR" 4 ++.IX Item "-R sectionname" ++.PD 0 ++.IP "\fB\-\-remove\-section=\fR\fIsectionname\fR" 4 ++.IX Item "--remove-section=sectionname" ++.PD ++Remove any section named \fIsectionname\fR from the output file, in ++addition to whatever sections would otherwise be removed. This ++option may be given more than once. Note that using this option ++inappropriately may make the output file unusable. The wildcard ++character \fB*\fR may be given at the end of \fIsectionname\fR. If ++so, then any section starting with \fIsectionname\fR will be removed. ++.Sp ++If the first character of \fIsectionpattern\fR is the exclamation ++point (!) then matching sections will not be removed even if an ++earlier use of \fB\-\-remove\-section\fR on the same command line ++would otherwise remove it. For example: ++.Sp ++.Vb 1 ++\& \-\-remove\-section=.text.* \-\-remove\-section=!.text.foo ++.Ve ++.Sp ++will remove all sections matching the pattern '.text.*', but will not ++remove the section '.text.foo'. ++.IP "\fB\-\-keep\-section=\fR\fIsectionpattern\fR" 4 ++.IX Item "--keep-section=sectionpattern" ++When removing sections from the output file, keep sections that match ++\&\fIsectionpattern\fR. ++.IP "\fB\-\-remove\-relocations=\fR\fIsectionpattern\fR" 4 ++.IX Item "--remove-relocations=sectionpattern" ++Remove relocations from the output file for any section matching ++\&\fIsectionpattern\fR. This option may be given more than once. Note ++that using this option inappropriately may make the output file ++unusable. Wildcard characters are accepted in \fIsectionpattern\fR. ++For example: ++.Sp ++.Vb 1 ++\& \-\-remove\-relocations=.text.* ++.Ve ++.Sp ++will remove the relocations for all sections matching the patter ++\&'.text.*'. ++.Sp ++If the first character of \fIsectionpattern\fR is the exclamation ++point (!) then matching sections will not have their relocation ++removed even if an earlier use of \fB\-\-remove\-relocations\fR on the ++same command line would otherwise cause the relocations to be removed. ++For example: ++.Sp ++.Vb 1 ++\& \-\-remove\-relocations=.text.* \-\-remove\-relocations=!.text.foo ++.Ve ++.Sp ++will remove all relocations for sections matching the pattern ++\&'.text.*', but will not remove relocations for the section ++\&'.text.foo'. ++.IP "\fB\-s\fR" 4 ++.IX Item "-s" ++.PD 0 ++.IP "\fB\-\-strip\-all\fR" 4 ++.IX Item "--strip-all" ++.PD ++Remove all symbols. ++.IP "\fB\-g\fR" 4 ++.IX Item "-g" ++.PD 0 ++.IP "\fB\-S\fR" 4 ++.IX Item "-S" ++.IP "\fB\-d\fR" 4 ++.IX Item "-d" ++.IP "\fB\-\-strip\-debug\fR" 4 ++.IX Item "--strip-debug" ++.PD ++Remove debugging symbols only. ++.IP "\fB\-\-strip\-dwo\fR" 4 ++.IX Item "--strip-dwo" ++Remove the contents of all \s-1DWARF\s0 .dwo sections, leaving the ++remaining debugging sections and all symbols intact. ++See the description of this option in the \fBobjcopy\fR section ++for more information. ++.IP "\fB\-\-strip\-unneeded\fR" 4 ++.IX Item "--strip-unneeded" ++Remove all symbols that are not needed for relocation processing. ++.IP "\fB\-K\fR \fIsymbolname\fR" 4 ++.IX Item "-K symbolname" ++.PD 0 ++.IP "\fB\-\-keep\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--keep-symbol=symbolname" ++.PD ++When stripping symbols, keep symbol \fIsymbolname\fR even if it would ++normally be stripped. This option may be given more than once. ++.IP "\fB\-M\fR" 4 ++.IX Item "-M" ++.PD 0 ++.IP "\fB\-\-merge\-notes\fR" 4 ++.IX Item "--merge-notes" ++.IP "\fB\-\-no\-merge\-notes\fR" 4 ++.IX Item "--no-merge-notes" ++.PD ++For \s-1ELF\s0 files, attempt (or do not attempt) to reduce the size of any ++\&\s-1SHT_NOTE\s0 type sections by removing duplicate notes. The default is to ++attempt this reduction unless stripping debug or \s-1DWO\s0 information. ++.IP "\fB\-N\fR \fIsymbolname\fR" 4 ++.IX Item "-N symbolname" ++.PD 0 ++.IP "\fB\-\-strip\-symbol=\fR\fIsymbolname\fR" 4 ++.IX Item "--strip-symbol=symbolname" ++.PD ++Remove symbol \fIsymbolname\fR from the source file. This option may be ++given more than once, and may be combined with strip options other than ++\&\fB\-K\fR. ++.IP "\fB\-o\fR \fIfile\fR" 4 ++.IX Item "-o file" ++Put the stripped output in \fIfile\fR, rather than replacing the ++existing file. When this argument is used, only one \fIobjfile\fR ++argument may be specified. ++.IP "\fB\-p\fR" 4 ++.IX Item "-p" ++.PD 0 ++.IP "\fB\-\-preserve\-dates\fR" 4 ++.IX Item "--preserve-dates" ++.PD ++Preserve the access and modification dates of the file. ++.IP "\fB\-D\fR" 4 ++.IX Item "-D" ++.PD 0 ++.IP "\fB\-\-enable\-deterministic\-archives\fR" 4 ++.IX Item "--enable-deterministic-archives" ++.PD ++Operate in \fIdeterministic\fR mode. When copying archive members ++and writing the archive index, use zero for UIDs, GIDs, timestamps, ++and use consistent file modes for all files. ++.Sp ++If \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR, then this mode is on by default. ++It can be disabled with the \fB\-U\fR option, below. ++.IP "\fB\-U\fR" 4 ++.IX Item "-U" ++.PD 0 ++.IP "\fB\-\-disable\-deterministic\-archives\fR" 4 ++.IX Item "--disable-deterministic-archives" ++.PD ++Do \fInot\fR operate in \fIdeterministic\fR mode. This is the ++inverse of the \fB\-D\fR option, above: when copying archive members ++and writing the archive index, use their actual \s-1UID, GID,\s0 timestamp, ++and file mode values. ++.Sp ++This is the default unless \fIbinutils\fR was configured with ++\&\fB\-\-enable\-deterministic\-archives\fR. ++.IP "\fB\-w\fR" 4 ++.IX Item "-w" ++.PD 0 ++.IP "\fB\-\-wildcard\fR" 4 ++.IX Item "--wildcard" ++.PD ++Permit regular expressions in \fIsymbolname\fRs used in other command ++line options. The question mark (?), asterisk (*), backslash (\e) and ++square brackets ([]) operators can be used anywhere in the symbol ++name. If the first character of the symbol name is the exclamation ++point (!) then the sense of the switch is reversed for that symbol. ++For example: ++.Sp ++.Vb 1 ++\& \-w \-K !foo \-K fo* ++.Ve ++.Sp ++would cause strip to only keep symbols that start with the letters ++\&\*(L"fo\*(R", but to discard the symbol \*(L"foo\*(R". ++.IP "\fB\-x\fR" 4 ++.IX Item "-x" ++.PD 0 ++.IP "\fB\-\-discard\-all\fR" 4 ++.IX Item "--discard-all" ++.PD ++Remove non-global symbols. ++.IP "\fB\-X\fR" 4 ++.IX Item "-X" ++.PD 0 ++.IP "\fB\-\-discard\-locals\fR" 4 ++.IX Item "--discard-locals" ++.PD ++Remove compiler-generated local symbols. ++(These usually start with \fBL\fR or \fB.\fR.) ++.IP "\fB\-\-keep\-file\-symbols\fR" 4 ++.IX Item "--keep-file-symbols" ++When stripping a file, perhaps with \fB\-\-strip\-debug\fR or ++\&\fB\-\-strip\-unneeded\fR, retain any symbols specifying source file names, ++which would otherwise get stripped. ++.IP "\fB\-\-only\-keep\-debug\fR" 4 ++.IX Item "--only-keep-debug" ++Strip a file, emptying the contents of any sections that would not be ++stripped by \fB\-\-strip\-debug\fR and leaving the debugging sections ++intact. In \s-1ELF\s0 files, this preserves all the note sections in the ++output as well. ++.Sp ++Note \- the section headers of the stripped sections are preserved, ++including their sizes, but the contents of the section are discarded. ++The section headers are preserved so that other tools can match up the ++debuginfo file with the real executable, even if that executable has ++been relocated to a different address space. ++.Sp ++The intention is that this option will be used in conjunction with ++\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a ++stripped binary which will occupy less space in \s-1RAM\s0 and in a ++distribution and the second a debugging information file which is only ++needed if debugging abilities are required. The suggested procedure ++to create these files is as follows: ++.RS 4 ++.IP "1." 4 ++.IX Item "1." ++\&\f(CW\*(C`foo\*(C'\fR then... ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++create a file containing the debugging info. ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++stripped executable. ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++to add a link to the debugging info into the stripped executable. ++.RE ++.RS 4 ++.Sp ++Note\-\-\-the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info ++file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is ++optional. You could instead do this: ++.IP "1." 4 ++.IX Item "1." ++.PD 0 ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++.ie n .IP "1." 4 ++.el .IP "1." 4 ++.IX Item "1." ++.RE ++.RS 4 ++.PD ++.Sp ++i.e., the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the ++full executable. It does not have to be a file created by the ++\&\fB\-\-only\-keep\-debug\fR switch. ++.Sp ++Note\-\-\-this switch is only intended for use on fully linked files. It ++does not make sense to use it on object files where the debugging ++information may be incomplete. Besides the gnu_debuglink feature ++currently only supports the presence of one filename containing ++debugging information, not multiple filenames on a one-per-object-file ++basis. ++.RE ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Show the version number for \fBstrip\fR. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-\-verbose\fR" 4 ++.IX Item "--verbose" ++.PD ++Verbose output: list all object files modified. In the case of ++archives, \fBstrip \-v\fR lists all members of the archive. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/windmc.1 b/binutils/doc/windmc.1 +--- a/binutils/doc/windmc.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/windmc.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,360 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "WINDMC 1" ++.TH WINDMC 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++windmc \- generates Windows message resources ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++windmc [options] input-file ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBwindmc\fR reads message definitions from an input file (.mc) and ++translate them into a set of output files. The output files may be of ++four kinds: ++.ie n .IP """h""" 4 ++.el .IP "\f(CWh\fR" 4 ++.IX Item "h" ++A C header file containing the message definitions. ++.ie n .IP """rc""" 4 ++.el .IP "\f(CWrc\fR" 4 ++.IX Item "rc" ++A resource file compilable by the \fBwindres\fR tool. ++.ie n .IP """bin""" 4 ++.el .IP "\f(CWbin\fR" 4 ++.IX Item "bin" ++One or more binary files containing the resource data for a specific ++message language. ++.ie n .IP """dbg""" 4 ++.el .IP "\f(CWdbg\fR" 4 ++.IX Item "dbg" ++A C include file that maps message id's to their symbolic name. ++.PP ++The exact description of these different formats is available in ++documentation from Microsoft. ++.PP ++When \fBwindmc\fR converts from the \f(CW\*(C`mc\*(C'\fR format to the \f(CW\*(C`bin\*(C'\fR ++format, \f(CW\*(C`rc\*(C'\fR, \f(CW\*(C`h\*(C'\fR, and optional \f(CW\*(C`dbg\*(C'\fR it is acting like the ++Windows Message Compiler. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fB\-a\fR" 4 ++.IX Item "-a" ++.PD 0 ++.IP "\fB\-\-ascii_in\fR" 4 ++.IX Item "--ascii_in" ++.PD ++Specifies that the input file specified is \s-1ASCII.\s0 This is the default ++behaviour. ++.IP "\fB\-A\fR" 4 ++.IX Item "-A" ++.PD 0 ++.IP "\fB\-\-ascii_out\fR" 4 ++.IX Item "--ascii_out" ++.PD ++Specifies that messages in the output \f(CW\*(C`bin\*(C'\fR files should be in \s-1ASCII\s0 ++format. ++.IP "\fB\-b\fR" 4 ++.IX Item "-b" ++.PD 0 ++.IP "\fB\-\-binprefix\fR" 4 ++.IX Item "--binprefix" ++.PD ++Specifies that \f(CW\*(C`bin\*(C'\fR filenames should have to be prefixed by the ++basename of the source file. ++.IP "\fB\-c\fR" 4 ++.IX Item "-c" ++.PD 0 ++.IP "\fB\-\-customflag\fR" 4 ++.IX Item "--customflag" ++.PD ++Sets the customer bit in all message id's. ++.IP "\fB\-C\fR \fIcodepage\fR" 4 ++.IX Item "-C codepage" ++.PD 0 ++.IP "\fB\-\-codepage_in\fR \fIcodepage\fR" 4 ++.IX Item "--codepage_in codepage" ++.PD ++Sets the default codepage to be used to convert input file to \s-1UTF16.\s0 The ++default is ocdepage 1252. ++.IP "\fB\-d\fR" 4 ++.IX Item "-d" ++.PD 0 ++.IP "\fB\-\-decimal_values\fR" 4 ++.IX Item "--decimal_values" ++.PD ++Outputs the constants in the header file in decimal. Default is using ++hexadecimal output. ++.IP "\fB\-e\fR \fIext\fR" 4 ++.IX Item "-e ext" ++.PD 0 ++.IP "\fB\-\-extension\fR \fIext\fR" 4 ++.IX Item "--extension ext" ++.PD ++The extension for the header file. The default is .h extension. ++.IP "\fB\-F\fR \fItarget\fR" 4 ++.IX Item "-F target" ++.PD 0 ++.IP "\fB\-\-target\fR \fItarget\fR" 4 ++.IX Item "--target target" ++.PD ++Specify the \s-1BFD\s0 format to use for a bin file as output. This ++is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list ++of supported targets. Normally \fBwindmc\fR will use the default ++format, which is the first one listed by the \fB\-\-help\fR option. ++.IP "\fB\-h\fR \fIpath\fR" 4 ++.IX Item "-h path" ++.PD 0 ++.IP "\fB\-\-headerdir\fR \fIpath\fR" 4 ++.IX Item "--headerdir path" ++.PD ++The target directory of the generated header file. The default is the ++current directory. ++.IP "\fB\-H\fR" 4 ++.IX Item "-H" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Displays a list of command-line options and then exits. ++.IP "\fB\-m\fR \fIcharacters\fR" 4 ++.IX Item "-m characters" ++.PD 0 ++.IP "\fB\-\-maxlength\fR \fIcharacters\fR" 4 ++.IX Item "--maxlength characters" ++.PD ++Instructs \fBwindmc\fR to generate a warning if the length ++of any message exceeds the number specified. ++.IP "\fB\-n\fR" 4 ++.IX Item "-n" ++.PD 0 ++.IP "\fB\-\-nullterminate\fR" 4 ++.IX Item "--nullterminate" ++.PD ++Terminate message text in \f(CW\*(C`bin\*(C'\fR files by zero. By default they are ++terminated by \s-1CR/LF.\s0 ++.IP "\fB\-o\fR" 4 ++.IX Item "-o" ++.PD 0 ++.IP "\fB\-\-hresult_use\fR" 4 ++.IX Item "--hresult_use" ++.PD ++Not yet implemented. Instructs \f(CW\*(C`windmc\*(C'\fR to generate an \s-1OLE2\s0 header ++file, using \s-1HRESULT\s0 definitions. Status codes are used if the flag is not ++specified. ++.IP "\fB\-O\fR \fIcodepage\fR" 4 ++.IX Item "-O codepage" ++.PD 0 ++.IP "\fB\-\-codepage_out\fR \fIcodepage\fR" 4 ++.IX Item "--codepage_out codepage" ++.PD ++Sets the default codepage to be used to output text files. The default ++is ocdepage 1252. ++.IP "\fB\-r\fR \fIpath\fR" 4 ++.IX Item "-r path" ++.PD 0 ++.IP "\fB\-\-rcdir\fR \fIpath\fR" 4 ++.IX Item "--rcdir path" ++.PD ++The target directory for the generated \f(CW\*(C`rc\*(C'\fR script and the generated ++\&\f(CW\*(C`bin\*(C'\fR files that the resource compiler script includes. The default ++is the current directory. ++.IP "\fB\-u\fR" 4 ++.IX Item "-u" ++.PD 0 ++.IP "\fB\-\-unicode_in\fR" 4 ++.IX Item "--unicode_in" ++.PD ++Specifies that the input file is \s-1UTF16.\s0 ++.IP "\fB\-U\fR" 4 ++.IX Item "-U" ++.PD 0 ++.IP "\fB\-\-unicode_out\fR" 4 ++.IX Item "--unicode_out" ++.PD ++Specifies that messages in the output \f(CW\*(C`bin\*(C'\fR file should be in \s-1UTF16\s0 ++format. This is the default behaviour. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++.PD 0 ++.IP "\fB\-\-verbose\fR" 4 ++.IX Item "--verbose" ++.PD ++Enable verbose mode. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Prints the version number for \fBwindmc\fR. ++.IP "\fB\-x\fR \fIpath\fR" 4 ++.IX Item "-x path" ++.PD 0 ++.IP "\fB\-\-xdgb\fR \fIpath\fR" 4 ++.IX Item "--xdgb path" ++.PD ++The path of the \f(CW\*(C`dbg\*(C'\fR C include file that maps message id's to the ++symbolic name. No such file is generated without specifying the switch. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/doc/windres.1 b/binutils/doc/windres.1 +--- a/binutils/doc/windres.1 1969-12-31 21:00:00.000000000 -0300 ++++ b/binutils/doc/windres.1 2021-03-30 17:47:59.838886000 -0300 +@@ -0,0 +1,368 @@ ++.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) ++.\" ++.\" Standard preamble: ++.\" ======================================================================== ++.de Sp \" Vertical space (when we can't use .PP) ++.if t .sp .5v ++.if n .sp ++.. ++.de Vb \" Begin verbatim text ++.ft CW ++.nf ++.ne \\$1 ++.. ++.de Ve \" End verbatim text ++.ft R ++.fi ++.. ++.\" Set up some character translations and predefined strings. \*(-- will ++.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left ++.\" double quote, and \*(R" will give a right double quote. \*(C+ will ++.\" give a nicer C++. Capital omega is used to do unbreakable dashes and ++.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, ++.\" nothing in troff, for use with C<>. ++.tr \(*W- ++.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' ++.ie n \{\ ++. ds -- \(*W- ++. ds PI pi ++. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch ++. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch ++. ds L" "" ++. ds R" "" ++. ds C` "" ++. ds C' "" ++'br\} ++.el\{\ ++. ds -- \|\(em\| ++. ds PI \(*p ++. ds L" `` ++. ds R" '' ++. ds C` ++. ds C' ++'br\} ++.\" ++.\" Escape single quotes in literal strings from groff's Unicode transform. ++.ie \n(.g .ds Aq \(aq ++.el .ds Aq ' ++.\" ++.\" If the F register is >0, we'll generate index entries on stderr for ++.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index ++.\" entries marked with X<> in POD. Of course, you'll have to process the ++.\" output yourself in some meaningful fashion. ++.\" ++.\" Avoid warning from groff about undefined register 'F'. ++.de IX ++.. ++.nr rF 0 ++.if \n(.g .if rF .nr rF 1 ++.if (\n(rF:(\n(.g==0)) \{\ ++. if \nF \{\ ++. de IX ++. tm Index:\\$1\t\\n%\t"\\$2" ++.. ++. if !\nF==2 \{\ ++. nr % 0 ++. nr F 2 ++. \} ++. \} ++.\} ++.rr rF ++.\" ++.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). ++.\" Fear. Run. Save yourself. No user-serviceable parts. ++. \" fudge factors for nroff and troff ++.if n \{\ ++. ds #H 0 ++. ds #V .8m ++. ds #F .3m ++. ds #[ \f1 ++. ds #] \fP ++.\} ++.if t \{\ ++. ds #H ((1u-(\\\\n(.fu%2u))*.13m) ++. ds #V .6m ++. ds #F 0 ++. ds #[ \& ++. ds #] \& ++.\} ++. \" simple accents for nroff and troff ++.if n \{\ ++. ds ' \& ++. ds ` \& ++. ds ^ \& ++. ds , \& ++. ds ~ ~ ++. ds / ++.\} ++.if t \{\ ++. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" ++. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' ++. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' ++. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' ++. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' ++. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' ++.\} ++. \" troff and (daisy-wheel) nroff accents ++.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' ++.ds 8 \h'\*(#H'\(*b\h'-\*(#H' ++.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] ++.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' ++.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' ++.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] ++.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] ++.ds ae a\h'-(\w'a'u*4/10)'e ++.ds Ae A\h'-(\w'A'u*4/10)'E ++. \" corrections for vroff ++.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' ++.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' ++. \" for low resolution devices (crt and lpr) ++.if \n(.H>23 .if \n(.V>19 \ ++\{\ ++. ds : e ++. ds 8 ss ++. ds o a ++. ds d- d\h'-1'\(ga ++. ds D- D\h'-1'\(hy ++. ds th \o'bp' ++. ds Th \o'LP' ++. ds ae ae ++. ds Ae AE ++.\} ++.rm #[ #] #H #V #F C ++.\" ======================================================================== ++.\" ++.IX Title "WINDRES 1" ++.TH WINDRES 1 "2020-04-03" "binutils-2.34" "GNU Development Tools" ++.\" For nroff, turn off justification. Always turn off hyphenation; it makes ++.\" way too many mistakes in technical documents. ++.if n .ad l ++.nh ++.SH "NAME" ++windres \- manipulate Windows resources ++.SH "SYNOPSIS" ++.IX Header "SYNOPSIS" ++windres [options] [input\-file] [output\-file] ++.SH "DESCRIPTION" ++.IX Header "DESCRIPTION" ++\&\fBwindres\fR reads resources from an input file and copies them into ++an output file. Either file may be in one of three formats: ++.ie n .IP """rc""" 4 ++.el .IP "\f(CWrc\fR" 4 ++.IX Item "rc" ++A text format read by the Resource Compiler. ++.ie n .IP """res""" 4 ++.el .IP "\f(CWres\fR" 4 ++.IX Item "res" ++A binary format generated by the Resource Compiler. ++.ie n .IP """coff""" 4 ++.el .IP "\f(CWcoff\fR" 4 ++.IX Item "coff" ++A \s-1COFF\s0 object or executable. ++.PP ++The exact description of these different formats is available in ++documentation from Microsoft. ++.PP ++When \fBwindres\fR converts from the \f(CW\*(C`rc\*(C'\fR format to the \f(CW\*(C`res\*(C'\fR ++format, it is acting like the Windows Resource Compiler. When ++\&\fBwindres\fR converts from the \f(CW\*(C`res\*(C'\fR format to the \f(CW\*(C`coff\*(C'\fR ++format, it is acting like the Windows \f(CW\*(C`CVTRES\*(C'\fR program. ++.PP ++When \fBwindres\fR generates an \f(CW\*(C`rc\*(C'\fR file, the output is similar ++but not identical to the format expected for the input. When an input ++\&\f(CW\*(C`rc\*(C'\fR file refers to an external filename, an output \f(CW\*(C`rc\*(C'\fR file ++will instead include the file contents. ++.PP ++If the input or output format is not specified, \fBwindres\fR will ++guess based on the file name, or, for the input file, the file contents. ++A file with an extension of \fI.rc\fR will be treated as an \f(CW\*(C`rc\*(C'\fR ++file, a file with an extension of \fI.res\fR will be treated as a ++\&\f(CW\*(C`res\*(C'\fR file, and a file with an extension of \fI.o\fR or ++\&\fI.exe\fR will be treated as a \f(CW\*(C`coff\*(C'\fR file. ++.PP ++If no output file is specified, \fBwindres\fR will print the resources ++in \f(CW\*(C`rc\*(C'\fR format to standard output. ++.PP ++The normal use is for you to write an \f(CW\*(C`rc\*(C'\fR file, use \fBwindres\fR ++to convert it to a \s-1COFF\s0 object file, and then link the \s-1COFF\s0 file into ++your application. This will make the resources described in the ++\&\f(CW\*(C`rc\*(C'\fR file available to Windows. ++.SH "OPTIONS" ++.IX Header "OPTIONS" ++.IP "\fB\-i\fR \fIfilename\fR" 4 ++.IX Item "-i filename" ++.PD 0 ++.IP "\fB\-\-input\fR \fIfilename\fR" 4 ++.IX Item "--input filename" ++.PD ++The name of the input file. If this option is not used, then ++\&\fBwindres\fR will use the first non-option argument as the input file ++name. If there are no non-option arguments, then \fBwindres\fR will ++read from standard input. \fBwindres\fR can not read a \s-1COFF\s0 file from ++standard input. ++.IP "\fB\-o\fR \fIfilename\fR" 4 ++.IX Item "-o filename" ++.PD 0 ++.IP "\fB\-\-output\fR \fIfilename\fR" 4 ++.IX Item "--output filename" ++.PD ++The name of the output file. If this option is not used, then ++\&\fBwindres\fR will use the first non-option argument, after any used ++for the input file name, as the output file name. If there is no ++non-option argument, then \fBwindres\fR will write to standard output. ++\&\fBwindres\fR can not write a \s-1COFF\s0 file to standard output. Note, ++for compatibility with \fBrc\fR the option \fB\-fo\fR is also ++accepted, but its use is not recommended. ++.IP "\fB\-J\fR \fIformat\fR" 4 ++.IX Item "-J format" ++.PD 0 ++.IP "\fB\-\-input\-format\fR \fIformat\fR" 4 ++.IX Item "--input-format format" ++.PD ++The input format to read. \fIformat\fR may be \fBres\fR, \fBrc\fR, or ++\&\fBcoff\fR. If no input format is specified, \fBwindres\fR will ++guess, as described above. ++.IP "\fB\-O\fR \fIformat\fR" 4 ++.IX Item "-O format" ++.PD 0 ++.IP "\fB\-\-output\-format\fR \fIformat\fR" 4 ++.IX Item "--output-format format" ++.PD ++The output format to generate. \fIformat\fR may be \fBres\fR, ++\&\fBrc\fR, or \fBcoff\fR. If no output format is specified, ++\&\fBwindres\fR will guess, as described above. ++.IP "\fB\-F\fR \fItarget\fR" 4 ++.IX Item "-F target" ++.PD 0 ++.IP "\fB\-\-target\fR \fItarget\fR" 4 ++.IX Item "--target target" ++.PD ++Specify the \s-1BFD\s0 format to use for a \s-1COFF\s0 file as input or output. This ++is a \s-1BFD\s0 target name; you can use the \fB\-\-help\fR option to see a list ++of supported targets. Normally \fBwindres\fR will use the default ++format, which is the first one listed by the \fB\-\-help\fR option. ++.IP "\fB\-\-preprocessor\fR \fIprogram\fR" 4 ++.IX Item "--preprocessor program" ++When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR file, it runs it through the C ++preprocessor first. This option may be used to specify the preprocessor ++to use, including any leading arguments. The default preprocessor ++argument is \f(CW\*(C`gcc \-E \-xc\-header \-DRC_INVOKED\*(C'\fR. ++.IP "\fB\-\-preprocessor\-arg\fR \fIoption\fR" 4 ++.IX Item "--preprocessor-arg option" ++When \fBwindres\fR reads an \f(CW\*(C`rc\*(C'\fR file, it runs it through ++the C preprocessor first. This option may be used to specify additional ++text to be passed to preprocessor on its command line. ++This option can be used multiple times to add multiple options to the ++preprocessor command line. ++.IP "\fB\-I\fR \fIdirectory\fR" 4 ++.IX Item "-I directory" ++.PD 0 ++.IP "\fB\-\-include\-dir\fR \fIdirectory\fR" 4 ++.IX Item "--include-dir directory" ++.PD ++Specify an include directory to use when reading an \f(CW\*(C`rc\*(C'\fR file. ++\&\fBwindres\fR will pass this to the preprocessor as an \fB\-I\fR ++option. \fBwindres\fR will also search this directory when looking for ++files named in the \f(CW\*(C`rc\*(C'\fR file. If the argument passed to this command ++matches any of the supported \fIformats\fR (as described in the \fB\-J\fR ++option), it will issue a deprecation warning, and behave just like the ++\&\fB\-J\fR option. New programs should not use this behaviour. If a ++directory happens to match a \fIformat\fR, simple prefix it with \fB./\fR ++to disable the backward compatibility. ++.IP "\fB\-D\fR \fItarget\fR" 4 ++.IX Item "-D target" ++.PD 0 ++.IP "\fB\-\-define\fR \fIsym\fR\fB[=\fR\fIval\fR\fB]\fR" 4 ++.IX Item "--define sym[=val]" ++.PD ++Specify a \fB\-D\fR option to pass to the preprocessor when reading an ++\&\f(CW\*(C`rc\*(C'\fR file. ++.IP "\fB\-U\fR \fItarget\fR" 4 ++.IX Item "-U target" ++.PD 0 ++.IP "\fB\-\-undefine\fR \fIsym\fR" 4 ++.IX Item "--undefine sym" ++.PD ++Specify a \fB\-U\fR option to pass to the preprocessor when reading an ++\&\f(CW\*(C`rc\*(C'\fR file. ++.IP "\fB\-r\fR" 4 ++.IX Item "-r" ++Ignored for compatibility with rc. ++.IP "\fB\-v\fR" 4 ++.IX Item "-v" ++Enable verbose mode. This tells you what the preprocessor is if you ++didn't specify one. ++.IP "\fB\-c\fR \fIval\fR" 4 ++.IX Item "-c val" ++.PD 0 ++.IP "\fB\-\-codepage\fR \fIval\fR" 4 ++.IX Item "--codepage val" ++.PD ++Specify the default codepage to use when reading an \f(CW\*(C`rc\*(C'\fR file. ++\&\fIval\fR should be a hexadecimal prefixed by \fB0x\fR or decimal ++codepage code. The valid range is from zero up to 0xffff, but the ++validity of the codepage is host and configuration dependent. ++.IP "\fB\-l\fR \fIval\fR" 4 ++.IX Item "-l val" ++.PD 0 ++.IP "\fB\-\-language\fR \fIval\fR" 4 ++.IX Item "--language val" ++.PD ++Specify the default language to use when reading an \f(CW\*(C`rc\*(C'\fR file. ++\&\fIval\fR should be a hexadecimal language code. The low eight bits are ++the language, and the high eight bits are the sublanguage. ++.IP "\fB\-\-use\-temp\-file\fR" 4 ++.IX Item "--use-temp-file" ++Use a temporary file to instead of using popen to read the output of ++the preprocessor. Use this option if the popen implementation is buggy ++on the host (eg., certain non-English language versions of Windows 95 and ++Windows 98 are known to have buggy popen where the output will instead ++go the console). ++.IP "\fB\-\-no\-use\-temp\-file\fR" 4 ++.IX Item "--no-use-temp-file" ++Use popen, not a temporary file, to read the output of the preprocessor. ++This is the default behaviour. ++.IP "\fB\-h\fR" 4 ++.IX Item "-h" ++.PD 0 ++.IP "\fB\-\-help\fR" 4 ++.IX Item "--help" ++.PD ++Prints a usage summary. ++.IP "\fB\-V\fR" 4 ++.IX Item "-V" ++.PD 0 ++.IP "\fB\-\-version\fR" 4 ++.IX Item "--version" ++.PD ++Prints the version number for \fBwindres\fR. ++.IP "\fB\-\-yydebug\fR" 4 ++.IX Item "--yydebug" ++If \fBwindres\fR is compiled with \f(CW\*(C`YYDEBUG\*(C'\fR defined as \f(CW1\fR, ++this will turn on parser debugging. ++.IP "\fB@\fR\fIfile\fR" 4 ++.IX Item "@file" ++Read command-line options from \fIfile\fR. The options read are ++inserted in place of the original @\fIfile\fR option. If \fIfile\fR ++does not exist, or cannot be read, then the option will be treated ++literally, and not removed. ++.Sp ++Options in \fIfile\fR are separated by whitespace. A whitespace ++character may be included in an option by surrounding the entire ++option in either single or double quotes. Any character (including a ++backslash) may be included by prefixing the character to be included ++with a backslash. The \fIfile\fR may itself contain additional ++@\fIfile\fR options; any such options will be processed recursively. ++.SH "SEE ALSO" ++.IX Header "SEE ALSO" ++the Info entries for \fIbinutils\fR. ++.SH "COPYRIGHT" ++.IX Header "COPYRIGHT" ++Copyright (c) 1991\-2020 Free Software Foundation, Inc. ++.PP ++Permission is granted to copy, distribute and/or modify this document ++under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.3 ++or any later version published by the Free Software Foundation; ++with no Invariant Sections, with no Front-Cover Texts, and with no ++Back-Cover Texts. A copy of the license is included in the ++section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R". +diff -rNU3 a/binutils/Makefile.in b/binutils/Makefile.in +--- a/binutils/Makefile.in 2021-03-30 23:12:40.151226599 -0300 ++++ b/binutils/Makefile.in 2021-03-30 17:47:59.815553000 -0300 +@@ -171,7 +171,7 @@ + am__EXEEXT_17 = $(am__EXEEXT_14) $(am__EXEEXT_15) $(am__EXEEXT_16) + am__EXEEXT_18 = bfdtest1$(EXEEXT) + am__EXEEXT_19 = bfdtest2$(EXEEXT) +-am__EXEEXT_20 = testsuite/gentestdlls$(EXEEXT) ++#am__EXEEXT_20 = testsuite/gentestdlls$(EXEEXT) + am__EXEEXT_21 = $(am__EXEEXT_18) $(am__EXEEXT_19) $(am__EXEEXT_20) + PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) + am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) +@@ -347,8 +347,8 @@ + $(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) \ + $(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \ + $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \ +- $(strip_new_SOURCES) $(sysdump_SOURCES) \ +- testsuite/gentestdlls.c $(windmc_SOURCES) $(windres_SOURCES) ++ $(strip_new_SOURCES) $(sysdump_SOURCES) ++# testsuite/gentestdlls.c $(windmc_SOURCES) $(windres_SOURCES) + RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ +@@ -537,6 +537,7 @@ + libexecdir = @libexecdir@ + localedir = @localedir@ + localstatedir = @localstatedir@ ++lt_ECHO = @lt_ECHO@ + mandir = @mandir@ + mkdir_p = @mkdir_p@ + oldincludedir = @oldincludedir@ +@@ -605,7 +606,7 @@ + EXTRA_SCRIPTS = embedspu + BFDTEST1_PROG = bfdtest1 + BFDTEST2_PROG = bfdtest2 +-GENTESTDLLS_PROG = testsuite/gentestdlls ++#GENTESTDLLS_PROG = testsuite/gentestdlls + TEST_PROGS = $(BFDTEST1_PROG) $(BFDTEST2_PROG) $(GENTESTDLLS_PROG) + RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG) + +diff -rNU3 a/binutils/po/sv.po b/binutils/po/sv.po +--- a/binutils/po/sv.po 2021-03-30 23:12:40.157893266 -0300 ++++ b/binutils/po/sv.po 2021-03-30 17:47:59.962219000 -0300 +@@ -5,7 +5,7 @@ + # Tommy Pettersson , 2001, 2002, 2004. + # Göran Uddeborg , 2013, 2014, 2016, 2017, 2018, 2019, 2020. + # +-# $Revision: 1.23 $ ++# Revision: 1.23 + # + msgid "" + msgstr "" +diff -rNU3 a/binutils/readelf.c b/binutils/readelf.c +--- a/binutils/readelf.c 2021-03-30 23:12:40.161226599 -0300 ++++ b/binutils/readelf.c 2021-03-30 17:47:59.992219000 -0300 +@@ -238,6 +238,7 @@ + static Elf_Internal_Dyn * dynamic_section; + static elf_section_list * symtab_shndx_list; + static bfd_boolean show_name = FALSE; ++static bfd_boolean do_special_files = FALSE; + static bfd_boolean do_dynamic = FALSE; + static bfd_boolean do_syms = FALSE; + static bfd_boolean do_dyn_syms = FALSE; +@@ -4456,6 +4457,7 @@ + {"relocs", no_argument, 0, 'r'}, + {"notes", no_argument, 0, 'n'}, + {"dynamic", no_argument, 0, 'd'}, ++ {"special-files", no_argument, 0, 'f'}, + {"arch-specific", no_argument, 0, 'A'}, + {"version-info", no_argument, 0, 'V'}, + {"use-dynamic", no_argument, 0, 'D'}, +@@ -4508,6 +4510,7 @@ + -r --relocs Display the relocations (if present)\n\ + -u --unwind Display the unwind info (if present)\n\ + -d --dynamic Display the dynamic section (if present)\n\ ++ -f --special-files Process non-plain files too\n\ + -V --version-info Display the version sections (if present)\n\ + -A --arch-specific Display architecture specific information (if any)\n\ + -c --archive-index Display the symbol/file index in an archive\n\ +@@ -4639,7 +4642,7 @@ + usage (stderr); + + while ((c = getopt_long +- (argc, argv, "ADHINR:SVWacdeghi:lnp:rstuvw::x:z", options, NULL)) != EOF) ++ (argc, argv, "ADHINR:SVWacdefghi:lnp:rstuvw::x:z", options, NULL)) != EOF) + { + switch (c) + { +@@ -4689,6 +4692,9 @@ + case 'u': + do_unwind = TRUE; + break; ++ case 'f': ++ do_special_files++; ++ break; + case 'h': + do_header = TRUE; + break; +@@ -5146,7 +5152,7 @@ + if (filedata->file_header.e_phnum > 1) + printf (_("\nProgram Headers:\n")); + else +- printf (_("\nProgram Headers:\n")); ++ printf (_("\nProgram Header:\n")); + + if (is_32bit_elf) + printf +@@ -18286,9 +18292,9 @@ + switch (pnote->type) + { + case NT_NETBSD_IDENT: +- version = byte_get ((unsigned char *) pnote->descdata, sizeof (version)); ++ version = byte_get((unsigned char *)pnote->descdata, sizeof(version)); + if ((version / 10000) % 100) +- printf (" NetBSD\t\t0x%08lx\tIDENT %u (%u.%u%s%c)\n", pnote->descsz, ++ printf (" NetBSD\t0x%08lx\tIDENT %u (%u.%u%s%c)\n", pnote->descsz, + version, version / 100000000, (version / 1000000) % 100, + (version / 10000) % 100 > 26 ? "Z" : "", + 'A' + (version / 10000) % 26); +@@ -20362,7 +20368,7 @@ + return FALSE; + } + +- if (! S_ISREG (statbuf.st_mode)) ++ if (!do_special_files && ! S_ISREG (statbuf.st_mode)) + { + error (_("'%s' is not an ordinary file\n"), file_name); + return FALSE; +diff -rNU3 a/config.guess b/config.guess +--- a/config.guess 2021-03-30 23:12:40.164559933 -0300 ++++ b/config.guess 2021-03-30 17:48:00.025553000 -0300 +@@ -184,6 +184,7 @@ + "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` + case "$UNAME_MACHINE_ARCH" in ++ aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; +diff -rNU3 a/gas/atof-generic.c b/gas/atof-generic.c +--- a/gas/atof-generic.c 2021-03-30 23:12:40.167893266 -0300 ++++ b/gas/atof-generic.c 2021-03-30 17:48:00.152219000 -0300 +@@ -120,6 +120,32 @@ + + switch (first_digit[0]) + { ++ case 's': ++ case 'S': ++ if (!strncasecmp ("snan", first_digit, 4)) ++ { ++ address_of_generic_floating_point_number->sign = 0; ++ address_of_generic_floating_point_number->exponent = 0; ++ address_of_generic_floating_point_number->leader = ++ address_of_generic_floating_point_number->low; ++ *address_of_string_pointer = first_digit + 4; ++ return 0; ++ } ++ break; ++ ++ case 'q': ++ case 'Q': ++ if (!strncasecmp ("qnan", first_digit, 4)) ++ { ++ address_of_generic_floating_point_number->sign = 0; ++ address_of_generic_floating_point_number->exponent = 0; ++ address_of_generic_floating_point_number->leader = ++ address_of_generic_floating_point_number->low; ++ *address_of_string_pointer = first_digit + 4; ++ return 0; ++ } ++ break; ++ + case 'n': + case 'N': + if (!strncasecmp ("nan", first_digit, 3)) +diff -rNU3 a/gas/config/atof-vax.c b/gas/config/atof-vax.c +--- a/gas/config/atof-vax.c 2021-03-30 23:12:40.167893266 -0300 ++++ b/gas/config/atof-vax.c 2021-03-30 17:48:00.162219000 -0300 +@@ -267,10 +267,27 @@ + int exponent_skippage; + LITTLENUM_TYPE word1; + +- /* JF: Deal with new Nan, +Inf and -Inf codes. */ + if (f->sign != '-' && f->sign != '+') + { +- make_invalid_floating_point_number (words); ++ if (f->sign == 0) ++ { ++ /* All NaNs are 0. */ ++ memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision); ++ } ++ else if (f->sign == 'P') ++ { ++ /* Positive Infinity. */ ++ memset (words, 0xff, sizeof (LITTLENUM_TYPE) * precision); ++ words[0] &= 0x7fff; ++ } ++ else if (f->sign == 'N') ++ { ++ /* Negative Infinity. */ ++ memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision); ++ words[0] = 0x0080; ++ } ++ else ++ make_invalid_floating_point_number (words); + return return_value; + } + +diff -rNU3 a/gas/config/obj-elf.c b/gas/config/obj-elf.c +--- a/gas/config/obj-elf.c 2021-03-30 23:12:40.167893266 -0300 ++++ b/gas/config/obj-elf.c 2021-03-30 17:48:00.168886000 -0300 +@@ -2063,6 +2063,7 @@ + || strcmp (type_name, "10") == 0 + || strcmp (type_name, "STT_GNU_IFUNC") == 0) + { ++#if 0 + struct elf_backend_data *bed; + + bed = (struct elf_backend_data *) get_elf_backend_data (stdoutput); +@@ -2072,6 +2073,7 @@ + && bed->elf_osabi != ELFOSABI_FREEBSD) + as_bad (_("symbol type \"%s\" is supported only by GNU " + "and FreeBSD targets"), type_name); ++#endif + elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_ifunc; + type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION; + } +diff -rNU3 a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c +--- a/gas/config/tc-aarch64.c 2021-03-30 23:12:40.171226600 -0300 ++++ b/gas/config/tc-aarch64.c 2021-03-30 17:48:00.172219000 -0300 +@@ -250,12 +250,6 @@ + typedef struct + { + const char *template; +- unsigned long value; +-} asm_barrier_opt; +- +-typedef struct +-{ +- const char *template; + uint32_t value; + } asm_nzcv; + +@@ -3994,7 +3988,7 @@ + parse_barrier (char **str) + { + char *p, *q; +- const asm_barrier_opt *o; ++ const struct aarch64_name_value_pair *o; + + p = q = *str; + while (ISALPHA (*q)) +diff -rNU3 a/gas/config/tc-arm.c b/gas/config/tc-arm.c +--- a/gas/config/tc-arm.c 2021-03-30 23:12:40.177893266 -0300 ++++ b/gas/config/tc-arm.c 2021-03-30 17:48:00.185553000 -0300 +@@ -23117,16 +23117,20 @@ + asection *sect; + + for (sect = stdoutput->sections; sect != NULL; sect = sect->next) +- if (seg_info (sect)->tc_segment_info_data.current_pred.state +- == MANUAL_PRED_BLOCK) +- { +- if (now_pred.type == SCALAR_PRED) +- as_warn (_("section '%s' finished with an open IT block."), +- sect->name); +- else +- as_warn (_("section '%s' finished with an open VPT/VPST block."), ++ { ++ segment_info_type *seginfo = seg_info (sect); ++ ++ if (seginfo && seginfo->tc_segment_info_data.current_pred.state ++ == MANUAL_PRED_BLOCK) ++ { ++ if (now_pred.type == SCALAR_PRED) ++ as_warn (_("section '%s' finished with an open IT block."), ++ sect->name); ++ else ++ as_warn (_("section '%s' finished with an open VPT/VPST block."), + sect->name); +- } ++ } ++ } + #else + if (now_pred.state == MANUAL_PRED_BLOCK) + { +diff -rNU3 a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c +--- a/gas/config/tc-m68k.c 2021-03-30 23:12:40.184559933 -0300 ++++ b/gas/config/tc-m68k.c 2021-03-30 17:48:00.222219000 -0300 +@@ -7294,7 +7294,7 @@ + { + if (arg[0] == 'm') + { +- if (arg[1] == '6') ++ if (arg[1] == '6' || arg[1] == '5') + arg += 1; + else if (arg[1] == 'c' && arg[2] == '6') + arg += 2; +diff -rNU3 a/gas/config/tc-mips.c b/gas/config/tc-mips.c +--- a/gas/config/tc-mips.c 2021-03-30 23:12:40.184559933 -0300 ++++ b/gas/config/tc-mips.c 2021-03-30 17:48:00.228886000 -0300 +@@ -933,6 +933,9 @@ + NUM_FIX_VR4120_CLASSES + }; + ++/* ...likewise -mtrap-zero-jump. */ ++static bfd_boolean mips_trap_zero_jump; ++ + /* ...likewise -mfix-loongson2f-jump. */ + static bfd_boolean mips_fix_loongson2f_jump; + +@@ -976,6 +979,8 @@ + + static int mips_relax_branch; + ++static int mips_fix_loongson2f_btb; ++ + /* TRUE if checks are suppressed for invalid branches between ISA modes. + Needed for broken assembly produced by some GCC versions and some + sloppy code out there, where branches to data labels are present. */ +@@ -1369,6 +1374,7 @@ + static void mips16_macro_build + (expressionS *, const char *, const char *, va_list *); + static void load_register (int, expressionS *, int); ++static void macro_build (expressionS *, const char *, const char *, ...); + static void macro_start (void); + static void macro_end (void); + static void macro (struct mips_cl_insn *ip, char *str); +@@ -1573,6 +1579,8 @@ + OPTION_NO_LOONGSON_EXT, + OPTION_LOONGSON_EXT2, + OPTION_NO_LOONGSON_EXT2, ++ OPTION_FIX_LOONGSON2F_BTB, ++ OPTION_NO_FIX_LOONGSON2F_BTB, + OPTION_END_OF_ENUM + }; + +@@ -1662,6 +1670,8 @@ + {"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP}, + {"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP}, + {"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP}, ++ {"mfix-loongson2f-btb", no_argument, NULL, OPTION_FIX_LOONGSON2F_BTB}, ++ {"mno-fix-loongson2f-btb", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_BTB}, + {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120}, + {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120}, + {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130}, +@@ -5619,6 +5629,8 @@ + if ((reglist & 0x3f00ffff) != 0) + return FALSE; + ++ ++/* Fix NOP issue: Replace nops by "or at,at,zero". */ + ra = (reglist >> 27) & 0x10; + sregs = ((reglist >> 22) & 0x100) | ((reglist >> 16) & 0xff); + } +@@ -5630,6 +5642,35 @@ + return TRUE; + } + ++static void ++trap_zero_jump (struct mips_cl_insn * ip) ++{ ++ if (strcmp (ip->insn_mo->name, "j") == 0 ++ || strcmp (ip->insn_mo->name, "jr") == 0 ++ || strcmp (ip->insn_mo->name, "jalr") == 0) ++ { ++ int sreg; ++ ++ if (mips_opts.warn_about_macros) ++ return; ++ ++ sreg = EXTRACT_OPERAND (0, RS, *ip); ++ if (mips_opts.isa == ISA_MIPS32 ++ || mips_opts.isa == ISA_MIPS32R2 ++ || mips_opts.isa == ISA_MIPS64 ++ || mips_opts.isa == ISA_MIPS64R2) ++ { ++ expressionS ep; ++ ep.X_op = O_constant; ++ ep.X_add_number = 4096; ++ macro_build (&ep, "tltiu", "s,j", sreg, BFD_RELOC_LO16); ++ } ++ else if (mips_opts.isa != ISA_UNKNOWN ++ && mips_opts.isa != ISA_MIPS1) ++ macro_build (NULL, "teq", "s,t", sreg, 0); ++ } ++} ++ + /* OP_ENTRY_EXIT_LIST matcher. */ + + static unsigned int +@@ -5843,6 +5884,13 @@ + } + frame_size /= 8; + ++ /* If the branch is itself the target of a branch, we can not swap. ++ We cheat on this; all we check for is whether there is a label on ++ this instruction. If there are any branches to anything other than ++ a label, users must use .set noreorder. */ ++ if (seg_info (now_seg)->label_list) ++ return FALSE; ++ + /* Finally build the instruction. */ + if (mips_opts.mips16) + opcode |= mips16_encode_save_restore (arg_mask, num_sregs, ra, s0, s1, +@@ -7044,6 +7092,11 @@ + if (mips_opts.mips16 && history[0].fixp[0]) + return FALSE; + ++ if (mips_fix_loongson2f) ++ fix_loongson2f (ip); ++ if (mips_trap_zero_jump) ++ trap_zero_jump (ip); ++ + /* If the branch is itself the target of a branch, we can not swap. + We cheat on this; all we check for is whether there is a label on + this instruction. If there are any branches to anything other than +@@ -7192,6 +7245,45 @@ + return TRUE; + } + ++/* Fix jump through register issue on loongson2f processor for kernel code: ++ force a BTB clear before the jump to prevent it from being incorrectly ++ prefetched by the branch prediction engine. */ ++ ++static void ++macro_build_jrpatch (expressionS *ep, unsigned int sreg) ++{ ++ if (!mips_fix_loongson2f_btb) ++ return; ++ ++ if (sreg == ZERO || sreg == KT0 || sreg == KT1 || sreg == AT) ++ return; ++ ++ if (!mips_opts.at) ++ { ++ as_warn (_("unable to apply loongson2f BTB workaround when .set noat")); ++ return; ++ } ++ ++ /* li $at, COP_0_BTB_CLEAR | COP_0_RAS_DISABLE */ ++ ep->X_op = O_constant; ++ ep->X_add_number = 3; ++ macro_build (ep, "ori", "t,r,i", AT, ZERO, BFD_RELOC_LO16); ++ ++ /* dmtc0 $at, COP_0_DIAG */ ++ macro_build (NULL, "dmtc0", "t,G", AT, 22); ++ ++ /* Hide these two instructions to avoid getting a ``macro expanded into ++ multiple instructions'' warning. */ ++ if (mips_relax.sequence != 2) { ++ mips_macro_warning.sizes[0] -= 2 * 4; ++ mips_macro_warning.insns[0] -= 2; ++ } ++ if (mips_relax.sequence != 1) { ++ mips_macro_warning.sizes[1] -= 2 * 4; ++ mips_macro_warning.insns[1] -= 2; ++ } ++} ++ + /* Decide how we should add IP to the instruction stream. + ADDRESS_EXPR is an operand of the instruction to be used with + RELOC_TYPE. */ +@@ -11552,6 +11644,26 @@ + macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", op[0], tempreg, breg); + break; + ++ case M_JR_S: ++ macro_build_jrpatch (&expr1, op[2]); ++ macro_build (NULL, "jr", "s", op[2]); ++ return; /* didn't modify $at */ ++ ++ case M_J_S: ++ macro_build_jrpatch (&expr1, op[2]); ++ macro_build (NULL, "j", "s", op[2]); ++ return; /* didn't modify $at */ ++ ++ case M_JALR_S: ++ macro_build_jrpatch (&expr1, op[2]); ++ macro_build (NULL, "jalr", "s", op[2]); ++ return; /* didn't modify $at */ ++ ++ case M_JALR_DS: ++ macro_build_jrpatch (&expr1, op[2]); ++ macro_build (NULL, "jalr", "d,s", op[0], op[2]); ++ return; /* didn't modify $at */ ++ + case M_MSGSND: + gas_assert (!mips_opts.micromips); + macro_build (NULL, "c2", "C", (op[0] << 16) | 0x01); +@@ -14993,6 +15105,14 @@ + mips_fix_vr4130 = 0; + break; + ++ case OPTION_FIX_LOONGSON2F_BTB: ++ mips_fix_loongson2f_btb = 1; ++ break; ++ ++ case OPTION_NO_FIX_LOONGSON2F_BTB: ++ mips_fix_loongson2f_btb = 0; ++ break; ++ + case OPTION_FIX_CN63XXP1: + mips_fix_cn63xxp1 = TRUE; + break; +@@ -20422,6 +20542,7 @@ + fprintf (stream, _("\ + -mfix-loongson2f-jump work around Loongson2F JUMP instructions\n\ + -mfix-loongson2f-nop work around Loongson2F NOP errata\n\ ++-mfix-loongson2f-btb work around Loongson2F BTB errata\n\ + -mfix-loongson3-llsc work around Loongson3 LL/SC errata\n\ + -mno-fix-loongson3-llsc disable work around Loongson3 LL/SC errata\n\ + -mfix-vr4120 work around certain VR4120 errata\n\ +diff -rNU3 a/gas/config/tc-mips.h b/gas/config/tc-mips.h +--- a/gas/config/tc-mips.h 2021-03-30 23:12:40.184559933 -0300 ++++ b/gas/config/tc-mips.h 2021-03-30 17:48:00.228886000 -0300 +@@ -187,7 +187,7 @@ + #define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size () + #define DWARF2_FDE_RELOC_SIZE (compact_eh ? 4 : mips_dwarf2_addr_size ()) + #define DWARF2_FDE_RELOC_ENCODING(enc) \ +- (enc | (compact_eh ? DW_EH_PE_pcrel : 0)) ++ (compact_eh ? (enc)|DW_EH_PE_pcrel : DW_EH_PE_absptr) + + #define TARGET_USE_CFIPOP 1 + +diff -rNU3 a/gas/config/tc-vax.c b/gas/config/tc-vax.c +--- a/gas/config/tc-vax.c 2021-03-30 23:12:40.184559933 -0300 ++++ b/gas/config/tc-vax.c 2021-03-30 17:48:00.278886000 -0300 +@@ -22,6 +22,7 @@ + + #include "vax-inst.h" + #include "obstack.h" /* For FRAG_APPEND_1_CHAR macro in "frags.h" */ ++#include "dw2gencfi.h" + #include "subsegs.h" + #include "safe-ctype.h" + +@@ -396,6 +397,9 @@ + && (PLT_symbol == NULL || fragP->fr_symbol != PLT_symbol) + && fragP->fr_symbol != NULL + && flag_want_pic ++#ifdef OBJ_ELF ++ && ELF_ST_VISIBILITY (S_GET_OTHER (fragP->fr_symbol)) != STV_HIDDEN ++#endif + && (!S_IS_DEFINED (fragP->fr_symbol) + || S_IS_WEAK (fragP->fr_symbol) + || S_IS_EXTERNAL (fragP->fr_symbol))) +@@ -1077,6 +1081,154 @@ + return retval; + } + ++#ifdef OBJ_AOUT ++#ifndef BFD_ASSEMBLER ++void ++tc_aout_fix_to_chars (where, fixP, segment_address_in_file) ++ char *where; ++ fixS *fixP; ++ relax_addressT segment_address_in_file; ++{ ++ /* ++ * In: length of relocation (or of address) in chars: 1, 2 or 4. ++ * Out: GNU LD relocation length code: 0, 1, or 2. ++ */ ++ ++ static const unsigned char nbytes_r_length[] = {42, 0, 1, 42, 2}; ++ int r_symbolnum; ++ int r_flags; ++ ++ know (fixP->fx_addsy != NULL); ++ ++ md_number_to_chars (where, ++ fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, ++ 4); ++ ++ r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) ++ ? S_GET_TYPE (fixP->fx_addsy) ++ : fixP->fx_addsy->sy_number); ++ r_flags = (fixP->fx_pcrel ? 1 : 0) ++ | (!S_IS_DEFINED (fixP->fx_addsy) ? 8 : 0) /* extern */ ++ | ((nbytes_r_length[fixP->fx_size] & 3) << 1); ++ ++#if 0 ++ r_flags |= ((!S_IS_DEFINED(fixP->fx_addsy) ++ && fixP->fx_pcrel ++ && fixP->fx_addsy != GOT_symbol ++ && fixP->fx_addsy != PLT_symbol ++ && flags_want_pic) ? 0x10 : 0); ++#endif ++ ++ switch (fixP->fx_r_type) { ++ case NO_RELOC: ++ break; ++ case NO_RELOC2: ++ if (r_flags & 8) ++ r_flags |= 0x80; /* setting the copy bit */ ++ /* says we can convert */ ++ /* to gotslot if needed */ ++ break; ++ case RELOC_32: ++ if (flag_want_pic && S_IS_EXTERNAL(fixP->fx_addsy)) { ++ r_symbolnum = fixP->fx_addsy->sy_number; ++ r_flags |= 8; /* set extern bit */ ++ } ++ break; ++ case RELOC_JMP_SLOT: ++ if (flag_want_pic) { ++ r_flags |= 0x20; /* set jmptable */ ++ r_flags &= ~0x08; /* clear extern bit */ ++ } ++ break; ++ case RELOC_JMP_TBL: ++ if (flag_want_pic) { ++ r_flags |= 0x20; /* set jmptable */ ++ r_flags |= 0x08; /* set extern bit */ ++ } ++ break; ++ case RELOC_GLOB_DAT: ++ if (flag_want_pic) { ++ r_flags |= 0x10; /* set baserel bit */ ++ r_symbolnum = fixP->fx_addsy->sy_number; ++ if (S_IS_EXTERNAL(fixP->fx_addsy)) ++ r_flags |= 8; /* set extern bit */ ++ } ++ break; ++ } ++ ++ where[4] = (r_symbolnum >> 0) & 0xff; ++ where[5] = (r_symbolnum >> 8) & 0xff; ++ where[6] = (r_symbolnum >> 16) & 0xff; ++ where[7] = r_flags; ++} ++#endif /* !BFD_ASSEMBLER */ ++#endif /* OBJ_AOUT */ ++ ++/* ++ * BUGS, GRIPES, APOLOGIA, etc. ++ * ++ * The opcode table 'votstrs' needs to be sorted on opcode frequency. ++ * That is, AFTER we hash it with hash_...(), we want most-used opcodes ++ * to come out of the hash table faster. ++ * ++ * I am sorry to inflict yet another VAX assembler on the world, but ++ * RMS says we must do everything from scratch, to prevent pin-heads ++ * restricting this software. ++ */ ++ ++/* ++ * This is a vaguely modular set of routines in C to parse VAX ++ * assembly code using DEC mnemonics. It is NOT un*x specific. ++ * ++ * The idea here is that the assembler has taken care of all: ++ * labels ++ * macros ++ * listing ++ * pseudo-ops ++ * line continuation ++ * comments ++ * condensing any whitespace down to exactly one space ++ * and all we have to do is parse 1 line into a vax instruction ++ * partially formed. We will accept a line, and deliver: ++ * an error message (hopefully empty) ++ * a skeleton VAX instruction (tree structure) ++ * textual pointers to all the operand expressions ++ * a warning message that notes a silly operand (hopefully empty) ++ */ ++ ++/* ++ * E D I T H I S T O R Y ++ * ++ * 17may86 Dean Elsner. Bug if line ends immediately after opcode. ++ * 30apr86 Dean Elsner. New vip_op() uses arg block so change call. ++ * 6jan86 Dean Elsner. Crock vip_begin() to call vip_op_defaults(). ++ * 2jan86 Dean Elsner. Invent synthetic opcodes. ++ * Widen vax_opcodeT to 32 bits. Use a bit for VIT_OPCODE_SYNTHETIC, ++ * which means this is not a real opcode, it is like a macro; it will ++ * be relax()ed into 1 or more instructions. ++ * Use another bit for VIT_OPCODE_SPECIAL if the op-code is not optimised ++ * like a regular branch instruction. Option added to vip_begin(): ++ * exclude synthetic opcodes. Invent synthetic_votstrs[]. ++ * 31dec85 Dean Elsner. Invent vit_opcode_nbytes. ++ * Also make vit_opcode into a char[]. We now have n-byte vax opcodes, ++ * so caller's don't have to know the difference between a 1-byte & a ++ * 2-byte op-code. Still need vax_opcodeT concept, so we know how ++ * big an object must be to hold an op.code. ++ * 30dec85 Dean Elsner. Widen typedef vax_opcodeT in "vax-inst.h" ++ * because vax opcodes may be 16 bits. Our crufty C compiler was ++ * happily initialising 8-bit vot_codes with 16-bit numbers! ++ * (Wouldn't the 'phone company like to compress data so easily!) ++ * 29dec85 Dean Elsner. New static table vax_operand_width_size[]. ++ * Invented so we know hw many bytes a "I^#42" needs in its immediate ++ * operand. Revised struct vop in "vax-inst.h": explicitly include ++ * byte length of each operand, and it's letter-code datum type. ++ * 17nov85 Dean Elsner. Name Change. ++ * Due to ar(1) truncating names, we learned the hard way that ++ * "vax-inst-parse.c" -> "vax-inst-parse." dropping the "o" off ++ * the archived object name. SO... we shortened the name of this ++ * source file, and changed the makefile. ++ */ ++ + /* Parse a vax operand in DEC assembler notation. + For speed, expect a string of whitespace to be reduced to a single ' '. + This is the case for GNU AS, and is easy for other DEC-compatible +@@ -3156,7 +3308,7 @@ + if (flag_want_pic && operandP->vop_mode == 8 + && this_add_symbol != NULL) + { +- as_warn (_("Symbol %s used as immediate operand in PIC mode."), ++ as_warn (_("Symbol '%s' used as immediate operand in PIC mode."), + S_GET_NAME (this_add_symbol)); + } + #endif +@@ -3232,7 +3384,15 @@ + length = 4; + } + } ++#ifdef OBJ_ELF ++ if (flag_want_pic && this_add_symbol != NULL) ++ { ++ as_warn (_("Symbol '%s' used as displacement in PIC mode."), ++ S_GET_NAME (this_add_symbol)); ++ } ++#endif + p = frag_more (1 + length); ++ know (operandP->vop_reg != 0xf); + know (operandP->vop_reg >= 0); + p[0] = operandP->vop_reg + | ((at | "?\12\14?\16"[length]) << 4); +@@ -3410,3 +3570,36 @@ + { + return vax_md_atof (type, litP, sizeP); + } ++ ++void ++vax_cfi_frame_initial_instructions (void) ++{ ++ cfi_add_CFA_def_cfa (14, 0); ++} ++ ++int ++tc_vax_regname_to_dw2regnum (char *regname) ++{ ++ unsigned int i; ++ static const struct { char *name; int dw2regnum; } regnames[] = ++ { ++ { "r0", 0 }, { "r1", 1 }, { "r2", 2 }, { "r3", 3 }, ++ { "r4", 4 }, { "r5", 5 }, { "r6", 6 }, { "r7", 7 }, ++ { "r8", 8 }, { "r9", 9 }, { "r10", 10 }, { "r11", 11 }, ++ { "ap", 12 }, { "fp", 13 }, { "sp", 14 }, { "pc", 15 }, ++ { "psw", 16 }, ++ }; ++ ++ for (i = 0; i < ARRAY_SIZE (regnames); ++i) ++ if (strcmp (regnames[i].name, regname) == 0) ++ return regnames[i].dw2regnum; ++ ++ return -1; ++} ++ ++void ++vax_cfi_emit_pcrel_expr (expressionS *expP, unsigned int nbytes) ++{ ++ expP->X_add_number += nbytes; ++ emit_expr (expP, nbytes); ++} +diff -rNU3 a/gas/config/tc-vax.h b/gas/config/tc-vax.h +--- a/gas/config/tc-vax.h 2021-03-30 23:12:40.184559933 -0300 ++++ b/gas/config/tc-vax.h 2021-03-30 17:48:00.282219000 -0300 +@@ -71,9 +71,17 @@ + == S_GET_SEGMENT ((FIX)->fx_addsy))) \ + || S_IS_LOCAL ((FIX)->fx_addsy))) + +-/* +- * Local Variables: +- * comment-column: 0 +- * fill-column: 131 +- * End: +- */ ++#define TARGET_USE_CFIPOP 1 ++ ++#define tc_cfi_frame_initial_instructions vax_cfi_frame_initial_instructions ++extern void vax_cfi_frame_initial_instructions (void); ++ ++#define tc_regname_to_dw2regnum tc_vax_regname_to_dw2regnum ++extern int tc_vax_regname_to_dw2regnum (char *); ++ ++#define tc_cfi_emit_pcrel_expr vax_cfi_emit_pcrel_expr ++extern void vax_cfi_emit_pcrel_expr (expressionS *, unsigned int); ++ ++#define DWARF2_LINE_MIN_INSN_LENGTH 1 ++#define DWARF2_DEFAULT_RETURN_COLUMN 15 ++#define DWARF2_CIE_DATA_ALIGNMENT -4 +diff -rNU3 a/gas/config/te-armnbsdeabi.h b/gas/config/te-armnbsdeabi.h +--- a/gas/config/te-armnbsdeabi.h 1969-12-31 21:00:00.000000000 -0300 ++++ b/gas/config/te-armnbsdeabi.h 2021-03-30 17:48:00.292219000 -0300 +@@ -0,0 +1,25 @@ ++/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. ++ ++ This file is part of GAS, the GNU Assembler. ++ ++ GAS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as ++ published by the Free Software Foundation; either version 3, ++ or (at your option) any later version. ++ ++ GAS is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ the GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GAS; see the file COPYING. If not, write to the Free ++ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA ++ 02110-1301, USA. */ ++ ++#include "te-nbsd.h" ++ ++/* The EABI requires the use of VFP. */ ++#define CPU_DEFAULT ARM_ARCH_V5TEJ ++#define FPU_DEFAULT FPU_ARCH_VFP ++#define EABI_DEFAULT EF_ARM_EABI_VER5 +diff -rNU3 a/gas/config/te-armnbsdeabihf.h b/gas/config/te-armnbsdeabihf.h +--- a/gas/config/te-armnbsdeabihf.h 1969-12-31 21:00:00.000000000 -0300 ++++ b/gas/config/te-armnbsdeabihf.h 2021-03-30 17:48:00.292219000 -0300 +@@ -0,0 +1,25 @@ ++/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. ++ ++ This file is part of GAS, the GNU Assembler. ++ ++ GAS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as ++ published by the Free Software Foundation; either version 3, ++ or (at your option) any later version. ++ ++ GAS is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ the GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GAS; see the file COPYING. If not, write to the Free ++ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA ++ 02110-1301, USA. */ ++ ++#include "te-nbsd.h" ++ ++/* The EABI requires the use of VFP. */ ++#define CPU_DEFAULT ARM_ARCH_V5TEJ ++#define FPU_DEFAULT FPU_ARCH_VFP_V2 ++#define EABI_DEFAULT EF_ARM_EABI_VER5 +diff -rNU3 a/gas/config/te-armnbsd.h b/gas/config/te-armnbsd.h +--- a/gas/config/te-armnbsd.h 1969-12-31 21:00:00.000000000 -0300 ++++ b/gas/config/te-armnbsd.h 2021-03-30 17:48:00.292219000 -0300 +@@ -0,0 +1,22 @@ ++/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. ++ ++ This file is part of GAS, the GNU Assembler. ++ ++ GAS is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as ++ published by the Free Software Foundation; either version 3, ++ or (at your option) any later version. ++ ++ GAS is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ++ the GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with GAS; see the file COPYING. If not, write to the Free ++ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA ++ 02110-1301, USA. */ ++ ++#include "te-nbsd.h" ++ ++#define CPU_DEFAULT ARM_ARCH_V4 +diff -rNU3 a/gas/config/vax-inst.h b/gas/config/vax-inst.h +--- a/gas/config/vax-inst.h 2021-03-30 23:12:40.184559933 -0300 ++++ b/gas/config/vax-inst.h 2021-03-30 17:48:00.298886000 -0300 +@@ -65,6 +65,8 @@ + #define VAX_WIDEN_WORD (0x20) /* Add this to byte branch to get word br. */ + #define VAX_WIDEN_LONG (0x6) /* Add this to byte branch to get long jmp.*/ + /* Needs VAX_PC_RELATIVE_MODE byte after it*/ ++#define VAX_CALLS (0xFB) /* Call with arg list on stack */ ++#define VAX_CALLG (0xFA) /* Call with arg list in memory */ + + struct vit /* vax instruction tree */ + { +diff -rNU3 a/gas/configure.tgt b/gas/configure.tgt +--- a/gas/configure.tgt 2021-03-30 23:12:40.191226600 -0300 ++++ b/gas/configure.tgt 2021-03-30 17:48:00.308886000 -0300 +@@ -70,7 +70,7 @@ + m32c) cpu_type=m32c endian=little ;; + m32r) cpu_type=m32r endian=big ;; + m32rle) cpu_type=m32r endian=little ;; +- m5200) cpu_type=m68k ;; ++ m5200|m5407) cpu_type=m68k ;; + m68008) cpu_type=m68k ;; + m680[012346]0) cpu_type=m68k ;; + m6811|m6812|m68hc12) cpu_type=m68hc11 ;; +@@ -123,6 +123,7 @@ + case ${generic_target} in + aarch64*-*-elf*) fmt=elf;; + aarch64*-*-fuchsia*) fmt=elf;; ++ aarch64*-*-netbsd*) fmt=elf em=nbsd ;; + aarch64*-*-linux*) fmt=elf em=linux + case ${cpu}-${os} in + aarch64*-linux-gnu_ilp32) arch=aarch64:32 ;; +@@ -139,6 +140,8 @@ + + arm-*-phoenix*) fmt=elf ;; + arm-*-elf) fmt=elf ;; ++ arm-*-netbsdelf*-*eabihf*) fmt=elf em=armnbsdeabihf ;; ++ arm-*-netbsdelf*-*eabi*) fmt=elf em=armnbsdeabi ;; + arm-*-eabi* | arm-*-rtems*) fmt=elf em=armeabi ;; + arm-*-symbianelf*) fmt=elf em=symbian ;; + arm-*-kaos*) fmt=elf ;; +@@ -152,7 +155,7 @@ + arm-*-uclinux*eabi*) fmt=elf em=armlinuxeabi ;; + arm-*-uclinux*) fmt=elf em=linux ;; + arm-*-nacl*) fmt=elf em=nacl ;; +- arm-*-netbsdelf*) fmt=elf em=nbsd ;; ++ arm-*-netbsdelf*) fmt=elf em=armnbsd ;; + arm-*-nto*) fmt=elf ;; + arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*) + fmt=coff em=wince-pe ;; +@@ -343,6 +346,7 @@ + + or1k*-*-elf | or1k*-*-rtems*) fmt=elf endian=big ;; + or1k*-*-linux*) fmt=elf em=linux endian=big ;; ++ or1k-*-netbsd*) fmt=elf em=nbsd ;; + + pj*) fmt=elf ;; + +diff -rNU3 a/gas/doc/c-mips.texi b/gas/doc/c-mips.texi +--- a/gas/doc/c-mips.texi 2021-03-30 23:12:40.191226600 -0300 ++++ b/gas/doc/c-mips.texi 2021-03-30 17:48:00.332219000 -0300 +@@ -325,6 +325,14 @@ + @itemx -mno-fix-vr4130 + Insert nops to work around the VR4130 @samp{mflo}/@samp{mfhi} errata. + ++@item -mfix-loongson2f-btb ++@itemx -mno-fix-loongson2f-btb ++Clear the Branch Target Buffer before any jump through a register. This ++option is intended to be used on kernel code for the Loongson 2F processor ++only; userland code compiled with this option will fault, and kernel code ++compiled with this option run on another processor than Loongson 2F will ++yield unpredictable results. ++ + @item -mfix-24k + @itemx -mno-fix-24k + Insert nops to work around the 24K @samp{eret}/@samp{deret} errata. +diff -rNU3 a/gas/doc/Makefile.am b/gas/doc/Makefile.am +--- a/gas/doc/Makefile.am 2021-03-30 23:12:40.191226600 -0300 ++++ b/gas/doc/Makefile.am 2021-03-30 17:48:00.308886000 -0300 +@@ -41,6 +41,8 @@ + -I "$(top_srcdir)/../bfd/doc" -I ../../bfd/doc + + asconfig.texi: $(CONFIG).texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_asconfig.text: + rm -f asconfig.texi + cp $(srcdir)/$(CONFIG).texi ./asconfig.texi + chmod u+w ./asconfig.texi +@@ -124,6 +126,8 @@ + # The sed command removes the no-adjust Nroff command so that + # the man output looks standard. + as.1: $(srcdir)/as.texi asconfig.texi $(CPU_DOCS) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_as.1: + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texi > as.pod + -($(POD2MAN) as.pod | \ +diff -rNU3 a/gas/doc/Makefile.in b/gas/doc/Makefile.in +--- a/gas/doc/Makefile.in 2021-03-30 23:12:40.191226600 -0300 ++++ b/gas/doc/Makefile.in 2021-03-30 17:48:00.308886000 -0300 +@@ -504,6 +504,8 @@ + -rm -rf .libs _libs + + as.info: as.texi $(as_TEXINFOS) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_as.info: as.texinfo $(as_TEXINFOS) + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ +@@ -940,6 +942,8 @@ + + + asconfig.texi: $(CONFIG).texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_asconfig.texi: + rm -f asconfig.texi + cp $(srcdir)/$(CONFIG).texi ./asconfig.texi + chmod u+w ./asconfig.texi +@@ -957,6 +961,8 @@ + # The sed command removes the no-adjust Nroff command so that + # the man output looks standard. + as.1: $(srcdir)/as.texi asconfig.texi $(CPU_DOCS) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_as.1: + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texi > as.pod + -($(POD2MAN) as.pod | \ +diff -rNU3 a/gas/remap.c b/gas/remap.c +--- a/gas/remap.c 2021-03-30 23:12:40.191226600 -0300 ++++ b/gas/remap.c 2021-03-30 17:48:00.495553000 -0300 +@@ -76,10 +76,13 @@ + + for (map = debug_prefix_maps; map; map = map->next) + if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0) +- { +- const char *name = filename + map->old_len; +- return concat (map->new_prefix, name, NULL); +- } +- +- return xstrdup (filename); ++ break; ++ if (!map) ++ return xstrdup (filename); ++ const char *name = filename + map->old_len; ++ size_t name_len = strlen (name) + 1; ++ char *s = (char *) xmalloc (name_len + map->new_len); ++ memcpy (s, map->new_prefix, map->new_len); ++ memcpy (s + map->new_len, name, name_len); ++ return s; + } +diff -rNU3 a/gold/Makefile.am b/gold/Makefile.am +--- a/gold/Makefile.am 2021-03-30 23:12:40.191226600 -0300 ++++ b/gold/Makefile.am 2021-03-30 17:48:00.518886000 -0300 +@@ -19,7 +19,7 @@ + + AUTOMAKE_OPTIONS = foreign + +-SUBDIRS = po testsuite ++SUBDIRS = po # testsuite + + tooldir = $(exec_prefix)/$(target_alias) + +Os arquivos binários a/gold/po/ja.gmo e b/gold/po/ja.gmo são diferentes +diff -rNU3 a/gold/po/ja.po b/gold/po/ja.po +--- a/gold/po/ja.po 2021-03-30 23:12:40.194559933 -0300 ++++ b/gold/po/ja.po 1969-12-31 21:00:00.000000000 -0300 +@@ -1,2241 +0,0 @@ +-# Japanese messages for GNU binutils gold. +-# Copyright (C) 2010 Free Software Foundation, Inc. +-# This file is distributed under the same license as the binutils package. +-# Yasuaki Taniguchi , 2010. +-# +-msgid "" +-msgstr "" +-"Project-Id-Version: gold 2.20.90\n" +-"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" +-"POT-Creation-Date: 2010-03-03 15:08+0100\n" +-"PO-Revision-Date: 2010-12-18 16:06+0900\n" +-"Last-Translator: Yasuaki Taniguchi \n" +-"Language-Team: Japanese \n" +-"X-Bugs: Report translation errors to the Language-Team address.\n" +-"MIME-Version: 1.0\n" +-"Content-Type: text/plain; charset=UTF-8\n" +-"Content-Transfer-Encoding: 8bit\n" +-"Plural-Forms: nplurals=1; plural=0;\n" +- +-#: archive.cc:119 +-#, c-format +-msgid "%s: no archive symbol table (run ranlib)" +-msgstr "%s: 書庫シンボル表がありません (ranlib を実行してください)" +- +-#: archive.cc:204 +-#, c-format +-msgid "%s: bad archive symbol table names" +-msgstr "%s: 誤った書庫シンボル表名です" +- +-#: archive.cc:236 +-#, c-format +-msgid "%s: malformed archive header at %zu" +-msgstr "%s: 誤った形式の書庫ヘッダが %zu にあります" +- +-#: archive.cc:256 +-#, c-format +-msgid "%s: malformed archive header size at %zu" +-msgstr "%s: 誤った形式の書庫ヘッダサイズが %zu にあります" +- +-#: archive.cc:267 +-#, c-format +-msgid "%s: malformed archive header name at %zu" +-msgstr "%s: 誤った形式の書庫ヘッダ名が %zu にあります" +- +-#: archive.cc:297 +-#, c-format +-msgid "%s: bad extended name index at %zu" +-msgstr "%s: 誤った拡張名索引が %zu にあります" +- +-#: archive.cc:307 +-#, c-format +-msgid "%s: bad extended name entry at header %zu" +-msgstr "%s: 誤った拡張名エントリが %zu にあります" +- +-#: archive.cc:404 +-#, c-format +-msgid "%s: short archive header at %zu" +-msgstr "%s: 短い書庫ヘッダが %zu にあります" +- +-#: archive.cc:560 +-#, c-format +-msgid "%s: member at %zu is not an ELF object" +-msgstr "%s: %zu にあるメンバは ELF オブジェクトではありません" +- +-#: archive.cc:879 +-#, c-format +-msgid "%s: archive libraries: %u\n" +-msgstr "%s: 書庫ライブラリ: %u\n" +- +-#: archive.cc:881 +-#, c-format +-msgid "%s: total archive members: %u\n" +-msgstr "%s: 書庫メンバ総数: %u\n" +- +-#: archive.cc:883 +-#, c-format +-msgid "%s: loaded archive members: %u\n" +-msgstr "%s: ロードされた書庫メンバ数: %u\n" +- +-#: arm.cc:1149 i386.cc:536 sparc.cc:1087 x86_64.cc:565 +-msgid "** PLT" +-msgstr "" +- +-#: arm.cc:1364 i386.cc:880 powerpc.cc:1014 sparc.cc:1502 x86_64.cc:955 +-#: x86_64.cc:1265 +-#, c-format +-msgid "%s: unsupported reloc %u against local symbol" +-msgstr "%s: 局所シンボルに対するサポートされない再配置 %u です" +- +-#: arm.cc:1404 powerpc.cc:1105 sparc.cc:1592 x86_64.cc:992 +-msgid "requires unsupported dynamic reloc; recompile with -fPIC" +-msgstr "サポートされていない動的再配置が必要になりました。 -fPIC を付けて再コンパイルしてください" +- +-#. These are relocations which should only be seen by the +-#. dynamic linker, and should never be seen here. +-#: arm.cc:1519 arm.cc:1739 arm.cc:2354 i386.cc:1002 i386.cc:1334 +-#: powerpc.cc:1223 powerpc.cc:1432 sparc.cc:1877 sparc.cc:2238 x86_64.cc:1145 +-#: x86_64.cc:1453 +-#, c-format +-msgid "%s: unexpected reloc %u in object file" +-msgstr "%s: オブジェクトファイル内で予期しない再配置 %u です" +- +-#: arm.cc:1538 i386.cc:1171 powerpc.cc:1242 sparc.cc:1896 x86_64.cc:1279 +-#: x86_64.cc:1571 +-#, c-format +-msgid "%s: unsupported reloc %u against global symbol %s" +-msgstr "%1$s: 大域シンボル %3$s に対するサポートされない再配置 %2$u です" +- +-#: arm.cc:1804 i386.cc:1542 +-#, c-format +-msgid "%s: unsupported RELA reloc section" +-msgstr "%s: サポートされない RELA 再配置セクションです" +- +-#: arm.cc:2047 +-msgid "relocation R_ARM_MOVW_ABS_NC cannot be used when makinga shared object; recompile with -fPIC" +-msgstr "" +- +-#: arm.cc:2056 +-msgid "relocation R_ARM_MOVT_ABS cannot be used when makinga shared object; recompile with -fPIC" +-msgstr "" +- +-#: arm.cc:2067 +-msgid "relocation R_ARM_THM_MOVW_ABS_NC cannot be used whenmaking a shared object; recompile with -fPIC" +-msgstr "" +- +-#: arm.cc:2077 +-msgid "relocation R_ARM_THM_MOVT_ABS cannot be used whenmaking a shared object; recompile with -fPIC" +-msgstr "" +- +-#: arm.cc:2141 +-msgid "cannot find origin of R_ARM_BASE_PREL" +-msgstr "" +- +-#: arm.cc:2169 +-msgid "cannot find origin of R_ARM_BASE_ABS" +-msgstr "" +- +-#: arm.cc:2230 i386.cc:1820 i386.cc:2521 powerpc.cc:1798 sparc.cc:2711 +-#: x86_64.cc:1935 x86_64.cc:2518 +-#, c-format +-msgid "unexpected reloc %u in object file" +-msgstr "オブジェクトファイル内で予期しない再配置 %u です" +- +-#: arm.cc:2236 i386.cc:1852 i386.cc:1931 i386.cc:1983 i386.cc:2014 +-#: i386.cc:2076 powerpc.cc:1804 sparc.cc:2717 sparc.cc:2900 sparc.cc:2961 +-#: sparc.cc:3068 x86_64.cc:1956 x86_64.cc:2039 x86_64.cc:2094 x86_64.cc:2119 +-#, c-format +-msgid "unsupported reloc %u" +-msgstr "サポートされない再配置 %u です" +- +-#: arm.cc:2248 +-#, c-format +-msgid "relocation overflow in relocation %u" +-msgstr "再配置 %u で再配置オーバーフローが発生しました" +- +-#: arm.cc:2256 +-#, c-format +-msgid "unexpected opcode while processing relocation %u" +-msgstr "再配置 %u を処理中に予期しないオペコードです" +- +-#: arm.cc:2359 i386.cc:2535 +-#, c-format +-msgid "unsupported reloc %u in object file" +-msgstr "オブジェクトファイル内でサポートされない再配置 %u です" +- +-#: binary.cc:129 +-#, c-format +-msgid "cannot open %s: %s:" +-msgstr "%s を開けません: %s:" +- +-#: compressed_output.cc:128 +-msgid "not compressing section data: zlib error" +-msgstr "セクションデータを圧縮しません: zlib エラー" +- +-#: cref.cc:244 +-#, c-format +-msgid "cannot open symbol count file %s: %s" +-msgstr "シンボルカウントファイル %s を開けません: %s" +- +-#: descriptors.cc:116 +-#, c-format +-msgid "file %s was removed during the link" +-msgstr "ファイル %s がリンク中に削除されました" +- +-#: descriptors.cc:169 +-msgid "out of file descriptors and couldn't close any" +-msgstr "ファイル記述子が足りなくなり、どれも閉じることが出来ませんでした" +- +-#: descriptors.cc:190 descriptors.cc:226 +-#, c-format +-msgid "while closing %s: %s" +-msgstr "%s を閉じている間: %s" +- +-#: dirsearch.cc:71 +-#, c-format +-msgid "%s: can not read directory: %s" +-msgstr "%s: ディレクトリを読み込めません: %s" +- +-#: dwarf_reader.cc:53 dwarf_reader.cc:84 +-msgid "Unusually large LEB128 decoded, debug information may be corrupted" +-msgstr "通常ではない大きな LEB128 デコードです。デバッグ情報が壊れているかもしれません" +- +-#: dynobj.cc:164 +-#, c-format +-msgid "unexpected duplicate type %u section: %u, %u" +-msgstr "" +- +-#: dynobj.cc:200 +-#, c-format +-msgid "unexpected link in section %u header: %u != %u" +-msgstr "" +- +-#: dynobj.cc:236 +-#, c-format +-msgid "DYNAMIC section %u link out of range: %u" +-msgstr "" +- +-#: dynobj.cc:244 +-#, c-format +-msgid "DYNAMIC section %u link %u is not a strtab" +-msgstr "" +- +-#: dynobj.cc:273 +-#, c-format +-msgid "DT_SONAME value out of range: %lld >= %lld" +-msgstr "DT_SONAME の値が範囲外です: %lld >= %lld" +- +-#: dynobj.cc:285 +-#, c-format +-msgid "DT_NEEDED value out of range: %lld >= %lld" +-msgstr "DT_NEEDED の値が範囲外です: %lld >= %lld" +- +-#: dynobj.cc:298 +-msgid "missing DT_NULL in dynamic segment" +-msgstr "動的セグメント内に DT_NULL がありません" +- +-#: dynobj.cc:344 +-#, c-format +-msgid "invalid dynamic symbol table name index: %u" +-msgstr "無効な動的シンボル表名索引です: %u" +- +-#: dynobj.cc:351 +-#, c-format +-msgid "dynamic symbol table name section has wrong type: %u" +-msgstr "動的シンボルテーブル名セクションの型が誤っています: %u" +- +-#: dynobj.cc:438 object.cc:463 object.cc:1106 +-#, c-format +-msgid "bad section name offset for section %u: %lu" +-msgstr "セクション %u に対する誤ったセクション名オフセットです: %lu" +- +-#: dynobj.cc:468 +-#, c-format +-msgid "duplicate definition for version %u" +-msgstr "" +- +-#: dynobj.cc:497 +-#, c-format +-msgid "unexpected verdef version %u" +-msgstr "" +- +-#: dynobj.cc:513 +-#, c-format +-msgid "verdef vd_cnt field too small: %u" +-msgstr "" +- +-#: dynobj.cc:521 +-#, c-format +-msgid "verdef vd_aux field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:532 +-#, c-format +-msgid "verdaux vda_name field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:542 +-#, c-format +-msgid "verdef vd_next field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:576 +-#, c-format +-msgid "unexpected verneed version %u" +-msgstr "" +- +-#: dynobj.cc:585 +-#, c-format +-msgid "verneed vn_aux field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:599 +-#, c-format +-msgid "vernaux vna_name field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:610 +-#, c-format +-msgid "verneed vna_next field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:621 +-#, c-format +-msgid "verneed vn_next field out of range: %u" +-msgstr "" +- +-#: dynobj.cc:670 +-msgid "size of dynamic symbols is not multiple of symbol size" +-msgstr "動的シンボルのサイズがシンボルサイズの倍数ではありません" +- +-#: dynobj.cc:1435 +-#, c-format +-msgid "symbol %s has undefined version %s" +-msgstr "" +- +-#: ehframe.h:82 +-msgid "** eh_frame_hdr" +-msgstr "" +- +-#: ehframe.h:353 +-msgid "** eh_frame" +-msgstr "" +- +-#: errors.cc:81 +-#, c-format +-msgid "%s: fatal error: " +-msgstr "%s: 致命的エラー: " +- +-#: errors.cc:92 +-#, c-format +-msgid "%s: error: " +-msgstr "%s: エラー: " +- +-#: errors.cc:104 +-#, c-format +-msgid "%s: warning: " +-msgstr "%s: 警告: " +- +-#: errors.cc:128 +-#, c-format +-msgid "%s: %s: error: " +-msgstr "%s: %s: エラー: " +- +-#: errors.cc:144 +-#, c-format +-msgid "%s: %s: warning: " +-msgstr "%s: %s: 警告: " +- +-#: errors.cc:167 +-#, c-format +-msgid "%s: %s: error: undefined reference to '%s'\n" +-msgstr "%s: %s: エラー: '%s' への未定義の参照です\n" +- +-#: errors.cc:172 +-#, c-format +-msgid "%s: %s: error: undefined reference to '%s', version '%s'\n" +-msgstr "%s: %s: error: '%s', バージョン '%s' への未定義の参照です\n" +- +-#: errors.cc:182 +-#, c-format +-msgid "%s: " +-msgstr "%s: " +- +-#: expression.cc:172 +-#, c-format +-msgid "undefined symbol '%s' referenced in expression" +-msgstr "式内で未定義シンボル '%s' が参照されました" +- +-#: expression.cc:209 +-msgid "invalid reference to dot symbol outside of SECTIONS clause" +-msgstr "" +- +-#. Handle unary operators. We use a preprocessor macro as a hack to +-#. capture the C operator. +-#: expression.cc:278 +-msgid "unary " +-msgstr "単項演算子 " +- +-#. Handle binary operators. We use a preprocessor macro as a hack to +-#. capture the C operator. KEEP_LEFT means that if the left operand +-#. is section relative and the right operand is not, the result uses +-#. the same section as the left operand. KEEP_RIGHT is the same with +-#. left and right swapped. IS_DIV means that we need to give an error +-#. if the right operand is zero. WARN means that we should warn if +-#. used on section relative values in a relocatable link. We always +-#. warn if used on values in different sections in a relocatable link. +-#: expression.cc:400 +-msgid "binary " +-msgstr "二項演算子 " +- +-#: expression.cc:404 +-msgid " by zero" +-msgstr "" +- +-#: expression.cc:575 +-msgid "max applied to section relative value" +-msgstr "" +- +-#: expression.cc:610 +-msgid "min applied to section relative value" +-msgstr "" +- +-#: expression.cc:740 +-msgid "aligning to section relative value" +-msgstr "" +- +-#: expression.cc:895 +-#, c-format +-msgid "unknown constant %s" +-msgstr "不明な定数 %s" +- +-#: expression.cc:1126 +-msgid "SEGMENT_START not implemented" +-msgstr "SEGMENT_START は実装されていません" +- +-#: expression.cc:1135 +-msgid "ORIGIN not implemented" +-msgstr "ORIGIN は実装されていません" +- +-#: expression.cc:1141 +-msgid "LENGTH not implemented" +-msgstr "LENGTH は実装されていません" +- +-#: fileread.cc:65 +-#, c-format +-msgid "munmap failed: %s" +-msgstr "munmap に失敗しました: %s" +- +-#: fileread.cc:129 +-#, c-format +-msgid "%s: fstat failed: %s" +-msgstr "%s: fstat に失敗しました: %s" +- +-#: fileread.cc:169 +-#, c-format +-msgid "could not reopen file %s" +-msgstr "ファイル %s を再度開くことが出来ませんでした" +- +-#: fileread.cc:302 +-#, c-format +-msgid "%s: pread failed: %s" +-msgstr "%s: pread に失敗しました: %s" +- +-#: fileread.cc:308 +-#, c-format +-msgid "%s: file too short: read only %lld of %lld bytes at %lld" +-msgstr "%1$s: ファイルが短すぎます。位置 %4$lld で %3$lld バイト中 %2$lld バイトしか読み込めませんでした" +- +-#: fileread.cc:372 +-#, c-format +-msgid "%s: attempt to map %lld bytes at offset %lld exceeds size of file; the file may be corrupt" +-msgstr "%1$s: オフセット %3$lld で %2$lld バイト分マップを試みましたがファイルサイズを超過しています。ファイルが壊れているかもしれません" +- +-#: fileread.cc:402 +-#, c-format +-msgid "%s: mmap offset %lld size %lld failed: %s" +-msgstr "%s: オフセット %lld、サイズ %lld の mmap に失敗しました: %s" +- +-#: fileread.cc:548 +-#, c-format +-msgid "%s: lseek failed: %s" +-msgstr "%s: lseek に失敗しました: %s" +- +-#: fileread.cc:554 +-#, c-format +-msgid "%s: readv failed: %s" +-msgstr "%s: readv に失敗しました: %s" +- +-#: fileread.cc:557 +-#, c-format +-msgid "%s: file too short: read only %zd of %zd bytes at %lld" +-msgstr "%1$s: ファイルが短すぎます。位置 %4$lld で %3$zd バイト中 %2$zd バイトしか読み込めませんでした" +- +-#: fileread.cc:706 +-#, c-format +-msgid "%s: total bytes mapped for read: %llu\n" +-msgstr "" +- +-#: fileread.cc:708 +-#, c-format +-msgid "%s: maximum bytes mapped for read at one time: %llu\n" +-msgstr "" +- +-#: fileread.cc:791 +-#, c-format +-msgid "%s: stat failed: %s" +-msgstr "%s: stat に失敗しました: %s" +- +-#: fileread.cc:849 +-#, c-format +-msgid "cannot find %s%s" +-msgstr "%s%s が見つかりません" +- +-#: fileread.cc:880 +-#, c-format +-msgid "cannot find %s" +-msgstr "%s が見つかりません" +- +-#: fileread.cc:904 +-#, c-format +-msgid "cannot open %s: %s" +-msgstr "%s を開けません: %s" +- +-#: gold-threads.cc:103 +-#, c-format +-msgid "pthead_mutextattr_init failed: %s" +-msgstr "pthead_mutextattr_init に失敗しました: %s" +- +-#: gold-threads.cc:107 +-#, c-format +-msgid "pthread_mutextattr_settype failed: %s" +-msgstr "pthread_mutextattr_settype に失敗しました: %s" +- +-#: gold-threads.cc:112 +-#, c-format +-msgid "pthread_mutex_init failed: %s" +-msgstr "pthread_mutex_init に失敗しました: %s" +- +-#: gold-threads.cc:116 +-#, c-format +-msgid "pthread_mutexattr_destroy failed: %s" +-msgstr "pthread_mutexattr_destroy に失敗しました: %s" +- +-#: gold-threads.cc:123 +-#, c-format +-msgid "pthread_mutex_destroy failed: %s" +-msgstr "pthread_mutex_destroy に失敗しました: %s" +- +-#: gold-threads.cc:131 gold-threads.cc:382 +-#, c-format +-msgid "pthread_mutex_lock failed: %s" +-msgstr "pthread_mutex_lock に失敗しました: %s" +- +-#: gold-threads.cc:139 gold-threads.cc:394 +-#, c-format +-msgid "pthread_mutex_unlock failed: %s" +-msgstr "pthread_mutex_unlock に失敗しました: %s" +- +-#: gold-threads.cc:220 +-#, c-format +-msgid "pthread_cond_init failed: %s" +-msgstr "pthread_cond_init に失敗しました: %s" +- +-#: gold-threads.cc:227 +-#, c-format +-msgid "pthread_cond_destroy failed: %s" +-msgstr "pthread_cond_destroy に失敗しました: %s" +- +-#: gold-threads.cc:236 +-#, c-format +-msgid "pthread_cond_wait failed: %s" +-msgstr "pthread_cond_wait に失敗しました: %s" +- +-#: gold-threads.cc:244 +-#, c-format +-msgid "pthread_cond_signal failed: %s" +-msgstr "pthread_cond_signal に失敗しました: %s" +- +-#: gold-threads.cc:252 +-#, c-format +-msgid "pthread_cond_broadcast failed: %s" +-msgstr "pthread_cond_broadcast に失敗しました: %s" +- +-#: gold-threads.cc:388 +-#, c-format +-msgid "pthread_once failed: %s" +-msgstr "pthread_once に失敗しました: %s" +- +-#: gold.cc:91 +-#, c-format +-msgid "%s: internal error in %s, at %s:%d\n" +-msgstr "%s: %s の中の位置 %s で内部エラーが発生しました:%d\n" +- +-#: gold.cc:173 +-msgid "no input files" +-msgstr "入力ファイルがありません" +- +-#: gold.cc:226 +-msgid "cannot mix -r with --gc-sections or --icf" +-msgstr "-r と --gc-sections 、--icf は同時に使用できません" +- +-#: gold.cc:407 +-#, c-format +-msgid "cannot mix -static with dynamic object %s" +-msgstr "-static と動的オブジェクト %s は同時に使用できません" +- +-#: gold.cc:411 +-#, c-format +-msgid "cannot mix -r with dynamic object %s" +-msgstr "-r と動的オブジェクト %s は同時に使用できません" +- +-#: gold.cc:415 +-#, c-format +-msgid "cannot use non-ELF output format with dynamic object %s" +-msgstr "動的オブジェクト %s を使用すると非 ELF 出力形式を使用できません" +- +-#: gold.cc:427 +-#, c-format +-msgid "cannot mix split-stack '%s' and non-split-stack '%s' when using -r" +-msgstr "-r を使用しているときはスタック分割 '%s' と非スタック分割 '%s' を同時に使用できません" +- +-#. FIXME: This needs to specify the location somehow. +-#: i386.cc:232 i386.cc:1669 sparc.cc:234 sparc.cc:2395 x86_64.cc:237 +-#: x86_64.cc:1732 +-msgid "missing expected TLS relocation" +-msgstr "予期される TLS 再配置がありません" +- +-#: i386.cc:944 x86_64.cc:1068 +-#, c-format +-msgid "section symbol %u has bad shndx %u" +-msgstr "" +- +-#: i386.cc:1036 i386.cc:1060 sparc.cc:1777 x86_64.cc:1176 x86_64.cc:1204 +-#, c-format +-msgid "local symbol %u has bad shndx %u" +-msgstr "" +- +-#: i386.cc:1991 +-msgid "both SUN and GNU model TLS relocations" +-msgstr "SUN と GNU モデルの TLS 再配置が両方あります" +- +-#: i386.cc:2730 x86_64.cc:2719 +-#, c-format +-msgid "failed to match split-stack sequence at section %u offset %0zx" +-msgstr "" +- +-#: icf.cc:616 +-#, c-format +-msgid "%s: ICF Converged after %u iteration(s)" +-msgstr "" +- +-#: icf.cc:619 +-#, c-format +-msgid "%s: ICF stopped after %u iteration(s)" +-msgstr "" +- +-#: icf.cc:633 +-#, c-format +-msgid "Could not find symbol %s to unfold\n" +-msgstr "" +- +-#: incremental.cc:242 +-#, c-format +-msgid "the link might take longer: cannot perform incremental link: %s" +-msgstr "リンクに時間がかかるかもしれません: 増分リンクを実行できません: %s" +- +-#: incremental.cc:302 +-msgid "no incremental data from previous build" +-msgstr "前回のビルドからの増分データがありません" +- +-#: incremental.cc:309 incremental.cc:332 +-msgid "invalid incremental build data" +-msgstr "無効な増分ビルドデータです" +- +-#: incremental.cc:321 +-msgid "different version of incremental build data" +-msgstr "異なるバージョンの増分ビルドデータです" +- +-#: incremental.cc:338 +-msgid "command line changed" +-msgstr "コマンドラインに変更がありました" +- +-#: incremental.cc:362 +-#, c-format +-msgid "unsupported ELF machine number %d" +-msgstr "サポートされていない ELF マシン番号 %d です" +- +-#: incremental.cc:387 +-msgid "output is not an ELF file." +-msgstr "出力が ELF ファイルではありません。" +- +-#: incremental.cc:410 +-msgid "unsupported file: 32-bit, big-endian" +-msgstr "サポートされていないファイルです: 32-ビット、ビッグエンディアン" +- +-#: incremental.cc:419 +-msgid "unsupported file: 32-bit, little-endian" +-msgstr "サポートされていないファイルです: 32-ビット、リトルエンディアン" +- +-#: incremental.cc:431 +-msgid "unsupported file: 64-bit, big-endian" +-msgstr "サポートされていないファイルです: 64-ビット、ビッグエンディアン" +- +-#: incremental.cc:440 +-msgid "unsupported file: 64-bit, little-endian" +-msgstr "サポートされていないファイルです: 64-ビット、リトルエンディアン" +- +-#: layout.cc:1887 +-#, c-format +-msgid "--build-id=uuid failed: could not open /dev/urandom: %s" +-msgstr "--build-id=uuid に失敗しました: /dev/urandom を開けませんでした: %s" +- +-#: layout.cc:1894 +-#, c-format +-msgid "/dev/urandom: read failed: %s" +-msgstr "/dev/urandom: 読み込みに失敗しました: %s" +- +-#: layout.cc:1896 +-#, c-format +-msgid "/dev/urandom: expected %zu bytes, got %zd bytes" +-msgstr "" +- +-#: layout.cc:1918 +-#, c-format +-msgid "--build-id argument '%s' not a valid hex number" +-msgstr "--build-id の引数 '%s' が有効な十六進数ではありません" +- +-#: layout.cc:1924 +-#, c-format +-msgid "unrecognized --build-id argument '%s'" +-msgstr "認識できない --build-id の引数 '%s' です" +- +-#: layout.cc:2337 +-#, c-format +-msgid "load segment overlap [0x%llx -> 0x%llx] and [0x%llx -> 0x%llx]" +-msgstr "ロードセグメントが重なり合っています [0x%llx -> 0x%llx] および [0x%llx -> 0x%llx]" +- +-#: mapfile.cc:70 +-#, c-format +-msgid "cannot open map file %s: %s" +-msgstr "マップファイル %s を開けません: %s" +- +-#: mapfile.cc:84 +-#, c-format +-msgid "cannot close map file: %s" +-msgstr "マップファイルを閉じられません: %s" +- +-#: mapfile.cc:116 +-#, c-format +-msgid "" +-"Archive member included because of file (symbol)\n" +-"\n" +-msgstr "" +- +-#: mapfile.cc:159 +-#, c-format +-msgid "" +-"\n" +-"Allocating common symbols\n" +-msgstr "" +- +-#: mapfile.cc:161 +-#, c-format +-msgid "" +-"Common symbol size file\n" +-"\n" +-msgstr "" +- +-#: mapfile.cc:195 +-#, c-format +-msgid "" +-"\n" +-"Memory map\n" +-"\n" +-msgstr "" +-"\n" +-"メモリマップ\n" +-"\n" +- +-#: mapfile.cc:361 +-#, c-format +-msgid "" +-"\n" +-"Discarded input sections\n" +-"\n" +-msgstr "" +-"\n" +-"破棄された入力セクション\n" +-"\n" +- +-#: merge.cc:455 +-#, c-format +-msgid "%s: %s merged constants size: %lu; input: %zu; output: %zu\n" +-msgstr "" +- +-#: merge.cc:478 +-msgid "mergeable string section length not multiple of character size" +-msgstr "" +- +-#: merge.cc:494 +-#, c-format +-msgid "%s: last entry in mergeable string section '%s' not null terminated" +-msgstr "" +- +-#: merge.cc:613 +-#, c-format +-msgid "%s: %s input: %zu\n" +-msgstr "" +- +-#: merge.h:300 +-msgid "** merge constants" +-msgstr "" +- +-#: merge.h:422 +-msgid "** merge strings" +-msgstr "" +- +-#: object.cc:75 +-msgid "missing SHT_SYMTAB_SHNDX section" +-msgstr "" +- +-#: object.cc:119 +-#, c-format +-msgid "symbol %u out of range for SHT_SYMTAB_SHNDX section" +-msgstr "" +- +-#: object.cc:126 +-#, c-format +-msgid "extended index for symbol %u out of range: %u" +-msgstr "" +- +-#: object.cc:148 object.cc:2331 output.cc:4052 +-#, c-format +-msgid "%s: %s" +-msgstr "" +- +-#: object.cc:190 +-#, c-format +-msgid "section name section has wrong type: %u" +-msgstr "" +- +-#: object.cc:546 +-#, c-format +-msgid "invalid symbol table name index: %u" +-msgstr "" +- +-#: object.cc:552 +-#, c-format +-msgid "symbol table name section has wrong type: %u" +-msgstr "" +- +-#: object.cc:641 +-#, c-format +-msgid "section group %u info %u out of range" +-msgstr "" +- +-#: object.cc:660 +-#, c-format +-msgid "symbol %u name offset %u out of range" +-msgstr "" +- +-#: object.cc:678 +-#, c-format +-msgid "symbol %u invalid section index %u" +-msgstr "" +- +-#: object.cc:723 +-#, c-format +-msgid "section %u in section group %u out of range" +-msgstr "" +- +-#: object.cc:731 +-#, c-format +-msgid "invalid section group %u refers to earlier section %u" +-msgstr "" +- +-#: object.cc:1037 reloc.cc:271 reloc.cc:838 +-#, c-format +-msgid "relocation section %u has bad info %u" +-msgstr "" +- +-#: object.cc:1231 +-#, c-format +-msgid "%s: removing unused section from '%s' in file '%s'" +-msgstr "" +- +-#: object.cc:1257 +-#, c-format +-msgid "%s: ICF folding section '%s' in file '%s'into '%s' in file '%s'" +-msgstr "" +- +-#: object.cc:1454 +-msgid "size of symbols is not multiple of symbol size" +-msgstr "" +- +-#: object.cc:1563 +-#, c-format +-msgid "local symbol %u section name out of range: %u >= %u" +-msgstr "" +- +-#: object.cc:1652 +-#, c-format +-msgid "unknown section index %u for local symbol %u" +-msgstr "" +- +-#: object.cc:1661 +-#, c-format +-msgid "local symbol %u section index %u out of range" +-msgstr "" +- +-#: object.cc:2169 +-#, c-format +-msgid "%s is not supported but is required for %s in %s" +-msgstr "" +- +-#: object.cc:2273 +-#, c-format +-msgid "%s: unsupported ELF machine number %d" +-msgstr "" +- +-#: object.cc:2283 +-#, c-format +-msgid "%s: incompatible target" +-msgstr "" +- +-#: object.cc:2347 plugin.cc:1019 +-#, c-format +-msgid "%s: not configured to support 32-bit big-endian object" +-msgstr "" +- +-#: object.cc:2363 plugin.cc:1028 +-#, c-format +-msgid "%s: not configured to support 32-bit little-endian object" +-msgstr "" +- +-#: object.cc:2382 plugin.cc:1040 +-#, c-format +-msgid "%s: not configured to support 64-bit big-endian object" +-msgstr "" +- +-#: object.cc:2398 plugin.cc:1049 +-#, c-format +-msgid "%s: not configured to support 64-bit little-endian object" +-msgstr "" +- +-#: options.cc:156 +-#, c-format +-msgid "" +-"Usage: %s [options] file...\n" +-"Options:\n" +-msgstr "" +-"使用法: %s [options] file...\n" +-"オプション:\n" +- +-#. config.guess and libtool.m4 look in ld --help output for the +-#. string "supported targets". +-#: options.cc:164 +-#, c-format +-msgid "%s: supported targets:" +-msgstr "" +- +-#: options.cc:176 +-#, c-format +-msgid "Report bugs to %s\n" +-msgstr "" +- +-#: options.cc:193 options.cc:203 options.cc:213 +-#, c-format +-msgid "%s: invalid option value (expected an integer): %s" +-msgstr "" +- +-#: options.cc:223 +-#, c-format +-msgid "%s: invalid option value (expected a floating point number): %s" +-msgstr "" +- +-#: options.cc:232 +-#, c-format +-msgid "%s: must take a non-empty argument" +-msgstr "" +- +-#: options.cc:273 +-#, c-format +-msgid "%s: must take one of the following arguments: %s" +-msgstr "" +- +-#: options.cc:300 +-#, c-format +-msgid " Supported targets:\n" +-msgstr "" +- +-#: options.cc:409 +-#, c-format +-msgid "unable to parse script file %s" +-msgstr "" +- +-#: options.cc:417 +-#, c-format +-msgid "unable to parse version script file %s" +-msgstr "" +- +-#: options.cc:425 +-#, c-format +-msgid "unable to parse dynamic-list script file %s" +-msgstr "" +- +-#: options.cc:522 +-#, c-format +-msgid "format '%s' not supported; treating as elf (supported formats: elf, binary)" +-msgstr "" +- +-#: options.cc:538 +-#, c-format +-msgid "%s: use the --help option for usage information\n" +-msgstr "" +- +-#: options.cc:547 +-#, c-format +-msgid "%s: %s: %s\n" +-msgstr "" +- +-#: options.cc:651 +-msgid "unexpected argument" +-msgstr "" +- +-#: options.cc:664 options.cc:725 +-msgid "missing argument" +-msgstr "" +- +-#: options.cc:736 +-msgid "unknown -z option" +-msgstr "" +- +-#: options.cc:935 +-#, c-format +-msgid "ignoring --threads: %s was compiled without thread support" +-msgstr "" +- +-#: options.cc:942 +-#, c-format +-msgid "ignoring --thread-count: %s was compiled without thread support" +-msgstr "" +- +-#: options.cc:981 +-#, c-format +-msgid "unable to open -retain-symbols-file file %s: %s" +-msgstr "" +- +-#: options.cc:1003 +-msgid "-shared and -static are incompatible" +-msgstr "" +- +-#: options.cc:1005 +-msgid "-shared and -pie are incompatible" +-msgstr "" +- +-#: options.cc:1008 +-msgid "-shared and -r are incompatible" +-msgstr "" +- +-#: options.cc:1010 +-msgid "-pie and -r are incompatible" +-msgstr "" +- +-#: options.cc:1014 +-msgid "-retain-symbols-file does not yet work with -r" +-msgstr "" +- +-#: options.cc:1020 +-msgid "binary output format not compatible with -shared or -pie or -r" +-msgstr "" +- +-#: options.cc:1026 +-#, c-format +-msgid "--hash-bucket-empty-fraction value %g out of range [0.0, 1.0)" +-msgstr "" +- +-#: options.cc:1031 +-msgid "Options --incremental-changed, --incremental-unchanged, --incremental-unknown require the use of --incremental" +-msgstr "" +- +-#: options.cc:1097 +-msgid "May not nest groups" +-msgstr "" +- +-#: options.cc:1109 +-msgid "Group end without group start" +-msgstr "" +- +-#. I guess it's neither a long option nor a short option. +-#: options.cc:1174 +-msgid "unknown option" +-msgstr "" +- +-#: options.cc:1201 +-#, c-format +-msgid "%s: missing group end\n" +-msgstr "" +- +-#: options.h:571 +-msgid "Report usage information" +-msgstr "" +- +-#: options.h:573 +-msgid "Report version information" +-msgstr "" +- +-#: options.h:575 +-msgid "Report version and target information" +-msgstr "" +- +-#: options.h:584 options.h:635 +-msgid "Not supported" +-msgstr "" +- +-#: options.h:585 options.h:636 +-msgid "Do not copy DT_NEEDED tags from shared libraries" +-msgstr "" +- +-#: options.h:588 +-msgid "Allow unresolved references in shared libraries" +-msgstr "" +- +-#: options.h:589 +-msgid "Do not allow unresolved references in shared libraries" +-msgstr "" +- +-#: options.h:592 +-msgid "Only set DT_NEEDED for shared libraries if used" +-msgstr "" +- +-#: options.h:593 +-msgid "Always DT_NEEDED for shared libraries" +-msgstr "" +- +-#: options.h:600 +-msgid "Set input format" +-msgstr "" +- +-#: options.h:603 +-msgid "-l searches for shared libraries" +-msgstr "" +- +-#: options.h:605 +-msgid "-l does not search for shared libraries" +-msgstr "" +- +-#: options.h:609 +-msgid "Bind defined symbols locally" +-msgstr "" +- +-#: options.h:612 +-msgid "Bind defined function symbols locally" +-msgstr "" +- +-#: options.h:615 +-msgid "Generate build ID note" +-msgstr "" +- +-#: options.h:616 options.h:655 +-msgid "[=STYLE]" +-msgstr "" +- +-#: options.h:619 +-msgid "Check segment addresses for overlaps (default)" +-msgstr "" +- +-#: options.h:620 +-msgid "Do not check segment addresses for overlaps" +-msgstr "" +- +-#: options.h:624 options.h:629 +-msgid "Compress .debug_* sections in the output file" +-msgstr "" +- +-#: options.h:630 +-msgid "[none]" +-msgstr "" +- +-#: options.h:639 +-msgid "Define common symbols" +-msgstr "" +- +-#: options.h:640 +-msgid "Do not define common symbols" +-msgstr "" +- +-#: options.h:642 options.h:644 +-msgid "Alias for -d" +-msgstr "" +- +-#: options.h:647 +-msgid "Turn on debugging" +-msgstr "" +- +-#: options.h:648 +-msgid "[all,files,script,task][,...]" +-msgstr "" +- +-#: options.h:651 +-msgid "Define a symbol" +-msgstr "" +- +-#: options.h:651 +-msgid "SYMBOL=EXPRESSION" +-msgstr "" +- +-#: options.h:654 +-msgid "Demangle C++ symbols in log messages" +-msgstr "" +- +-#: options.h:658 +-msgid "Do not demangle C++ symbols in log messages" +-msgstr "" +- +-#: options.h:662 +-msgid "Try to detect violations of the One Definition Rule" +-msgstr "" +- +-#: options.h:666 +-msgid "Delete all temporary local symbols" +-msgstr "" +- +-#: options.h:669 +-msgid "Add data symbols to dynamic symbols" +-msgstr "" +- +-#: options.h:672 +-msgid "Add C++ operator new/delete to dynamic symbols" +-msgstr "" +- +-#: options.h:675 +-msgid "Add C++ typeinfo to dynamic symbols" +-msgstr "" +- +-#: options.h:678 +-msgid "Read a list of dynamic symbols" +-msgstr "" +- +-#: options.h:678 options.h:732 options.h:766 options.h:893 options.h:921 +-msgid "FILE" +-msgstr "" +- +-#: options.h:681 +-msgid "Set program start address" +-msgstr "" +- +-#: options.h:681 options.h:908 options.h:910 options.h:912 +-msgid "ADDRESS" +-msgstr "" +- +-#: options.h:684 +-msgid "Exclude libraries from automatic export" +-msgstr "" +- +-#: options.h:688 +-msgid "Export all dynamic symbols" +-msgstr "" +- +-#: options.h:689 +-msgid "Do not export all dynamic symbols (default)" +-msgstr "" +- +-#: options.h:692 +-msgid "Create exception frame header" +-msgstr "" +- +-#: options.h:695 +-msgid "Treat warnings as errors" +-msgstr "" +- +-#: options.h:696 +-msgid "Do not treat warnings as errors" +-msgstr "" +- +-#: options.h:699 +-msgid "Call SYMBOL at unload-time" +-msgstr "" +- +-#: options.h:699 options.h:729 options.h:873 options.h:915 options.h:936 +-#: options.h:939 +-msgid "SYMBOL" +-msgstr "" +- +-#: options.h:702 +-msgid "Set shared library name" +-msgstr "" +- +-#: options.h:702 options.h:792 +-msgid "FILENAME" +-msgstr "" +- +-#: options.h:705 +-msgid "Min fraction of empty buckets in dynamic hash" +-msgstr "" +- +-#: options.h:706 +-msgid "FRACTION" +-msgstr "" +- +-#: options.h:709 +-msgid "Dynamic hash style" +-msgstr "" +- +-#: options.h:709 +-msgid "[sysv,gnu,both]" +-msgstr "" +- +-#: options.h:713 +-msgid "Set dynamic linker path" +-msgstr "" +- +-#: options.h:713 +-msgid "PROGRAM" +-msgstr "" +- +-#: options.h:716 +-msgid "Work in progress; do not use" +-msgstr "" +- +-#: options.h:717 +-msgid "Do a full build" +-msgstr "" +- +-#: options.h:720 +-msgid "Assume files changed" +-msgstr "" +- +-#: options.h:723 +-msgid "Assume files didn't change" +-msgstr "" +- +-#: options.h:726 +-msgid "Use timestamps to check files (default)" +-msgstr "" +- +-#: options.h:729 +-msgid "Call SYMBOL at load-time" +-msgstr "" +- +-#: options.h:732 +-msgid "Read only symbol values from FILE" +-msgstr "" +- +-#: options.h:735 +-msgid "Search for library LIBNAME" +-msgstr "" +- +-#: options.h:735 +-msgid "LIBNAME" +-msgstr "" +- +-#: options.h:738 +-msgid "Add directory to search path" +-msgstr "" +- +-#: options.h:738 options.h:813 options.h:816 options.h:820 options.h:887 +-msgid "DIR" +-msgstr "" +- +-#: options.h:741 +-msgid "Ignored for compatibility" +-msgstr "" +- +-#: options.h:741 +-msgid "EMULATION" +-msgstr "" +- +-#: options.h:744 +-msgid "Write map file on standard output" +-msgstr "" +- +-#: options.h:745 +-msgid "Write map file" +-msgstr "" +- +-#: options.h:746 +-msgid "MAPFILENAME" +-msgstr "" +- +-#: options.h:749 +-msgid "Do not page align data" +-msgstr "" +- +-#: options.h:751 +-msgid "Do not page align data, do not make text readonly" +-msgstr "" +- +-#: options.h:752 +-msgid "Page align data, make text readonly" +-msgstr "" +- +-#: options.h:755 +-msgid "Enable use of DT_RUNPATH and DT_FLAGS" +-msgstr "" +- +-#: options.h:756 +-msgid "Disable use of DT_RUNPATH and DT_FLAGS" +-msgstr "" +- +-#: options.h:759 +-msgid "Create an output file even if errors occur" +-msgstr "" +- +-#: options.h:762 options.h:958 +-msgid "Report undefined symbols (even with --shared)" +-msgstr "" +- +-#: options.h:766 +-msgid "Set output file name" +-msgstr "" +- +-#: options.h:769 +-msgid "Optimize output file size" +-msgstr "" +- +-#: options.h:769 +-msgid "LEVEL" +-msgstr "" +- +-#: options.h:772 +-msgid "Set output format" +-msgstr "" +- +-#: options.h:772 +-msgid "[binary]" +-msgstr "" +- +-#: options.h:775 options.h:777 +-msgid "Create a position independent executable" +-msgstr "" +- +-#: options.h:782 +-msgid "Load a plugin library" +-msgstr "" +- +-#: options.h:782 +-msgid "PLUGIN" +-msgstr "" +- +-#: options.h:784 +-msgid "Pass an option to the plugin" +-msgstr "" +- +-#: options.h:784 +-msgid "OPTION" +-msgstr "" +- +-#: options.h:788 +-msgid "Preread archive symbols when multi-threaded" +-msgstr "" +- +-#: options.h:791 +-msgid "Print symbols defined and used for each input" +-msgstr "" +- +-#: options.h:795 +-msgid "Ignored for SVR4 compatibility" +-msgstr "" +- +-#: options.h:798 +-msgid "Generate relocations in output" +-msgstr "" +- +-#: options.h:801 +-msgid "Generate relocatable output" +-msgstr "" +- +-#: options.h:804 +-msgid "Relax branches on certain targets" +-msgstr "" +- +-#: options.h:807 +-msgid "keep only symbols listed in this file" +-msgstr "" +- +-#: options.h:807 +-msgid "[file]" +-msgstr "" +- +-#: options.h:813 options.h:816 +-msgid "Add DIR to runtime search path" +-msgstr "" +- +-#: options.h:819 +-msgid "Add DIR to link time shared library search path" +-msgstr "" +- +-#: options.h:823 +-msgid "Strip all symbols" +-msgstr "" +- +-#: options.h:825 +-msgid "Strip debugging information" +-msgstr "" +- +-#: options.h:827 +-msgid "Emit only debug line number information" +-msgstr "" +- +-#: options.h:829 +-msgid "Strip debug symbols that are unused by gdb (at least versions <= 6.7)" +-msgstr "" +- +-#: options.h:832 +-msgid "Strip LTO intermediate code sections" +-msgstr "" +- +-#: options.h:835 +-msgid "(ARM only) The maximum distance from instructions in a group of sections to their stubs. Negative values mean stubs are always after the group. 1 means using default size.\n" +-msgstr "" +- +-#: options.h:838 options.h:852 options.h:956 options.h:975 +-msgid "SIZE" +-msgstr "" +- +-#: options.h:841 +-msgid "Use less memory and more disk I/O (included only for compatibility with GNU ld)" +-msgstr "" +- +-#: options.h:845 options.h:848 +-msgid "Generate shared library" +-msgstr "" +- +-#: options.h:851 +-msgid "Stack size when -fsplit-stack function calls non-split" +-msgstr "" +- +-#: options.h:857 +-msgid "Do not link against shared libraries" +-msgstr "" +- +-#: options.h:860 +-msgid "Identical Code Folding. '--icf=safe' folds only ctors and dtors." +-msgstr "" +- +-#: options.h:866 +-msgid "Number of iterations of ICF (default 2)" +-msgstr "" +- +-#: options.h:866 options.h:899 options.h:901 options.h:903 options.h:905 +-msgid "COUNT" +-msgstr "" +- +-#: options.h:869 +-msgid "List folded identical sections on stderr" +-msgstr "" +- +-#: options.h:870 +-msgid "Do not list folded identical sections" +-msgstr "" +- +-#: options.h:873 +-msgid "Do not fold this symbol during ICF" +-msgstr "" +- +-#: options.h:876 +-msgid "Remove unused sections" +-msgstr "" +- +-#: options.h:877 +-msgid "Don't remove unused sections (default)" +-msgstr "" +- +-#: options.h:880 +-msgid "List removed unused sections on stderr" +-msgstr "" +- +-#: options.h:881 +-msgid "Do not list removed unused sections" +-msgstr "" +- +-#: options.h:884 +-msgid "Print resource usage statistics" +-msgstr "" +- +-#: options.h:887 +-msgid "Set target system root directory" +-msgstr "" +- +-#: options.h:890 +-msgid "Print the name of each input file" +-msgstr "" +- +-#: options.h:893 +-msgid "Read linker script" +-msgstr "" +- +-#: options.h:896 +-msgid "Run the linker multi-threaded" +-msgstr "" +- +-#: options.h:897 +-msgid "Do not run the linker multi-threaded" +-msgstr "" +- +-#: options.h:899 +-msgid "Number of threads to use" +-msgstr "" +- +-#: options.h:901 +-msgid "Number of threads to use in initial pass" +-msgstr "" +- +-#: options.h:903 +-msgid "Number of threads to use in middle pass" +-msgstr "" +- +-#: options.h:905 +-msgid "Number of threads to use in final pass" +-msgstr "" +- +-#: options.h:908 +-msgid "Set the address of the bss segment" +-msgstr "" +- +-#: options.h:910 +-msgid "Set the address of the data segment" +-msgstr "" +- +-#: options.h:912 +-msgid "Set the address of the text segment" +-msgstr "" +- +-#: options.h:915 +-msgid "Create undefined reference to SYMBOL" +-msgstr "" +- +-#: options.h:918 +-msgid "Synonym for --debug=files" +-msgstr "" +- +-#: options.h:921 +-msgid "Read version script" +-msgstr "" +- +-#: options.h:924 +-msgid "Warn about duplicate common symbols" +-msgstr "" +- +-#: options.h:925 +-msgid "Do not warn about duplicate common symbols (default)" +-msgstr "" +- +-#: options.h:928 +-msgid "Warn when skipping an incompatible library" +-msgstr "" +- +-#: options.h:929 +-msgid "Don't warn when skipping an incompatible library" +-msgstr "" +- +-#: options.h:932 +-msgid "Include all archive contents" +-msgstr "" +- +-#: options.h:933 +-msgid "Include only needed archive contents" +-msgstr "" +- +-#: options.h:936 +-msgid "Use wrapper functions for SYMBOL" +-msgstr "" +- +-#: options.h:939 +-msgid "Trace references to symbol" +-msgstr "" +- +-#: options.h:942 +-msgid "Default search path for Solaris compatibility" +-msgstr "" +- +-#: options.h:943 +-msgid "PATH" +-msgstr "" +- +-#: options.h:946 +-msgid "Start a library search group" +-msgstr "" +- +-#: options.h:948 +-msgid "End a library search group" +-msgstr "" +- +-#: options.h:953 +-msgid "Sort dynamic relocs" +-msgstr "" +- +-#: options.h:954 +-msgid "Do not sort dynamic relocs" +-msgstr "" +- +-#: options.h:956 +-msgid "Set common page size to SIZE" +-msgstr "" +- +-#: options.h:961 +-msgid "Mark output as requiring executable stack" +-msgstr "" +- +-#: options.h:963 +-msgid "Mark DSO to be initialized first at runtime" +-msgstr "" +- +-#: options.h:966 +-msgid "Mark object to interpose all DSOs but executable" +-msgstr "" +- +-#: options.h:969 +-msgid "Mark object for lazy runtime binding (default)" +-msgstr "" +- +-#: options.h:972 +-msgid "Mark object requiring immediate process" +-msgstr "" +- +-#: options.h:975 +-msgid "Set maximum page size to SIZE" +-msgstr "" +- +-#: options.h:978 +-msgid "Do not create copy relocs" +-msgstr "" +- +-#: options.h:980 +-msgid "Mark object not to use default search paths" +-msgstr "" +- +-#: options.h:983 +-msgid "Mark DSO non-deletable at runtime" +-msgstr "" +- +-#: options.h:986 +-msgid "Mark DSO not available to dlopen" +-msgstr "" +- +-#: options.h:989 +-msgid "Mark DSO not available to dldump" +-msgstr "" +- +-#: options.h:992 +-msgid "Mark output as not requiring executable stack" +-msgstr "" +- +-#: options.h:994 +-msgid "Mark object for immediate function binding" +-msgstr "" +- +-#: options.h:997 +-msgid "Mark DSO to indicate that needs immediate $ORIGIN processing at runtime" +-msgstr "" +- +-#: options.h:1000 +-msgid "Where possible mark variables read-only after relocation" +-msgstr "" +- +-#: options.h:1001 +-msgid "Don't mark variables read-only after relocation" +-msgstr "" +- +-#: output.cc:1132 +-msgid "section group retained but group element discarded" +-msgstr "" +- +-#: output.cc:1860 +-#, c-format +-msgid "invalid alignment %lu for section \"%s\"" +-msgstr "" +- +-#: output.cc:3573 +-#, c-format +-msgid "dot moves backward in linker script from 0x%llx to 0x%llx" +-msgstr "" +- +-#: output.cc:3576 +-#, c-format +-msgid "address of section '%s' moves backward from 0x%llx to 0x%llx" +-msgstr "" +- +-#: output.cc:3755 +-#, c-format +-msgid "nobits section %s may not precede progbits section %s in same segment" +-msgstr "" +- +-#: output.cc:3907 output.cc:3975 +-#, c-format +-msgid "%s: open: %s" +-msgstr "" +- +-#: output.cc:3996 +-#, c-format +-msgid "%s: mremap: %s" +-msgstr "" +- +-#: output.cc:4005 +-#, c-format +-msgid "%s: mmap: %s" +-msgstr "" +- +-#: output.cc:4085 +-#, c-format +-msgid "%s: mmap: failed to allocate %lu bytes for output file: %s" +-msgstr "" +- +-#: output.cc:4096 +-#, c-format +-msgid "%s: munmap: %s" +-msgstr "" +- +-#: output.cc:4115 +-#, c-format +-msgid "%s: write: unexpected 0 return-value" +-msgstr "" +- +-#: output.cc:4117 +-#, c-format +-msgid "%s: write: %s" +-msgstr "" +- +-#: output.cc:4132 +-#, c-format +-msgid "%s: close: %s" +-msgstr "" +- +-#: output.h:520 +-msgid "** section headers" +-msgstr "" +- +-#: output.h:565 +-msgid "** segment headers" +-msgstr "" +- +-#: output.h:613 +-msgid "** file header" +-msgstr "" +- +-#: output.h:833 +-msgid "** fill" +-msgstr "" +- +-#: output.h:987 +-msgid "** string table" +-msgstr "" +- +-#: output.h:1300 +-msgid "** dynamic relocs" +-msgstr "" +- +-#: output.h:1301 output.h:1637 +-msgid "** relocs" +-msgstr "" +- +-#: output.h:1662 +-msgid "** group" +-msgstr "" +- +-#: output.h:1774 +-msgid "** GOT" +-msgstr "" +- +-#: output.h:1916 +-msgid "** dynamic" +-msgstr "" +- +-#: output.h:2039 +-msgid "** symtab xindex" +-msgstr "" +- +-#: parameters.cc:172 +-#, c-format +-msgid "unrecognized output format %s" +-msgstr "" +- +-#: plugin.cc:106 +-#, c-format +-msgid "%s: could not load plugin library" +-msgstr "" +- +-#: plugin.cc:116 +-#, c-format +-msgid "%s: could not find onload entry point" +-msgstr "" +- +-#: plugin.cc:426 +-msgid "Input files added by plug-ins in --incremental mode not supported yet.\n" +-msgstr "" +- +-#: powerpc.cc:1502 sparc.cc:2307 x86_64.cc:1632 +-#, c-format +-msgid "%s: unsupported REL reloc section" +-msgstr "" +- +-#: readsyms.cc:191 +-#, c-format +-msgid "%s: file is empty" +-msgstr "" +- +-#. Here we have to handle any other input file types we need. +-#: readsyms.cc:575 +-#, c-format +-msgid "%s: not an object or archive" +-msgstr "" +- +-#: reduced_debug_output.cc:236 +-msgid "Debug abbreviations extend beyond .debug_abbrev section; failed to reduce debug abbreviations" +-msgstr "" +- +-#: reduced_debug_output.cc:322 +-msgid "Extremely large compile unit in debug info; failed to reduce debug info" +-msgstr "" +- +-#: reduced_debug_output.cc:330 +-msgid "Debug info extends beyond .debug_info section;failed to reduce debug info" +-msgstr "" +- +-#: reduced_debug_output.cc:350 reduced_debug_output.cc:392 +-msgid "Invalid DIE in debug info; failed to reduce debug info" +-msgstr "" +- +-#: reduced_debug_output.cc:373 +-msgid "Debug info extends beyond .debug_info section; failed to reduce debug info" +-msgstr "" +- +-#: reloc.cc:297 reloc.cc:858 +-#, c-format +-msgid "relocation section %u uses unexpected symbol table %u" +-msgstr "" +- +-#: reloc.cc:312 reloc.cc:875 +-#, c-format +-msgid "unexpected entsize for reloc section %u: %lu != %u" +-msgstr "" +- +-#: reloc.cc:321 reloc.cc:884 +-#, c-format +-msgid "reloc section %u size %lu uneven" +-msgstr "" +- +-#: reloc.cc:1203 +-#, c-format +-msgid "could not convert call to '%s' to '%s'" +-msgstr "" +- +-#: reloc.cc:1343 +-#, c-format +-msgid "reloc section size %zu is not a multiple of reloc size %d\n" +-msgstr "" +- +-#. We should only see externally visible symbols in the symbol +-#. table. +-#: resolve.cc:191 +-msgid "invalid STB_LOCAL symbol in external symbols" +-msgstr "" +- +-#. Any target which wants to handle STB_LOOS, etc., needs to +-#. define a resolve method. +-#: resolve.cc:197 +-msgid "unsupported symbol binding" +-msgstr "" +- +-#. A dynamic object cannot reference a hidden or internal symbol +-#. defined in another object. +-#: resolve.cc:266 +-#, c-format +-msgid "%s symbol '%s' in %s is referenced by DSO %s" +-msgstr "" +- +-#: resolve.cc:326 +-#, c-format +-msgid "common of '%s' overriding smaller common" +-msgstr "" +- +-#: resolve.cc:331 +-#, c-format +-msgid "common of '%s' overidden by larger common" +-msgstr "" +- +-#: resolve.cc:336 +-#, c-format +-msgid "multiple common of '%s'" +-msgstr "" +- +-#: resolve.cc:442 +-#, c-format +-msgid "multiple definition of '%s'" +-msgstr "" +- +-#: resolve.cc:481 +-#, c-format +-msgid "definition of '%s' overriding common" +-msgstr "" +- +-#: resolve.cc:516 +-#, c-format +-msgid "definition of '%s' overriding dynamic common definition" +-msgstr "" +- +-#: resolve.cc:636 +-#, c-format +-msgid "common '%s' overridden by previous definition" +-msgstr "" +- +-#: resolve.cc:766 resolve.cc:778 +-msgid "command line" +-msgstr "" +- +-#: script-sections.cc:690 +-msgid "dot may not move backward" +-msgstr "" +- +-#: script-sections.cc:757 +-msgid "** expression" +-msgstr "" +- +-#: script-sections.cc:941 +-msgid "fill value is not absolute" +-msgstr "" +- +-#: script-sections.cc:1913 +-#, c-format +-msgid "alignment of section %s is not absolute" +-msgstr "" +- +-#: script-sections.cc:1957 +-#, c-format +-msgid "subalign of section %s is not absolute" +-msgstr "" +- +-#: script-sections.cc:1972 +-#, c-format +-msgid "fill of section %s is not absolute" +-msgstr "" +- +-#: script-sections.cc:2048 +-msgid "SPECIAL constraints are not implemented" +-msgstr "" +- +-#: script-sections.cc:2090 +-msgid "mismatched definition for constrained sections" +-msgstr "" +- +-#: script-sections.cc:2634 +-msgid "DATA_SEGMENT_ALIGN may only appear once in a linker script" +-msgstr "" +- +-#: script-sections.cc:2649 +-msgid "DATA_SEGMENT_RELRO_END may only appear once in a linker script" +-msgstr "" +- +-#: script-sections.cc:2654 +-msgid "DATA_SEGMENT_RELRO_END must follow DATA_SEGMENT_ALIGN" +-msgstr "" +- +-#: script-sections.cc:2826 +-msgid "no matching section constraint" +-msgstr "" +- +-#: script-sections.cc:3151 +-msgid "TLS sections are not adjacent" +-msgstr "" +- +-#: script-sections.cc:3280 +-msgid "allocated section not in any segment" +-msgstr "" +- +-#: script-sections.cc:3309 +-#, c-format +-msgid "no segment %s" +-msgstr "" +- +-#: script-sections.cc:3323 +-msgid "section in two PT_LOAD segments" +-msgstr "" +- +-#: script-sections.cc:3330 +-msgid "allocated section not in any PT_LOAD segment" +-msgstr "" +- +-#: script-sections.cc:3358 +-msgid "may only specify load address for PT_LOAD segment" +-msgstr "" +- +-#: script-sections.cc:3382 +-#, c-format +-msgid "PHDRS load address overrides section %s load address" +-msgstr "" +- +-#. We could support this if we wanted to. +-#: script-sections.cc:3393 +-msgid "using only one of FILEHDR and PHDRS is not currently supported" +-msgstr "" +- +-#: script-sections.cc:3408 +-msgid "sections loaded on first page without room for file and program headers are not supported" +-msgstr "" +- +-#: script-sections.cc:3414 +-msgid "using FILEHDR and PHDRS on more than one PT_LOAD segment is not currently supported" +-msgstr "" +- +-#: script.cc:1072 +-msgid "invalid use of PROVIDE for dot symbol" +-msgstr "" +- +-#: script.cc:2132 +-#, c-format +-msgid "%s:%d:%d: %s" +-msgstr "" +- +-#. There are some options that we could handle here--e.g., +-#. -lLIBRARY. Should we bother? +-#: script.cc:2297 +-#, c-format +-msgid "%s:%d:%d: ignoring command OPTION; OPTION is only valid for scripts specified via -T/--script" +-msgstr "" +- +-#: script.cc:2362 +-#, c-format +-msgid "%s:%d:%d: ignoring SEARCH_DIR; SEARCH_DIR is only valid for scripts specified via -T/--script" +-msgstr "" +- +-#: script.cc:2606 script.cc:2620 +-#, c-format +-msgid "%s:%d:%d: DATA_SEGMENT_ALIGN not in SECTIONS clause" +-msgstr "" +- +-#: script.cc:2739 +-msgid "unknown PHDR type (try integer)" +-msgstr "" +- +-#: stringpool.cc:528 +-#, c-format +-msgid "%s: %s entries: %zu; buckets: %zu\n" +-msgstr "" +- +-#: stringpool.cc:532 +-#, c-format +-msgid "%s: %s entries: %zu\n" +-msgstr "" +- +-#: stringpool.cc:535 +-#, c-format +-msgid "%s: %s Stringdata structures: %zu\n" +-msgstr "" +- +-#: symtab.cc:857 +-#, c-format +-msgid "%s: reference to %s" +-msgstr "" +- +-#: symtab.cc:859 +-#, c-format +-msgid "%s: definition of %s" +-msgstr "" +- +-#: symtab.cc:1052 +-#, c-format +-msgid "bad global symbol name offset %u at %zu" +-msgstr "" +- +-#: symtab.cc:1278 +-msgid "--just-symbols does not make sense with a shared object" +-msgstr "" +- +-#: symtab.cc:1284 +-msgid "too few symbol versions" +-msgstr "" +- +-#: symtab.cc:1333 +-#, c-format +-msgid "bad symbol name offset %u at %zu" +-msgstr "" +- +-#: symtab.cc:1396 +-#, c-format +-msgid "versym for symbol %zu out of range: %u" +-msgstr "" +- +-#: symtab.cc:1404 +-#, c-format +-msgid "versym for symbol %zu has no name: %u" +-msgstr "" +- +-#: symtab.cc:2549 symtab.cc:2681 +-#, c-format +-msgid "%s: unsupported symbol section 0x%x" +-msgstr "" +- +-#: symtab.cc:2933 +-#, c-format +-msgid "%s: symbol table entries: %zu; buckets: %zu\n" +-msgstr "" +- +-#: symtab.cc:2936 +-#, c-format +-msgid "%s: symbol table entries: %zu\n" +-msgstr "" +- +-#: symtab.cc:3007 +-#, c-format +-msgid "while linking %s: symbol '%s' defined in multiple places (possible ODR violation):" +-msgstr "" +- +-#: target-reloc.h:259 +-msgid "relocation refers to discarded comdat section" +-msgstr "再配置が破棄された domdat セクションを参照しています" +- +-#: target-reloc.h:298 +-#, c-format +-msgid "reloc has bad offset %zu" +-msgstr "再配置に誤ったオフセット %zu があります" +- +-#: target.cc:90 +-#, c-format +-msgid "%s: unsupported ELF file type %d" +-msgstr "%s: サポートされていない ELF ファイル型 %d です" +- +-#: target.cc:157 +-#, c-format +-msgid "linker does not include stack split support required by %s" +-msgstr "リンカは %s で必要となるスタック分割をサポートしていません" +- +-#: tls.h:59 +-msgid "TLS relocation out of range" +-msgstr "TLS 再配置が範囲外です" +- +-#: tls.h:73 +-msgid "TLS relocation against invalid instruction" +-msgstr "無効な命令に対する TLS 再配置です" +- +-#. This output is intended to follow the GNU standards. +-#: version.cc:65 +-#, c-format +-msgid "Copyright 2008 Free Software Foundation, Inc.\n" +-msgstr "Copyright 2008 Free Software Foundation, Inc.\n" +- +-#: version.cc:66 +-#, c-format +-msgid "" +-"This program is free software; you may redistribute it under the terms of\n" +-"the GNU General Public License version 3 or (at your option) a later version.\n" +-"This program has absolutely no warranty.\n" +-msgstr "" +-"This program is free software; you may redistribute it under the terms of\n" +-"the GNU General Public License version 3 or (at your option) a later version.\n" +-"This program has absolutely no warranty.\n" +- +-#: workqueue-threads.cc:106 +-#, c-format +-msgid "%s failed: %s" +-msgstr "%s に失敗しました: %s" +- +-#: x86_64.cc:2184 +-#, c-format +-msgid "unsupported reloc type %u" +-msgstr "サポートされていない再配置型 %u です" +- +-#: x86_64.cc:2524 +-#, c-format +-msgid "unsupported reloc %u against local symbol" +-msgstr "サポートされていない局所シンボルに対する再配置 %u です" +diff -rNU3 a/gprof/corefile.c b/gprof/corefile.c +--- a/gprof/corefile.c 2021-03-30 23:12:40.197893267 -0300 ++++ b/gprof/corefile.c 2021-03-30 17:48:00.645553000 -0300 +@@ -30,6 +30,8 @@ + #include "safe-ctype.h" + #include /* For UINT_MAX. */ + ++#include ++ + bfd *core_bfd; + static int core_num_syms; + static asymbol **core_syms; +diff -rNU3 a/gprof/gprof.c b/gprof/gprof.c +--- a/gprof/gprof.c 2021-03-30 23:12:40.197893267 -0300 ++++ b/gprof/gprof.c 2021-03-30 17:48:00.645553000 -0300 +@@ -47,6 +47,8 @@ + + static void usage (FILE *, int) ATTRIBUTE_NORETURN; + ++#include ++ + const char * whoami; + const char * function_mapping_file; + static const char * external_symbol_table; +diff -rNU3 a/include/elf/common.h b/include/elf/common.h +--- a/include/elf/common.h 2021-03-30 23:12:40.197893267 -0300 ++++ b/include/elf/common.h 2021-03-30 17:48:00.692219000 -0300 +@@ -686,6 +686,7 @@ + must start with "NetBSD-CORE". */ + + #define NT_NETBSDCORE_PROCINFO 1 /* Has a struct procinfo */ ++#define NT_NETBSDCORE_AUXV 2 /* Has ELF Auxiliary vector */ + #define NT_NETBSDCORE_FIRSTMACH 32 /* start of machdep note types */ + + +@@ -862,6 +863,15 @@ + #define NT_NETBSD_IDENT 1 + #define NT_NETBSD_MARCH 5 + ++/* Values for NetBSD .note.netbsd.ident notes. Note name is "PaX". */ ++#define NT_NETBSD_PAX 3 ++#define NT_NETBSD_PAX_MPROTECT 0x01 /* Force enable Mprotect */ ++#define NT_NETBSD_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */ ++#define NT_NETBSD_PAX_GUARD 0x04 /* Force enable Segvguard */ ++#define NT_NETBSD_PAX_NOGUARD 0x08 /* Force disable Segvguard */ ++#define NT_NETBSD_PAX_ASLR 0x10 /* Force enable ASLR */ ++#define NT_NETBSD_PAX_NOASLR 0x20 /* Force disable ASLR */ ++ + /* Values for OpenBSD .note.openbsd.ident notes. Note name is "OpenBSD". */ + + #define NT_OPENBSD_IDENT 1 +diff -rNU3 a/include/opcode/mips.h b/include/opcode/mips.h +--- a/include/opcode/mips.h 2021-03-30 23:12:40.201226600 -0300 ++++ b/include/opcode/mips.h 2021-03-30 17:48:00.728886000 -0300 +@@ -1595,7 +1595,11 @@ + M_DSUB_I, + M_DSUBU_I, + M_DSUBU_I_2, ++ M_JR_S, ++ M_J_S, + M_J_A, ++ M_JALR_S, ++ M_JALR_DS, + M_JAL_1, + M_JAL_2, + M_JAL_A, +diff -rNU3 a/ld/configdoc.texi b/ld/configdoc.texi +--- a/ld/configdoc.texi 2021-03-30 23:12:40.201226600 -0300 ++++ b/ld/configdoc.texi 1969-12-31 21:00:00.000000000 -0300 +@@ -1,35 +0,0 @@ +-@c Copyright (C) 2012-2020 Free Software Foundation, Inc. +-@c For copying conditions, see the file ld.texi. +- +-@c ------------------------------ CONFIGURATION VARS: +-@c 1. Inclusiveness of this manual +-@set GENERIC +- +-@c 2. Specific target machines +-@set ARM +-@set C6X +-@set CSKY +-@set H8300 +-@set HPPA +-@set I960 +-@set M68HC11 +-@set M68K +-@set MIPS +-@set MMIX +-@set MSP430 +-@set NDS32 +-@set NIOSII +-@set POWERPC +-@set POWERPC64 +-@set Renesas +-@set S/390 +-@set SPU +-@set TICOFF +-@set WIN32 +-@set XTENSA +- +-@c 3. Properties of this configuration +-@clear SingleFormat +-@set UsesEnvVars +-@c ------------------------------ end CONFIGURATION VARS +- +diff -rNU3 a/ld/configure.tgt b/ld/configure.tgt +--- a/ld/configure.tgt 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/configure.tgt 2021-03-30 17:48:00.818886000 -0300 +@@ -77,6 +77,12 @@ + targ_extra_libpath="aarch64linuxb aarch64linux32 aarch64linux32b armelfb_linux_eabi armelf_linux_eabi" + targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b aarch64elfb armelf armelfb $targ_extra_libpath" + ;; ++aarch64_be-*-netbsd*) targ_emul=aarch64nbsdb ++ targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb" ++ ;; ++aarch64-*-netbsd*) targ_emul=aarch64nbsd ++ targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb" ++ ;; + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + targ_emul=elf64alpha_fbsd + targ_extra_emuls="elf64alpha alpha" +@@ -133,11 +139,21 @@ + ;; + arm*-*-freebsd* | arm-*-kfreebsd*-gnu) + targ_emul=armelf_fbsd +- targ_extra_emuls="armelfb_fbsd armelf" +- ;; +-armeb-*-netbsdelf*) targ_emul=armelfb_nbsd; +- targ_extra_emuls="armelf_nbsd armelf" +- ;; ++ targ_extra_emuls="armelfb_fbsd armelf" ;; ++arm*eb-*-netbsdelf*-*eabihf*) ++ targ_emul=armelfb_nbsd_eabihf; ++ targ_extra_emuls="armelf_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf" ;; ++arm*eb-*-netbsdelf*-*eabi*) ++ targ_emul=armelfb_nbsd_eabi; ++ targ_extra_emuls="armelf_nbsd_eabi armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd armelfb_nbsd armelf" ;; ++arm*-*-netbsdelf*-*eabihf*) ++ targ_emul=armelf_nbsd_eabihf; ++ targ_extra_emuls="armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf" ;; ++arm*-*-netbsdelf*-*eabi*) ++ targ_emul=armelf_nbsd_eabi; ++ targ_extra_emuls="armelfb_nbsd_eabi armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd armelfb_nbsd armelf" ;; ++arm*eb-*-netbsdelf*) targ_emul=armelfb_nbsd; ++ targ_extra_emuls="armelf_nbsd armelf" ;; + arm-*-netbsdelf*) targ_emul=armelf_nbsd; + targ_extra_emuls="armelfb_nbsd armelf" + ;; +@@ -486,8 +502,15 @@ + ;; + mips*-sgi-irix6*) targ_emul=elf32bmipn32 + targ_extra_emuls="elf32bsmip elf64bmip" ++ targ_extra_libpath=$targ_extra_emuls ;; ++mips64*el-*-netbsd*) targ_emul=elf32ltsmipn32 ++ targ_extra_emuls="elf64btsmip elf64ltsmip elf32ltsmip elf32btsmipn32 elf32btsmip" ++ targ_extra_libpath=$targ_extra_emuls ++ ;; ++mips64*-*-netbsd*) targ_emul=elf32btsmipn32 ++ targ_extra_emuls="elf64ltsmip elf64btsmip elf32btsmip elf32ltsmipn32 elf32ltsmip" + targ_extra_libpath=$targ_extra_emuls +- ;; ++ ;; + mips*el-*-netbsd*) targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip" + ;; +@@ -646,6 +669,21 @@ + tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'` + tdir_elf32ppc_fbsd=$tdir_elf32ppc + ;; ++powerpc-*-netbsd*) ++ targ_emul=elf32ppc_nbsd ++ targ_extra_emuls="elf32ppc elf32ppcsim" ++ targ_extra_libpath=elf32ppc; ++ tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ++ targ64_extra_emuls=elf64ppc ++ targ64_extra_libpath=elf64ppc ++ ;; ++powerpc64-*-netbsd*) ++ targ_emul=elf64ppc ++ targ_extra_emuls="elf32ppc elf32ppc_nbsd elf32ppcsim" ++ targ_extra_libpath="elf32ppc_nbsd elf32ppc" ++ tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'` ++ tdir_elf32ppc_fbsd=$tdir_elf32ppc ++ ;; + powerpc-*-vxworks*) + targ_emul=elf32ppcvxworks + targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" +@@ -750,7 +788,8 @@ + ;; + pru*-*-*) targ_emul=pruelf + ;; +-riscv32*-*-linux*) targ_emul=elf32lriscv ++riscv32*-*-linux* | riscv-*-netbsd* | riscv32*-*-netbsd*) ++ targ_emul=elf32lriscv + targ_extra_emuls="elf32lriscv_ilp32f elf32lriscv_ilp32 elf64lriscv elf64lriscv_lp64f elf64lriscv_lp64" + targ_extra_libpath=$targ_extra_emuls + ;; +@@ -759,7 +798,8 @@ + targ_extra_emuls="elf64lriscv" + targ_extra_libpath=$targ_extra_emuls + ;; +-riscv64*-*-linux*) targ_emul=elf64lriscv ++riscv64*-*-linux* | riscv64*-*-netbsd*) ++ targ_emul=elf64lriscv + targ_extra_emuls="elf64lriscv_lp64f elf64lriscv_lp64 elf32lriscv elf32lriscv_ilp32f elf32lriscv_ilp32" + targ_extra_libpath=$targ_extra_emuls + ;; +@@ -864,6 +904,16 @@ + targ_extra_libpath=elf64_sparc + tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'` + ;; ++sparc64-*-netbsd*) targ_emul=elf64_sparc ++ targ_extra_emuls="elf32_sparc" ++ ;; ++sparc64-*-openbsd*) targ_emul=elf64_sparc ++ targ_extra_emuls="elf32_sparc" ++ ;; ++sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ++ ;; ++sparc*-*-netbsd*) targ_emul=sparcnbsd ++ ;; + sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) + targ_emul=elf32_sparc_sol2 + targ_extra_emuls=elf32_sparc +diff -rNU3 a/ld/emulparams/aarch64nbsdb.sh b/ld/emulparams/aarch64nbsdb.sh +--- a/ld/emulparams/aarch64nbsdb.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/aarch64nbsdb.sh 2021-03-30 17:48:00.828886000 -0300 +@@ -0,0 +1,2 @@ ++. ${srcdir}/emulparams/aarch64nbsd.sh ++OUTPUT_FORMAT="elf64-bigaarch64" +diff -rNU3 a/ld/emulparams/aarch64nbsd.sh b/ld/emulparams/aarch64nbsd.sh +--- a/ld/emulparams/aarch64nbsd.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/aarch64nbsd.sh 2021-03-30 17:48:00.828886000 -0300 +@@ -0,0 +1,37 @@ ++ARCH=aarch64 ++MACHINE= ++NOP=0 ++ ++SCRIPT_NAME=elf ++ELFSIZE=64 ++OUTPUT_FORMAT="elf64-littleaarch64" ++BIG_OUTPUT_FORMAT="elf64-bigaarch64" ++LITTLE_OUTPUT_FORMAT="elf64-littleaarch64" ++NO_REL_RELOCS=yes ++ ++TEMPLATE_NAME=elf ++EXTRA_EM_FILE=aarch64elf ++ ++GENERATE_SHLIB_SCRIPT=yes ++GENERATE_PIE_SCRIPT=yes ++ ++MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" ++COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" ++SEPARATE_GOTPLT=24 ++IREL_IN_PLT= ++ ++TEXT_START_ADDR=0x200100000 ++ ++DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; ++ ++# AArch64 does not support .s* sections. ++NO_SMALL_DATA=yes ++ ++OTHER_BSS_SYMBOLS='__bss_start__ = .;' ++OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' ++OTHER_END_SYMBOLS='__end__ = . ;' ++ ++OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' ++ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' ++# Ensure each PLT entry is aligned to a cache line. ++PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }" +diff -rNU3 a/ld/emulparams/armelfb_nbsd_eabihf.sh b/ld/emulparams/armelfb_nbsd_eabihf.sh +--- a/ld/emulparams/armelfb_nbsd_eabihf.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/armelfb_nbsd_eabihf.sh 2021-03-30 17:48:00.838886000 -0300 +@@ -0,0 +1,2 @@ ++. ${srcdir}/emulparams/armelf_nbsd_eabihf.sh ++OUTPUT_FORMAT="elf32-bigarm" +diff -rNU3 a/ld/emulparams/armelfb_nbsd_eabi.sh b/ld/emulparams/armelfb_nbsd_eabi.sh +--- a/ld/emulparams/armelfb_nbsd_eabi.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/armelfb_nbsd_eabi.sh 2021-03-30 17:48:00.838886000 -0300 +@@ -0,0 +1,2 @@ ++. ${srcdir}/emulparams/armelf_nbsd_eabi.sh ++OUTPUT_FORMAT="elf32-bigarm" +diff -rNU3 a/ld/emulparams/armelf_nbsd_eabihf.sh b/ld/emulparams/armelf_nbsd_eabihf.sh +--- a/ld/emulparams/armelf_nbsd_eabihf.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/armelf_nbsd_eabihf.sh 2021-03-30 17:48:00.838886000 -0300 +@@ -0,0 +1,20 @@ ++. ${srcdir}/emulparams/armelf_nbsd.sh ++ ++# Use the ARM ABI-compliant exception-handling sections. ++OTHER_READONLY_SECTIONS=" ++ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } ++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } ++ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } ++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" ++ ++case "$target" in ++ arm*-*-netbsdelf*-*eabihf*) ++ ;; ++ aarch64*-*-netbsd* | arm*-*-netbsdelf*) ++ case "$EMULATION_NAME" in ++ *armelf*eabihf) ++ LIB_PATH='=/usr/lib/eabihf' ++ ;; ++ esac ++ ;; ++esac +diff -rNU3 a/ld/emulparams/armelf_nbsd_eabi.sh b/ld/emulparams/armelf_nbsd_eabi.sh +--- a/ld/emulparams/armelf_nbsd_eabi.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/armelf_nbsd_eabi.sh 2021-03-30 17:48:00.838886000 -0300 +@@ -0,0 +1,27 @@ ++. ${srcdir}/emulparams/armelf_nbsd.sh ++ ++# Use the ARM ABI-compliant exception-handling sections. ++OTHER_READONLY_SECTIONS=" ++ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } ++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } ++ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } ++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" ++ ++case "$target" in ++ arm*-*-netbsdelf*-*eabihf*) ++ case "$EMULATION_NAME" in ++ *armelf*eabi) ++ LIB_PATH='=/usr/lib/eabi' ++ ;; ++ esac ++ ;; ++ arm*-*-netbsdelf*-*eabi*) ++ ;; ++ aarch64*-*-netbsd* | arm*-*-netbsdelf*) ++ case "$EMULATION_NAME" in ++ *armelf*eabi) ++ LIB_PATH='=/usr/lib/eabi' ++ ;; ++ esac ++ ;; ++esac +diff -rNU3 a/ld/emulparams/armelf_nbsd.sh b/ld/emulparams/armelf_nbsd.sh +--- a/ld/emulparams/armelf_nbsd.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/armelf_nbsd.sh 2021-03-30 17:48:00.838886000 -0300 +@@ -1,7 +1,19 @@ + source_sh ${srcdir}/emulparams/armelf.sh + MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" +-TEXT_START_ADDR=0x00008000 ++TEXT_START_ADDR=0x00010000 + TARGET2_TYPE=got-rel ++GENERATE_PIE_SCRIPT=yes + ++unset DATA_START_SYMBOLS + unset STACK_ADDR + unset EMBEDDED ++ ++case "$target" in ++ aarch64*-*-netbsd* | arm*-*-netbsdelf*-*eabi*) ++ case "$EMULATION_NAME" in ++ armelf*_nbsd) ++ LIB_PATH='=/usr/lib/oabi' ++ ;; ++ esac ++ ;; ++esac +diff -rNU3 a/ld/emulparams/elf32bmipn32-defs.sh b/ld/emulparams/elf32bmipn32-defs.sh +--- a/ld/emulparams/elf32bmipn32-defs.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf32bmipn32-defs.sh 2021-03-30 17:48:00.845553000 -0300 +@@ -6,6 +6,7 @@ + + # Handle both big- and little-ended 32-bit MIPS objects. + ARCH=mips ++MACHINE= + OUTPUT_FORMAT="elf32-bigmips" + BIG_OUTPUT_FORMAT="elf32-bigmips" + LITTLE_OUTPUT_FORMAT="elf32-littlemips" +@@ -77,7 +78,7 @@ + " + + # Magic symbols. +-TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" ++TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .); ${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" + DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" + OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};" + +diff -rNU3 a/ld/emulparams/elf32bmip.sh b/ld/emulparams/elf32bmip.sh +--- a/ld/emulparams/elf32bmip.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf32bmip.sh 2021-03-30 17:48:00.845553000 -0300 +@@ -56,7 +56,7 @@ + .lit8 ${RELOCATING-0} : { *(.lit8) } + .lit4 ${RELOCATING-0} : { *(.lit4) } + " +-TEXT_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" ++TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .); ${CREATE_SHLIB+PROVIDE (}_ftext = .${CREATE_SHLIB+)};" + DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fdata = .${CREATE_SHLIB+)};" + OTHER_BSS_SYMBOLS="${CREATE_SHLIB+PROVIDE (}_fbss = .${CREATE_SHLIB+)};" + OTHER_SECTIONS=" +diff -rNU3 a/ld/emulparams/elf32lriscv_ilp32f.sh b/ld/emulparams/elf32lriscv_ilp32f.sh +--- a/ld/emulparams/elf32lriscv_ilp32f.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf32lriscv_ilp32f.sh 2021-03-30 17:48:00.848886000 -0300 +@@ -11,4 +11,13 @@ + LIBPATH_SUFFIX="32/ilp32f 32" ;; + esac + ;; ++ # NetBSD puts ILP32 libraries in rv32 subdirectory. ++ # XXX d vs f vs "" ++ riscv64-*-netbsd*) ++ case "$EMULATION_NAME" in ++ *32*) ++ LIB_PATH='=/usr/lib/rv32' ++ ;; ++ esac ++ ;; + esac +diff -rNU3 a/ld/emulparams/elf32lriscv_ilp32.sh b/ld/emulparams/elf32lriscv_ilp32.sh +--- a/ld/emulparams/elf32lriscv_ilp32.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf32lriscv_ilp32.sh 2021-03-30 17:48:00.848886000 -0300 +@@ -11,4 +11,13 @@ + LIBPATH_SUFFIX="32/ilp32 32" ;; + esac + ;; ++ # NetBSD puts ILP32 libraries in rv32 subdirectory. ++ # XXX d vs f vs "" ++ riscv64-*-netbsd*) ++ case "$EMULATION_NAME" in ++ *32*) ++ LIB_PATH='=/usr/lib/rv32' ++ ;; ++ esac ++ ;; + esac +diff -rNU3 a/ld/emulparams/elf32lriscv.sh b/ld/emulparams/elf32lriscv.sh +--- a/ld/emulparams/elf32lriscv.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf32lriscv.sh 2021-03-30 17:48:00.848886000 -0300 +@@ -12,4 +12,13 @@ + LIBPATH_SUFFIX="32/ilp32d 32" ;; + esac + ;; ++ # NetBSD puts ILP32 libraries in rv32 subdirectory. ++ # XXX d vs f vs "" ++ riscv64-*-netbsd*) ++ case "$EMULATION_NAME" in ++ *32*) ++ LIB_PATH='=/usr/lib/rv32' ++ ;; ++ esac ++ ;; + esac +diff -rNU3 a/ld/emulparams/elf32or1k_nbsd.sh b/ld/emulparams/elf32or1k_nbsd.sh +--- a/ld/emulparams/elf32or1k_nbsd.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/elf32or1k_nbsd.sh 2021-03-30 17:48:00.852219000 -0300 +@@ -0,0 +1,6 @@ ++. ${srcdir}/emulparams/elf32or1k.sh ++unset EMBEDDED ++GENERATE_SHLIB_SCRIPT=yes ++GENERATE_PIE_SCRIPT=yes ++GENERATE_COMBRELOC_SCRIPT=yes ++TEXT_START_ADDR=0x00002000 +diff -rNU3 a/ld/emulparams/elf32ppc_nbsd.sh b/ld/emulparams/elf32ppc_nbsd.sh +--- a/ld/emulparams/elf32ppc_nbsd.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/elf32ppc_nbsd.sh 2021-03-30 17:48:00.852219000 -0300 +@@ -0,0 +1,10 @@ ++. ${srcdir}/emulparams/elf32ppc.sh ++ ++case "$target" in ++ powerpc64*-*-netbsd*) ++ case "$EMULATION_NAME" in ++ *32*) ++ LIB_PATH='=/usr/lib/powerpc' ++ ;; ++ esac ++esac +diff -rNU3 a/ld/emulparams/elf32_sparc.sh b/ld/emulparams/elf32_sparc.sh +--- a/ld/emulparams/elf32_sparc.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf32_sparc.sh 2021-03-30 17:48:00.842219000 -0300 +@@ -13,6 +13,17 @@ + TEMPLATE_NAME=elf + DATA_PLT= + GENERATE_SHLIB_SCRIPT=yes ++#ELFSIZE=32 + GENERATE_PIE_SCRIPT=yes + NOP=0x01000000 + NO_SMALL_DATA=yes ++ ++case "$target" in ++ sparc64-*-netbsd*) ++ case "$EMULATION_NAME" in ++ *32*) ++ LIB_PATH='=/usr/lib/sparc' ++ ;; ++ esac ++ ;; ++esac +diff -rNU3 a/ld/emulparams/elf64alpha_nbsd.sh b/ld/emulparams/elf64alpha_nbsd.sh +--- a/ld/emulparams/elf64alpha_nbsd.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf64alpha_nbsd.sh 2021-03-30 17:48:00.855553000 -0300 +@@ -1,2 +1,8 @@ + source_sh ${srcdir}/emulparams/elf64alpha.sh + ENTRY=__start ++ ++NOP=0x47ff041f ++# XXX binutils 2.13 ++# Note that the number is always big-endian, thus we have to ++# reverse the digit string. ++#NOP=0x0000fe2f1f04ff47 # unop; nop +diff -rNU3 a/ld/emulparams/elf_i386.sh b/ld/emulparams/elf_i386.sh +--- a/ld/emulparams/elf_i386.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/elf_i386.sh 2021-03-30 17:48:00.858886000 -0300 +@@ -14,10 +14,22 @@ + TEMPLATE_NAME=elf + EXTRA_EM_FILE="elf-x86" + GENERATE_SHLIB_SCRIPT=yes ++#ELFSIZE=32 + GENERATE_PIE_SCRIPT=yes + NO_SMALL_DATA=yes + SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0" + IREL_IN_PLT= ++ ++case "$target" in ++ x86_64-*-netbsd*) ++ case "$EMULATION_NAME" in ++ *i386*) ++ LIB_PATH='=/usr/lib/i386' ++ ;; ++ esac ++ ;; ++esac ++ + # These sections are placed right after .plt section. + OTHER_PLT_SECTIONS=" + .plt.got ${RELOCATING-0} : { *(.plt.got) } +diff -rNU3 a/ld/emulparams/hppalinux.sh b/ld/emulparams/hppalinux.sh +--- a/ld/emulparams/hppalinux.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/hppalinux.sh 2021-03-30 17:48:00.862219000 -0300 +@@ -1,5 +1,5 @@ + # If you change this file, please also look at files which source this one: +-# hppanbsd.sh ++# hppanbsd.sh hppaobsd.sh + + SCRIPT_NAME=elf + ELFSIZE=32 +diff -rNU3 a/ld/emulparams/m68kelfnbsd.sh b/ld/emulparams/m68kelfnbsd.sh +--- a/ld/emulparams/m68kelfnbsd.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/m68kelfnbsd.sh 2021-03-30 17:48:00.865553000 -0300 +@@ -1,4 +1,4 @@ + source_sh ${srcdir}/emulparams/m68kelf.sh + TEXT_START_ADDR=0x2000 + TARGET_PAGE_SIZE=0x2000 +-MACHINE= ++NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR} +diff -rNU3 a/ld/emulparams/m68kelf.sh b/ld/emulparams/m68kelf.sh +--- a/ld/emulparams/m68kelf.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/m68kelf.sh 2021-03-30 17:48:00.865553000 -0300 +@@ -10,5 +10,6 @@ + TEMPLATE_NAME=elf + EXTRA_EM_FILE=m68kelf + GENERATE_SHLIB_SCRIPT=yes ++ELFSIZE=32 + GENERATE_PIE_SCRIPT=yes + NO_SMALL_DATA=yes +diff -rNU3 a/ld/emulparams/shelf_nbsd.sh b/ld/emulparams/shelf_nbsd.sh +--- a/ld/emulparams/shelf_nbsd.sh 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/emulparams/shelf_nbsd.sh 2021-03-30 17:48:00.868886000 -0300 +@@ -9,7 +9,12 @@ + + DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; + +-ENTRY=_start ++ENTRY=__start + + unset EMBEDDED ++unset OTHER_SECTIONS ++ ++OTHER_READWRITE_SECTIONS=' ++ .note.ABI-tag : { *(.note.ABI-tag) } ++' + unset STACK_ADDR +diff -rNU3 a/ld/emulparams/sh.sh b/ld/emulparams/sh.sh +--- a/ld/emulparams/sh.sh 2021-03-30 23:12:40.207893267 -0300 ++++ b/ld/emulparams/sh.sh 2021-03-30 17:48:00.868886000 -0300 +@@ -3,6 +3,6 @@ + + SCRIPT_NAME=sh + OUTPUT_FORMAT="coff-sh" +-TEXT_START_ADDR=0x8000 +-TARGET_PAGE_SIZE=128 ++TEXT_START_ADDR=0x1000 ++TARGET_PAGE_SIZE=0x1000 + ARCH=sh +diff -rNU3 a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em +--- a/ld/emultempl/aarch64elf.em 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/emultempl/aarch64elf.em 2021-03-30 17:48:00.872219000 -0300 +@@ -44,6 +44,7 @@ + ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); + #endif /* not TARGET_ */ + input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; ++ input_flags.add_DT_NEEDED_for_dynamic = TRUE; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; +diff -rNU3 a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em +--- a/ld/emultempl/armelf.em 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/emultempl/armelf.em 2021-03-30 17:48:00.875553000 -0300 +@@ -57,6 +57,7 @@ + ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); + #endif /* not TARGET_ */ + input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; ++ input_flags.add_DT_NEEDED_for_dynamic = TRUE; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; +diff -rNU3 a/ld/emultempl/elf.em b/ld/emultempl/elf.em +--- a/ld/emultempl/elf.em 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/emultempl/elf.em 2021-03-30 17:48:00.875553000 -0300 +@@ -79,6 +79,7 @@ + { + ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`); + input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; ++ input_flags.add_DT_NEEDED_for_dynamic = TRUE; + config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; + config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; + link_info.check_relocs_after_open_input = TRUE; +diff -rNU3 a/ld/genscripts.sh b/ld/genscripts.sh +--- a/ld/genscripts.sh 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/genscripts.sh 2021-03-30 17:48:00.895553000 -0300 +@@ -257,7 +257,8 @@ + done + libs="${exec_prefix}/${TOOL_LIB}/lib ${libs}" + fi +- append_to_lib_path ${libs} ++ #NetBSD: don't spam linker scripts like this. ++ #append_to_lib_path ${libs} + fi + + if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then +diff -rNU3 a/ld/ldlex.l b/ld/ldlex.l +--- a/ld/ldlex.l 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/ldlex.l 2021-03-30 17:48:00.918886000 -0300 +@@ -58,10 +58,6 @@ + #undef YY_INPUT + #define YY_INPUT(buf,result,max_size) result = yy_input (buf, max_size) + +-#ifndef YY_NO_UNPUT +-#define YY_NO_UNPUT +-#endif +- + #define MAX_INCLUDE_DEPTH 10 + static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; + static const char *file_name_stack[MAX_INCLUDE_DEPTH]; +@@ -89,6 +85,8 @@ + + %} + ++%option nounput ++ + %a 4000 + %o 5000 + +diff -rNU3 a/ld/lexsup.c b/ld/lexsup.c +--- a/ld/lexsup.c 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/lexsup.c 2021-03-30 17:48:00.918886000 -0300 +@@ -427,7 +427,7 @@ + ONE_DASH }, + { {"shared", no_argument, NULL, OPTION_SHARED}, + '\0', NULL, N_("Create a shared library"), ONE_DASH }, +- { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */ ++ { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD, NetBSD. */ + '\0', NULL, NULL, ONE_DASH }, + { {"pie", no_argument, NULL, OPTION_PIE}, + '\0', NULL, N_("Create a position independent executable"), ONE_DASH }, +@@ -527,6 +527,8 @@ + { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE}, + '\0', NULL, N_("Include all objects from following archives"), + TWO_DASHES }, ++ { {"Bforcearchive", no_argument, NULL, OPTION_WHOLE_ARCHIVE}, ++ '\0', NULL, NULL, TWO_DASHES }, /* NetBSD. */ + { {"wrap", required_argument, NULL, OPTION_WRAP}, + '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, + { {"ignore-unresolved-symbol", required_argument, NULL, +diff -rNU3 a/ld/Makefile.am b/ld/Makefile.am +--- a/ld/Makefile.am 2021-03-30 23:12:40.201226600 -0300 ++++ b/ld/Makefile.am 2021-03-30 17:48:00.812219000 -0300 +@@ -181,6 +181,8 @@ + earmelf_linux_fdpiceabi.c \ + earmelf_nacl.c \ + earmelf_nbsd.c \ ++ earmelf_nbsd_eabi.c \ ++ earmelf_nbsd_eabihf.c \ + earmelf_phoenix.c \ + earmelf_vxworks.c \ + earmelfb.c \ +@@ -191,6 +193,9 @@ + earmelfb_linux_fdpiceabi.c \ + earmelfb_nacl.c \ + earmelfb_nbsd.c \ ++ earmelfb_nbsd_eabi.c \ ++ earmelfb_nbsd_eabihf.c \ ++ earmnbsd.c \ + earmnto.c \ + earmpe.c \ + earmsymbian.c \ +@@ -252,6 +257,12 @@ + eelf32lppclinux.c \ + eelf32lppcnto.c \ + eelf32lppcsim.c \ ++ eelf32lriscv.c \ ++ eelf32lsmip.c \ ++ eelf32ltsmip.c \ ++ eelf32ltsmip_fbsd.c \ ++ eelf32ltsmipn32.c \ ++ eelf32ltsmipn32_fbsd.c \ + eelf32m32c.c \ + eelf32mb_linux.c \ + eelf32mbel_linux.c \ +@@ -265,8 +276,10 @@ + eelf32mt.c \ + eelf32or1k.c \ + eelf32or1k_linux.c \ ++ eelf32or1k_nbsd.c \ + eelf32ppc.c \ + eelf32ppc_fbsd.c \ ++ eelf32ppc_nbsd.c \ + eelf32ppclinux.c \ + eelf32ppcnto.c \ + eelf32ppcsim.c \ +@@ -400,6 +413,8 @@ + eaarch64fbsdb.c \ + eaarch64linux.c \ + eaarch64linuxb.c \ ++ eaarch64nbsd.c \ ++ eaarch64nbsdb.c \ + eaarch64linux32.c \ + eaarch64linux32b.c \ + eelf32_x86_64.c \ +@@ -1017,6 +1032,8 @@ + # because almost all configs use "gen" version of manual. + # Set DOCVER above to change. + configdoc.texi: ${DOCVER}-doc.texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_configdoc.texi: + cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi + chmod u+w ./configdoc.texi + +@@ -1024,6 +1041,8 @@ + # The sed command removes the no-adjust Nroff command so that + # the man output looks standard. + ld.1: $(srcdir)/ld.texi configdoc.texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ld.1: + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texi > ld.pod + -($(POD2MAN) ld.pod | \ +diff -rNU3 a/ld/Makefile.in b/ld/Makefile.in +--- a/ld/Makefile.in 2021-03-30 23:12:40.201226600 -0300 ++++ b/ld/Makefile.in 2021-03-30 17:48:00.815553000 -0300 +@@ -671,6 +671,8 @@ + earmelf_linux_fdpiceabi.c \ + earmelf_nacl.c \ + earmelf_nbsd.c \ ++ earmelf_nbsd_eabi.c \ ++ earmelf_nbsd_eabihf.c \ + earmelf_phoenix.c \ + earmelf_vxworks.c \ + earmelfb.c \ +@@ -681,6 +683,9 @@ + earmelfb_linux_fdpiceabi.c \ + earmelfb_nacl.c \ + earmelfb_nbsd.c \ ++ earmelfb_nbsd_eabi.c \ ++ earmelfb_nbsd_eabihf.c \ ++ earmnbsd.c \ + earmnto.c \ + earmpe.c \ + earmsymbian.c \ +@@ -742,6 +747,12 @@ + eelf32lppclinux.c \ + eelf32lppcnto.c \ + eelf32lppcsim.c \ ++ eelf32lriscv.c \ ++ eelf32lsmip.c \ ++ eelf32ltsmip.c \ ++ eelf32ltsmip_fbsd.c \ ++ eelf32ltsmipn32.c \ ++ eelf32ltsmipn32_fbsd.c \ + eelf32m32c.c \ + eelf32mb_linux.c \ + eelf32mbel_linux.c \ +@@ -755,8 +766,10 @@ + eelf32mt.c \ + eelf32or1k.c \ + eelf32or1k_linux.c \ ++ eelf32or1k_nbsd.c \ + eelf32ppc.c \ + eelf32ppc_fbsd.c \ ++ eelf32ppc_nbsd.c \ + eelf32ppclinux.c \ + eelf32ppcnto.c \ + eelf32ppcsim.c \ +@@ -889,6 +902,8 @@ + eaarch64fbsdb.c \ + eaarch64linux.c \ + eaarch64linuxb.c \ ++ eaarch64nbsd.c \ ++ eaarch64nbsdb.c \ + eaarch64linux32.c \ + eaarch64linux32b.c \ + eelf32_x86_64.c \ +@@ -1206,6 +1221,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux32b.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linuxb.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64nbsd.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64nbsdb.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaix5ppc.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaix5rs6.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaixppc.Po@am__quote@ +@@ -1226,6 +1243,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_fdpiceabi.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nacl.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd_eabi.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd_eabihf.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_phoenix.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_vxworks.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb.Po@am__quote@ +@@ -1236,6 +1255,9 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux_fdpiceabi.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nacl.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd_eabi.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd_eabihf.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmnbsd.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmnto.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmpe.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmsymbian.Po@am__quote@ +@@ -1313,6 +1335,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppclinux.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppcnto.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppcsim.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lriscv.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lr5900.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lr5900n32.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lriscv.Po@am__quote@ +@@ -1336,8 +1359,10 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mt.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_linux.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_nbsd.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc_fbsd.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc_nbsd.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppclinux.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcnto.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcsim.Po@am__quote@ +@@ -1586,6 +1611,8 @@ + -rm -f libtool config.lt + + ld.info: ld.texi $(ld_TEXINFOS) ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ld.info: ld.texinfo $(ld_TEXINFOS) + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ +@@ -2582,6 +2609,8 @@ + # because almost all configs use "gen" version of manual. + # Set DOCVER above to change. + configdoc.texi: ${DOCVER}-doc.texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_configdoc.texi: + cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi + chmod u+w ./configdoc.texi + +@@ -2589,6 +2618,8 @@ + # The sed command removes the no-adjust Nroff command so that + # the man output looks standard. + ld.1: $(srcdir)/ld.texi configdoc.texi ++ @echo "NOT REBUILDING $@" ++NetBSD_DISABLED_ld.1: + touch $@ + -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texi > ld.pod + -($(POD2MAN) ld.pod | \ +diff -rNU3 a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc +--- a/ld/scripttempl/elf.sc 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/scripttempl/elf.sc 2021-03-30 17:48:00.995553000 -0300 +@@ -103,6 +103,8 @@ + # + # Each of these can also have corresponding .rel.* and .rela.* sections. + ++test -z "$TEXT_START_SYMBOLS" && TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .);" ++test -z "$ENTRY" && ENTRY=_start + if test -n "$NOP"; then + FILL="=$NOP" + else +@@ -510,6 +512,7 @@ + .text ${RELOCATING-0} : + { + ${RELOCATING+${TEXT_START_SYMBOLS}} ++ *(.text) + ${RELOCATING+*(.text.unlikely .text.*_unlikely .text.unlikely.*)} + ${RELOCATING+*(.text.exit .text.exit.*)} + ${RELOCATING+*(.text.startup .text.startup.*)} +diff -rNU3 a/ld/scripttempl/sh.sc b/ld/scripttempl/sh.sc +--- a/ld/scripttempl/sh.sc 2021-03-30 23:12:40.211226601 -0300 ++++ b/ld/scripttempl/sh.sc 2021-03-30 17:48:01.002219000 -0300 +@@ -23,6 +23,7 @@ + + OUTPUT_FORMAT("${OUTPUT_FORMAT}") + OUTPUT_ARCH(${ARCH}) ++${LIB_SEARCH_DIRS} + + EOF + +@@ -42,9 +43,9 @@ + *(.text) + *(.strings) + ${RELOCATING+ _etext = . ; } +- } ${RELOCATING+ > ram} ++ } + ${CONSTRUCTING+${TORS}} +- .data : ++ .data ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} : + { + *(.data) + ${RELOCATING+*(.gcc_exc*)} +@@ -53,19 +54,19 @@ + ${RELOCATING+___EH_FRAME_END__ = . ;} + ${RELOCATING+LONG(0);} + ${RELOCATING+ _edata = . ; } +- } ${RELOCATING+ > ram} +- .bss : ++ } ++ .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} : + { + ${RELOCATING+ _bss_start = . ; } + *(.bss) + *(COMMON) + ${RELOCATING+ _end = . ; } +- } ${RELOCATING+ > ram} +- .stack ${RELOCATING+ 0x30000 } : ++ } ++ .stack : + { + ${RELOCATING+ _stack = . ; } + *(.stack) +- } ${RELOCATING+ > ram} ++ } + .stab 0 ${RELOCATING+(NOLOAD)} : + { + *(.stab) +diff -rNU3 a/libiberty/configure b/libiberty/configure +--- a/libiberty/configure 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/configure 2021-03-30 17:48:01.032219000 -0300 +@@ -7471,7 +7471,7 @@ + + + # We need multilib support, but only if configuring for the target. +-ac_config_files="$ac_config_files Makefile testsuite/Makefile" ++ac_config_files="$ac_config_files Makefile" # testsuite/Makefile + + ac_config_commands="$ac_config_commands default" + +diff -rNU3 a/libiberty/configure.ac b/libiberty/configure.ac +--- a/libiberty/configure.ac 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/configure.ac 2021-03-30 17:48:01.032219000 -0300 +@@ -728,7 +728,7 @@ + AC_SUBST(htmldir) + + # We need multilib support, but only if configuring for the target. +-AC_CONFIG_FILES([Makefile testsuite/Makefile]) ++AC_CONFIG_FILES([Makefile]) + AC_CONFIG_COMMANDS([default], + [[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + if test -n "$CONFIG_FILES"; then +diff -rNU3 a/libiberty/floatformat.c b/libiberty/floatformat.c +--- a/libiberty/floatformat.c 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/floatformat.c 2021-03-30 17:48:01.045553000 -0300 +@@ -498,7 +498,11 @@ + if (nan) + dto = NAN; + else ++#ifdef __vax__ ++ dto = HUGE_VAL; ++#else + dto = INFINITY; ++#endif + + if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1)) + dto = -dto; +diff -rNU3 a/libiberty/Makefile.in b/libiberty/Makefile.in +--- a/libiberty/Makefile.in 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/Makefile.in 2021-03-30 17:48:01.028886000 -0300 +@@ -97,7 +97,7 @@ + "tooldir=$(tooldir)" + + # Subdirectories to recurse into. We need to override this during cleaning +-SUBDIRS = testsuite ++SUBDIRS = # testsuite + + # FIXME: add @BUILD_INFO@ once we're sure it works for everyone. + all: stamp-picdir stamp-noasandir $(TARGETLIB) required-list all-subdir +diff -rNU3 a/libiberty/make-temp-file.c b/libiberty/make-temp-file.c +--- a/libiberty/make-temp-file.c 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/make-temp-file.c 2021-03-30 17:48:01.048886000 -0300 +@@ -129,10 +129,10 @@ + base = try_dir (P_tmpdir, base); + #endif + +- /* Try /var/tmp, /usr/tmp, then /tmp. */ ++ /* Try /tmp, /var/tmp, then /usr/tmp. */ ++ base = try_dir (tmp, base); + base = try_dir (vartmp, base); + base = try_dir (usrtmp, base); +- base = try_dir (tmp, base); + + /* If all else fails, use the current directory! */ + if (base == 0) +diff -rNU3 a/libiberty/strerror.c b/libiberty/strerror.c +--- a/libiberty/strerror.c 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/strerror.c 2021-03-30 17:48:01.072219000 -0300 +@@ -347,7 +347,7 @@ + ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"), + #endif + #if defined (ENOPROTOOPT) +- ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"), ++ ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol option not available"), + #endif + #if defined (EPROTONOSUPPORT) + ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"), +diff -rNU3 a/libiberty/strsignal.c b/libiberty/strsignal.c +--- a/libiberty/strsignal.c 2021-03-30 23:12:40.214559934 -0300 ++++ b/libiberty/strsignal.c 2021-03-30 17:48:01.075553000 -0300 +@@ -551,7 +551,7 @@ + #ifndef HAVE_PSIGNAL + + void +-psignal (int signo, char *message) ++psignal (int signo, const char *message) + { + if (signal_names == NULL) + { +diff -rNU3 a/opcodes/cgen.sh b/opcodes/cgen.sh +--- a/opcodes/cgen.sh 2021-03-30 23:12:40.217893267 -0300 ++++ b/opcodes/cgen.sh 2021-03-30 17:48:01.238886000 -0300 +@@ -61,6 +61,7 @@ + shift ; extrafiles=$9 + + rootdir=${srcdir}/.. ++move_if_change="${CONFIG_SHELL:-/bin/sh} ${rootdir}/move-if-change" + + # $arch is $6, as passed on the command line. + # $ARCH is the same argument but in all uppercase. +diff -rNU3 a/opcodes/configure b/opcodes/configure +--- a/opcodes/configure 2021-03-30 23:12:40.221226601 -0300 ++++ b/opcodes/configure 2021-03-30 17:48:01.242219000 -0300 +@@ -12919,6 +12919,7 @@ + bfd_powerpc_64_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; + bfd_pru_arch) ta="$ta pru-dis.lo pru-opc.lo" ;; + bfd_pyramid_arch) ;; ++ bfd_riscv_arch) ta="$ta riscv-dis.lo riscv-opc.lo" ;; + bfd_romp_arch) ;; + bfd_riscv_arch) ta="$ta riscv-dis.lo riscv-opc.lo" ;; + bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; +@@ -12926,7 +12927,29 @@ + bfd_rx_arch) ta="$ta rx-dis.lo rx-decode.lo";; + bfd_s390_arch) ta="$ta s390-dis.lo s390-opc.lo" ;; + bfd_score_arch) ta="$ta score-dis.lo score7-dis.lo" ;; +- bfd_sh_arch) ta="$ta sh-dis.lo cgen-bitset.lo" ;; ++ bfd_sh_arch) ++ # We can't decide what we want just from the CPU family. ++ # We want SH5 support unless a specific version of sh is ++ # specified, as in sh3-elf, sh3b-linux-gnu, etc. ++ # Include it just for ELF targets, since the SH5 bfd:s are ELF only. ++ for t in $target $canon_targets; do ++ # For NetBSD we do NOT want SH5 support unless sh5 or sh64 ++ # is specified ++ case $t in ++ sh5*-* | sh64*-*) # let the case below handle it ++ ;; ++ sh*-*-netbsd* | sh*l*-*-netbsd*) ++ continue ;; ++ esac ++ case $t in ++ all | sh5*-* | sh64*-* | sh-*-*elf* | shl*-*-*elf* | \ ++ sh-*-linux* | shl-*-linux*) ++ ta="$ta sh64-dis.lo sh64-opc.lo" ++ archdefs="$archdefs -DINCLUDE_SHMEDIA" ++ break;; ++ esac; ++ done ++ ta="$ta sh-dis.lo cgen-bitset.lo" ;; + bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;; + bfd_spu_arch) ta="$ta spu-dis.lo spu-opc.lo" ;; + bfd_tic30_arch) ta="$ta tic30-dis.lo" ;; +diff -rNU3 a/opcodes/Makefile.am b/opcodes/Makefile.am +--- a/opcodes/Makefile.am 2021-03-30 23:12:40.217893267 -0300 ++++ b/opcodes/Makefile.am 2021-03-30 17:48:01.165553000 -0300 +@@ -78,6 +78,7 @@ + mep-desc.h mep-opc.h \ + microblaze-opc.h \ + mt-desc.h mt-opc.h \ ++ or1k-desc.h or1k-opc.h \ + score-opc.h \ + sh-opc.h \ + sysdep.h \ +diff -rNU3 a/opcodes/Makefile.in b/opcodes/Makefile.in +--- a/opcodes/Makefile.in 2021-03-30 23:12:40.217893267 -0300 ++++ b/opcodes/Makefile.in 2021-03-30 17:48:01.168886000 -0300 +@@ -1019,6 +1019,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-dis.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-ibld.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-opc.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-opinst.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdp11-dis.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdp11-opc.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pj-dis.Plo@am__quote@ +diff -rNU3 a/zlib/adler32.c b/zlib/adler32.c +--- a/zlib/adler32.c 2021-03-30 23:12:40.221226601 -0300 ++++ b/zlib/adler32.c 2021-03-30 17:48:01.618886000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id: adler32.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ ++/* @(#) Id: adler32.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp */ + + #include "zutil.h" + +diff -rNU3 a/zlib/ChangeLog b/zlib/ChangeLog +--- a/zlib/ChangeLog 2021-03-30 23:12:40.221226601 -0300 ++++ b/zlib/ChangeLog 2021-03-30 17:48:01.615553000 -0300 +@@ -1259,7 +1259,7 @@ + - use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau) + - added makelcc.bat for lcc-win32 (Tom St Denis) + - in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe) +-- Avoid expanded $Id: ChangeLog,v 1.5 2002/05/08 04:38:00 aoliva Exp $. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. ++- Avoid expanded Id: ChangeLog,v 1.5 2002/05/08 04:38:00 aoliva Exp . Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion. + - check for unistd.h in configure (for off_t) + - remove useless check parameter in inflate_blocks_free + - avoid useless assignment of s->check to itself in inflate_blocks_new +diff -rNU3 a/zlib/compress.c b/zlib/compress.c +--- a/zlib/compress.c 2021-03-30 23:12:40.221226601 -0300 ++++ b/zlib/compress.c 2021-03-30 17:48:01.618886000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id: compress.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ ++/* @(#) Id: compress.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp */ + + #define ZLIB_INTERNAL + #include "zlib.h" +diff -rNU3 a/zlib/contrib/ada/buffer_demo.adb b/zlib/contrib/ada/buffer_demo.adb +--- a/zlib/contrib/ada/buffer_demo.adb 2021-03-30 23:12:40.221226601 -0300 ++++ b/zlib/contrib/ada/buffer_demo.adb 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + -- +--- $Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp $ ++-- Id: buffer_demo.adb,v 1.3 2004/09/06 06:55:35 vagul Exp + + -- This demo program provided by Dr Steve Sangwine + -- +diff -rNU3 a/zlib/contrib/ada/mtest.adb b/zlib/contrib/ada/mtest.adb +--- a/zlib/contrib/ada/mtest.adb 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/mtest.adb 2021-03-30 17:48:01.625553000 -0300 +@@ -8,7 +8,7 @@ + -- Continuous test for ZLib multithreading. If the test would fail + -- we should provide thread safe allocation routines for the Z_Stream. + -- +--- $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $ ++-- Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp + + with ZLib; + with Ada.Streams; +diff -rNU3 a/zlib/contrib/ada/read.adb b/zlib/contrib/ada/read.adb +--- a/zlib/contrib/ada/read.adb 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/read.adb 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp $ ++-- Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp + + -- Test/demo program for the generic read interface. + +diff -rNU3 a/zlib/contrib/ada/test.adb b/zlib/contrib/ada/test.adb +--- a/zlib/contrib/ada/test.adb 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/test.adb 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: test.adb,v 1.17 2003/08/12 12:13:30 vagul Exp $ ++-- Id: test.adb,v 1.17 2003/08/12 12:13:30 vagul Exp + + -- The program has a few aims. + -- 1. Test ZLib.Ada95 thick binding functionality. +diff -rNU3 a/zlib/contrib/ada/zlib.adb b/zlib/contrib/ada/zlib.adb +--- a/zlib/contrib/ada/zlib.adb 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/zlib.adb 2021-03-30 17:48:01.628886000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp $ ++-- Id: zlib.adb,v 1.31 2004/09/06 06:53:19 vagul Exp + + with Ada.Exceptions; + with Ada.Unchecked_Conversion; +diff -rNU3 a/zlib/contrib/ada/zlib.ads b/zlib/contrib/ada/zlib.ads +--- a/zlib/contrib/ada/zlib.ads 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/zlib.ads 2021-03-30 17:48:01.628886000 -0300 +@@ -25,7 +25,7 @@ + -- covered by the GNU Public License. -- + ------------------------------------------------------------------------------ + +--- $Id: zlib.ads,v 1.26 2004/09/06 06:53:19 vagul Exp $ ++-- Id: zlib.ads,v 1.26 2004/09/06 06:53:19 vagul Exp + + with Ada.Streams; + +diff -rNU3 a/zlib/contrib/ada/zlib-streams.adb b/zlib/contrib/ada/zlib-streams.adb +--- a/zlib/contrib/ada/zlib-streams.adb 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/zlib-streams.adb 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: zlib-streams.adb,v 1.10 2004/05/31 10:53:40 vagul Exp $ ++-- Id: zlib-streams.adb,v 1.10 2004/05/31 10:53:40 vagul Exp + + with Ada.Unchecked_Deallocation; + +diff -rNU3 a/zlib/contrib/ada/zlib-streams.ads b/zlib/contrib/ada/zlib-streams.ads +--- a/zlib/contrib/ada/zlib-streams.ads 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/zlib-streams.ads 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: zlib-streams.ads,v 1.12 2004/05/31 10:53:40 vagul Exp $ ++-- Id: zlib-streams.ads,v 1.12 2004/05/31 10:53:40 vagul Exp + + package ZLib.Streams is + +diff -rNU3 a/zlib/contrib/ada/zlib-thin.adb b/zlib/contrib/ada/zlib-thin.adb +--- a/zlib/contrib/ada/zlib-thin.adb 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/zlib-thin.adb 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp $ ++-- Id: zlib-thin.adb,v 1.8 2003/12/14 18:27:31 vagul Exp + + package body ZLib.Thin is + +diff -rNU3 a/zlib/contrib/ada/zlib-thin.ads b/zlib/contrib/ada/zlib-thin.ads +--- a/zlib/contrib/ada/zlib-thin.ads 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/ada/zlib-thin.ads 2021-03-30 17:48:01.625553000 -0300 +@@ -6,7 +6,7 @@ + -- Open source license information is in the zlib.ads file. -- + ---------------------------------------------------------------- + +--- $Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp $ ++-- Id: zlib-thin.ads,v 1.11 2004/07/23 06:33:11 vagul Exp + + with Interfaces.C.Strings; + +diff -rNU3 a/zlib/contrib/iostream2/zstream.h b/zlib/contrib/iostream2/zstream.h +--- a/zlib/contrib/iostream2/zstream.h 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/contrib/iostream2/zstream.h 2021-03-30 17:48:01.635553000 -0300 +@@ -21,7 +21,7 @@ + + /* + * zstream.h - C++ interface to the 'zlib' general purpose compression library +- * $Id: zstream.h,v 1.1 1999/05/04 19:30:27 tromey Exp $ ++ * Id: zstream.h,v 1.1 1999/05/04 19:30:27 tromey Exp + */ + + #include +Os arquivos binários a/zlib/contrib/masmx64/gvmat64.obj e b/zlib/contrib/masmx64/gvmat64.obj são diferentes +Os arquivos binários a/zlib/contrib/masmx64/inffasx64.obj e b/zlib/contrib/masmx64/inffasx64.obj são diferentes +Os arquivos binários a/zlib/contrib/masmx86/gvmat32.obj e b/zlib/contrib/masmx86/gvmat32.obj são diferentes +Os arquivos binários a/zlib/contrib/masmx86/inffas32.obj e b/zlib/contrib/masmx86/inffas32.obj são diferentes +diff -rNU3 a/zlib/crc32.c b/zlib/crc32.c +--- a/zlib/crc32.c 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/crc32.c 2021-03-30 17:48:01.658886000 -0300 +@@ -9,7 +9,7 @@ + * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3. + */ + +-/* @(#) $Id: crc32.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ ++/* @(#) Id: crc32.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp */ + + /* + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore +diff -rNU3 a/zlib/deflate.c b/zlib/deflate.c +--- a/zlib/deflate.c 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/deflate.c 2021-03-30 17:48:01.662219000 -0300 +@@ -47,7 +47,7 @@ + * + */ + +-/* @(#) $Id: deflate.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ ++/* @(#) Id: deflate.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp */ + + #include "deflate.h" + +diff -rNU3 a/zlib/deflate.h b/zlib/deflate.h +--- a/zlib/deflate.h 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/deflate.h 2021-03-30 17:48:01.662219000 -0300 +@@ -8,7 +8,7 @@ + subject to change. Applications should only use zlib.h. + */ + +-/* @(#) $Id: deflate.h,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ ++/* @(#) Id: deflate.h,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp */ + + #ifndef DEFLATE_H + #define DEFLATE_H +diff -rNU3 a/zlib/example.c b/zlib/example.c +--- a/zlib/example.c 2021-03-30 23:12:40.224559934 -0300 ++++ b/zlib/example.c 2021-03-30 17:48:01.662219000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id: example.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp $ */ ++/* @(#) Id: example.c,v 1.1.1.2 2002/03/11 21:53:23 tromey Exp */ + + #include "zlib.h" + #include +diff -rNU3 a/zlib/minigzip.c b/zlib/minigzip.c +--- a/zlib/minigzip.c 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/minigzip.c 2021-03-30 17:48:01.668886000 -0300 +@@ -13,7 +13,7 @@ + * or in pipe mode. + */ + +-/* @(#) $Id: minigzip.c,v 1.1.1.2 2002/03/11 21:53:26 tromey Exp $ */ ++/* @(#) Id: minigzip.c,v 1.1.1.2 2002/03/11 21:53:26 tromey Exp */ + + #include "zlib.h" + #include +diff -rNU3 a/zlib/test/example.c b/zlib/test/example.c +--- a/zlib/test/example.c 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/test/example.c 2021-03-30 17:48:01.672219000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id$ */ ++/* @(#) Id */ + + #include "zlib.h" + #include +diff -rNU3 a/zlib/test/minigzip.c b/zlib/test/minigzip.c +--- a/zlib/test/minigzip.c 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/test/minigzip.c 2021-03-30 17:48:01.672219000 -0300 +@@ -13,7 +13,7 @@ + * or in pipe mode. + */ + +-/* @(#) $Id$ */ ++/* @(#) Id */ + + #include "zlib.h" + #include +diff -rNU3 a/zlib/trees.c b/zlib/trees.c +--- a/zlib/trees.c 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/trees.c 2021-03-30 17:48:01.672219000 -0300 +@@ -30,7 +30,7 @@ + * Addison-Wesley, 1983. ISBN 0-201-06672-6. + */ + +-/* @(#) $Id: trees.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp $ */ ++/* @(#) Id: trees.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp */ + + /* #define GEN_TREES_H */ + +diff -rNU3 a/zlib/uncompr.c b/zlib/uncompr.c +--- a/zlib/uncompr.c 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/uncompr.c 2021-03-30 17:48:01.672219000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id: uncompr.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp $ */ ++/* @(#) Id: uncompr.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp */ + + #define ZLIB_INTERNAL + #include "zlib.h" +diff -rNU3 a/zlib/zconf.h b/zlib/zconf.h +--- a/zlib/zconf.h 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/zconf.h 2021-03-30 17:48:01.675553000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id: zconf.h,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp $ */ ++/* @(#) Id: zconf.h,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp */ + + #ifndef ZCONF_H + #define ZCONF_H +diff -rNU3 a/zlib/zconf.h.cmakein b/zlib/zconf.h.cmakein +--- a/zlib/zconf.h.cmakein 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/zconf.h.cmakein 2021-03-30 17:48:01.675553000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id$ */ ++/* @(#) Id */ + + #ifndef ZCONF_H + #define ZCONF_H +diff -rNU3 a/zlib/zconf.h.in b/zlib/zconf.h.in +--- a/zlib/zconf.h.in 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/zconf.h.in 2021-03-30 17:48:01.675553000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id$ */ ++/* @(#) Id */ + + #ifndef ZCONF_H + #define ZCONF_H +diff -rNU3 a/zlib/zutil.c b/zlib/zutil.c +--- a/zlib/zutil.c 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/zutil.c 2021-03-30 17:48:01.675553000 -0300 +@@ -3,7 +3,7 @@ + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +-/* @(#) $Id: zutil.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp $ */ ++/* @(#) Id: zutil.c,v 1.1.1.2 2002/03/11 21:53:27 tromey Exp */ + + #include "zutil.h" + #ifndef Z_SOLO +diff -rNU3 a/zlib/zutil.h b/zlib/zutil.h +--- a/zlib/zutil.h 2021-03-30 23:12:40.227893268 -0300 ++++ b/zlib/zutil.h 2021-03-30 17:48:01.675553000 -0300 +@@ -8,7 +8,7 @@ + subject to change. Applications should only use zlib.h. + */ + +-/* @(#) $Id: zutil.h,v 1.1.1.2 2002/03/11 21:53:28 tromey Exp $ */ ++/* @(#) Id: zutil.h,v 1.1.1.2 2002/03/11 21:53:28 tromey Exp */ + + #ifndef ZUTIL_H + #define ZUTIL_H diff --git a/external/gpl3/binutils/patches/0000-binutils_nbsd.patch b/external/gpl3/binutils/patches/0000-binutils_nbsd.patch deleted file mode 100644 index 7ad82421f..000000000 --- a/external/gpl3/binutils/patches/0000-binutils_nbsd.patch +++ /dev/null @@ -1,37997 +0,0 @@ -diff -rNU3 dist.orig/bfd/ChangeLog dist/bfd/ChangeLog ---- dist.orig/bfd/ChangeLog 2013-03-25 10:08:08.000000000 +0100 -+++ dist/bfd/ChangeLog 2015-10-18 13:11:12.000000000 +0200 -@@ -1,3 +1,8 @@ -+2013-12-14 Alan Modra -+ -+ * elflink.c (_bfd_elf_merge_symbol): If merging a new weak -+ symbol that will be skipped, we don't have a new definition. -+ - 2013-03-25 Tristan Gingold - - * configure.in: Bump version to 2.23.2 -diff -rNU3 dist.orig/bfd/Makefile.am dist/bfd/Makefile.am ---- dist.orig/bfd/Makefile.am 2013-03-25 10:08:05.000000000 +0100 -+++ dist/bfd/Makefile.am 2015-10-18 13:11:13.000000000 +0200 -@@ -897,6 +897,18 @@ - sed -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new - mv -f elf64-ia64.new elf64-ia64.c - -+elf32-riscv.c : elfnn-riscv.c -+ rm -f elf32-riscv.c -+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new -+ sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new -+ mv -f elf32-riscv.new elf32-riscv.c -+ -+elf64-riscv.c : elfnn-riscv.c -+ rm -f elf64-riscv.c -+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new -+ sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new -+ mv -f elf64-riscv.new elf64-riscv.c -+ - peigen.c : peXXigen.c - rm -f peigen.c - sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new -diff -rNU3 dist.orig/bfd/Makefile.in dist/bfd/Makefile.in ---- dist.orig/bfd/Makefile.in 2013-03-25 10:08:08.000000000 +0100 -+++ dist/bfd/Makefile.in 2015-10-18 13:11:13.000000000 +0200 -@@ -419,7 +419,7 @@ - cpu-mt.lo \ - cpu-ns32k.lo \ - cpu-openrisc.lo \ -- cpu-or32.lo \ -+ cpu-or1k.lo \ - cpu-pdp11.lo \ - cpu-pj.lo \ - cpu-plugin.lo \ -@@ -500,7 +500,7 @@ - cpu-mt.c \ - cpu-ns32k.c \ - cpu-openrisc.c \ -- cpu-or32.c \ -+ cpu-or1k.c \ - cpu-pdp11.c \ - cpu-pj.c \ - cpu-plugin.c \ -@@ -559,7 +559,7 @@ - coff-m68k.lo \ - coff-m88k.lo \ - coff-mips.lo \ -- coff-or32.lo \ -+ coff-or1k.lo \ - coff-rs6000.lo \ - coff-sh.lo \ - coff-sparc.lo \ -@@ -627,7 +627,7 @@ - elf32-msp430.lo \ - elf32-mt.lo \ - elf32-openrisc.lo \ -- elf32-or32.lo \ -+ elf32-or1k.lo \ - elf32-pj.lo \ - elf32-ppc.lo \ - elf32-rl78.lo \ -@@ -747,7 +747,7 @@ - coff-m68k.c \ - coff-m88k.c \ - coff-mips.c \ -- coff-or32.c \ -+ coff-or1k.c \ - coff-rs6000.c \ - coff-sh.c \ - coff-sparc.c \ -@@ -815,7 +815,7 @@ - elf32-msp430.c \ - elf32-mt.c \ - elf32-openrisc.c \ -- elf32-or32.c \ -+ elf32-or1k.c \ - elf32-pj.c \ - elf32-ppc.c \ - elf32-rl78.c \ -@@ -1253,7 +1253,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m68k.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-m88k.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-mips.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-or32.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-or1k.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-rs6000.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sh.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/coff-sparc.Plo@am__quote@ -@@ -1323,7 +1323,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-mt.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-ns32k.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-openrisc.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or32.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-or1k.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pdp11.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-pj.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-plugin.Plo@am__quote@ -@@ -1408,7 +1408,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-msp430.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-mt.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-openrisc.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or32.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-or1k.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-pj.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-ppc.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-rl78.Plo@am__quote@ -@@ -1967,6 +1967,18 @@ - sed -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new - mv -f elf64-ia64.new elf64-ia64.c - -+elf32-riscv.c : elfnn-riscv.c -+ rm -f elf32-riscv.c -+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new -+ sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new -+ mv -f elf32-riscv.new elf32-riscv.c -+ -+elf64-riscv.c : elfnn-riscv.c -+ rm -f elf64-riscv.c -+ echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new -+ sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new -+ mv -f elf64-riscv.new elf64-riscv.c -+ - peigen.c : peXXigen.c - rm -f peigen.c - sed -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new -diff -rNU3 dist.orig/bfd/aoutx.h dist/bfd/aoutx.h ---- dist.orig/bfd/aoutx.h 2012-05-01 18:07:33.000000000 +0200 -+++ dist/bfd/aoutx.h 2015-10-18 13:11:12.000000000 +0200 -@@ -762,7 +762,7 @@ - break; - - case bfd_arch_arm: -- if (machine == 0) -+ if (machine == 0 || machine == 5) - arch_flags = M_ARM; - break; - -diff -rNU3 dist.orig/bfd/archive.c dist/bfd/archive.c ---- dist.orig/bfd/archive.c 2013-03-25 09:06:19.000000000 +0100 -+++ dist/bfd/archive.c 2015-10-18 13:11:12.000000000 +0200 -@@ -157,6 +157,9 @@ - #define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen) - - #define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) -+ -+static const char * normalize (bfd *, const char *); -+ - #define arch_hdr(bfd) ((struct ar_hdr *) arch_eltdata (bfd)->arch_header) - - /* True iff NAME designated a BSD 4.4 extended name. */ -@@ -760,7 +763,9 @@ - /* Pad to an even boundary... - Note that last_file->origin can be odd in the case of - BSD-4.4-style element with a long odd size. */ -- filestart += filestart % 2; -+ if (!strncmp(arch_hdr (last_file)->ar_name, "#1/", 3)) -+ size += strlen(normalize(last_file, last_file->filename)); -+ filestart += size % 2; - } - - return _bfd_get_elt_at_filepos (archive, filestart); -@@ -2180,11 +2185,22 @@ - current = current->archive_next) - { - char buffer[DEFAULT_BUFFERSIZE]; -- bfd_size_type remaining = arelt_size (current); -+ bfd_size_type saved_size = arelt_size (current); -+ bfd_size_type remaining = saved_size; -+ struct ar_hdr *hdr = arch_hdr (current); - - /* Write ar header. */ - if (!_bfd_write_ar_hdr (arch, current)) -- return FALSE; -+ return FALSE; -+ /* Write filename if it is a 4.4BSD extended file, and add to size. */ -+ if (!strncmp (hdr->ar_name, "#1/", 3)) -+ { -+ const char *normal = normalize (current, current->filename); -+ unsigned int thislen = strlen (normal); -+ if (bfd_write (normal, 1, thislen, arch) != thislen) -+ return FALSE; -+ saved_size += thislen; -+ } - if (bfd_is_thin_archive (arch)) - continue; - if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) -@@ -2457,11 +2473,19 @@ - { - do - { -+#if 1 -+ bfd_size_type size = arelt_size (current); -+ if (!strncmp(arch_hdr (current)->ar_name, "#1/", 3)) -+ size += strlen(normalize(current, current->filename)); -+ firstreal += size + sizeof (struct ar_hdr); -+ firstreal += size % 2; -+#else - struct areltdata *ared = arch_eltdata (current); - - firstreal += (ared->parsed_size + ared->extra_size - + sizeof (struct ar_hdr)); - firstreal += firstreal % 2; -+#endif - current = current->archive_next; - } - while (current != map[count].u.abfd); -diff -rNU3 dist.orig/bfd/archures.c dist/bfd/archures.c ---- dist.orig/bfd/archures.c 2012-09-04 14:53:41.000000000 +0200 -+++ dist/bfd/archures.c 2015-10-18 13:11:12.000000000 +0200 -@@ -123,7 +123,7 @@ - .#define bfd_mach_i960_jx 7 - .#define bfd_mach_i960_hx 8 - . --. bfd_arch_or32, {* OpenRISC 32 *} -+. bfd_arch_or1k, {* OpenRISC 32 *} - . - . bfd_arch_sparc, {* SPARC *} - .#define bfd_mach_sparc 1 -@@ -245,6 +245,9 @@ - .#define bfd_mach_ppc_e6500 5007 - .#define bfd_mach_ppc_titan 83 - .#define bfd_mach_ppc_vle 84 -+. bfd_arch_riscv, {* RISC-V *} -+.#define bfd_mach_riscv32 132 -+.#define bfd_mach_riscv64 164 - . bfd_arch_rs6000, {* IBM RS/6000 *} - .#define bfd_mach_rs6k 6000 - .#define bfd_mach_rs6k_rs1 6001 -@@ -556,12 +559,13 @@ - extern const bfd_arch_info_type bfd_mt_arch; - extern const bfd_arch_info_type bfd_ns32k_arch; - extern const bfd_arch_info_type bfd_openrisc_arch; --extern const bfd_arch_info_type bfd_or32_arch; -+extern const bfd_arch_info_type bfd_or1k_arch; - extern const bfd_arch_info_type bfd_pdp11_arch; - extern const bfd_arch_info_type bfd_pj_arch; - extern const bfd_arch_info_type bfd_plugin_arch; - extern const bfd_arch_info_type bfd_powerpc_archs[]; - #define bfd_powerpc_arch bfd_powerpc_archs[0] -+extern const bfd_arch_info_type bfd_riscv_arch; - extern const bfd_arch_info_type bfd_rs6000_arch; - extern const bfd_arch_info_type bfd_rl78_arch; - extern const bfd_arch_info_type bfd_rx_arch; -@@ -642,9 +646,10 @@ - &bfd_mt_arch, - &bfd_ns32k_arch, - &bfd_openrisc_arch, -- &bfd_or32_arch, -+ &bfd_or1k_arch, - &bfd_pdp11_arch, - &bfd_powerpc_arch, -+ &bfd_riscv_arch, - &bfd_rs6000_arch, - &bfd_rl78_arch, - &bfd_rx_arch, -diff -rNU3 dist.orig/bfd/bfd-in2.h dist/bfd/bfd-in2.h ---- dist.orig/bfd/bfd-in2.h 2012-09-04 14:53:41.000000000 +0200 -+++ dist/bfd/bfd-in2.h 2015-10-18 13:11:12.000000000 +0200 -@@ -1852,7 +1852,9 @@ - #define bfd_mach_i960_jx 7 - #define bfd_mach_i960_hx 8 - -- bfd_arch_or32, /* OpenRISC 32 */ -+ bfd_arch_or1k, /* OpenRISC 1000 */ -+#define bfd_mach_or1k 1 -+#define bfd_mach_or1knd 2 - - bfd_arch_sparc, /* SPARC */ - #define bfd_mach_sparc 1 -@@ -1974,6 +1976,9 @@ - #define bfd_mach_ppc_e6500 5007 - #define bfd_mach_ppc_titan 83 - #define bfd_mach_ppc_vle 84 -+ bfd_arch_riscv, /* RISC-V */ -+#define bfd_mach_riscv32 132 -+#define bfd_mach_riscv64 164 - bfd_arch_rs6000, /* IBM RS/6000 */ - #define bfd_mach_rs6k 6000 - #define bfd_mach_rs6k_rs1 6001 -@@ -4803,9 +4808,66 @@ - BFD_RELOC_860_HIGOT, - BFD_RELOC_860_HIGOTOFF, - --/* OpenRISC Relocations. */ -- BFD_RELOC_OPENRISC_ABS_26, -- BFD_RELOC_OPENRISC_REL_26, -+/* OpenRISC 1000 Relocations. */ -+ BFD_RELOC_OR1K_REL_26, -+ BFD_RELOC_OR1K_GOTPC_HI16, -+ BFD_RELOC_OR1K_GOTPC_LO16, -+ BFD_RELOC_OR1K_GOT16, -+ BFD_RELOC_OR1K_PLT26, -+ BFD_RELOC_OR1K_GOTOFF_HI16, -+ BFD_RELOC_OR1K_GOTOFF_LO16, -+ BFD_RELOC_OR1K_COPY, -+ BFD_RELOC_OR1K_GLOB_DAT, -+ BFD_RELOC_OR1K_JMP_SLOT, -+ BFD_RELOC_OR1K_RELATIVE, -+ BFD_RELOC_OR1K_TLS_GD_HI16, -+ BFD_RELOC_OR1K_TLS_GD_LO16, -+ BFD_RELOC_OR1K_TLS_LDM_HI16, -+ BFD_RELOC_OR1K_TLS_LDM_LO16, -+ BFD_RELOC_OR1K_TLS_LDO_HI16, -+ BFD_RELOC_OR1K_TLS_LDO_LO16, -+ BFD_RELOC_OR1K_TLS_IE_HI16, -+ BFD_RELOC_OR1K_TLS_IE_LO16, -+ BFD_RELOC_OR1K_TLS_LE_HI16, -+ BFD_RELOC_OR1K_TLS_LE_LO16, -+ BFD_RELOC_OR1K_TLS_TPOFF, -+ BFD_RELOC_OR1K_TLS_DTPOFF, -+ BFD_RELOC_OR1K_TLS_DTPMOD, -+ -+/* RISC-V relocations. */ -+ BFD_RELOC_RISCV_HI20, -+ BFD_RELOC_RISCV_PCREL_HI20, -+ BFD_RELOC_RISCV_PCREL_LO12_I, -+ BFD_RELOC_RISCV_PCREL_LO12_S, -+ BFD_RELOC_RISCV_LO12_I, -+ BFD_RELOC_RISCV_LO12_S, -+ BFD_RELOC_RISCV_GPREL12_I, -+ BFD_RELOC_RISCV_GPREL12_S, -+ BFD_RELOC_RISCV_TPREL_HI20, -+ BFD_RELOC_RISCV_TPREL_LO12_I, -+ BFD_RELOC_RISCV_TPREL_LO12_S, -+ BFD_RELOC_RISCV_TPREL_ADD, -+ BFD_RELOC_RISCV_CALL, -+ BFD_RELOC_RISCV_CALL_PLT, -+ BFD_RELOC_RISCV_ADD8, -+ BFD_RELOC_RISCV_ADD16, -+ BFD_RELOC_RISCV_ADD32, -+ BFD_RELOC_RISCV_ADD64, -+ BFD_RELOC_RISCV_SUB8, -+ BFD_RELOC_RISCV_SUB16, -+ BFD_RELOC_RISCV_SUB32, -+ BFD_RELOC_RISCV_SUB64, -+ BFD_RELOC_RISCV_GOT_HI20, -+ BFD_RELOC_RISCV_TLS_GOT_HI20, -+ BFD_RELOC_RISCV_TLS_GD_HI20, -+ BFD_RELOC_RISCV_JMP, -+ BFD_RELOC_RISCV_TLS_DTPMOD32, -+ BFD_RELOC_RISCV_TLS_DTPREL32, -+ BFD_RELOC_RISCV_TLS_DTPMOD64, -+ BFD_RELOC_RISCV_TLS_DTPREL64, -+ BFD_RELOC_RISCV_TLS_TPREL32, -+ BFD_RELOC_RISCV_TLS_TPREL64, -+ BFD_RELOC_RISCV_ALIGN, - - /* H8 elf Relocations. */ - BFD_RELOC_H8_DIR16A8, -@@ -5788,6 +5850,11 @@ - /* This BFD has been created by the linker and doesn't correspond - to any input file. */ - #define BFD_LINKER_CREATED 0x2000 -+ /* This may be set before writing out a BFD to request that it -+ be written using values for UIDs, GIDs, timestamps, etc. that -+ will be consistent from run to run. */ -+#define BFD_DETERMINISTIC_OUTPUT 0x4000 -+ - - /* This may be set before writing out a BFD to request that it - be written using values for UIDs, GIDs, timestamps, etc. that -diff -rNU3 dist.orig/bfd/coff-alpha.c dist/bfd/coff-alpha.c ---- dist.orig/bfd/coff-alpha.c 2012-07-13 16:22:42.000000000 +0200 -+++ dist/bfd/coff-alpha.c 2015-10-18 13:11:12.000000000 +0200 -@@ -642,7 +642,9 @@ - case ALPHA_R_OP_STORE: - /* The STORE reloc needs the size and offset fields. We store - them in the addend. */ -+#if 0 - BFD_ASSERT (intern->r_offset <= 256); -+#endif - rptr->addend = (intern->r_offset << 8) + intern->r_size; - break; - -diff -rNU3 dist.orig/bfd/coff-or32.c dist/bfd/coff-or32.c ---- dist.orig/bfd/coff-or32.c 2012-07-13 16:22:43.000000000 +0200 -+++ dist/bfd/coff-or32.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,629 +0,0 @@ --/* BFD back-end for OpenRISC 1000 COFF binaries. -- Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 -- Free Software Foundation, Inc. -- Contributed by Ivan Guzvinec -- -- This file is part of BFD, the Binary File Descriptor library. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#define OR32 1 -- --#include "sysdep.h" --#include "bfd.h" --#include "libbfd.h" --#include "coff/or32.h" --#include "coff/internal.h" --#include "libcoff.h" -- --static bfd_reloc_status_type or32_reloc -- (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); -- --#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) -- --#define INSERT_HWORD(WORD,HWORD) \ -- (((WORD) & 0xffff0000) | ((HWORD)& 0x0000ffff)) --#define EXTRACT_HWORD(WORD) \ -- ((WORD) & 0x0000ffff) --#define SIGN_EXTEND_HWORD(HWORD) \ -- ((HWORD) & 0x8000 ? (HWORD)|(~0xffffL) : (HWORD)) -- --#define INSERT_JUMPTARG(WORD,JT) \ -- (((WORD) & 0xfc000000) | ((JT)& 0x03ffffff)) --#define EXTRACT_JUMPTARG(WORD) \ -- ((WORD) & 0x03ffffff) --#define SIGN_EXTEND_JUMPTARG(JT) \ -- ((JT) & 0x04000000 ? (JT)|(~0x03ffffffL) : (JT)) -- --/* Provided the symbol, returns the value reffed. */ -- --static long --get_symbol_value (asymbol *symbol) --{ -- long relocation = 0; -- -- if (bfd_is_com_section (symbol->section)) -- relocation = 0; -- else -- relocation = symbol->value + -- symbol->section->output_section->vma + -- symbol->section->output_offset; -- -- return relocation; --} -- --/* This function is in charge of performing all the or32 relocations. */ -- --static bfd_reloc_status_type --or32_reloc (bfd *abfd, -- arelent *reloc_entry, -- asymbol *symbol_in, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message) --{ -- /* The consth relocation comes in two parts, we have to remember -- the state between calls, in these variables. */ -- static bfd_boolean part1_consth_active = FALSE; -- static unsigned long part1_consth_value; -- -- unsigned long insn; -- unsigned long sym_value; -- unsigned long unsigned_value; -- unsigned short r_type; -- long signed_value; -- -- unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ -- bfd_byte *hit_data =addr + (bfd_byte *)(data); -- -- r_type = reloc_entry->howto->type; -- -- if (output_bfd) -- { -- /* Partial linking - do nothing. */ -- reloc_entry->address += input_section->output_offset; -- return bfd_reloc_ok; -- } -- -- if (symbol_in != NULL -- && bfd_is_und_section (symbol_in->section)) -- { -- /* Keep the state machine happy in case we're called again. */ -- if (r_type == R_IHIHALF) -- { -- part1_consth_active = TRUE; -- part1_consth_value = 0; -- } -- -- return bfd_reloc_undefined; -- } -- -- if ((part1_consth_active) && (r_type != R_IHCONST)) -- { -- part1_consth_active = FALSE; -- *error_message = (char *) "Missing IHCONST"; -- -- return bfd_reloc_dangerous; -- } -- -- sym_value = get_symbol_value (symbol_in); -- -- switch (r_type) -- { -- case R_IREL: -- insn = bfd_get_32(abfd, hit_data); -- -- /* Take the value in the field and sign extend it. */ -- signed_value = EXTRACT_JUMPTARG (insn); -- signed_value = SIGN_EXTEND_JUMPTARG (signed_value); -- signed_value <<= 2; -- -- /* See the note on the R_IREL reloc in coff_or32_relocate_section. */ -- if (signed_value == - (long) reloc_entry->address) -- signed_value = 0; -- -- signed_value += sym_value + reloc_entry->addend; -- /* Relative jmp/call, so subtract from the value the -- address of the place we're coming from. */ -- signed_value -= (reloc_entry->address -- + input_section->output_section->vma -- + input_section->output_offset); -- if (signed_value > 0x7ffffff || signed_value < -0x8000000) -- return bfd_reloc_overflow; -- -- signed_value >>= 2; -- insn = INSERT_JUMPTARG (insn, signed_value); -- bfd_put_32 (abfd, insn, hit_data); -- break; -- -- case R_ILOHALF: -- insn = bfd_get_32 (abfd, hit_data); -- unsigned_value = EXTRACT_HWORD (insn); -- unsigned_value += sym_value + reloc_entry->addend; -- insn = INSERT_HWORD (insn, unsigned_value); -- bfd_put_32 (abfd, insn, hit_data); -- break; -- -- case R_IHIHALF: -- insn = bfd_get_32 (abfd, hit_data); -- -- /* consth, part 1 -- Just get the symbol value that is referenced. */ -- part1_consth_active = TRUE; -- part1_consth_value = sym_value + reloc_entry->addend; -- -- /* Don't modify insn until R_IHCONST. */ -- break; -- -- case R_IHCONST: -- insn = bfd_get_32 (abfd, hit_data); -- -- /* consth, part 2 -- Now relocate the reference. */ -- if (! part1_consth_active) -- { -- *error_message = (char *) "Missing IHIHALF"; -- return bfd_reloc_dangerous; -- } -- -- /* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */ -- unsigned_value = 0; /*EXTRACT_HWORD(insn) << 16;*/ -- unsigned_value += reloc_entry->addend; /* r_symndx */ -- unsigned_value += part1_consth_value; -- unsigned_value = unsigned_value >> 16; -- insn = INSERT_HWORD (insn, unsigned_value); -- part1_consth_active = FALSE; -- bfd_put_32 (abfd, insn, hit_data); -- break; -- -- case R_BYTE: -- insn = bfd_get_8 (abfd, hit_data); -- unsigned_value = insn + sym_value + reloc_entry->addend; -- if (unsigned_value & 0xffffff00) -- return bfd_reloc_overflow; -- bfd_put_8 (abfd, unsigned_value, hit_data); -- break; -- -- case R_HWORD: -- insn = bfd_get_16 (abfd, hit_data); -- unsigned_value = insn + sym_value + reloc_entry->addend; -- if (unsigned_value & 0xffff0000) -- return bfd_reloc_overflow; -- bfd_put_16 (abfd, insn, hit_data); -- break; -- -- case R_WORD: -- insn = bfd_get_32 (abfd, hit_data); -- insn += sym_value + reloc_entry->addend; -- bfd_put_32 (abfd, insn, hit_data); -- break; -- -- default: -- *error_message = _("Unrecognized reloc"); -- return bfd_reloc_dangerous; -- } -- -- return bfd_reloc_ok; --} -- --/* type rightshift -- size -- bitsize -- pc-relative -- bitpos -- absolute -- complain_on_overflow -- special_function -- relocation name -- partial_inplace -- src_mask --*/ -- --/* FIXME: I'm not real sure about this table. */ --static reloc_howto_type howto_table[] = --{ -- { R_ABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "ABS", TRUE, 0xffffffff,0xffffffff, FALSE }, -- EMPTY_HOWTO (1), -- EMPTY_HOWTO (2), -- EMPTY_HOWTO (3), -- EMPTY_HOWTO (4), -- EMPTY_HOWTO (5), -- EMPTY_HOWTO (6), -- EMPTY_HOWTO (7), -- EMPTY_HOWTO (8), -- EMPTY_HOWTO (9), -- EMPTY_HOWTO (10), -- EMPTY_HOWTO (11), -- EMPTY_HOWTO (12), -- EMPTY_HOWTO (13), -- EMPTY_HOWTO (14), -- EMPTY_HOWTO (15), -- EMPTY_HOWTO (16), -- EMPTY_HOWTO (17), -- EMPTY_HOWTO (18), -- EMPTY_HOWTO (19), -- EMPTY_HOWTO (20), -- EMPTY_HOWTO (21), -- EMPTY_HOWTO (22), -- EMPTY_HOWTO (23), -- { R_IREL, 0, 3, 32, TRUE, 0, complain_overflow_signed, or32_reloc, "IREL", TRUE, 0xffffffff,0xffffffff, FALSE }, -- { R_IABS, 0, 3, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "IABS", TRUE, 0xffffffff,0xffffffff, FALSE }, -- { R_ILOHALF, 0, 3, 16, TRUE, 0, complain_overflow_signed, or32_reloc, "ILOHALF", TRUE, 0x0000ffff,0x0000ffff, FALSE }, -- { R_IHIHALF, 0, 3, 16, TRUE, 16,complain_overflow_signed, or32_reloc, "IHIHALF", TRUE, 0xffff0000,0xffff0000, FALSE }, -- { R_IHCONST, 0, 3, 16, TRUE, 0, complain_overflow_signed, or32_reloc, "IHCONST", TRUE, 0xffff0000,0xffff0000, FALSE }, -- { R_BYTE, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, or32_reloc, "BYTE", TRUE, 0x000000ff,0x000000ff, FALSE }, -- { R_HWORD, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, or32_reloc, "HWORD", TRUE, 0x0000ffff,0x0000ffff, FALSE }, -- { R_WORD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, or32_reloc, "WORD", TRUE, 0xffffffff,0xffffffff, FALSE }, --}; -- --#define BADMAG(x) OR32BADMAG (x) -- --#define RELOC_PROCESSING(relent, reloc, symbols, abfd, section) \ -- reloc_processing (relent, reloc, symbols, abfd, section) -- --static void --reloc_processing (arelent *relent, -- struct internal_reloc *reloc, -- asymbol **symbols, -- bfd *abfd, -- asection *section) --{ -- static bfd_vma ihihalf_vaddr = (bfd_vma) -1; -- -- relent->address = reloc->r_vaddr; -- relent->howto = howto_table + reloc->r_type; -- -- if (reloc->r_type == R_IHCONST) -- { -- /* The address of an R_IHCONST should always be the address of -- the immediately preceding R_IHIHALF. relocs generated by gas -- are correct, but relocs generated by High C are different (I -- can't figure out what the address means for High C). We can -- handle both gas and High C by ignoring the address here, and -- simply reusing the address saved for R_IHIHALF. */ -- if (ihihalf_vaddr == (bfd_vma) -1) -- abort (); -- -- relent->address = ihihalf_vaddr; -- ihihalf_vaddr = (bfd_vma) -1; -- relent->addend = reloc->r_symndx; -- relent->sym_ptr_ptr= bfd_abs_section_ptr->symbol_ptr_ptr; -- } -- else -- { -- relent->sym_ptr_ptr = symbols + obj_convert (abfd)[reloc->r_symndx]; -- relent->addend = 0; -- relent->address-= section->vma; -- -- if (reloc->r_type == R_IHIHALF) -- ihihalf_vaddr = relent->address; -- else if (ihihalf_vaddr != (bfd_vma) -1) -- abort (); -- } --} -- --/* The reloc processing routine for the optimized COFF linker. */ -- --static bfd_boolean --coff_or32_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info, -- bfd *input_bfd, -- asection *input_section, -- bfd_byte *contents, -- struct internal_reloc *relocs, -- struct internal_syment *syms, -- asection **sections) --{ -- struct internal_reloc *rel; -- struct internal_reloc *relend; -- bfd_boolean hihalf; -- bfd_vma hihalf_val; -- -- /* If we are performing a relocatable link, we don't need to do a -- thing. The caller will take care of adjusting the reloc -- addresses and symbol indices. */ -- if (info->relocatable) -- return TRUE; -- -- hihalf = FALSE; -- hihalf_val = 0; -- -- rel = relocs; -- relend = rel + input_section->reloc_count; -- -- for (; rel < relend; rel++) -- { -- long symndx; -- bfd_byte *loc; -- struct coff_link_hash_entry *h; -- struct internal_syment *sym; -- asection *sec; -- bfd_vma val; -- bfd_boolean overflow; -- unsigned long insn; -- long signed_value; -- unsigned long unsigned_value; -- bfd_reloc_status_type rstat; -- -- symndx = rel->r_symndx; -- loc = contents + rel->r_vaddr - input_section->vma; -- -- if (symndx == -1 || rel->r_type == R_IHCONST) -- h = NULL; -- else -- h = obj_coff_sym_hashes (input_bfd)[symndx]; -- -- sym = NULL; -- sec = NULL; -- val = 0; -- -- /* An R_IHCONST reloc does not have a symbol. Instead, the -- symbol index is an addend. R_IHCONST is always used in -- conjunction with R_IHHALF. */ -- if (rel->r_type != R_IHCONST) -- { -- if (h == NULL) -- { -- if (symndx == -1) -- sec = bfd_abs_section_ptr; -- else -- { -- sym = syms + symndx; -- sec = sections[symndx]; -- val = (sec->output_section->vma -- + sec->output_offset -- + sym->n_value -- - sec->vma); -- } -- } -- else -- { -- if (h->root.type == bfd_link_hash_defined -- || h->root.type == bfd_link_hash_defweak) -- { -- sec = h->root.u.def.section; -- val = (h->root.u.def.value -- + sec->output_section->vma -- + sec->output_offset); -- } -- else -- { -- if (! ((*info->callbacks->undefined_symbol) -- (info, h->root.root.string, input_bfd, input_section, -- rel->r_vaddr - input_section->vma, TRUE))) -- return FALSE; -- } -- } -- -- if (hihalf) -- { -- if (! ((*info->callbacks->reloc_dangerous) -- (info, "missing IHCONST reloc", input_bfd, -- input_section, rel->r_vaddr - input_section->vma))) -- return FALSE; -- hihalf = FALSE; -- } -- } -- -- overflow = FALSE; -- -- switch (rel->r_type) -- { -- default: -- bfd_set_error (bfd_error_bad_value); -- return FALSE; -- -- case R_IREL: -- insn = bfd_get_32 (input_bfd, loc); -- -- /* Extract the addend. */ -- signed_value = EXTRACT_JUMPTARG (insn); -- signed_value = SIGN_EXTEND_JUMPTARG (signed_value); -- signed_value <<= 2; -- -- /* Determine the destination of the jump. */ -- signed_value += val; -- -- /* Make the destination PC relative. */ -- signed_value -= (input_section->output_section->vma -- + input_section->output_offset -- + (rel->r_vaddr - input_section->vma)); -- if (signed_value > 0x7ffffff || signed_value < - 0x8000000) -- { -- overflow = TRUE; -- signed_value = 0; -- } -- -- /* Put the adjusted value back into the instruction. */ -- signed_value >>= 2; -- insn = INSERT_JUMPTARG(insn, signed_value); -- -- bfd_put_32 (input_bfd, (bfd_vma) insn, loc); -- break; -- -- case R_ILOHALF: -- insn = bfd_get_32 (input_bfd, loc); -- unsigned_value = EXTRACT_HWORD (insn); -- unsigned_value += val; -- insn = INSERT_HWORD (insn, unsigned_value); -- bfd_put_32 (input_bfd, insn, loc); -- break; -- -- case R_IHIHALF: -- /* Save the value for the R_IHCONST reloc. */ -- hihalf = TRUE; -- hihalf_val = val; -- break; -- -- case R_IHCONST: -- if (! hihalf) -- { -- if (! ((*info->callbacks->reloc_dangerous) -- (info, "missing IHIHALF reloc", input_bfd, -- input_section, rel->r_vaddr - input_section->vma))) -- return FALSE; -- hihalf_val = 0; -- } -- -- insn = bfd_get_32 (input_bfd, loc); -- unsigned_value = rel->r_symndx + hihalf_val; -- unsigned_value >>= 16; -- insn = INSERT_HWORD (insn, unsigned_value); -- bfd_put_32 (input_bfd, (bfd_vma) insn, loc); -- -- hihalf = FALSE; -- break; -- -- case R_BYTE: -- case R_HWORD: -- case R_WORD: -- rstat = _bfd_relocate_contents (howto_table + rel->r_type, -- input_bfd, val, loc); -- if (rstat == bfd_reloc_overflow) -- overflow = TRUE; -- else if (rstat != bfd_reloc_ok) -- abort (); -- break; -- } -- -- if (overflow) -- { -- const char *name; -- char buf[SYMNMLEN + 1]; -- -- if (symndx == -1) -- name = "*ABS*"; -- else if (h != NULL) -- name = NULL; -- else if (sym == NULL) -- name = "*unknown*"; -- else if (sym->_n._n_n._n_zeroes == 0 -- && sym->_n._n_n._n_offset != 0) -- name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset; -- else -- { -- strncpy (buf, sym->_n._n_name, SYMNMLEN); -- buf[SYMNMLEN] = '\0'; -- name = buf; -- } -- -- if (! ((*info->callbacks->reloc_overflow) -- (info, (h ? &h->root : NULL), name, -- howto_table[rel->r_type].name, (bfd_vma) 0, input_bfd, -- input_section, rel->r_vaddr - input_section->vma))) -- return FALSE; -- } -- } -- -- return TRUE; --} -- --#define coff_relocate_section coff_or32_relocate_section -- --/* We don't want to change the symndx of a R_IHCONST reloc, since it -- is actually an addend, not a symbol index at all. */ -- --static bfd_boolean --coff_or32_adjust_symndx (bfd *obfd ATTRIBUTE_UNUSED, -- struct bfd_link_info *info ATTRIBUTE_UNUSED, -- bfd *ibfd ATTRIBUTE_UNUSED, -- asection *sec ATTRIBUTE_UNUSED, -- struct internal_reloc *irel, -- bfd_boolean *adjustedp) --{ -- if (irel->r_type == R_IHCONST) -- *adjustedp = TRUE; -- else -- *adjustedp = FALSE; -- return TRUE; --} -- --#define coff_adjust_symndx coff_or32_adjust_symndx -- --#ifndef bfd_pe_print_pdata --#define bfd_pe_print_pdata NULL --#endif -- --#include "coffcode.h" -- --const bfd_target or32coff_big_vec = --{ -- "coff-or32-big", /* Name. */ -- bfd_target_coff_flavour, -- BFD_ENDIAN_BIG, /* Data byte order is big. */ -- BFD_ENDIAN_BIG, /* Header byte order is big. */ -- -- (HAS_RELOC | EXEC_P | /* Object flags. */ -- HAS_LINENO | HAS_DEBUG | -- HAS_SYMS | HAS_LOCALS | WP_TEXT), -- -- (SEC_HAS_CONTENTS | SEC_ALLOC | /* Section flags. */ -- SEC_LOAD | SEC_RELOC | -- SEC_READONLY ), -- '_', /* Leading underscore. */ -- '/', /* ar_pad_char. */ -- 15, /* ar_max_namelen. */ -- 0, /* match priority. */ -- -- /* Data. */ -- bfd_getb64, bfd_getb_signed_64, bfd_putb64, -- bfd_getb32, bfd_getb_signed_32, bfd_putb32, -- bfd_getb16, bfd_getb_signed_16, bfd_putb16, -- -- /* Headers. */ -- bfd_getb64, bfd_getb_signed_64, bfd_putb64, -- bfd_getb32, bfd_getb_signed_32, bfd_putb32, -- bfd_getb16, bfd_getb_signed_16, bfd_putb16, -- -- { -- _bfd_dummy_target, -- coff_object_p, -- bfd_generic_archive_p, -- _bfd_dummy_target -- }, -- { -- bfd_false, -- coff_mkobject, -- _bfd_generic_mkarchive, -- bfd_false -- }, -- { -- bfd_false, -- coff_write_object_contents, -- _bfd_write_archive_contents, -- bfd_false -- }, -- -- BFD_JUMP_TABLE_GENERIC (coff), -- BFD_JUMP_TABLE_COPY (coff), -- BFD_JUMP_TABLE_CORE (_bfd_nocore), -- BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), -- BFD_JUMP_TABLE_SYMBOLS (coff), -- BFD_JUMP_TABLE_RELOCS (coff), -- BFD_JUMP_TABLE_WRITE (coff), -- BFD_JUMP_TABLE_LINK (coff), -- BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), -- -- /* Alternative_target. */ --#ifdef TARGET_LITTLE_SYM -- & TARGET_LITTLE_SYM, --#else -- NULL, --#endif -- -- COFF_SWAP_TABLE --}; -diff -rNU3 dist.orig/bfd/coffcode.h dist/bfd/coffcode.h ---- dist.orig/bfd/coffcode.h 2011-09-27 18:03:49.000000000 +0200 -+++ dist/bfd/coffcode.h 2015-10-18 13:11:12.000000000 +0200 -@@ -2083,12 +2083,6 @@ - machine = 0; - switch (internal_f->f_magic) - { --#ifdef OR32_MAGIC_BIG -- case OR32_MAGIC_BIG: -- case OR32_MAGIC_LITTLE: -- arch = bfd_arch_or32; -- break; --#endif - #ifdef PPCMAGIC - case PPCMAGIC: - arch = bfd_arch_powerpc; -@@ -3055,15 +3049,6 @@ - return TRUE; - #endif - --#ifdef OR32_MAGIC_BIG -- case bfd_arch_or32: -- if (bfd_big_endian (abfd)) -- * magicp = OR32_MAGIC_BIG; -- else -- * magicp = OR32_MAGIC_LITTLE; -- return TRUE; --#endif -- - default: /* Unknown architecture. */ - /* Fall through to "return FALSE" below, to avoid - "statement never reached" errors on the one below. */ -diff -rNU3 dist.orig/bfd/config.bfd dist/bfd/config.bfd ---- dist.orig/bfd/config.bfd 2012-09-04 16:14:59.000000000 +0200 -+++ dist/bfd/config.bfd 2015-10-18 13:11:12.000000000 +0200 -@@ -86,16 +86,18 @@ - i[3-7]86) targ_archs=bfd_i386_arch ;; - i370) targ_archs=bfd_i370_arch ;; - lm32) targ_archs=bfd_lm32_arch ;; -+m5200|m5407) targ_archs=bfd_m68k_arch ;; - m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;; - m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch bfd_m9s12x_arch bfd_m9s12xg_arch" ;; - m68*) targ_archs=bfd_m68k_arch ;; - m88*) targ_archs=bfd_m88k_arch ;; - microblaze*) targ_archs=bfd_microblaze_arch ;; - mips*) targ_archs=bfd_mips_arch ;; --or32*) targ_archs=bfd_or32_arch ;; -+or1k*) targ_archs=bfd_or1k_arch ;; - pdp11*) targ_archs=bfd_pdp11_arch ;; - pj*) targ_archs="bfd_pj_arch bfd_i386_arch";; - powerpc*) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; -+riscv*) targ_archs=bfd_riscv_arch ;; - rs6000) targ_archs="bfd_rs6000_arch bfd_powerpc_arch" ;; - s390*) targ_archs=bfd_s390_arch ;; - sh*) targ_archs=bfd_sh_arch ;; -@@ -164,6 +166,16 @@ - targ_selvecs="bfd_elf64_littleaarch64_vec bfd_elf32_bigarm_vec bfd_elf32_littlearm_vec" - want64=true - ;; -+ aarch64-*-netbsd*) -+ targ_defvec=bfd_elf64_littleaarch64_vec -+ targ_selvecs="bfd_elf64_bigaarch64_vec bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec" -+ want64=true -+ ;; -+ aarch64_be-*-netbsd*) -+ targ_defvec=bfd_elf64_bigaarch64_vec -+ targ_selvecs="bfd_elf64_littleaarch64_vec bfd_elf32_bigarm_vec bfd_elf32_littlearm_vec" -+ want64=true -+ ;; - alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) - targ_defvec=bfd_elf64_alpha_freebsd_vec - targ_selvecs="bfd_elf64_alpha_vec ecoffalpha_little_vec" -@@ -250,17 +262,17 @@ - targ64_selvecs="bfd_elf32_x86_64_nacl_vec bfd_elf64_x86_64_nacl_vec" - targ_archs="$targ_archs bfd_i386_arch" - ;; -- armeb-*-netbsdelf*) -+ arm*eb-*-netbsdelf*) - targ_defvec=bfd_elf32_bigarm_vec -- targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec" -+ targ_selvecs="bfd_elf32_littlearm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec" - ;; -- arm-*-netbsdelf*) -+ arm*-*-netbsdelf*) - targ_defvec=bfd_elf32_littlearm_vec -- targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec" -+ targ_selvecs="bfd_elf32_bigarm_vec armnetbsd_vec armcoff_little_vec armcoff_big_vec" - ;; - arm-*-netbsd* | arm-*-openbsd*) - targ_defvec=armnetbsd_vec -- targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec" -+ targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec armcoff_little_vec armcoff_big_vec" - targ_underscore=yes - targ_cflags=-D__QNXTARGET__ - ;; -@@ -574,8 +586,8 @@ - ;; - i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu) - targ_defvec=bfd_elf32_i386_vec -- targ_selvecs=i386netbsd_vec -- targ64_selvecs="bfd_elf64_x86_64_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec" -+ targ_selvecs="i386netbsd_vec i386coff_vec i386pei_vec" -+ targ64_selvecs="bfd_elf64_x86_64_vec x86_64pei_vec bfd_elf64_l1om_vec bfd_elf64_k1om_vec" - ;; - i[3-7]86-*-netbsdpe*) - targ_defvec=i386pe_vec -@@ -845,12 +857,12 @@ - # targ_selvecs=m68kmach3_vec - # targ_cflags=-DSTAT_FOR_EXEC - ;; -- m68*-hp*-netbsd*) -+ m68k4k*-*-netbsd*) - targ_defvec=m68k4knetbsd_vec -- targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec" -+ targ_selvecs="m68knetbsd_vec hp300bsd_vec sunos_big_vec bfd_elf32_m68k_vec" - targ_underscore=yes - ;; -- m68*-*-netbsdelf*) -+ m68*-*-netbsdelf* | m5407-*-netbsdelf*) - targ_defvec=bfd_elf32_m68k_vec - targ_selvecs="m68knetbsd_vec m68k4knetbsd_vec hp300bsd_vec sunos_big_vec" - ;; -@@ -923,6 +935,16 @@ - targ_defvec=ecoff_big_vec - targ_selvecs=ecoff_little_vec - ;; -+#ifdef BFD64 -+ mips64*el-*-netbsd*) -+ targ_defvec=bfd_elf32_ntradlittlemips_vec -+ targ_selvecs="bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec" -+ ;; -+ mips64*-*-netbsd*) -+ targ_defvec=bfd_elf32_ntradbigmips_vec -+ targ_selvecs="bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradlittlemips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec" -+ ;; -+#endif - mips*el-*-netbsd*) - targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_little_vec ecoff_big_vec" -@@ -1102,17 +1124,16 @@ - targ_underscore=yes - ;; - -- openrisc-*-elf) -- targ_defvec=bfd_elf32_openrisc_vec -+ or1k*-*-elf) -+ targ_defvec=bfd_elf32_or1k_big_vec - ;; - -- or32-*-coff) -- targ_defvec=or32coff_big_vec -- targ_underscore=yes -+ or1k*-*-linux*) -+ targ_defvec=bfd_elf32_or1k_big_vec - ;; - -- or32-*-elf) -- targ_defvec=bfd_elf32_or32_big_vec -+ or1k*-*-netbsd*) -+ targ_defvec=bfd_elf32_or1k_big_vec - ;; - - pdp11-*-*) -@@ -1252,6 +1273,14 @@ - targ_defvec=bfd_elf32_rl78_vec - ;; - -+#ifdef BFD64 -+ riscv*-*-*) -+ targ_defvec=bfd_elf64_riscv_vec -+ targ_selvecs="bfd_elf32_riscv_vec bfd_elf64_riscv_vec" -+ want64=true -+ ;; -+#endif -+ - rx-*-elf) - targ_defvec=bfd_elf32_rx_le_vec - targ_selvecs="bfd_elf32_rx_be_vec bfd_elf32_rx_le_vec bfd_elf32_rx_be_ns_vec" -@@ -1347,6 +1376,8 @@ - want64=true - ;; - -+#endif -+ - sh*l*-*-netbsdelf*) - targ_defvec=bfd_elf32_shlnbsd_vec - targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" -@@ -1357,8 +1388,6 @@ - targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" - want64=true - ;; --#endif -- - sh*-*-netbsdelf*) - targ_defvec=bfd_elf32_shnbsd_vec - targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" -@@ -1448,11 +1477,12 @@ - ;; - sparc-*-netbsdelf*) - targ_defvec=bfd_elf32_sparc_vec -- targ_selvecs=sparcnetbsd_vec -+ targ_selvecs="sparcnetbsd_vec sunos_big_vec" -+ want64=true - ;; -- sparc-*-netbsdaout* | sparc-*-netbsd*) -+ sparc-*-netbsd*) - targ_defvec=sparcnetbsd_vec -- targ_selvecs=bfd_elf32_sparc_vec -+ targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" - targ_underscore=yes - ;; - sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]) -@@ -1500,6 +1530,10 @@ - targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec" - want64=true - ;; -+ sparc64-*-netbsd*) -+ targ_defvec=bfd_elf64_sparc_vec -+ targ_selvecs="bfd_elf32_sparc_vec sparcnetbsd_vec sunos_big_vec" -+ ;; - sparc64-*-elf* | sparc64-*-rtems* ) - targ_defvec=bfd_elf64_sparc_vec - targ_selvecs=bfd_elf32_sparc_vec -diff -rNU3 dist.orig/bfd/configure dist/bfd/configure ---- dist.orig/bfd/configure 2013-03-25 10:08:07.000000000 +0100 -+++ dist/bfd/configure 2015-10-18 13:11:12.000000000 +0200 -@@ -12101,10 +12101,10 @@ - withval=$with_pkgversion; case "$withval" in - yes) as_fn_error "package version not specified" "$LINENO" 5 ;; - no) PKGVERSION= ;; -- *) PKGVERSION="($withval) " ;; -+ *) PKGVERSION="($withval)\ " ;; - esac - else -- PKGVERSION="(GNU Binutils) " -+ PKGVERSION="(GNU Binutils)\ " - - fi - -@@ -13861,6 +13861,7 @@ - COREFILE=netbsd-core.lo - ;; - arm-*-riscix) COREFILE=trad-core.lo ;; -+ arm*-*-netbsd*) COREFILE=netbsd-core.lo ;; - hppa*-*-hpux*) COREFILE=hpux-core.lo ;; - hppa*-*-hiux*) COREFILE=hpux-core.lo ;; - hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; -@@ -13923,7 +13924,7 @@ - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i860mach3.h"' - ;; -- mips-*-netbsd* | mips*-*-openbsd*) -+ mips*-*-netbsd* | mips*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - mips-dec-*) -@@ -15278,14 +15279,14 @@ - tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - bfd_elf32_ntradlittlemips_vec | bfd_elf32_ntradlittlemips_freebsd_vec) - tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; -- bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; -- bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; -+ bfd_elf32_or1k_big_vec) tb="$tb elf32-or1k.lo elf32.lo $elf" ;; - bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; - bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; - bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_powerpc_freebsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; -+ bfd_elf32_riscv_vec) tb="$tb elf32-riscv.lo elfxx-riscv.lo elf32.lo $elf" ;; - bfd_elf32_rl78_vec) tb="$tb elf32-rl78.lo $elf" ;; - bfd_elf32_rx_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; - bfd_elf32_rx_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; -@@ -15356,6 +15357,7 @@ - bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_powerpc_freebsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; -+ bfd_elf64_riscv_vec) tb="$tb elf64-riscv.lo elf64.lo elfxx-riscv.lo elf32.lo $elf"; target_size=64 ;; - bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; -@@ -15447,7 +15449,6 @@ - nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; - nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; - nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; -- or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;; - pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; - pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; - pef_vec) tb="$tb pef.lo" ;; -diff -rNU3 dist.orig/bfd/configure.host dist/bfd/configure.host ---- dist.orig/bfd/configure.host 2010-12-31 12:00:52.000000000 +0100 -+++ dist/bfd/configure.host 2015-10-18 13:11:12.000000000 +0200 -@@ -57,6 +57,18 @@ - - m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;; - -+sparc64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;; -+ -+x86_64*-*-netbsd*) host64=true; HOST_64BIT_TYPE=long ;; -+ -+*-*-aix*) HOST_64BIT_TYPE="long long" -+ HOST_U_64BIT_TYPE="unsigned long long" -+ ;; -+ -+*-*-solaris*) HOST_64BIT_TYPE="long long" -+ HOST_U_64BIT_TYPE="unsigned long long" -+ ;; -+ - # Some Solaris systems (osol0906 at least) have a libc that doesn't recognise - # the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the - # default code page used by windres/windmc when not specified by a commandline -diff -rNU3 dist.orig/bfd/configure.in dist/bfd/configure.in ---- dist.orig/bfd/configure.in 2013-03-25 10:08:05.000000000 +0100 -+++ dist/bfd/configure.in 2015-10-18 13:11:12.000000000 +0200 -@@ -254,6 +254,7 @@ - COREFILE=netbsd-core.lo - ;; - arm-*-riscix) COREFILE=trad-core.lo ;; -+ arm*-*-netbsd*) COREFILE=netbsd-core.lo ;; - hppa*-*-hpux*) COREFILE=hpux-core.lo ;; - hppa*-*-hiux*) COREFILE=hpux-core.lo ;; - hppa*-*-mpeix*) COREFILE=hpux-core.lo ;; -@@ -340,7 +341,7 @@ - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/i860mach3.h"' - ;; -- mips-*-netbsd* | mips*-*-openbsd*) -+ mips*-*-netbsd* | mips*-*-openbsd*) - COREFILE=netbsd-core.lo - ;; - mips-dec-*) -@@ -771,7 +772,8 @@ - bfd_elf32_ntradlittlemips_vec | bfd_elf32_ntradlittlemips_freebsd_vec) - tb="$tb elfn32-mips.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; - bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; -- bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; -+ bfd_elf32_or1k_big_vec) tb="$tb elf32-or1k.lo elf32.lo $elf" ;; -+ bfd_elf32_riscv_vec) tb="$tb elf32-riscv.lo elfxx-riscv.lo elf32.lo $elf"; target_size=64 ;; - bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; - bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; - bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; -@@ -835,6 +837,7 @@ - bfd_elf64_bigaarch64_vec) tb="$tb elf64-aarch64.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; -+ bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;; - bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elfxx-ia64.lo elf64.lo $elf"; target_size=64 ;; -@@ -844,10 +847,12 @@ - bfd_elf64_littleaarch64_vec)tb="$tb elf64-aarch64.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_little_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_littlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf-vxworks.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; -+ bfd_elf32_m32c_vec) tb="$tb elf32-m32c.lo elf32.lo $elf" ;; - bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_powerpc_freebsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; -+ bfd_elf64_riscv_vec) tb="$tb elf64-riscv.lo elf64.lo elfxx-riscv.lo elf32.lo $elf"; target_size=64 ;; - bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; -@@ -939,7 +944,6 @@ - nlm32_i386_vec) tb="$tb nlm32-i386.lo nlm32.lo nlm.lo" ;; - nlm32_powerpc_vec) tb="$tb nlm32-ppc.lo nlm32.lo nlm.lo" ;; - nlm32_sparc_vec) tb="$tb nlm32-sparc.lo nlm32.lo nlm.lo" ;; -- or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;; - pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; - pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; - pef_vec) tb="$tb pef.lo" ;; -diff -rNU3 dist.orig/bfd/cpu-or1k.c dist/bfd/cpu-or1k.c ---- dist.orig/bfd/cpu-or1k.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/bfd/cpu-or1k.c 2015-10-18 13:11:12.000000000 +0200 -@@ -0,0 +1,61 @@ -+/* BFD support for the OpenRISC 1000 architecture. -+ Copyright 2002, 2005, 2007 Free Software Foundation, Inc. -+ Contributed by Ivan Guzvinec -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+#include "sysdep.h" -+#include "bfd.h" -+#include "libbfd.h" -+ -+extern const bfd_arch_info_type bfd_or1knd_arch; -+ -+const bfd_arch_info_type bfd_or1k_arch = -+ { -+ 32, /* 32 bits in a word. */ -+ 32, /* 32 bits in an address. */ -+ 8, /* 8 bits in a byte. */ -+ bfd_arch_or1k, -+ bfd_mach_or1k, -+ "or1k", -+ "or1k", -+ 4, -+ TRUE, /* The one and only. */ -+ bfd_default_compatible, -+ bfd_default_scan, -+ bfd_arch_default_fill, -+ &bfd_or1knd_arch, -+ }; -+ -+ -+const bfd_arch_info_type bfd_or1knd_arch = -+ { -+ 32, /* 32 bits in a word. */ -+ 32, /* 32 bits in an address. */ -+ 8, /* 8 bits in a byte. */ -+ bfd_arch_or1k, -+ bfd_mach_or1knd, -+ "or1knd", -+ "or1knd", -+ 4, -+ TRUE, /* The one and only. */ -+ bfd_default_compatible, -+ bfd_default_scan, -+ bfd_arch_default_fill, -+ 0, -+ }; -diff -rNU3 dist.orig/bfd/cpu-or32.c dist/bfd/cpu-or32.c ---- dist.orig/bfd/cpu-or32.c 2012-01-31 18:54:35.000000000 +0100 -+++ dist/bfd/cpu-or32.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,42 +0,0 @@ --/* BFD support for the OpenRISC 1000 architecture. -- Copyright 2002, 2005, 2007 Free Software Foundation, Inc. -- Contributed by Ivan Guzvinec -- -- This file is part of BFD, the Binary File Descriptor library. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#include "sysdep.h" --#include "bfd.h" --#include "libbfd.h" -- --const bfd_arch_info_type bfd_or32_arch = -- { -- 32, /* 32 bits in a word. */ -- 32, /* 32 bits in an address. */ -- 8, /* 8 bits in a byte. */ -- bfd_arch_or32, -- 0, /* Only 1 machine. */ -- "or32", -- "or32", -- 4, -- TRUE, /* The one and only. */ -- bfd_default_compatible, -- bfd_default_scan, -- bfd_arch_default_fill, -- 0, -- }; -- -diff -rNU3 dist.orig/bfd/cpu-riscv.c dist/bfd/cpu-riscv.c ---- dist.orig/bfd/cpu-riscv.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/bfd/cpu-riscv.c 2015-10-18 13:11:12.000000000 +0200 -@@ -0,0 +1,80 @@ -+/* BFD backend for RISC-V -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on MIPS target. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+#include "sysdep.h" -+#include "bfd.h" -+#include "libbfd.h" -+ -+static const bfd_arch_info_type *riscv_compatible -+ (const bfd_arch_info_type *, const bfd_arch_info_type *); -+ -+/* The default routine tests bits_per_word, which is wrong on RISC-V, as -+ RISC-V word size doesn't correlate with reloc size. */ -+ -+static const bfd_arch_info_type * -+riscv_compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b) -+{ -+ if (a->arch != b->arch) -+ return NULL; -+ -+ /* Machine compatibility is checked in -+ _bfd_riscv_elf_merge_private_bfd_data. */ -+ -+ return a; -+} -+ -+#define N(BITS_WORD, BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \ -+ { \ -+ BITS_WORD, /* bits in a word */ \ -+ BITS_ADDR, /* bits in an address */ \ -+ 8, /* 8 bits in a byte */ \ -+ bfd_arch_riscv, \ -+ NUMBER, \ -+ "riscv", \ -+ PRINT, \ -+ 3, \ -+ DEFAULT, \ -+ riscv_compatible, \ -+ bfd_default_scan, \ -+ bfd_arch_default_fill, \ -+ NEXT, \ -+ } -+ -+enum -+{ -+ I_riscv64, -+ I_riscv32 -+}; -+ -+#define NN(index) (&arch_info_struct[(index) + 1]) -+ -+static const bfd_arch_info_type arch_info_struct[] = -+{ -+ N (64, 64, bfd_mach_riscv64, "riscv:rv64", FALSE, NN(I_riscv64)), -+ N (32, 32, bfd_mach_riscv32, "riscv:rv32", FALSE, 0) -+}; -+ -+/* The default architecture is riscv:rv64. */ -+ -+const bfd_arch_info_type bfd_riscv_arch = -+N (64, 64, 0, "riscv", TRUE, &arch_info_struct[0]); -diff -rNU3 dist.orig/bfd/doc/Makefile.in dist/bfd/doc/Makefile.in ---- dist.orig/bfd/doc/Makefile.in 2013-03-25 10:08:08.000000000 +0100 -+++ dist/bfd/doc/Makefile.in 2015-10-18 13:11:12.000000000 +0200 -@@ -417,7 +417,9 @@ - clean-libtool: - -rm -rf .libs _libs - --bfd.info: bfd.texinfo $(bfd_TEXINFOS) -+bfd.info: -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_bfd.info: bfd.texinfo $(bfd_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ -diff -rNU3 dist.orig/bfd/doc/reloc.texi dist/bfd/doc/reloc.texi ---- dist.orig/bfd/doc/reloc.texi 2012-11-13 15:19:29.000000000 +0100 -+++ dist/bfd/doc/reloc.texi 2015-10-18 13:11:12.000000000 +0200 -@@ -570,6 +570,12 @@ - @deffnx {} BFD_RELOC_68K_TLS_LE8 - Relocations used by 68K ELF. - @end deffn -+@deffn {} BFD_RELOC_VAX_GLOB_DAT -+@deffnx {} BFD_RELOC_VAX_GLOB_REF -+@deffnx {} BFD_RELOC_VAX_JMP_SLOT -+@deffnx {} BFD_RELOC_VAX_RELATIVE -+Relocations used by VAX ELF. -+@end deffn - @deffn {} BFD_RELOC_32_BASEREL - @deffnx {} BFD_RELOC_16_BASEREL - @deffnx {} BFD_RELOC_LO16_BASEREL -diff -rNU3 dist.orig/bfd/elf-bfd.h dist/bfd/elf-bfd.h ---- dist.orig/bfd/elf-bfd.h 2013-03-25 09:06:19.000000000 +0100 -+++ dist/bfd/elf-bfd.h 2015-10-18 13:11:12.000000000 +0200 -@@ -420,6 +420,7 @@ - MICROBLAZE_ELF_DATA, - MIPS_ELF_DATA, - MN10300_ELF_DATA, -+ OR1K_ELF_DATA, - PPC32_ELF_DATA, - PPC64_ELF_DATA, - S390_ELF_DATA, -@@ -432,6 +433,7 @@ - XGATE_ELF_DATA, - TILEGX_ELF_DATA, - TILEPRO_ELF_DATA, -+ RISCV_ELF_DATA, - GENERIC_ELF_DATA - }; - -diff -rNU3 dist.orig/bfd/elf.c dist/bfd/elf.c ---- dist.orig/bfd/elf.c 2013-03-25 09:06:19.000000000 +0100 -+++ dist/bfd/elf.c 2015-10-18 13:11:12.000000000 +0200 -@@ -8756,6 +8756,23 @@ - return TRUE; - } - -+ /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5. -+ There's also old PT___GETREGS40 == mach + 1 for old reg -+ structure which lacks GBR. */ -+ -+ case bfd_arch_sh: -+ switch (note->type) -+ { -+ case NT_NETBSDCORE_FIRSTMACH+3: -+ return elfcore_make_note_pseudosection (abfd, ".reg", note); -+ -+ case NT_NETBSDCORE_FIRSTMACH+5: -+ return elfcore_make_note_pseudosection (abfd, ".reg2", note); -+ -+ default: -+ return TRUE; -+ } -+ - /* On all other arch's, PT_GETREGS == mach+1 and - PT_GETFPREGS == mach+3. */ - -diff -rNU3 dist.orig/bfd/elf32-arm.c dist/bfd/elf32-arm.c ---- dist.orig/bfd/elf32-arm.c 2013-03-25 09:06:19.000000000 +0100 -+++ dist/bfd/elf32-arm.c 2015-10-18 13:11:12.000000000 +0200 -@@ -13475,6 +13475,10 @@ - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; - -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation to `%s' in readonly section `%s'"), -+ h->root.root.string, s->name); - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ -@@ -15640,7 +15644,7 @@ - #ifdef __QNXTARGET__ - #define ELF_MAXPAGESIZE 0x1000 - #else --#define ELF_MAXPAGESIZE 0x8000 -+#define ELF_MAXPAGESIZE 0x10000 - #endif - #define ELF_MINPAGESIZE 0x1000 - #define ELF_COMMONPAGESIZE 0x1000 -@@ -15769,9 +15773,6 @@ - #undef elf_backend_modify_program_headers - #define elf_backend_modify_program_headers nacl_modify_program_headers - --#undef ELF_MAXPAGESIZE --#define ELF_MAXPAGESIZE 0x10000 -- - #include "elf32-target.h" - - /* Reset to defaults. */ -diff -rNU3 dist.orig/bfd/elf32-hppa.c dist/bfd/elf32-hppa.c ---- dist.orig/bfd/elf32-hppa.c 2012-06-29 16:45:58.000000000 +0200 -+++ dist/bfd/elf32-hppa.c 2015-10-18 13:11:12.000000000 +0200 -@@ -2191,6 +2191,10 @@ - { - struct bfd_link_info *info = inf; - -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ eh->root.root.string); - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ -diff -rNU3 dist.orig/bfd/elf32-i386.c dist/bfd/elf32-i386.c ---- dist.orig/bfd/elf32-i386.c 2013-03-25 09:06:19.000000000 +0100 -+++ dist/bfd/elf32-i386.c 2015-10-18 13:11:12.000000000 +0200 -@@ -518,7 +518,7 @@ - /* The name of the dynamic interpreter. This is put in the .interp - section. */ - --#define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1" -+#define ELF_DYNAMIC_INTERPRETER "/libexec/ld.elf_so" - - /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid - copying dynamic variables from a shared lib into an app's dynbss -@@ -2552,7 +2552,10 @@ - if (s != NULL && (s->flags & SEC_READONLY) != 0) - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; -- -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ h->root.root.string); - info->flags |= DF_TEXTREL; - - if (info->warn_shared_textrel && info->shared) -diff -rNU3 dist.orig/bfd/elf32-m68k.c dist/bfd/elf32-m68k.c ---- dist.orig/bfd/elf32-m68k.c 2012-07-13 16:22:47.000000000 +0200 -+++ dist/bfd/elf32-m68k.c 2015-10-18 13:11:12.000000000 +0200 -@@ -2532,7 +2532,7 @@ - if (ind->got_entry_key != 0) - { - BFD_ASSERT (dir->got_entry_key == 0); -- /* Assert that GOTs aren't partioned yet. */ -+ /* Assert that GOTs aren't partitioned yet. */ - BFD_ASSERT (ind->glist == NULL); - - dir->got_entry_key = ind->got_entry_key; -@@ -3104,6 +3104,7 @@ - /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL - && (h->needs_plt -+ || h->type == STT_GNU_IFUNC - || h->u.weakdef != NULL - || (h->def_dynamic - && h->ref_regular -@@ -3112,7 +3113,7 @@ - /* If this is a function, put it in the procedure linkage table. We - will fill in the contents of the procedure linkage table later, - when we know the address of the .got section. */ -- if (h->type == STT_FUNC -+ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) - || h->needs_plt) - { - if ((h->plt.refcount <= 0 -diff -rNU3 dist.orig/bfd/elf32-openrisc.c dist/bfd/elf32-openrisc.c ---- dist.orig/bfd/elf32-openrisc.c 2012-05-07 05:27:50.000000000 +0200 -+++ dist/bfd/elf32-openrisc.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,566 +0,0 @@ --/* OpenRISC-specific support for 32-bit ELF. -- Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2010, 2012 -- Free Software Foundation, Inc. -- Contributed by Johan Rydberg, jrydberg@opencores.org -- -- This file is part of BFD, the Binary File Descriptor library. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#include "sysdep.h" --#include "bfd.h" --#include "libbfd.h" --#include "elf-bfd.h" --#include "elf/openrisc.h" --#include "libiberty.h" -- --static reloc_howto_type openrisc_elf_howto_table[] = --{ -- /* This reloc does nothing. */ -- HOWTO (R_OPENRISC_NONE, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 32, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_NONE", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A PC relative 26 bit relocation, right shifted by 2. */ -- HOWTO (R_OPENRISC_INSN_REL_26, /* type */ -- 2, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 26, /* bitsize */ -- TRUE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_INSN_REL_26", /* name */ -- FALSE, /* partial_inplace */ -- 0x00000000, /* src_mask */ -- 0x03ffffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A absolute 26 bit relocation, right shifted by 2. */ -- HOWTO (R_OPENRISC_INSN_ABS_26, /* type */ -- 2, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 26, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_signed, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_INSN_ABS_26", /* name */ -- FALSE, /* partial_inplace */ -- 0x00000000, /* src_mask */ -- 0x03ffffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- HOWTO (R_OPENRISC_LO_16_IN_INSN, /* type */ -- 0, /* rightshift */ -- 1, /* size (0 = byte, 1 = short, 2 = long) */ -- 16, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_LO_16_IN_INSN", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0x0000ffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- HOWTO (R_OPENRISC_HI_16_IN_INSN, /* type */ -- 16, /* rightshift */ -- 1, /* size (0 = byte, 1 = short, 2 = long) */ -- 16, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_HI_16_IN_INSN", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0x0000ffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* An 8 bit absolute relocation. */ -- HOWTO (R_OPENRISC_8, /* type */ -- 0, /* rightshift */ -- 0, /* size (0 = byte, 1 = short, 2 = long) */ -- 8, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_8", /* name */ -- TRUE, /* partial_inplace */ -- 0x0000, /* src_mask */ -- 0x00ff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A 16 bit absolute relocation. */ -- HOWTO (R_OPENRISC_16, /* type */ -- 0, /* rightshift */ -- 1, /* size (0 = byte, 1 = short, 2 = long) */ -- 16, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_16", /* name */ -- TRUE, /* partial_inplace */ -- 0x00000000, /* src_mask */ -- 0x0000ffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A 32 bit absolute relocation. */ -- HOWTO (R_OPENRISC_32, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 32, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OPENRISC_32", /* name */ -- TRUE, /* partial_inplace */ -- 0x00000000, /* src_mask */ -- 0xffffffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* GNU extension to record C++ vtable hierarchy. */ -- HOWTO (R_OPENRISC_GNU_VTINHERIT, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 0, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- NULL, /* special_function */ -- "R_OPENRISC_GNU_VTINHERIT", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* GNU extension to record C++ vtable member usage. */ -- HOWTO (R_OPENRISC_GNU_VTENTRY, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 0, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- _bfd_elf_rel_vtable_reloc_fn, /* special_function */ -- "R_OPENRISC_GNU_VTENTRY", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0, /* dst_mask */ -- FALSE), /* pcrel_offset */ --}; -- --/* Map BFD reloc types to OpenRISC ELF reloc types. */ -- --struct openrisc_reloc_map --{ -- bfd_reloc_code_real_type bfd_reloc_val; -- unsigned int openrisc_reloc_val; --}; -- --static const struct openrisc_reloc_map openrisc_reloc_map[] = --{ -- { BFD_RELOC_NONE, R_OPENRISC_NONE }, -- { BFD_RELOC_32, R_OPENRISC_32 }, -- { BFD_RELOC_16, R_OPENRISC_16 }, -- { BFD_RELOC_8, R_OPENRISC_8 }, -- { BFD_RELOC_OPENRISC_REL_26, R_OPENRISC_INSN_REL_26 }, -- { BFD_RELOC_OPENRISC_ABS_26, R_OPENRISC_INSN_ABS_26 }, -- { BFD_RELOC_HI16, R_OPENRISC_HI_16_IN_INSN }, -- { BFD_RELOC_LO16, R_OPENRISC_LO_16_IN_INSN }, -- { BFD_RELOC_VTABLE_INHERIT, R_OPENRISC_GNU_VTINHERIT }, -- { BFD_RELOC_VTABLE_ENTRY, R_OPENRISC_GNU_VTENTRY } --}; -- --static reloc_howto_type * --openrisc_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, -- bfd_reloc_code_real_type code) --{ -- unsigned int i; -- -- for (i = ARRAY_SIZE (openrisc_reloc_map); --i;) -- if (openrisc_reloc_map[i].bfd_reloc_val == code) -- return & openrisc_elf_howto_table[openrisc_reloc_map[i]. -- openrisc_reloc_val]; -- -- return NULL; --} -- --static reloc_howto_type * --openrisc_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, -- const char *r_name) --{ -- unsigned int i; -- -- for (i = 0; -- i < (sizeof (openrisc_elf_howto_table) -- / sizeof (openrisc_elf_howto_table[0])); -- i++) -- if (openrisc_elf_howto_table[i].name != NULL -- && strcasecmp (openrisc_elf_howto_table[i].name, r_name) == 0) -- return &openrisc_elf_howto_table[i]; -- -- return NULL; --} -- --/* Set the howto pointer for an OpenRISC ELF reloc. */ -- --static void --openrisc_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, -- arelent * cache_ptr, -- Elf_Internal_Rela * dst) --{ -- unsigned int r_type; -- -- r_type = ELF32_R_TYPE (dst->r_info); -- BFD_ASSERT (r_type < (unsigned int) R_OPENRISC_max); -- cache_ptr->howto = & openrisc_elf_howto_table[r_type]; --} -- --/* Perform a single relocation. By default we use the standard BFD -- routines, but a few relocs, we have to do them ourselves. */ -- --static bfd_reloc_status_type --openrisc_final_link_relocate (reloc_howto_type *howto, -- bfd *input_bfd, -- asection *input_section, -- bfd_byte *contents, -- Elf_Internal_Rela *rel, -- bfd_vma relocation) --{ -- bfd_reloc_status_type r = bfd_reloc_ok; -- -- switch (howto->type) -- { -- case R_OPENRISC_LO_16_IN_INSN: -- relocation &= 0xffff; -- r = _bfd_final_link_relocate (howto, input_bfd, input_section, -- contents, rel->r_offset, -- relocation, rel->r_addend); -- break; -- -- default: -- r = _bfd_final_link_relocate (howto, input_bfd, input_section, -- contents, rel->r_offset, -- relocation, rel->r_addend); -- } -- -- return r; --} -- --/* Relocate an OpenRISC ELF section. -- -- The RELOCATE_SECTION function is called by the new ELF backend linker -- to handle the relocations for a section. -- -- The relocs are always passed as Rela structures; if the section -- actually uses Rel structures, the r_addend field will always be -- zero. -- -- This function is responsible for adjusting the section contents as -- necessary, and (if using Rela relocs and generating a relocatable -- output file) adjusting the reloc addend as necessary. -- -- This function does not have to worry about setting the reloc -- address or the reloc symbol index. -- -- LOCAL_SYMS is a pointer to the swapped in local symbols. -- -- LOCAL_SECTIONS is an array giving the section in the input file -- corresponding to the st_shndx field of each local symbol. -- -- The global hash table entry for the global symbols can be found -- via elf_sym_hashes (input_bfd). -- -- When generating relocatable output, this function must handle -- STB_LOCAL/STT_SECTION symbols specially. The output symbol is -- going to be the section symbol corresponding to the output -- section, which means that the addend must be adjusted -- accordingly. */ -- --static bfd_boolean --openrisc_elf_relocate_section (bfd *output_bfd, -- struct bfd_link_info *info, -- bfd *input_bfd, -- asection *input_section, -- bfd_byte *contents, -- Elf_Internal_Rela *relocs, -- Elf_Internal_Sym *local_syms, -- asection **local_sections) --{ -- Elf_Internal_Shdr *symtab_hdr; -- struct elf_link_hash_entry **sym_hashes; -- Elf_Internal_Rela *rel; -- Elf_Internal_Rela *relend; -- -- symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; -- sym_hashes = elf_sym_hashes (input_bfd); -- relend = relocs + input_section->reloc_count; -- -- for (rel = relocs; rel < relend; rel++) -- { -- reloc_howto_type *howto; -- unsigned long r_symndx; -- Elf_Internal_Sym *sym; -- asection *sec; -- struct elf_link_hash_entry *h; -- bfd_vma relocation; -- bfd_reloc_status_type r; -- const char *name = NULL; -- int r_type; -- -- r_type = ELF32_R_TYPE (rel->r_info); -- r_symndx = ELF32_R_SYM (rel->r_info); -- -- if (r_type == R_OPENRISC_GNU_VTINHERIT -- || r_type == R_OPENRISC_GNU_VTENTRY) -- continue; -- -- if ((unsigned int) r_type > -- (sizeof openrisc_elf_howto_table / sizeof (reloc_howto_type))) -- abort (); -- -- howto = openrisc_elf_howto_table + ELF32_R_TYPE (rel->r_info); -- h = NULL; -- sym = NULL; -- sec = NULL; -- -- if (r_symndx < symtab_hdr->sh_info) -- { -- sym = local_syms + r_symndx; -- sec = local_sections[r_symndx]; -- relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); -- -- name = bfd_elf_string_from_elf_section -- (input_bfd, symtab_hdr->sh_link, sym->st_name); -- name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; -- } -- else -- { -- bfd_boolean unresolved_reloc, warned; -- -- RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, -- r_symndx, symtab_hdr, sym_hashes, -- h, sec, relocation, -- unresolved_reloc, warned); -- } -- -- if (sec != NULL && discarded_section (sec)) -- RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, -- rel, 1, relend, howto, 0, contents); -- -- if (info->relocatable) -- continue; -- -- r = openrisc_final_link_relocate (howto, input_bfd, input_section, -- contents, rel, relocation); -- -- if (r != bfd_reloc_ok) -- { -- const char *msg = NULL; -- -- switch (r) -- { -- case bfd_reloc_overflow: -- r = info->callbacks->reloc_overflow -- (info, (h ? &h->root : NULL), name, howto->name, -- (bfd_vma) 0, input_bfd, input_section, rel->r_offset); -- break; -- -- case bfd_reloc_undefined: -- r = info->callbacks->undefined_symbol -- (info, name, input_bfd, input_section, rel->r_offset, TRUE); -- break; -- -- case bfd_reloc_outofrange: -- msg = _("internal error: out of range error"); -- break; -- -- case bfd_reloc_notsupported: -- msg = _("internal error: unsupported relocation error"); -- break; -- -- case bfd_reloc_dangerous: -- msg = _("internal error: dangerous relocation"); -- break; -- -- default: -- msg = _("internal error: unknown error"); -- break; -- } -- -- if (msg) -- r = info->callbacks->warning -- (info, msg, name, input_bfd, input_section, rel->r_offset); -- -- if (!r) -- return FALSE; -- } -- } -- -- return TRUE; --} -- --/* Return the section that should be marked against GC for a given -- relocation. */ -- --static asection * --openrisc_elf_gc_mark_hook (asection *sec, -- struct bfd_link_info *info, -- Elf_Internal_Rela *rel, -- struct elf_link_hash_entry *h, -- Elf_Internal_Sym *sym) --{ -- if (h != NULL) -- switch (ELF32_R_TYPE (rel->r_info)) -- { -- case R_OPENRISC_GNU_VTINHERIT: -- case R_OPENRISC_GNU_VTENTRY: -- return NULL; -- } -- -- return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); --} -- --/* Look through the relocs for a section during the first phase. -- Since we don't do .gots or .plts, we just need to consider the -- virtual table relocs for gc. */ -- --static bfd_boolean --openrisc_elf_check_relocs (bfd *abfd, -- struct bfd_link_info *info, -- asection *sec, -- const Elf_Internal_Rela *relocs) --{ -- Elf_Internal_Shdr *symtab_hdr; -- struct elf_link_hash_entry **sym_hashes; -- const Elf_Internal_Rela *rel; -- const Elf_Internal_Rela *rel_end; -- -- if (info->relocatable) -- return TRUE; -- -- symtab_hdr = &elf_tdata (abfd)->symtab_hdr; -- sym_hashes = elf_sym_hashes (abfd); -- -- rel_end = relocs + sec->reloc_count; -- for (rel = relocs; rel < rel_end; rel++) -- { -- struct elf_link_hash_entry *h; -- unsigned long r_symndx; -- -- r_symndx = ELF32_R_SYM (rel->r_info); -- if (r_symndx < symtab_hdr->sh_info) -- h = NULL; -- else -- { -- h = sym_hashes[r_symndx - symtab_hdr->sh_info]; -- while (h->root.type == bfd_link_hash_indirect -- || h->root.type == bfd_link_hash_warning) -- h = (struct elf_link_hash_entry *) h->root.u.i.link; -- } -- -- switch (ELF32_R_TYPE (rel->r_info)) -- { -- /* This relocation describes the C++ object vtable hierarchy. -- Reconstruct it for later use during GC. */ -- case R_OPENRISC_GNU_VTINHERIT: -- if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) -- return FALSE; -- break; -- -- /* This relocation describes which C++ vtable entries are actually -- used. Record for later use during GC. */ -- case R_OPENRISC_GNU_VTENTRY: -- BFD_ASSERT (h != NULL); -- if (h != NULL -- && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) -- return FALSE; -- break; -- } -- } -- -- return TRUE; --} -- --/* Set the right machine number. */ -- --static bfd_boolean --openrisc_elf_object_p (bfd *abfd) --{ -- bfd_default_set_arch_mach (abfd, bfd_arch_openrisc, 0); -- return TRUE; --} -- --/* Store the machine number in the flags field. */ -- --static void --openrisc_elf_final_write_processing (bfd *abfd, -- bfd_boolean linker ATTRIBUTE_UNUSED) --{ -- unsigned long val; -- -- switch (bfd_get_mach (abfd)) -- { -- default: -- val = 0; -- break; -- } -- -- elf_elfheader (abfd)->e_flags &= ~0xf; -- elf_elfheader (abfd)->e_flags |= val; --} -- -- --#define ELF_ARCH bfd_arch_openrisc --#define ELF_MACHINE_CODE EM_OPENRISC --#define ELF_MACHINE_ALT1 EM_OPENRISC_OLD --#define ELF_MAXPAGESIZE 0x1000 -- --#define TARGET_BIG_SYM bfd_elf32_openrisc_vec --#define TARGET_BIG_NAME "elf32-openrisc" -- --#define elf_info_to_howto_rel NULL --#define elf_info_to_howto openrisc_info_to_howto_rela --#define elf_backend_relocate_section openrisc_elf_relocate_section --#define elf_backend_gc_mark_hook openrisc_elf_gc_mark_hook --#define elf_backend_check_relocs openrisc_elf_check_relocs -- --#define elf_backend_can_gc_sections 1 --#define elf_backend_rela_normal 1 -- --#define bfd_elf32_bfd_reloc_type_lookup openrisc_reloc_type_lookup --#define bfd_elf32_bfd_reloc_name_lookup openrisc_reloc_name_lookup -- --#define elf_backend_object_p openrisc_elf_object_p --#define elf_backend_final_write_processing openrisc_elf_final_write_processing -- --#include "elf32-target.h" -diff -rNU3 dist.orig/bfd/elf32-or1k.c dist/bfd/elf32-or1k.c ---- dist.orig/bfd/elf32-or1k.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/bfd/elf32-or1k.c 2015-10-18 13:11:12.000000000 +0200 -@@ -0,0 +1,2852 @@ -+/* Or1k-specific support for 32-bit ELF. -+ Copyright 2001-2014 Free Software Foundation, Inc. -+ Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org -+ -+ PIC parts added by Stefan Kristiansson, stefan.kristiansson@saunalahti.fi, -+ largely based on elf32-m32r.c and elf32-microblaze.c. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, see . */ -+ -+#include "sysdep.h" -+#include "bfd.h" -+#include "libbfd.h" -+#include "elf-bfd.h" -+#include "elf/or1k.h" -+#include "libiberty.h" -+ -+#define PLT_ENTRY_SIZE 20 -+ -+#define PLT0_ENTRY_WORD0 0x19800000 /* l.movhi r12, 0 <- hi(.got+4) */ -+#define PLT0_ENTRY_WORD1 0xa98c0000 /* l.ori r12, r12, 0 <- lo(.got+4) */ -+#define PLT0_ENTRY_WORD2 0x85ec0004 /* l.lwz r15, 4(r12) <- *(.got+8)*/ -+#define PLT0_ENTRY_WORD3 0x44007800 /* l.jr r15 */ -+#define PLT0_ENTRY_WORD4 0x858c0000 /* l.lwz r12, 0(r12) */ -+ -+#define PLT0_PIC_ENTRY_WORD0 0x85900004 /* l.lwz r12, 4(r16) */ -+#define PLT0_PIC_ENTRY_WORD1 0x85f00008 /* l.lwz r15, 8(r16) */ -+#define PLT0_PIC_ENTRY_WORD2 0x44007800 /* l.jr r15 */ -+#define PLT0_PIC_ENTRY_WORD3 0x15000000 /* l.nop */ -+#define PLT0_PIC_ENTRY_WORD4 0x15000000 /* l.nop */ -+ -+#define PLT_ENTRY_WORD0 0x19800000 /* l.movhi r12, 0 <- hi(got idx addr) */ -+#define PLT_ENTRY_WORD1 0xa98c0000 /* l.ori r12, r12, 0 <- lo(got idx addr) */ -+#define PLT_ENTRY_WORD2 0x858c0000 /* l.lwz r12, 0(r12) */ -+#define PLT_ENTRY_WORD3 0x44006000 /* l.jr r12 */ -+#define PLT_ENTRY_WORD4 0xa9600000 /* l.ori r11, r0, 0 <- reloc offset */ -+ -+#define PLT_PIC_ENTRY_WORD0 0x85900000 /* l.lwz r12, 0(r16) <- index in got */ -+#define PLT_PIC_ENTRY_WORD1 0xa9600000 /* l.ori r11, r0, 0 <- reloc offset */ -+#define PLT_PIC_ENTRY_WORD2 0x44006000 /* l.jr r12 */ -+#define PLT_PIC_ENTRY_WORD3 0x15000000 /* l.nop */ -+#define PLT_PIC_ENTRY_WORD4 0x15000000 /* l.nop */ -+ -+#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" -+ -+static reloc_howto_type or1k_elf_howto_table[] = -+{ -+ /* This reloc does nothing. */ -+ HOWTO (R_OR1K_NONE, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_NONE", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_32, -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_unsigned, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_32", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_16, -+ 0, /* rightshift */ -+ 1, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_unsigned, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_8, -+ 0, /* rightshift */ -+ 0, /* size (0 = byte, 1 = short, 2 = long) */ -+ 8, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_unsigned, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_8", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_LO_16_IN_INSN, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_LO_16_IN_INSN", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0x0000ffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_HI_16_IN_INSN, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_HI_16_IN_INSN", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0x0000ffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* A PC relative 26 bit relocation, right shifted by 2. */ -+ HOWTO (R_OR1K_INSN_REL_26, /* type */ -+ 2, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 26, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_INSN_REL_26", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0x03ffffff, /* dst_mask */ -+ TRUE), /* pcrel_offset */ -+ -+ /* GNU extension to record C++ vtable hierarchy. */ -+ HOWTO (R_OR1K_GNU_VTINHERIT, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ NULL, /* special_function */ -+ "R_OR1K_GNU_VTINHERIT", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* GNU extension to record C++ vtable member usage. */ -+ HOWTO (R_OR1K_GNU_VTENTRY, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */ -+ "R_OR1K_GNU_VTENTRY", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_32_PCREL, -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_32_PCREL", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_16_PCREL, -+ 0, /* rightshift */ -+ 1, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_16_PCREL", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_8_PCREL, -+ 0, /* rightshift */ -+ 0, /* size (0 = byte, 1 = short, 2 = long) */ -+ 8, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_8_PCREL", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_GOTPC_HI16, /* Type. */ -+ 16, /* Rightshift. */ -+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ -+ 16, /* Bitsize. */ -+ TRUE, /* PC_relative. */ -+ 0, /* Bitpos. */ -+ complain_overflow_dont, /* Complain on overflow. */ -+ bfd_elf_generic_reloc, /* Special Function. */ -+ "R_OR1K_GOTPC_HI16", /* Name. */ -+ FALSE, /* Partial Inplace. */ -+ 0, /* Source Mask. */ -+ 0xffff, /* Dest Mask. */ -+ TRUE), /* PC relative offset? */ -+ -+ HOWTO (R_OR1K_GOTPC_LO16, /* Type. */ -+ 0, /* Rightshift. */ -+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ -+ 16, /* Bitsize. */ -+ TRUE, /* PC_relative. */ -+ 0, /* Bitpos. */ -+ complain_overflow_dont, /* Complain on overflow. */ -+ bfd_elf_generic_reloc, /* Special Function. */ -+ "R_OR1K_GOTPC_LO16", /* Name. */ -+ FALSE, /* Partial Inplace. */ -+ 0, /* Source Mask. */ -+ 0xffff, /* Dest Mask. */ -+ TRUE), /* PC relative offset? */ -+ -+ HOWTO (R_OR1K_GOT16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_GOT16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* A 26 bit PLT relocation. Shifted by 2. */ -+ HOWTO (R_OR1K_PLT26, /* Type. */ -+ 2, /* Rightshift. */ -+ 2, /* Size (0 = byte, 1 = short, 2 = long). */ -+ 26, /* Bitsize. */ -+ TRUE, /* PC_relative. */ -+ 0, /* Bitpos. */ -+ complain_overflow_dont, /* Complain on overflow. */ -+ bfd_elf_generic_reloc,/* Special Function. */ -+ "R_OR1K_PLT26", /* Name. */ -+ FALSE, /* Partial Inplace. */ -+ 0, /* Source Mask. */ -+ 0x03ffffff, /* Dest Mask. */ -+ TRUE), /* PC relative offset? */ -+ -+ HOWTO (R_OR1K_GOTOFF_HI16, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_GOTOFF_HI16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_GOTOFF_LO16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_GOTOFF_LO16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_COPY, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_bitfield, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_COPY", /* name */ -+ FALSE, /* partial_inplace */ -+ 0xffffffff, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_GLOB_DAT, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_bitfield, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_GLOB_DAT", /* name */ -+ FALSE, /* partial_inplace */ -+ 0xffffffff, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_JMP_SLOT, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_bitfield, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_JMP_SLOT", /* name */ -+ FALSE, /* partial_inplace */ -+ 0xffffffff, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_RELATIVE, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_bitfield, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_RELATIVE", /* name */ -+ FALSE, /* partial_inplace */ -+ 0xffffffff, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_GD_HI16, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_GD_HI16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_GD_LO16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_GD_LO16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_LDM_HI16, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_LDM_HI16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_LDM_LO16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_LDM_LO16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_LDO_HI16, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_LDO_HI16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_LDO_LO16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_LDO_LO16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_IE_HI16, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_IE_HI16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_IE_LO16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_IE_LO16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_LE_HI16, /* type */ -+ 16, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_LE_HI16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_OR1K_TLS_LE_LO16, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_OR1K_TLS_LE_LO16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0xffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+}; -+ -+/* Map BFD reloc types to Or1k ELF reloc types. */ -+ -+struct or1k_reloc_map -+{ -+ bfd_reloc_code_real_type bfd_reloc_val; -+ unsigned int or1k_reloc_val; -+}; -+ -+static const struct or1k_reloc_map or1k_reloc_map[] = -+{ -+ { BFD_RELOC_NONE, R_OR1K_NONE }, -+ { BFD_RELOC_32, R_OR1K_32 }, -+ { BFD_RELOC_16, R_OR1K_16 }, -+ { BFD_RELOC_8, R_OR1K_8 }, -+ { BFD_RELOC_LO16, R_OR1K_LO_16_IN_INSN }, -+ { BFD_RELOC_HI16, R_OR1K_HI_16_IN_INSN }, -+ { BFD_RELOC_OR1K_REL_26, R_OR1K_INSN_REL_26 }, -+ { BFD_RELOC_VTABLE_ENTRY, R_OR1K_GNU_VTENTRY }, -+ { BFD_RELOC_VTABLE_INHERIT, R_OR1K_GNU_VTINHERIT }, -+ { BFD_RELOC_32_PCREL, R_OR1K_32_PCREL }, -+ { BFD_RELOC_16_PCREL, R_OR1K_16_PCREL }, -+ { BFD_RELOC_8_PCREL, R_OR1K_8_PCREL }, -+ { BFD_RELOC_OR1K_GOTPC_HI16, R_OR1K_GOTPC_HI16 }, -+ { BFD_RELOC_OR1K_GOTPC_LO16, R_OR1K_GOTPC_LO16 }, -+ { BFD_RELOC_OR1K_GOT16, R_OR1K_GOT16 }, -+ { BFD_RELOC_OR1K_PLT26, R_OR1K_PLT26 }, -+ { BFD_RELOC_OR1K_GOTOFF_HI16, R_OR1K_GOTOFF_HI16 }, -+ { BFD_RELOC_OR1K_GOTOFF_LO16, R_OR1K_GOTOFF_LO16 }, -+ { BFD_RELOC_OR1K_GLOB_DAT, R_OR1K_GLOB_DAT }, -+ { BFD_RELOC_OR1K_COPY, R_OR1K_COPY }, -+ { BFD_RELOC_OR1K_JMP_SLOT, R_OR1K_JMP_SLOT }, -+ { BFD_RELOC_OR1K_RELATIVE, R_OR1K_RELATIVE }, -+ { BFD_RELOC_OR1K_TLS_GD_HI16, R_OR1K_TLS_GD_HI16 }, -+ { BFD_RELOC_OR1K_TLS_GD_LO16, R_OR1K_TLS_GD_LO16 }, -+ { BFD_RELOC_OR1K_TLS_LDM_HI16, R_OR1K_TLS_LDM_HI16 }, -+ { BFD_RELOC_OR1K_TLS_LDM_LO16, R_OR1K_TLS_LDM_LO16 }, -+ { BFD_RELOC_OR1K_TLS_LDO_HI16, R_OR1K_TLS_LDO_HI16 }, -+ { BFD_RELOC_OR1K_TLS_LDO_LO16, R_OR1K_TLS_LDO_LO16 }, -+ { BFD_RELOC_OR1K_TLS_IE_HI16, R_OR1K_TLS_IE_HI16 }, -+ { BFD_RELOC_OR1K_TLS_IE_LO16, R_OR1K_TLS_IE_LO16 }, -+ { BFD_RELOC_OR1K_TLS_LE_HI16, R_OR1K_TLS_LE_HI16 }, -+ { BFD_RELOC_OR1K_TLS_LE_LO16, R_OR1K_TLS_LE_LO16 }, -+}; -+ -+/* The linker needs to keep track of the number of relocs that it -+ decides to copy as dynamic relocs in check_relocs for each symbol. -+ This is so that it can later discard them if they are found to be -+ unnecessary. We store the information in a field extending the -+ regular ELF linker hash table. */ -+ -+struct elf_or1k_dyn_relocs -+{ -+ struct elf_or1k_dyn_relocs *next; -+ -+ /* The input section of the reloc. */ -+ asection *sec; -+ -+ /* Total number of relocs copied for the input section. */ -+ bfd_size_type count; -+ -+ /* Number of pc-relative relocs copied for the input section. */ -+ bfd_size_type pc_count; -+}; -+ -+#define TLS_UNKNOWN 0 -+#define TLS_NONE 1 -+#define TLS_GD 2 -+#define TLS_LD 3 -+#define TLS_IE 4 -+#define TLS_LE 5 -+ -+/* ELF linker hash entry. */ -+struct elf_or1k_link_hash_entry -+{ -+ struct elf_link_hash_entry root; -+ -+ /* Track dynamic relocs copied for this symbol. */ -+ struct elf_or1k_dyn_relocs *dyn_relocs; -+ -+ /* Track type of TLS access. */ -+ unsigned char tls_type; -+}; -+ -+/* ELF object data. */ -+struct elf_or1k_obj_tdata -+{ -+ struct elf_obj_tdata root; -+ -+ /* tls_type for each local got entry. */ -+ unsigned char *local_tls_type; -+}; -+ -+#define elf_or1k_tdata(abfd) \ -+ ((struct elf_or1k_obj_tdata *) (abfd)->tdata.any) -+ -+#define elf_or1k_local_tls_type(abfd) \ -+ (elf_or1k_tdata (abfd)->local_tls_type) -+ -+/* ELF linker hash table. */ -+struct elf_or1k_link_hash_table -+{ -+ struct elf_link_hash_table root; -+ -+ /* Short-cuts to get to dynamic linker sections. */ -+ asection *sgot; -+ asection *sgotplt; -+ asection *srelgot; -+ asection *splt; -+ asection *srelplt; -+ asection *sdynbss; -+ asection *srelbss; -+ -+ /* Small local sym to section mapping cache. */ -+ struct sym_cache sym_sec; -+}; -+ -+/* Get the ELF linker hash table from a link_info structure. */ -+#define or1k_elf_hash_table(p) \ -+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ -+ == OR1K_ELF_DATA ? ((struct elf_or1k_link_hash_table *) ((p)->hash)) : NULL) -+ -+static bfd_boolean -+elf_or1k_mkobject (bfd *abfd) -+{ -+ return bfd_elf_allocate_object (abfd, sizeof (struct elf_or1k_obj_tdata), -+ OR1K_ELF_DATA); -+} -+ -+/* Create an entry in an or1k ELF linker hash table. */ -+ -+static struct bfd_hash_entry * -+or1k_elf_link_hash_newfunc (struct bfd_hash_entry *entry, -+ struct bfd_hash_table *table, -+ const char *string) -+{ -+ struct elf_or1k_link_hash_entry *ret = -+ (struct elf_or1k_link_hash_entry *) entry; -+ -+ /* Allocate the structure if it has not already been allocated by a -+ subclass. */ -+ if (ret == NULL) -+ ret = bfd_hash_allocate (table, -+ sizeof (struct elf_or1k_link_hash_entry)); -+ if (ret == NULL) -+ return NULL; -+ -+ /* Call the allocation method of the superclass. */ -+ ret = ((struct elf_or1k_link_hash_entry *) -+ _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, -+ table, string)); -+ if (ret != NULL) -+ { -+ struct elf_or1k_link_hash_entry *eh; -+ -+ eh = (struct elf_or1k_link_hash_entry *) ret; -+ eh->dyn_relocs = NULL; -+ eh->tls_type = TLS_UNKNOWN; -+ } -+ -+ return (struct bfd_hash_entry *) ret; -+} -+ -+/* Create an or1k ELF linker hash table. */ -+ -+static struct bfd_link_hash_table * -+or1k_elf_link_hash_table_create (bfd *abfd) -+{ -+ struct elf_or1k_link_hash_table *ret; -+ bfd_size_type amt = sizeof (struct elf_or1k_link_hash_table); -+ -+ ret = bfd_zmalloc (amt); -+ if (ret == NULL) -+ return NULL; -+ -+ if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, -+ or1k_elf_link_hash_newfunc, -+ sizeof (struct elf_or1k_link_hash_entry), -+ OR1K_ELF_DATA)) -+ { -+ free (ret); -+ return NULL; -+ } -+ -+ return &ret->root.root; -+} -+ -+static reloc_howto_type * -+or1k_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, -+ bfd_reloc_code_real_type code) -+{ -+ unsigned int i; -+ -+ for (i = ARRAY_SIZE (or1k_reloc_map); --i;) -+ if (or1k_reloc_map[i].bfd_reloc_val == code) -+ return & or1k_elf_howto_table[or1k_reloc_map[i].or1k_reloc_val]; -+ -+ return NULL; -+} -+ -+static reloc_howto_type * -+or1k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, -+ const char *r_name) -+{ -+ unsigned int i; -+ -+ for (i = 0; -+ i < (sizeof (or1k_elf_howto_table) -+ / sizeof (or1k_elf_howto_table[0])); -+ i++) -+ if (or1k_elf_howto_table[i].name != NULL -+ && strcasecmp (or1k_elf_howto_table[i].name, r_name) == 0) -+ return &or1k_elf_howto_table[i]; -+ -+ return NULL; -+} -+ -+/* Set the howto pointer for an Or1k ELF reloc. */ -+ -+static void -+or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, -+ arelent * cache_ptr, -+ Elf_Internal_Rela * dst) -+{ -+ unsigned int r_type; -+ -+ r_type = ELF32_R_TYPE (dst->r_info); -+ BFD_ASSERT (r_type < (unsigned int) R_OR1K_max); -+ cache_ptr->howto = & or1k_elf_howto_table[r_type]; -+} -+ -+ -+/* Return the relocation value for @tpoff relocations.. */ -+static bfd_vma -+tpoff (struct bfd_link_info *info, bfd_vma address) -+{ -+ /* If tls_sec is NULL, we should have signalled an error already. */ -+ if (elf_hash_table (info)->tls_sec == NULL) -+ return 0; -+ -+ /* The thread pointer on or1k stores the address after the TCB where -+ the data is, just compute the difference. No need to compensate -+ for the size of TCB. */ -+ return (address - elf_hash_table (info)->tls_sec->vma); -+} -+ -+/* Relocate an Or1k ELF section. -+ -+ The RELOCATE_SECTION function is called by the new ELF backend linker -+ to handle the relocations for a section. -+ -+ The relocs are always passed as Rela structures; if the section -+ actually uses Rel structures, the r_addend field will always be -+ zero. -+ -+ This function is responsible for adjusting the section contents as -+ necessary, and (if using Rela relocs and generating a relocatable -+ output file) adjusting the reloc addend as necessary. -+ -+ This function does not have to worry about setting the reloc -+ address or the reloc symbol index. -+ -+ LOCAL_SYMS is a pointer to the swapped in local symbols. -+ -+ LOCAL_SECTIONS is an array giving the section in the input file -+ corresponding to the st_shndx field of each local symbol. -+ -+ The global hash table entry for the global symbols can be found -+ via elf_sym_hashes (input_bfd). -+ -+ When generating relocatable output, this function must handle -+ STB_LOCAL/STT_SECTION symbols specially. The output symbol is -+ going to be the section symbol corresponding to the output -+ section, which means that the addend must be adjusted -+ accordingly. */ -+ -+static bfd_boolean -+or1k_elf_relocate_section (bfd *output_bfd, -+ struct bfd_link_info *info, -+ bfd *input_bfd, -+ asection *input_section, -+ bfd_byte *contents, -+ Elf_Internal_Rela *relocs, -+ Elf_Internal_Sym *local_syms, -+ asection **local_sections) -+{ -+ Elf_Internal_Shdr *symtab_hdr; -+ struct elf_link_hash_entry **sym_hashes; -+ Elf_Internal_Rela *rel; -+ Elf_Internal_Rela *relend; -+ struct elf_or1k_link_hash_table *htab = or1k_elf_hash_table (info); -+ bfd *dynobj; -+ asection *sreloc; -+ bfd_vma *local_got_offsets; -+ asection *sgot; -+ -+ if (htab == NULL) -+ return FALSE; -+ -+ dynobj = htab->root.dynobj; -+ local_got_offsets = elf_local_got_offsets (input_bfd); -+ -+ sreloc = elf_section_data (input_section)->sreloc; -+ -+ sgot = htab->sgot; -+ -+ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; -+ sym_hashes = elf_sym_hashes (input_bfd); -+ relend = relocs + input_section->reloc_count; -+ -+ for (rel = relocs; rel < relend; rel++) -+ { -+ reloc_howto_type *howto; -+ unsigned long r_symndx; -+ Elf_Internal_Sym *sym; -+ asection *sec; -+ struct elf_link_hash_entry *h; -+ bfd_vma relocation; -+ bfd_reloc_status_type r; -+ const char *name = NULL; -+ int r_type; -+ -+ r_type = ELF32_R_TYPE (rel->r_info); -+ r_symndx = ELF32_R_SYM (rel->r_info); -+ -+ if (r_type == R_OR1K_GNU_VTINHERIT -+ || r_type == R_OR1K_GNU_VTENTRY) -+ continue; -+ -+ if (r_type < 0 || r_type >= (int) R_OR1K_max) -+ { -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+ } -+ -+ howto = or1k_elf_howto_table + ELF32_R_TYPE (rel->r_info); -+ h = NULL; -+ sym = NULL; -+ sec = NULL; -+ -+ if (r_symndx < symtab_hdr->sh_info) -+ { -+ sym = local_syms + r_symndx; -+ sec = local_sections[r_symndx]; -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); -+ -+ name = bfd_elf_string_from_elf_section -+ (input_bfd, symtab_hdr->sh_link, sym->st_name); -+ name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; -+ } -+ else -+ { -+ bfd_boolean unresolved_reloc, warned; -+ -+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, -+ r_symndx, symtab_hdr, sym_hashes, -+ h, sec, relocation, -+ unresolved_reloc, warned); -+ } -+ -+ if (sec != NULL && discarded_section (sec)) -+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, -+ rel, 1, relend, howto, 0, contents); -+ -+ if (info->relocatable) -+ continue; -+ -+ switch (howto->type) -+ { -+ case R_OR1K_PLT26: -+ { -+ if (htab->splt != NULL && h != NULL -+ && h->plt.offset != (bfd_vma) -1) -+ { -+ relocation = (htab->splt->output_section->vma -+ + htab->splt->output_offset -+ + h->plt.offset); -+ } -+ break; -+ } -+ -+ case R_OR1K_GOT16: -+ /* Relocation is to the entry for this symbol in the global -+ offset table. */ -+ BFD_ASSERT (sgot != NULL); -+ if (h != NULL) -+ { -+ bfd_boolean dyn; -+ bfd_vma off; -+ -+ off = h->got.offset; -+ BFD_ASSERT (off != (bfd_vma) -1); -+ -+ dyn = htab->root.dynamic_sections_created; -+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) -+ || (info->shared -+ && SYMBOL_REFERENCES_LOCAL (info, h))) -+ { -+ /* This is actually a static link, or it is a -+ -Bsymbolic link and the symbol is defined -+ locally, or the symbol was forced to be local -+ because of a version file. We must initialize -+ this entry in the global offset table. Since the -+ offset must always be a multiple of 4, we use the -+ least significant bit to record whether we have -+ initialized it already. -+ -+ When doing a dynamic link, we create a .rela.got -+ relocation entry to initialize the value. This -+ is done in the finish_dynamic_symbol routine. */ -+ if ((off & 1) != 0) -+ off &= ~1; -+ else -+ { -+ /* Write entry in GOT. */ -+ bfd_put_32 (output_bfd, relocation, -+ sgot->contents + off); -+ /* Mark GOT entry as having been written. */ -+ h->got.offset |= 1; -+ } -+ } -+ -+ relocation = sgot->output_offset + off; -+ } -+ else -+ { -+ bfd_vma off; -+ bfd_byte *loc; -+ -+ BFD_ASSERT (local_got_offsets != NULL -+ && local_got_offsets[r_symndx] != (bfd_vma) -1); -+ -+ /* Get offset into GOT table. */ -+ off = local_got_offsets[r_symndx]; -+ -+ /* The offset must always be a multiple of 4. We use -+ the least significant bit to record whether we have -+ already processed this entry. */ -+ if ((off & 1) != 0) -+ off &= ~1; -+ else -+ { -+ /* Write entry in GOT. */ -+ bfd_put_32 (output_bfd, relocation, sgot->contents + off); -+ if (info->shared) -+ { -+ asection *srelgot; -+ Elf_Internal_Rela outrel; -+ -+ /* We need to generate a R_OR1K_RELATIVE reloc -+ for the dynamic linker. */ -+ srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); -+ BFD_ASSERT (srelgot != NULL); -+ -+ outrel.r_offset = (sgot->output_section->vma -+ + sgot->output_offset -+ + off); -+ outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE); -+ outrel.r_addend = relocation; -+ loc = srelgot->contents; -+ loc += srelgot->reloc_count * sizeof (Elf32_External_Rela); -+ bfd_elf32_swap_reloca_out (output_bfd, &outrel,loc); -+ ++srelgot->reloc_count; -+ } -+ -+ local_got_offsets[r_symndx] |= 1; -+ } -+ relocation = sgot->output_offset + off; -+ } -+ -+ /* Addend should be zero. */ -+ if (rel->r_addend != 0) -+ (*_bfd_error_handler) -+ (_("internal error: addend should be zero for R_OR1K_GOT16")); -+ -+ break; -+ -+ case R_OR1K_GOTOFF_LO16: -+ case R_OR1K_GOTOFF_HI16: -+ /* Relocation is offset from GOT. */ -+ BFD_ASSERT (sgot != NULL); -+ relocation -= sgot->output_section->vma; -+ break; -+ -+ case R_OR1K_INSN_REL_26: -+ case R_OR1K_HI_16_IN_INSN: -+ case R_OR1K_LO_16_IN_INSN: -+ case R_OR1K_32: -+ /* R_OR1K_16? */ -+ { -+ /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols -+ from removed linkonce sections, or sections discarded by -+ a linker script. */ -+ if (r_symndx == STN_UNDEF -+ || (input_section->flags & SEC_ALLOC) == 0) -+ break; -+ -+ if ((info->shared -+ && (h == NULL -+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ || h->root.type != bfd_link_hash_undefweak) -+ && (howto->type != R_OR1K_INSN_REL_26 -+ || !SYMBOL_CALLS_LOCAL (info, h))) -+ || (!info->shared -+ && h != NULL -+ && h->dynindx != -1 -+ && !h->non_got_ref -+ && ((h->def_dynamic -+ && !h->def_regular) -+ || h->root.type == bfd_link_hash_undefweak -+ || h->root.type == bfd_link_hash_undefined))) -+ { -+ Elf_Internal_Rela outrel; -+ bfd_byte *loc; -+ bfd_boolean skip; -+ -+ /* When generating a shared object, these relocations -+ are copied into the output file to be resolved at run -+ time. */ -+ -+ BFD_ASSERT (sreloc != NULL); -+ -+ skip = FALSE; -+ -+ outrel.r_offset = -+ _bfd_elf_section_offset (output_bfd, info, input_section, -+ rel->r_offset); -+ if (outrel.r_offset == (bfd_vma) -1) -+ skip = TRUE; -+ else if (outrel.r_offset == (bfd_vma) -2) -+ skip = TRUE; -+ outrel.r_offset += (input_section->output_section->vma -+ + input_section->output_offset); -+ -+ if (skip) -+ memset (&outrel, 0, sizeof outrel); -+ /* h->dynindx may be -1 if the symbol was marked to -+ become local. */ -+ else if (h != NULL -+ && ((! info->symbolic && h->dynindx != -1) -+ || !h->def_regular)) -+ { -+ BFD_ASSERT (h->dynindx != -1); -+ outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); -+ outrel.r_addend = rel->r_addend; -+ } -+ else -+ { -+ if (r_type == R_OR1K_32) -+ { -+ outrel.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE); -+ outrel.r_addend = relocation + rel->r_addend; -+ } -+ else -+ { -+ BFD_FAIL (); -+ (*_bfd_error_handler) -+ (_("%B: probably compiled without -fPIC?"), -+ input_bfd); -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+ } -+ } -+ -+ loc = sreloc->contents; -+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); -+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); -+ break; -+ } -+ break; -+ } -+ -+ case R_OR1K_TLS_LDM_HI16: -+ case R_OR1K_TLS_LDM_LO16: -+ case R_OR1K_TLS_LDO_HI16: -+ case R_OR1K_TLS_LDO_LO16: -+ /* TODO: implement support for local dynamic. */ -+ BFD_FAIL (); -+ (*_bfd_error_handler) -+ (_("%B: support for local dynamic not implemented"), -+ input_bfd); -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+ -+ -+ case R_OR1K_TLS_GD_HI16: -+ case R_OR1K_TLS_GD_LO16: -+ case R_OR1K_TLS_IE_HI16: -+ case R_OR1K_TLS_IE_LO16: -+ { -+ bfd_vma gotoff; -+ Elf_Internal_Rela rela; -+ bfd_byte *loc; -+ int dynamic; -+ -+ sreloc = bfd_get_section_by_name (dynobj, ".rela.got"); -+ -+ /* Mark as TLS related GOT entry by setting -+ bit 2 as well as bit 1. */ -+ if (h != NULL) -+ { -+ gotoff = h->got.offset; -+ h->got.offset |= 3; -+ } -+ else -+ { -+ gotoff = local_got_offsets[r_symndx]; -+ local_got_offsets[r_symndx] |= 3; -+ } -+ -+ /* Only process the relocation once. */ -+ if (gotoff & 1) -+ { -+ relocation = sgot->output_offset + (gotoff & ~3); -+ break; -+ } -+ -+ BFD_ASSERT (elf_hash_table (info)->hgot == NULL -+ || elf_hash_table (info)->hgot->root.u.def.value == 0); -+ -+ /* Dynamic entries will require relocations. if we do not need -+ them we will just use the default R_OR1K_NONE and -+ not set anything. */ -+ dynamic = info->shared -+ || (sec && (sec->flags & SEC_ALLOC) != 0 -+ && h != NULL -+ && (h->root.type == bfd_link_hash_defweak || !h->def_regular)); -+ -+ /* Shared GD. */ -+ if (dynamic && (howto->type == R_OR1K_TLS_GD_HI16 -+ || howto->type == R_OR1K_TLS_GD_LO16)) -+ { -+ int i; -+ -+ /* Add DTPMOD and DTPOFF GOT and rela entries. */ -+ for (i = 0; i < 2; ++i) -+ { -+ rela.r_offset = sgot->output_section->vma + -+ sgot->output_offset + gotoff + i*4; -+ if (h != NULL && h->dynindx != -1) -+ { -+ rela.r_info = ELF32_R_INFO (h->dynindx, -+ (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF)); -+ rela.r_addend = 0; -+ } -+ else -+ { -+ rela.r_info = ELF32_R_INFO (0, -+ (i == 0 ? R_OR1K_TLS_DTPMOD : R_OR1K_TLS_DTPOFF)); -+ rela.r_addend = tpoff (info, relocation); -+ } -+ -+ loc = sreloc->contents; -+ loc += sreloc->reloc_count++ * -+ sizeof (Elf32_External_Rela); -+ -+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); -+ bfd_put_32 (output_bfd, 0, sgot->contents + gotoff + i*4); -+ } -+ } -+ /* Static GD. */ -+ else if (howto->type == R_OR1K_TLS_GD_HI16 -+ || howto->type == R_OR1K_TLS_GD_LO16) -+ { -+ bfd_put_32 (output_bfd, 1, sgot->contents + gotoff); -+ bfd_put_32 (output_bfd, tpoff (info, relocation), -+ sgot->contents + gotoff + 4); -+ } -+ /* Shared IE. */ -+ else if (dynamic) -+ { -+ /* Add TPOFF GOT and rela entries. */ -+ rela.r_offset = sgot->output_section->vma + -+ sgot->output_offset + gotoff; -+ if (h != NULL && h->dynindx != -1) -+ { -+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_TLS_TPOFF); -+ rela.r_addend = 0; -+ } -+ else -+ { -+ rela.r_info = ELF32_R_INFO (0, R_OR1K_TLS_TPOFF); -+ rela.r_addend = tpoff (info, relocation); -+ } -+ -+ loc = sreloc->contents; -+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); -+ -+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); -+ bfd_put_32 (output_bfd, 0, sgot->contents + gotoff); -+ } -+ /* Static IE. */ -+ else -+ { -+ bfd_put_32 (output_bfd, tpoff (info, relocation), -+ sgot->contents + gotoff); -+ } -+ relocation = sgot->output_offset + gotoff; -+ break; -+ } -+ case R_OR1K_TLS_LE_HI16: -+ case R_OR1K_TLS_LE_LO16: -+ -+ /* Relocation is offset from TP. */ -+ relocation = tpoff (info, relocation); -+ break; -+ -+ case R_OR1K_TLS_DTPMOD: -+ case R_OR1K_TLS_DTPOFF: -+ case R_OR1K_TLS_TPOFF: -+ /* These are resolved dynamically on load and shouldn't -+ be used as linker input. */ -+ BFD_FAIL (); -+ (*_bfd_error_handler) -+ (_("%B: will not resolve runtime TLS relocation"), -+ input_bfd); -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+ -+ default: -+ break; -+ } -+ r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, -+ rel->r_offset, relocation, rel->r_addend); -+ -+ if (r != bfd_reloc_ok) -+ { -+ const char *msg = NULL; -+ -+ switch (r) -+ { -+ case bfd_reloc_overflow: -+ r = info->callbacks->reloc_overflow -+ (info, (h ? &h->root : NULL), name, howto->name, -+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset); -+ break; -+ -+ case bfd_reloc_undefined: -+ r = info->callbacks->undefined_symbol -+ (info, name, input_bfd, input_section, rel->r_offset, TRUE); -+ break; -+ -+ case bfd_reloc_outofrange: -+ msg = _("internal error: out of range error"); -+ break; -+ -+ case bfd_reloc_notsupported: -+ msg = _("internal error: unsupported relocation error"); -+ break; -+ -+ case bfd_reloc_dangerous: -+ msg = _("internal error: dangerous relocation"); -+ break; -+ -+ default: -+ msg = _("internal error: unknown error"); -+ break; -+ } -+ -+ if (msg) -+ r = info->callbacks->warning -+ (info, msg, name, input_bfd, input_section, rel->r_offset); -+ -+ if (!r) -+ return FALSE; -+ } -+ } -+ -+ return TRUE; -+} -+ -+/* Return the section that should be marked against GC for a given -+ relocation. */ -+ -+static asection * -+or1k_elf_gc_mark_hook (asection *sec, -+ struct bfd_link_info *info, -+ Elf_Internal_Rela *rel, -+ struct elf_link_hash_entry *h, -+ Elf_Internal_Sym *sym) -+{ -+ if (h != NULL) -+ switch (ELF32_R_TYPE (rel->r_info)) -+ { -+ case R_OR1K_GNU_VTINHERIT: -+ case R_OR1K_GNU_VTENTRY: -+ return NULL; -+ } -+ -+ return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); -+} -+ -+static bfd_boolean -+or1k_elf_gc_sweep_hook (bfd *abfd, -+ struct bfd_link_info *info ATTRIBUTE_UNUSED, -+ asection *sec, -+ const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED) -+{ -+ /* Update the got entry reference counts for the section being removed. */ -+ Elf_Internal_Shdr *symtab_hdr; -+ struct elf_link_hash_entry **sym_hashes; -+ bfd_signed_vma *local_got_refcounts; -+ const Elf_Internal_Rela *rel, *relend; -+ -+ elf_section_data (sec)->local_dynrel = NULL; -+ -+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr; -+ sym_hashes = elf_sym_hashes (abfd); -+ local_got_refcounts = elf_local_got_refcounts (abfd); -+ -+ relend = relocs + sec->reloc_count; -+ for (rel = relocs; rel < relend; rel++) -+ { -+ unsigned long r_symndx; -+ struct elf_link_hash_entry *h = NULL; -+ -+ r_symndx = ELF32_R_SYM (rel->r_info); -+ if (r_symndx >= symtab_hdr->sh_info) -+ { -+ h = sym_hashes[r_symndx - symtab_hdr->sh_info]; -+ while (h->root.type == bfd_link_hash_indirect -+ || h->root.type == bfd_link_hash_warning) -+ h = (struct elf_link_hash_entry *) h->root.u.i.link; -+ } -+ -+ switch (ELF32_R_TYPE (rel->r_info)) -+ { -+ case R_OR1K_GOT16: -+ if (h != NULL) -+ { -+ if (h->got.refcount > 0) -+ h->got.refcount--; -+ } -+ else -+ { -+ if (local_got_refcounts && local_got_refcounts[r_symndx] > 0) -+ local_got_refcounts[r_symndx]--; -+ } -+ break; -+ -+ default: -+ break; -+ } -+ } -+ return TRUE; -+} -+ -+/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up -+ shortcuts to them in our hash table. */ -+ -+static bfd_boolean -+create_got_section (bfd *dynobj, struct bfd_link_info *info) -+{ -+ struct elf_or1k_link_hash_table *htab; -+ asection *s; -+ -+ /* This function may be called more than once. */ -+ s = bfd_get_section_by_name (dynobj, ".got"); -+ if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0) -+ return TRUE; -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ if (! _bfd_elf_create_got_section (dynobj, info)) -+ return FALSE; -+ -+ htab->sgot = bfd_get_section_by_name (dynobj, ".got"); -+ htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); -+ htab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); -+ -+ if (! htab->sgot || ! htab->sgotplt || ! htab->srelgot) -+ abort (); -+ -+ if (! bfd_set_section_flags (dynobj, htab->srelgot, SEC_ALLOC -+ | SEC_LOAD -+ | SEC_HAS_CONTENTS -+ | SEC_IN_MEMORY -+ | SEC_LINKER_CREATED -+ | SEC_READONLY) -+ || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) -+ return FALSE; -+ -+ return TRUE; -+} -+ -+/* Look through the relocs for a section during the first phase. */ -+ -+static bfd_boolean -+or1k_elf_check_relocs (bfd *abfd, -+ struct bfd_link_info *info, -+ asection *sec, -+ const Elf_Internal_Rela *relocs) -+{ -+ Elf_Internal_Shdr *symtab_hdr; -+ struct elf_link_hash_entry **sym_hashes; -+ const Elf_Internal_Rela *rel; -+ -+ const Elf_Internal_Rela *rel_end; -+ struct elf_or1k_link_hash_table *htab; -+ bfd *dynobj; -+ asection *sreloc = NULL; -+ -+ if (info->relocatable) -+ return TRUE; -+ -+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr; -+ sym_hashes = elf_sym_hashes (abfd); -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ dynobj = htab->root.dynobj; -+ -+ rel_end = relocs + sec->reloc_count; -+ for (rel = relocs; rel < rel_end; rel++) -+ { -+ struct elf_link_hash_entry *h; -+ unsigned long r_symndx; -+ unsigned char tls_type; -+ -+ r_symndx = ELF32_R_SYM (rel->r_info); -+ if (r_symndx < symtab_hdr->sh_info) -+ h = NULL; -+ else -+ { -+ h = sym_hashes[r_symndx - symtab_hdr->sh_info]; -+ while (h->root.type == bfd_link_hash_indirect -+ || h->root.type == bfd_link_hash_warning) -+ h = (struct elf_link_hash_entry *) h->root.u.i.link; -+ -+ /* PR15323, ref flags aren't set for references in the same -+ object. */ -+ h->root.non_ir_ref = 1; -+ } -+ -+ switch (ELF32_R_TYPE (rel->r_info)) -+ { -+ case R_OR1K_TLS_GD_HI16: -+ case R_OR1K_TLS_GD_LO16: -+ tls_type = TLS_GD; -+ break; -+ case R_OR1K_TLS_LDM_HI16: -+ case R_OR1K_TLS_LDM_LO16: -+ case R_OR1K_TLS_LDO_HI16: -+ case R_OR1K_TLS_LDO_LO16: -+ tls_type = TLS_LD; -+ break; -+ case R_OR1K_TLS_IE_HI16: -+ case R_OR1K_TLS_IE_LO16: -+ tls_type = TLS_IE; -+ break; -+ case R_OR1K_TLS_LE_HI16: -+ case R_OR1K_TLS_LE_LO16: -+ tls_type = TLS_LE; -+ break; -+ default: -+ tls_type = TLS_NONE; -+ } -+ -+ /* Record TLS type. */ -+ if (h != NULL) -+ ((struct elf_or1k_link_hash_entry *) h)->tls_type = tls_type; -+ else -+ { -+ unsigned char *local_tls_type; -+ -+ /* This is a TLS type record for a local symbol. */ -+ local_tls_type = (unsigned char *) elf_or1k_local_tls_type (abfd); -+ if (local_tls_type == NULL) -+ { -+ bfd_size_type size; -+ -+ size = symtab_hdr->sh_info; -+ local_tls_type = bfd_zalloc (abfd, size); -+ if (local_tls_type == NULL) -+ return FALSE; -+ elf_or1k_local_tls_type (abfd) = local_tls_type; -+ } -+ local_tls_type[r_symndx] = tls_type; -+ } -+ -+ switch (ELF32_R_TYPE (rel->r_info)) -+ { -+ /* This relocation describes the C++ object vtable hierarchy. -+ Reconstruct it for later use during GC. */ -+ case R_OR1K_GNU_VTINHERIT: -+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) -+ return FALSE; -+ break; -+ -+ /* This relocation describes which C++ vtable entries are actually -+ used. Record for later use during GC. */ -+ case R_OR1K_GNU_VTENTRY: -+ BFD_ASSERT (h != NULL); -+ if (h != NULL -+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) -+ return FALSE; -+ break; -+ -+ /* This relocation requires .plt entry. */ -+ case R_OR1K_PLT26: -+ if (h != NULL) -+ { -+ h->needs_plt = 1; -+ h->plt.refcount += 1; -+ } -+ break; -+ -+ case R_OR1K_GOT16: -+ case R_OR1K_GOTOFF_HI16: -+ case R_OR1K_GOTOFF_LO16: -+ case R_OR1K_TLS_GD_HI16: -+ case R_OR1K_TLS_GD_LO16: -+ case R_OR1K_TLS_IE_HI16: -+ case R_OR1K_TLS_IE_LO16: -+ if (htab->sgot == NULL) -+ { -+ if (dynobj == NULL) -+ htab->root.dynobj = dynobj = abfd; -+ if (! create_got_section (dynobj, info)) -+ return FALSE; -+ } -+ -+ if (ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_HI16 && -+ ELF32_R_TYPE (rel->r_info) != R_OR1K_GOTOFF_LO16) -+ { -+ if (h != NULL) -+ h->got.refcount += 1; -+ else -+ { -+ bfd_signed_vma *local_got_refcounts; -+ -+ /* This is a global offset table entry for a local symbol. */ -+ local_got_refcounts = elf_local_got_refcounts (abfd); -+ if (local_got_refcounts == NULL) -+ { -+ bfd_size_type size; -+ -+ size = symtab_hdr->sh_info; -+ size *= sizeof (bfd_signed_vma); -+ local_got_refcounts = bfd_zalloc (abfd, size); -+ if (local_got_refcounts == NULL) -+ return FALSE; -+ elf_local_got_refcounts (abfd) = local_got_refcounts; -+ } -+ local_got_refcounts[r_symndx] += 1; -+ } -+ } -+ break; -+ -+ case R_OR1K_INSN_REL_26: -+ case R_OR1K_HI_16_IN_INSN: -+ case R_OR1K_LO_16_IN_INSN: -+ case R_OR1K_32: -+ /* R_OR1K_16? */ -+ { -+ if (h != NULL && !info->shared) -+ { -+ /* We may need a copy reloc. */ -+ h->non_got_ref = 1; -+ -+ /* We may also need a .plt entry. */ -+ h->plt.refcount += 1; -+ if (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26) -+ h->pointer_equality_needed = 1; -+ } -+ -+ /* If we are creating a shared library, and this is a reloc -+ against a global symbol, or a non PC relative reloc -+ against a local symbol, then we need to copy the reloc -+ into the shared library. However, if we are linking with -+ -Bsymbolic, we do not need to copy a reloc against a -+ global symbol which is defined in an object we are -+ including in the link (i.e., DEF_REGULAR is set). At -+ this point we have not seen all the input files, so it is -+ possible that DEF_REGULAR is not set now but will be set -+ later (it is never cleared). In case of a weak definition, -+ DEF_REGULAR may be cleared later by a strong definition in -+ a shared library. We account for that possibility below by -+ storing information in the relocs_copied field of the hash -+ table entry. A similar situation occurs when creating -+ shared libraries and symbol visibility changes render the -+ symbol local. -+ -+ If on the other hand, we are creating an executable, we -+ may need to keep relocations for symbols satisfied by a -+ dynamic library if we manage to avoid copy relocs for the -+ symbol. */ -+ -+ if ((info->shared -+ && (sec->flags & SEC_ALLOC) != 0 -+ && (ELF32_R_TYPE (rel->r_info) != R_OR1K_INSN_REL_26 -+ || (h != NULL -+ && (!SYMBOLIC_BIND (info, h) -+ || h->root.type == bfd_link_hash_defweak -+ || !h->def_regular)))) -+ || (!info->shared -+ && (sec->flags & SEC_ALLOC) != 0 -+ && h != NULL -+ && (h->root.type == bfd_link_hash_defweak -+ || !h->def_regular))) -+ { -+ struct elf_or1k_dyn_relocs *p; -+ struct elf_or1k_dyn_relocs **head; -+ -+ /* When creating a shared object, we must copy these -+ relocs into the output file. We create a reloc -+ section in dynobj and make room for the reloc. */ -+ if (sreloc == NULL) -+ { -+ const char *name; -+ unsigned int strndx = elf_elfheader (abfd)->e_shstrndx; -+ unsigned int shnam = _bfd_elf_single_rel_hdr (sec)->sh_name; -+ -+ name = bfd_elf_string_from_elf_section (abfd, strndx, shnam); -+ if (name == NULL) -+ return FALSE; -+ -+ if (strncmp (name, ".rela", 5) != 0 -+ || strcmp (bfd_get_section_name (abfd, sec), -+ name + 5) != 0) -+ { -+ (*_bfd_error_handler) -+ (_("%B: bad relocation section name `%s\'"), -+ abfd, name); -+ } -+ -+ if (htab->root.dynobj == NULL) -+ htab->root.dynobj = abfd; -+ dynobj = htab->root.dynobj; -+ -+ sreloc = bfd_get_section_by_name (dynobj, name); -+ if (sreloc == NULL) -+ { -+ sreloc = _bfd_elf_make_dynamic_reloc_section -+ (sec, dynobj, 2, abfd, /*rela?*/ TRUE); -+ -+ if (sreloc == NULL) -+ return FALSE; -+ } -+ elf_section_data (sec)->sreloc = sreloc; -+ } -+ -+ /* If this is a global symbol, we count the number of -+ relocations we need for this symbol. */ -+ if (h != NULL) -+ head = &((struct elf_or1k_link_hash_entry *) h)->dyn_relocs; -+ else -+ { -+ /* Track dynamic relocs needed for local syms too. -+ We really need local syms available to do this -+ easily. Oh well. */ -+ -+ asection *s; -+ Elf_Internal_Sym *isym; -+ void *vpp; -+ -+ isym = bfd_sym_from_r_symndx (&htab->sym_sec, -+ abfd, r_symndx); -+ if (isym == NULL) -+ return FALSE; -+ -+ s = bfd_section_from_elf_index (abfd, isym->st_shndx); -+ if (s == NULL) -+ return FALSE; -+ -+ vpp = &elf_section_data (s)->local_dynrel; -+ head = (struct elf_or1k_dyn_relocs **) vpp; -+ } -+ -+ p = *head; -+ if (p == NULL || p->sec != sec) -+ { -+ bfd_size_type amt = sizeof *p; -+ p = ((struct elf_or1k_dyn_relocs *) -+ bfd_alloc (htab->root.dynobj, amt)); -+ if (p == NULL) -+ return FALSE; -+ p->next = *head; -+ *head = p; -+ p->sec = sec; -+ p->count = 0; -+ p->pc_count = 0; -+ } -+ -+ p->count += 1; -+ if (ELF32_R_TYPE (rel->r_info) == R_OR1K_INSN_REL_26) -+ p->pc_count += 1; -+ } -+ } -+ break; -+ } -+ } -+ -+ return TRUE; -+} -+ -+/* Finish up the dynamic sections. */ -+ -+static bfd_boolean -+or1k_elf_finish_dynamic_sections (bfd *output_bfd, -+ struct bfd_link_info *info) -+{ -+ bfd *dynobj; -+ asection *sdyn, *sgot; -+ struct elf_or1k_link_hash_table *htab; -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ dynobj = htab->root.dynobj; -+ -+ sgot = htab->sgotplt; -+ sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); -+ -+ if (htab->root.dynamic_sections_created) -+ { -+ asection *splt; -+ Elf32_External_Dyn *dyncon, *dynconend; -+ -+ BFD_ASSERT (sgot != NULL && sdyn != NULL); -+ -+ dyncon = (Elf32_External_Dyn *) sdyn->contents; -+ dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); -+ -+ for (; dyncon < dynconend; dyncon++) -+ { -+ Elf_Internal_Dyn dyn; -+ asection *s; -+ -+ bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); -+ -+ switch (dyn.d_tag) -+ { -+ default: -+ continue; -+ -+ case DT_PLTGOT: -+ s = htab->sgot->output_section; -+ BFD_ASSERT (s != NULL); -+ dyn.d_un.d_ptr = s->vma; -+ break; -+ -+ case DT_JMPREL: -+ s = htab->srelplt->output_section; -+ BFD_ASSERT (s != NULL); -+ dyn.d_un.d_ptr = s->vma; -+ break; -+ -+ case DT_PLTRELSZ: -+ s = htab->srelplt->output_section; -+ BFD_ASSERT (s != NULL); -+ dyn.d_un.d_val = s->size; -+ break; -+ -+ case DT_RELASZ: -+ /* My reading of the SVR4 ABI indicates that the -+ procedure linkage table relocs (DT_JMPREL) should be -+ included in the overall relocs (DT_RELA). This is -+ what Solaris does. However, UnixWare can not handle -+ that case. Therefore, we override the DT_RELASZ entry -+ here to make it not include the JMPREL relocs. Since -+ the linker script arranges for .rela.plt to follow all -+ other relocation sections, we don't have to worry -+ about changing the DT_RELA entry. */ -+ if (htab->srelplt != NULL) -+ { -+ /* FIXME: this calculation sometimes produces -+ wrong result, the problem is that the dyn.d_un.d_val -+ is not always correct, needs investigation why -+ that happens. In the meantime, reading the -+ ".rela.dyn" section by name seems to yield -+ correct result. -+ -+ s = htab->srelplt->output_section; -+ dyn.d_un.d_val -= s->size; -+ */ -+ -+ s = bfd_get_section_by_name (output_bfd, ".rela.dyn"); -+ dyn.d_un.d_val = s ? s->size : 0; -+ } -+ break; -+ } -+ bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); -+ } -+ -+ -+ /* Fill in the first entry in the procedure linkage table. */ -+ splt = htab->splt; -+ if (splt && splt->size > 0) -+ { -+ if (info->shared) -+ { -+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD0, -+ splt->contents); -+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD1, -+ splt->contents + 4); -+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD2, -+ splt->contents + 8); -+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD3, -+ splt->contents + 12); -+ bfd_put_32 (output_bfd, PLT0_PIC_ENTRY_WORD4, -+ splt->contents + 16); -+ } -+ else -+ { -+ unsigned long addr; -+ /* addr = .got + 4 */ -+ addr = sgot->output_section->vma + sgot->output_offset + 4; -+ bfd_put_32 (output_bfd, -+ PLT0_ENTRY_WORD0 | ((addr >> 16) & 0xffff), -+ splt->contents); -+ bfd_put_32 (output_bfd, -+ PLT0_ENTRY_WORD1 | (addr & 0xffff), -+ splt->contents + 4); -+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD2, splt->contents + 8); -+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD3, splt->contents + 12); -+ bfd_put_32 (output_bfd, PLT0_ENTRY_WORD4, splt->contents + 16); -+ } -+ -+ elf_section_data (splt->output_section)->this_hdr.sh_entsize = 4; -+ } -+ } -+ -+ /* Set the first entry in the global offset table to the address of -+ the dynamic section. */ -+ if (sgot && sgot->size > 0) -+ { -+ if (sdyn == NULL) -+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); -+ else -+ bfd_put_32 (output_bfd, -+ sdyn->output_section->vma + sdyn->output_offset, -+ sgot->contents); -+ elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; -+ } -+ -+ if (htab->sgot && htab->sgot->size > 0) -+ elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 4; -+ -+ return TRUE; -+} -+ -+/* Finish up dynamic symbol handling. We set the contents of various -+ dynamic sections here. */ -+ -+static bfd_boolean -+or1k_elf_finish_dynamic_symbol (bfd *output_bfd, -+ struct bfd_link_info *info, -+ struct elf_link_hash_entry *h, -+ Elf_Internal_Sym *sym) -+{ -+ struct elf_or1k_link_hash_table *htab; -+ bfd_byte *loc; -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ if (h->plt.offset != (bfd_vma) -1) -+ { -+ asection *splt; -+ asection *sgot; -+ asection *srela; -+ -+ bfd_vma plt_index; -+ bfd_vma got_offset; -+ bfd_vma got_addr; -+ Elf_Internal_Rela rela; -+ -+ /* This symbol has an entry in the procedure linkage table. Set -+ it up. */ -+ BFD_ASSERT (h->dynindx != -1); -+ -+ splt = htab->splt; -+ sgot = htab->sgotplt; -+ srela = htab->srelplt; -+ BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); -+ -+ /* Get the index in the procedure linkage table which -+ corresponds to this symbol. This is the index of this symbol -+ in all the symbols for which we are making plt entries. The -+ first entry in the procedure linkage table is reserved. */ -+ plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1; -+ -+ /* Get the offset into the .got table of the entry that -+ corresponds to this function. Each .got entry is 4 bytes. -+ The first three are reserved. */ -+ got_offset = (plt_index + 3) * 4; -+ got_addr = got_offset; -+ -+ /* Fill in the entry in the procedure linkage table. */ -+ if (! info->shared) -+ { -+ got_addr += htab->sgotplt->output_section->vma -+ + htab->sgotplt->output_offset; -+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD0 | ((got_addr >> 16) & 0xffff), -+ splt->contents + h->plt.offset); -+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD1 | (got_addr & 0xffff), -+ splt->contents + h->plt.offset + 4); -+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD2, -+ splt->contents + h->plt.offset + 8); -+ bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD3, -+ splt->contents + h->plt.offset + 12); -+ bfd_put_32 (output_bfd, PLT_ENTRY_WORD4 -+ | plt_index * sizeof (Elf32_External_Rela), -+ splt->contents + h->plt.offset + 16); -+ } -+ else -+ { -+ bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD0 | (got_addr & 0xffff), -+ splt->contents + h->plt.offset); -+ bfd_put_32 (output_bfd, PLT_PIC_ENTRY_WORD1 -+ | plt_index * sizeof (Elf32_External_Rela), -+ splt->contents + h->plt.offset + 4); -+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD2, -+ splt->contents + h->plt.offset + 8); -+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD3, -+ splt->contents + h->plt.offset + 12); -+ bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_ENTRY_WORD4, -+ splt->contents + h->plt.offset + 16); -+ } -+ -+ /* Fill in the entry in the global offset table. */ -+ bfd_put_32 (output_bfd, -+ (splt->output_section->vma -+ + splt->output_offset), /* Same offset. */ -+ sgot->contents + got_offset); -+ -+ /* Fill in the entry in the .rela.plt section. */ -+ rela.r_offset = (sgot->output_section->vma -+ + sgot->output_offset -+ + got_offset); -+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_JMP_SLOT); -+ rela.r_addend = 0; -+ loc = srela->contents; -+ loc += plt_index * sizeof (Elf32_External_Rela); -+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); -+ -+ if (!h->def_regular) -+ { -+ /* Mark the symbol as undefined, rather than as defined in -+ the .plt section. Leave the value alone. */ -+ sym->st_shndx = SHN_UNDEF; -+ } -+ -+ } -+ -+ if (h->got.offset != (bfd_vma) -1 -+ && (h->got.offset & 2) == 0) /* Homemade TLS check. */ -+ { -+ asection *sgot; -+ asection *srela; -+ Elf_Internal_Rela rela; -+ -+ /* This symbol has an entry in the global offset table. Set it -+ up. */ -+ sgot = htab->sgot; -+ srela = htab->srelgot; -+ BFD_ASSERT (sgot != NULL && srela != NULL); -+ -+ rela.r_offset = (sgot->output_section->vma -+ + sgot->output_offset -+ + (h->got.offset &~ 1)); -+ -+ /* If this is a -Bsymbolic link, and the symbol is defined -+ locally, we just want to emit a RELATIVE reloc. Likewise if -+ the symbol was forced to be local because of a version file. -+ The entry in the global offset table will already have been -+ initialized in the relocate_section function. */ -+ if (info->shared && SYMBOL_REFERENCES_LOCAL (info, h)) -+ { -+ rela.r_info = ELF32_R_INFO (0, R_OR1K_RELATIVE); -+ rela.r_addend = (h->root.u.def.value -+ + h->root.u.def.section->output_section->vma -+ + h->root.u.def.section->output_offset); -+ } -+ else -+ { -+ BFD_ASSERT ((h->got.offset & 1) == 0); -+ bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); -+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_GLOB_DAT); -+ rela.r_addend = 0; -+ } -+ -+ loc = srela->contents; -+ loc += srela->reloc_count * sizeof (Elf32_External_Rela); -+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); -+ ++srela->reloc_count; -+ } -+ -+ if (h->needs_copy) -+ { -+ asection *s; -+ Elf_Internal_Rela rela; -+ -+ /* This symbols needs a copy reloc. Set it up. */ -+ BFD_ASSERT (h->dynindx != -1 -+ && (h->root.type == bfd_link_hash_defined -+ || h->root.type == bfd_link_hash_defweak)); -+ -+ s = bfd_get_section_by_name (h->root.u.def.section->owner, -+ ".rela.bss"); -+ BFD_ASSERT (s != NULL); -+ -+ rela.r_offset = (h->root.u.def.value -+ + h->root.u.def.section->output_section->vma -+ + h->root.u.def.section->output_offset); -+ rela.r_info = ELF32_R_INFO (h->dynindx, R_OR1K_COPY); -+ rela.r_addend = 0; -+ loc = s->contents; -+ loc += s->reloc_count * sizeof (Elf32_External_Rela); -+ bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); -+ ++s->reloc_count; -+ } -+ -+ /* Mark some specially defined symbols as absolute. */ -+ if (strcmp (h->root.root.string, "_DYNAMIC") == 0 -+ || h == htab->root.hgot) -+ sym->st_shndx = SHN_ABS; -+ -+ return TRUE; -+} -+ -+static enum elf_reloc_type_class -+or1k_elf_reloc_type_class (const Elf_Internal_Rela *rela) -+{ -+ switch ((int) ELF32_R_TYPE (rela->r_info)) -+ { -+ case R_OR1K_RELATIVE: return reloc_class_relative; -+ case R_OR1K_JMP_SLOT: return reloc_class_plt; -+ case R_OR1K_COPY: return reloc_class_copy; -+ default: return reloc_class_normal; -+ } -+} -+ -+/* Adjust a symbol defined by a dynamic object and referenced by a -+ regular object. The current definition is in some section of the -+ dynamic object, but we're not including those sections. We have to -+ change the definition to something the rest of the link can -+ understand. */ -+ -+static bfd_boolean -+or1k_elf_adjust_dynamic_symbol (struct bfd_link_info *info, -+ struct elf_link_hash_entry *h) -+{ -+ struct elf_or1k_link_hash_table *htab; -+ struct elf_or1k_link_hash_entry *eh; -+ struct elf_or1k_dyn_relocs *p; -+ bfd *dynobj; -+ asection *s; -+ -+ dynobj = elf_hash_table (info)->dynobj; -+ -+ /* Make sure we know what is going on here. */ -+ BFD_ASSERT (dynobj != NULL -+ && (h->needs_plt -+ || h->type == STT_GNU_IFUNC -+ || h->u.weakdef != NULL -+ || (h->def_dynamic -+ && h->ref_regular -+ && !h->def_regular))); -+ -+ /* If this is a function, put it in the procedure linkage table. We -+ will fill in the contents of the procedure linkage table later, -+ when we know the address of the .got section. */ -+ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) -+ || h->needs_plt) -+ { -+ if (! info->shared -+ && !h->def_dynamic -+ && !h->ref_dynamic -+ && h->root.type != bfd_link_hash_undefweak -+ && h->root.type != bfd_link_hash_undefined) -+ { -+ /* This case can occur if we saw a PLT reloc in an input -+ file, but the symbol was never referred to by a dynamic -+ object. In such a case, we don't actually need to build -+ a procedure linkage table, and we can just do a PCREL -+ reloc instead. */ -+ h->plt.offset = (bfd_vma) -1; -+ h->needs_plt = 0; -+ } -+ -+ return TRUE; -+ } -+ else -+ h->plt.offset = (bfd_vma) -1; -+ -+ /* If this is a weak symbol, and there is a real definition, the -+ processor independent code will have arranged for us to see the -+ real definition first, and we can just use the same value. */ -+ if (h->u.weakdef != NULL) -+ { -+ BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined -+ || h->u.weakdef->root.type == bfd_link_hash_defweak); -+ h->root.u.def.section = h->u.weakdef->root.u.def.section; -+ h->root.u.def.value = h->u.weakdef->root.u.def.value; -+ return TRUE; -+ } -+ -+ /* This is a reference to a symbol defined by a dynamic object which -+ is not a function. */ -+ -+ /* If we are creating a shared library, we must presume that the -+ only references to the symbol are via the global offset table. -+ For such cases we need not do anything here; the relocations will -+ be handled correctly by relocate_section. */ -+ if (info->shared) -+ return TRUE; -+ -+ /* If there are no references to this symbol that do not use the -+ GOT, we don't need to generate a copy reloc. */ -+ if (!h->non_got_ref) -+ return TRUE; -+ -+ /* If -z nocopyreloc was given, we won't generate them either. */ -+ if (info->nocopyreloc) -+ { -+ h->non_got_ref = 0; -+ return TRUE; -+ } -+ -+ eh = (struct elf_or1k_link_hash_entry *) h; -+ for (p = eh->dyn_relocs; p != NULL; p = p->next) -+ { -+ s = p->sec->output_section; -+ if (s != NULL && (s->flags & (SEC_READONLY | SEC_HAS_CONTENTS)) != 0) -+ break; -+ } -+ -+ /* If we didn't find any dynamic relocs in sections which needs the -+ copy reloc, then we'll be keeping the dynamic relocs and avoiding -+ the copy reloc. */ -+ if (p == NULL) -+ { -+ h->non_got_ref = 0; -+ return TRUE; -+ } -+ -+ /* We must allocate the symbol in our .dynbss section, which will -+ become part of the .bss section of the executable. There will be -+ an entry for this symbol in the .dynsym section. The dynamic -+ object will contain position independent code, so all references -+ from the dynamic object to this symbol will go through the global -+ offset table. The dynamic linker will use the .dynsym entry to -+ determine the address it must put in the global offset table, so -+ both the dynamic object and the regular object will refer to the -+ same memory location for the variable. */ -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ s = htab->sdynbss; -+ BFD_ASSERT (s != NULL); -+ -+ /* We must generate a R_OR1K_COPY reloc to tell the dynamic linker -+ to copy the initial value out of the dynamic object and into the -+ runtime process image. We need to remember the offset into the -+ .rela.bss section we are going to use. */ -+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) -+ { -+ asection *srel; -+ -+ srel = htab->srelbss; -+ BFD_ASSERT (srel != NULL); -+ srel->size += sizeof (Elf32_External_Rela); -+ h->needs_copy = 1; -+ } -+ -+ return _bfd_elf_adjust_dynamic_copy (h, s); -+} -+ -+/* Allocate space in .plt, .got and associated reloc sections for -+ dynamic relocs. */ -+ -+static bfd_boolean -+allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) -+{ -+ struct bfd_link_info *info; -+ struct elf_or1k_link_hash_table *htab; -+ struct elf_or1k_link_hash_entry *eh; -+ struct elf_or1k_dyn_relocs *p; -+ -+ if (h->root.type == bfd_link_hash_indirect) -+ return TRUE; -+ -+ info = (struct bfd_link_info *) inf; -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ eh = (struct elf_or1k_link_hash_entry *) h; -+ -+ if (htab->root.dynamic_sections_created -+ && h->plt.refcount > 0) -+ { -+ /* Make sure this symbol is output as a dynamic symbol. -+ Undefined weak syms won't yet be marked as dynamic. */ -+ if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ -+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) -+ { -+ asection *s = htab->splt; -+ -+ /* If this is the first .plt entry, make room for the special -+ first entry. */ -+ if (s->size == 0) -+ s->size = PLT_ENTRY_SIZE; -+ -+ h->plt.offset = s->size; -+ -+ /* If this symbol is not defined in a regular file, and we are -+ not generating a shared library, then set the symbol to this -+ location in the .plt. This is required to make function -+ pointers compare as equal between the normal executable and -+ the shared library. */ -+ if (! info->shared -+ && !h->def_regular) -+ { -+ h->root.u.def.section = s; -+ h->root.u.def.value = h->plt.offset; -+ } -+ -+ /* Make room for this entry. */ -+ s->size += PLT_ENTRY_SIZE; -+ -+ /* We also need to make an entry in the .got.plt section, which -+ will be placed in the .got section by the linker script. */ -+ htab->sgotplt->size += 4; -+ -+ /* We also need to make an entry in the .rel.plt section. */ -+ htab->srelplt->size += sizeof (Elf32_External_Rela); -+ } -+ else -+ { -+ h->plt.offset = (bfd_vma) -1; -+ h->needs_plt = 0; -+ } -+ } -+ else -+ { -+ h->plt.offset = (bfd_vma) -1; -+ h->needs_plt = 0; -+ } -+ -+ if (h->got.refcount > 0) -+ { -+ asection *s; -+ bfd_boolean dyn; -+ unsigned char tls_type; -+ -+ /* Make sure this symbol is output as a dynamic symbol. -+ Undefined weak syms won't yet be marked as dynamic. */ -+ if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ -+ s = htab->sgot; -+ -+ h->got.offset = s->size; -+ -+ tls_type = ((struct elf_or1k_link_hash_entry *) h)->tls_type; -+ -+ /* TLS GD requires two GOT and two relocs. */ -+ if (tls_type == TLS_GD) -+ s->size += 8; -+ else -+ s->size += 4; -+ dyn = htab->root.dynamic_sections_created; -+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)) -+ { -+ if (tls_type == TLS_GD) -+ htab->srelgot->size += 2 * sizeof (Elf32_External_Rela); -+ else -+ htab->srelgot->size += sizeof (Elf32_External_Rela); -+ } -+ } -+ else -+ h->got.offset = (bfd_vma) -1; -+ -+ if (eh->dyn_relocs == NULL) -+ return TRUE; -+ -+ /* In the shared -Bsymbolic case, discard space allocated for -+ dynamic pc-relative relocs against symbols which turn out to be -+ defined in regular objects. For the normal shared case, discard -+ space for pc-relative relocs that have become local due to symbol -+ visibility changes. */ -+ -+ if (info->shared) -+ { -+ if (SYMBOL_CALLS_LOCAL (info, h)) -+ { -+ struct elf_or1k_dyn_relocs **pp; -+ -+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL;) -+ { -+ p->count -= p->pc_count; -+ p->pc_count = 0; -+ if (p->count == 0) -+ *pp = p->next; -+ else -+ pp = &p->next; -+ } -+ } -+ -+ /* Also discard relocs on undefined weak syms with non-default -+ visibility. */ -+ if (eh->dyn_relocs != NULL -+ && h->root.type == bfd_link_hash_undefweak) -+ { -+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) -+ eh->dyn_relocs = NULL; -+ -+ /* Make sure undefined weak symbols are output as a dynamic -+ symbol in PIEs. */ -+ else if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ } -+ } -+ else -+ { -+ /* For the non-shared case, discard space for relocs against -+ symbols which turn out to need copy relocs or are not -+ dynamic. */ -+ -+ if (!h->non_got_ref -+ && ((h->def_dynamic -+ && !h->def_regular) -+ || (htab->root.dynamic_sections_created -+ && (h->root.type == bfd_link_hash_undefweak -+ || h->root.type == bfd_link_hash_undefined)))) -+ { -+ /* Make sure this symbol is output as a dynamic symbol. -+ Undefined weak syms won't yet be marked as dynamic. */ -+ if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ -+ /* If that succeeded, we know we'll be keeping all the -+ relocs. */ -+ if (h->dynindx != -1) -+ goto keep; -+ } -+ -+ eh->dyn_relocs = NULL; -+ -+ keep: ; -+ } -+ -+ /* Finally, allocate space. */ -+ for (p = eh->dyn_relocs; p != NULL; p = p->next) -+ { -+ asection *sreloc = elf_section_data (p->sec)->sreloc; -+ sreloc->size += p->count * sizeof (Elf32_External_Rela); -+ } -+ -+ return TRUE; -+} -+ -+/* Find any dynamic relocs that apply to read-only sections. */ -+ -+static bfd_boolean -+readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf) -+{ -+ struct elf_or1k_link_hash_entry *eh; -+ struct elf_or1k_dyn_relocs *p; -+ -+ eh = (struct elf_or1k_link_hash_entry *) h; -+ for (p = eh->dyn_relocs; p != NULL; p = p->next) -+ { -+ asection *s = p->sec->output_section; -+ -+ if (s != NULL && (s->flags & SEC_READONLY) != 0) -+ { -+ struct bfd_link_info *info = (struct bfd_link_info *) inf; -+ -+ info->flags |= DF_TEXTREL; -+ -+ /* Not an error, just cut short the traversal. */ -+ return FALSE; -+ } -+ } -+ return TRUE; -+} -+ -+/* Set the sizes of the dynamic sections. */ -+ -+static bfd_boolean -+or1k_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, -+ struct bfd_link_info *info) -+{ -+ struct elf_or1k_link_hash_table *htab; -+ bfd *dynobj; -+ asection *s; -+ bfd_boolean relocs; -+ bfd *ibfd; -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ dynobj = htab->root.dynobj; -+ BFD_ASSERT (dynobj != NULL); -+ -+ if (htab->root.dynamic_sections_created) -+ { -+ /* Set the contents of the .interp section to the interpreter. */ -+ if (info->executable) -+ { -+ s = bfd_get_section_by_name (dynobj, ".interp"); -+ BFD_ASSERT (s != NULL); -+ s->size = sizeof ELF_DYNAMIC_INTERPRETER; -+ s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; -+ } -+ } -+ -+ /* Set up .got offsets for local syms, and space for local dynamic -+ relocs. */ -+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) -+ { -+ bfd_signed_vma *local_got; -+ bfd_signed_vma *end_local_got; -+ bfd_size_type locsymcount; -+ Elf_Internal_Shdr *symtab_hdr; -+ unsigned char *local_tls_type; -+ asection *srel; -+ -+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) -+ continue; -+ -+ for (s = ibfd->sections; s != NULL; s = s->next) -+ { -+ struct elf_or1k_dyn_relocs *p; -+ -+ for (p = ((struct elf_or1k_dyn_relocs *) -+ elf_section_data (s)->local_dynrel); -+ p != NULL; -+ p = p->next) -+ { -+ if (! bfd_is_abs_section (p->sec) -+ && bfd_is_abs_section (p->sec->output_section)) -+ { -+ /* Input section has been discarded, either because -+ it is a copy of a linkonce section or due to -+ linker script /DISCARD/, so we'll be discarding -+ the relocs too. */ -+ } -+ else if (p->count != 0) -+ { -+ srel = elf_section_data (p->sec)->sreloc; -+ srel->size += p->count * sizeof (Elf32_External_Rela); -+ if ((p->sec->output_section->flags & SEC_READONLY) != 0) -+ info->flags |= DF_TEXTREL; -+ } -+ } -+ } -+ -+ local_got = elf_local_got_refcounts (ibfd); -+ if (!local_got) -+ continue; -+ -+ symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; -+ locsymcount = symtab_hdr->sh_info; -+ end_local_got = local_got + locsymcount; -+ s = htab->sgot; -+ srel = htab->srelgot; -+ local_tls_type = (unsigned char *) elf_or1k_local_tls_type (ibfd); -+ for (; local_got < end_local_got; ++local_got) -+ { -+ if (*local_got > 0) -+ { -+ *local_got = s->size; -+ -+ /* TLS GD requires two GOT and two relocs. */ -+ if (local_tls_type != NULL && *local_tls_type == TLS_GD) -+ s->size += 8; -+ else -+ s->size += 4; -+ if (info->shared) -+ { -+ if (local_tls_type != NULL && *local_tls_type == TLS_GD) -+ srel->size += 2 * sizeof (Elf32_External_Rela); -+ else -+ srel->size += sizeof (Elf32_External_Rela); -+ } -+ } -+ else -+ -+ *local_got = (bfd_vma) -1; -+ -+ if (local_tls_type) -+ ++local_tls_type; -+ } -+ } -+ -+ /* Allocate global sym .plt and .got entries, and space for global -+ sym dynamic relocs. */ -+ elf_link_hash_traverse (&htab->root, allocate_dynrelocs, info); -+ -+ /* We now have determined the sizes of the various dynamic sections. -+ Allocate memory for them. */ -+ relocs = FALSE; -+ for (s = dynobj->sections; s != NULL; s = s->next) -+ { -+ if ((s->flags & SEC_LINKER_CREATED) == 0) -+ continue; -+ -+ if (s == htab->splt -+ || s == htab->sgot -+ || s == htab->sgotplt -+ || s == htab->sdynbss) -+ { -+ /* Strip this section if we don't need it; see the -+ comment below. */ -+ } -+ else if (CONST_STRNEQ (bfd_get_section_name (dynobj, s), ".rela")) -+ { -+ if (s->size != 0 && s != htab->srelplt) -+ relocs = TRUE; -+ -+ /* We use the reloc_count field as a counter if we need -+ to copy relocs into the output file. */ -+ s->reloc_count = 0; -+ } -+ else -+ /* It's not one of our sections, so don't allocate space. */ -+ continue; -+ -+ if (s->size == 0) -+ { -+ /* If we don't need this section, strip it from the -+ output file. This is mostly to handle .rela.bss and -+ .rela.plt. We must create both sections in -+ create_dynamic_sections, because they must be created -+ before the linker maps input sections to output -+ sections. The linker does that before -+ adjust_dynamic_symbol is called, and it is that -+ function which decides whether anything needs to go -+ into these sections. */ -+ s->flags |= SEC_EXCLUDE; -+ continue; -+ } -+ -+ if ((s->flags & SEC_HAS_CONTENTS) == 0) -+ continue; -+ -+ /* Allocate memory for the section contents. We use bfd_zalloc -+ here in case unused entries are not reclaimed before the -+ section's contents are written out. This should not happen, -+ but this way if it does, we get a R_OR1K_NONE reloc instead -+ of garbage. */ -+ s->contents = bfd_zalloc (dynobj, s->size); -+ -+ if (s->contents == NULL) -+ return FALSE; -+ } -+ -+ if (htab->root.dynamic_sections_created) -+ { -+ /* Add some entries to the .dynamic section. We fill in the -+ values later, in or1k_elf_finish_dynamic_sections, but we -+ must add the entries now so that we get the correct size for -+ the .dynamic section. The DT_DEBUG entry is filled in by the -+ dynamic linker and used by the debugger. */ -+#define add_dynamic_entry(TAG, VAL) \ -+ _bfd_elf_add_dynamic_entry (info, TAG, VAL) -+ -+ if (info->executable) -+ { -+ if (! add_dynamic_entry (DT_DEBUG, 0)) -+ return FALSE; -+ } -+ -+ if (htab->splt->size != 0) -+ { -+ if (! add_dynamic_entry (DT_PLTGOT, 0) -+ || ! add_dynamic_entry (DT_PLTRELSZ, 0) -+ || ! add_dynamic_entry (DT_PLTREL, DT_RELA) -+ || ! add_dynamic_entry (DT_JMPREL, 0)) -+ return FALSE; -+ } -+ -+ if (relocs) -+ { -+ if (! add_dynamic_entry (DT_RELA, 0) -+ || ! add_dynamic_entry (DT_RELASZ, 0) -+ || ! add_dynamic_entry (DT_RELAENT, -+ sizeof (Elf32_External_Rela))) -+ return FALSE; -+ -+ /* If any dynamic relocs apply to a read-only section, -+ then we need a DT_TEXTREL entry. */ -+ if ((info->flags & DF_TEXTREL) == 0) -+ elf_link_hash_traverse (&htab->root, readonly_dynrelocs, -+ info); -+ -+ if ((info->flags & DF_TEXTREL) != 0) -+ { -+ if (! add_dynamic_entry (DT_TEXTREL, 0)) -+ return FALSE; -+ } -+ } -+ } -+ -+#undef add_dynamic_entry -+ return TRUE; -+} -+ -+/* Create dynamic sections when linking against a dynamic object. */ -+ -+static bfd_boolean -+or1k_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) -+{ -+ struct elf_or1k_link_hash_table *htab; -+ -+ htab = or1k_elf_hash_table (info); -+ if (htab == NULL) -+ return FALSE; -+ -+ if (!htab->sgot && !create_got_section (dynobj, info)) -+ return FALSE; -+ -+ if (!_bfd_elf_create_dynamic_sections (dynobj, info)) -+ return FALSE; -+ -+ htab->splt = bfd_get_section_by_name (dynobj, ".plt"); -+ htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); -+ htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); -+ if (!info->shared) -+ htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); -+ -+ if (!htab->splt || !htab->srelplt || !htab->sdynbss -+ || (!info->shared && !htab->srelbss)) -+ abort (); -+ -+ return TRUE; -+} -+ -+/* Copy the extra info we tack onto an elf_link_hash_entry. */ -+ -+static void -+or1k_elf_copy_indirect_symbol (struct bfd_link_info *info, -+ struct elf_link_hash_entry *dir, -+ struct elf_link_hash_entry *ind) -+{ -+ struct elf_or1k_link_hash_entry * edir; -+ struct elf_or1k_link_hash_entry * eind; -+ -+ edir = (struct elf_or1k_link_hash_entry *) dir; -+ eind = (struct elf_or1k_link_hash_entry *) ind; -+ -+ if (eind->dyn_relocs != NULL) -+ { -+ if (edir->dyn_relocs != NULL) -+ { -+ struct elf_or1k_dyn_relocs **pp; -+ struct elf_or1k_dyn_relocs *p; -+ -+ /* Add reloc counts against the indirect sym to the direct sym -+ list. Merge any entries against the same section. */ -+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;) -+ { -+ struct elf_or1k_dyn_relocs *q; -+ -+ for (q = edir->dyn_relocs; q != NULL; q = q->next) -+ if (q->sec == p->sec) -+ { -+ q->pc_count += p->pc_count; -+ q->count += p->count; -+ *pp = p->next; -+ break; -+ } -+ if (q == NULL) -+ pp = &p->next; -+ } -+ *pp = edir->dyn_relocs; -+ } -+ -+ edir->dyn_relocs = eind->dyn_relocs; -+ eind->dyn_relocs = NULL; -+ } -+ -+ if (ind->root.type == bfd_link_hash_indirect) -+ { -+ if (dir->got.refcount <= 0) -+ { -+ edir->tls_type = eind->tls_type; -+ eind->tls_type = TLS_UNKNOWN; -+ } -+ } -+ -+ _bfd_elf_link_hash_copy_indirect (info, dir, ind); -+} -+ -+/* Set the right machine number. */ -+ -+static bfd_boolean -+or1k_elf_object_p (bfd *abfd) -+{ -+ unsigned long mach = bfd_mach_or1k; -+ -+ if (elf_elfheader (abfd)->e_flags & EF_OR1K_NODELAY) -+ mach = bfd_mach_or1knd; -+ -+ return bfd_default_set_arch_mach (abfd, bfd_arch_or1k, mach); -+} -+ -+/* Store the machine number in the flags field. */ -+ -+static void -+or1k_elf_final_write_processing (bfd *abfd, -+ bfd_boolean linker ATTRIBUTE_UNUSED) -+{ -+ switch (bfd_get_mach (abfd)) -+ { -+ default: -+ case bfd_mach_or1k: -+ break; -+ case bfd_mach_or1knd: -+ elf_elfheader (abfd)->e_flags |= EF_OR1K_NODELAY; -+ break; -+ } -+} -+ -+static bfd_boolean -+or1k_elf_set_private_flags (bfd *abfd, flagword flags) -+{ -+ BFD_ASSERT (!elf_flags_init (abfd) -+ || elf_elfheader (abfd)->e_flags == flags); -+ -+ elf_elfheader (abfd)->e_flags = flags; -+ elf_flags_init (abfd) = TRUE; -+ return TRUE; -+} -+ -+/* Make sure all input files are consistent with respect to -+ EF_OR1K_NODELAY flag setting. */ -+ -+static bfd_boolean -+elf32_or1k_merge_private_bfd_data (bfd *ibfd, bfd *obfd) -+{ -+ flagword out_flags; -+ flagword in_flags; -+ -+ in_flags = elf_elfheader (ibfd)->e_flags; -+ out_flags = elf_elfheader (obfd)->e_flags; -+ -+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour -+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour) -+ return TRUE; -+ -+ if (!elf_flags_init (obfd)) -+ { -+ elf_flags_init (obfd) = TRUE; -+ elf_elfheader (obfd)->e_flags = in_flags; -+ -+ return TRUE; -+ } -+ -+ if (in_flags == out_flags) -+ return TRUE; -+ -+ if ((in_flags & EF_OR1K_NODELAY) != (out_flags & EF_OR1K_NODELAY)) -+ { -+ (*_bfd_error_handler) -+ (_("%B: EF_OR1K_NODELAY flag mismatch with previous modules"), ibfd); -+ -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+ } -+ -+ return TRUE; -+ -+} -+ -+#define ELF_ARCH bfd_arch_or1k -+#define ELF_MACHINE_CODE EM_OR1K -+#define ELF_TARGET_ID OR1K_ELF_DATA -+#define ELF_MAXPAGESIZE 0x2000 -+ -+#define TARGET_BIG_SYM bfd_elf32_or1k_big_vec -+#define TARGET_BIG_NAME "elf32-or1k" -+ -+#define elf_info_to_howto_rel NULL -+#define elf_info_to_howto or1k_info_to_howto_rela -+#define elf_backend_relocate_section or1k_elf_relocate_section -+#define elf_backend_gc_mark_hook or1k_elf_gc_mark_hook -+#define elf_backend_gc_sweep_hook or1k_elf_gc_sweep_hook -+#define elf_backend_check_relocs or1k_elf_check_relocs -+#define elf_backend_reloc_type_class or1k_elf_reloc_type_class -+#define elf_backend_can_gc_sections 1 -+#define elf_backend_rela_normal 1 -+ -+#define bfd_elf32_mkobject elf_or1k_mkobject -+ -+#define bfd_elf32_bfd_merge_private_bfd_data elf32_or1k_merge_private_bfd_data -+#define bfd_elf32_bfd_set_private_flags or1k_elf_set_private_flags -+#define bfd_elf32_bfd_reloc_type_lookup or1k_reloc_type_lookup -+#define bfd_elf32_bfd_reloc_name_lookup or1k_reloc_name_lookup -+ -+#define elf_backend_object_p or1k_elf_object_p -+#define elf_backend_final_write_processing or1k_elf_final_write_processing -+#define elf_backend_can_refcount 1 -+ -+#define elf_backend_plt_readonly 1 -+#define elf_backend_want_got_plt 1 -+#define elf_backend_want_plt_sym 0 -+#define elf_backend_got_header_size 12 -+#define bfd_elf32_bfd_link_hash_table_create or1k_elf_link_hash_table_create -+#define elf_backend_copy_indirect_symbol or1k_elf_copy_indirect_symbol -+#define elf_backend_create_dynamic_sections or1k_elf_create_dynamic_sections -+#define elf_backend_finish_dynamic_sections or1k_elf_finish_dynamic_sections -+#define elf_backend_size_dynamic_sections or1k_elf_size_dynamic_sections -+#define elf_backend_adjust_dynamic_symbol or1k_elf_adjust_dynamic_symbol -+#define elf_backend_finish_dynamic_symbol or1k_elf_finish_dynamic_symbol -+ -+#include "elf32-target.h" -diff -rNU3 dist.orig/bfd/elf32-or32.c dist/bfd/elf32-or32.c ---- dist.orig/bfd/elf32-or32.c 2007-07-03 16:26:41.000000000 +0200 -+++ dist/bfd/elf32-or32.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,514 +0,0 @@ --/* OR32-specific support for 32-bit ELF -- Copyright 2002, 2004, 2005, 2007 Free Software Foundation, Inc. -- Contributed by Ivan Guzvinec -- -- This file is part of BFD, the Binary File Descriptor library. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#include "sysdep.h" --#include "bfd.h" --#include "libbfd.h" --#include "elf-bfd.h" --#include "elf/or32.h" --#include "libiberty.h" -- --/* Try to minimize the amount of space occupied by relocation tables -- on the ROM (not that the ROM won't be swamped by other ELF overhead). */ --#define USE_REL 1 -- --/* Set the right machine number for an OR32 ELF file. */ -- --static bfd_boolean --or32_elf_object_p (bfd *abfd) --{ -- (void) bfd_default_set_arch_mach (abfd, bfd_arch_or32, 0); -- return TRUE; --} -- --/* The final processing done just before writing out an OR32 ELF object file. -- This gets the OR32 architecture right based on the machine number. */ -- --static void --or32_elf_final_write_processing (bfd *abfd, -- bfd_boolean linker ATTRIBUTE_UNUSED) --{ -- elf_elfheader (abfd)->e_flags &=~ EF_OR32_MACH; --} -- --static bfd_reloc_status_type --or32_elf_32_reloc (bfd *abfd, -- arelent *reloc_entry, -- asymbol *symbol, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message ATTRIBUTE_UNUSED) --{ -- if (output_bfd != NULL) -- { -- unsigned long insn; -- bfd_size_type addr = reloc_entry->address; -- -- reloc_entry->address += input_section->output_offset; -- -- insn = bfd_get_32 (abfd, (bfd_byte *) data + addr); -- insn += symbol->section->output_section->vma; -- insn += symbol->section->output_offset; -- insn += symbol->value; -- bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); -- -- return bfd_reloc_ok; -- } -- -- return bfd_reloc_continue; --} -- --static bfd_reloc_status_type --or32_elf_16_reloc (bfd *abfd, -- arelent *reloc_entry, -- asymbol *symbol, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message ATTRIBUTE_UNUSED) --{ -- if (output_bfd != NULL) -- { -- unsigned short insn; -- bfd_size_type addr = reloc_entry->address; -- -- reloc_entry->address += input_section->output_offset; -- -- insn = bfd_get_16 (abfd, (bfd_byte *) data + addr); -- insn += symbol->section->output_section->vma; -- insn += symbol->section->output_offset; -- insn += symbol->value; -- bfd_put_16 (abfd, insn, (bfd_byte *) data + addr); -- -- return bfd_reloc_ok; -- } -- -- return bfd_reloc_continue; --} -- --static bfd_reloc_status_type --or32_elf_8_reloc (bfd *abfd ATTRIBUTE_UNUSED, -- arelent *reloc_entry, -- asymbol *symbol, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message ATTRIBUTE_UNUSED) --{ -- if (output_bfd != NULL) -- { -- unsigned char insn; -- bfd_size_type addr = reloc_entry->address; -- -- reloc_entry->address += input_section->output_offset; -- -- insn = bfd_get_8 (abfd, (bfd_byte *) data + addr); -- insn += symbol->section->output_section->vma; -- insn += symbol->section->output_offset; -- insn += symbol->value; -- bfd_put_8 (abfd, insn, (bfd_byte *) data + addr); -- -- return bfd_reloc_ok; -- } -- -- return bfd_reloc_continue; --} -- --/* Do a R_OR32_CONSTH relocation. This has to be done in combination -- with a R_OR32_CONST reloc, because there is a carry from the LO16 to -- the HI16. Here we just save the information we need; we do the -- actual relocation when we see the LO16. OR32 ELF requires that the -- LO16 immediately follow the HI16. As a GNU extension, we permit an -- arbitrary number of HI16 relocs to be associated with a single LO16 -- reloc. This extension permits gcc to output the HI and LO relocs -- itself. This code is copied from the elf32-mips.c. */ -- --struct or32_consth --{ -- struct or32_consth *next; -- bfd_byte *addr; -- bfd_vma addend; --}; -- --/* FIXME: This should not be a static variable. */ -- --static struct or32_consth *or32_consth_list; -- --static bfd_reloc_status_type --or32_elf_consth_reloc (bfd *abfd ATTRIBUTE_UNUSED, -- arelent *reloc_entry, -- asymbol *symbol, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message ATTRIBUTE_UNUSED) --{ -- bfd_reloc_status_type ret; -- bfd_vma relocation; -- struct or32_consth *n; -- -- ret = bfd_reloc_ok; -- -- if (bfd_is_und_section (symbol->section) -- && output_bfd == NULL) -- ret = bfd_reloc_undefined; -- -- if (bfd_is_com_section (symbol->section)) -- relocation = 0; -- else -- relocation = symbol->value; -- -- relocation += symbol->section->output_section->vma; -- relocation += symbol->section->output_offset; -- relocation += reloc_entry->addend; -- -- if (reloc_entry->address > bfd_get_section_limit (abfd, input_section)) -- return bfd_reloc_outofrange; -- -- /* Save the information, and let LO16 do the actual relocation. */ -- n = bfd_malloc (sizeof *n); -- if (n == NULL) -- return bfd_reloc_outofrange; -- n->addr = (bfd_byte *) data + reloc_entry->address; -- n->addend = relocation; -- n->next = or32_consth_list; -- or32_consth_list = n; -- -- if (output_bfd != NULL) -- reloc_entry->address += input_section->output_offset; -- -- return ret; --} -- --/* Do a R_OR32_CONST relocation. This is a straightforward 16 bit -- inplace relocation; this function exists in order to do the -- R_OR32_CONSTH relocation described above. */ -- --static bfd_reloc_status_type --or32_elf_const_reloc (bfd *abfd, -- arelent *reloc_entry, -- asymbol *symbol, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message) --{ -- if (or32_consth_list != NULL) -- { -- struct or32_consth *l; -- -- l = or32_consth_list; -- while (l != NULL) -- { -- unsigned long insn; -- unsigned long val; -- unsigned long vallo; -- struct or32_consth *next; -- -- /* Do the HI16 relocation. Note that we actually don't need -- to know anything about the LO16 itself, except where to -- find the low 16 bits of the addend needed by the LO16. */ -- insn = bfd_get_32 (abfd, l->addr); -- vallo = (bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address) -- & 0xffff); -- val = ((insn & 0xffff) << 16) + vallo; -- val += l->addend; -- -- insn = (insn &~ 0xffff) | ((val >> 16) & 0xffff); -- bfd_put_32 (abfd, insn, l->addr); -- -- next = l->next; -- free (l); -- l = next; -- } -- -- or32_consth_list = NULL; -- } -- -- if (output_bfd != NULL) -- { -- unsigned long insn, tmp; -- bfd_size_type addr = reloc_entry->address; -- -- reloc_entry->address += input_section->output_offset; -- -- insn = bfd_get_32 (abfd, (bfd_byte *) data + addr); -- tmp = insn & 0x0000ffff; -- tmp += symbol->section->output_section->vma; -- tmp += symbol->section->output_offset; -- tmp += symbol->value; -- insn = (insn & 0xffff0000) | (tmp & 0x0000ffff); -- bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); -- -- return bfd_reloc_ok; -- } -- -- /* Now do the LO16 reloc in the usual way. */ -- return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, -- input_section, output_bfd, error_message); --} -- --static bfd_reloc_status_type --or32_elf_jumptarg_reloc (bfd *abfd, -- arelent *reloc_entry, -- asymbol *symbol ATTRIBUTE_UNUSED, -- void * data, -- asection *input_section, -- bfd *output_bfd, -- char **error_message ATTRIBUTE_UNUSED) --{ -- if (output_bfd != NULL) -- { -- unsigned long insn, tmp; -- bfd_size_type addr = reloc_entry->address; -- -- reloc_entry->address += input_section->output_offset; -- -- insn = bfd_get_32 (abfd, (bfd_byte *) data + addr); -- tmp = insn | 0xfc000000; -- tmp -= (input_section->output_offset >> 2); -- insn = (insn & 0xfc000000) | (tmp & 0x03ffffff); -- bfd_put_32 (abfd, insn, (bfd_byte *) data + addr); -- -- return bfd_reloc_ok; -- } -- -- return bfd_reloc_continue; --} -- --static reloc_howto_type elf_or32_howto_table[] = --{ -- /* This reloc does nothing. */ -- HOWTO (R_OR32_NONE, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 32, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- bfd_elf_generic_reloc, /* special_function */ -- "R_OR32_NONE", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A standard 32 bit relocation. */ -- HOWTO (R_OR32_32, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 32, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- or32_elf_32_reloc, /* special_function */ -- "R_OR32_32", /* name */ -- FALSE, /* partial_inplace */ -- 0xffffffff, /* src_mask */ -- 0xffffffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A standard 16 bit relocation. */ -- HOWTO (R_OR32_16, /* type */ -- 0, /* rightshift */ -- 1, /* size (0 = byte, 1 = short, 2 = long) */ -- 16, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- or32_elf_16_reloc, /* special_function */ -- "R_OR32_16", /* name */ -- FALSE, /* partial_inplace */ -- 0x0000ffff, /* src_mask */ -- 0x0000ffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A standard 8 bit relocation. */ -- HOWTO (R_OR32_8, /* type */ -- 0, /* rightshift */ -- 0, /* size (0 = byte, 1 = short, 2 = long) */ -- 8, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_bitfield, /* complain_on_overflow */ -- or32_elf_8_reloc, /* special_function */ -- "R_OR32_8", /* name */ -- FALSE, /* partial_inplace */ -- 0x000000ff, /* src_mask */ -- 0x000000ff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A standard low 16 bit relocation. */ -- HOWTO (R_OR32_CONST, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 16, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- or32_elf_const_reloc, /* special_function */ -- "R_OR32_CONST", /* name */ -- FALSE, /* partial_inplace */ -- 0x0000ffff, /* src_mask */ -- 0x0000ffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A standard high 16 bit relocation. */ -- HOWTO (R_OR32_CONSTH, /* type */ -- 16, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 16, /* bitsize */ -- TRUE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- or32_elf_consth_reloc, /* special_function */ -- "R_OR32_CONSTH", /* name */ -- FALSE, /* partial_inplace */ -- 0xffff0000, /* src_mask */ -- 0x0000ffff, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* A standard branch relocation. */ -- HOWTO (R_OR32_JUMPTARG, /* type */ -- 2, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 28, /* bitsize */ -- TRUE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_signed, /* complain_on_overflow */ -- or32_elf_jumptarg_reloc,/* special_function */ -- "R_OR32_JUMPTARG", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0x03ffffff, /* dst_mask */ -- TRUE), /* pcrel_offset */ -- -- /* GNU extension to record C++ vtable hierarchy. */ -- HOWTO (R_OR32_GNU_VTINHERIT, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 0, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- NULL, /* special_function */ -- "R_OR32_GNU_VTINHERIT", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0, /* dst_mask */ -- FALSE), /* pcrel_offset */ -- -- /* GNU extension to record C++ vtable member usage. */ -- HOWTO (R_OR32_GNU_VTENTRY, /* type */ -- 0, /* rightshift */ -- 2, /* size (0 = byte, 1 = short, 2 = long) */ -- 0, /* bitsize */ -- FALSE, /* pc_relative */ -- 0, /* bitpos */ -- complain_overflow_dont, /* complain_on_overflow */ -- _bfd_elf_rel_vtable_reloc_fn, /* special_function */ -- "R_OR32_GNU_VTENTRY", /* name */ -- FALSE, /* partial_inplace */ -- 0, /* src_mask */ -- 0, /* dst_mask */ -- FALSE), /* pcrel_offset */ --}; -- --/* Map BFD reloc types to OR32 ELF reloc types. */ -- --struct or32_reloc_map --{ -- bfd_reloc_code_real_type bfd_reloc_val; -- unsigned char elf_reloc_val; --}; -- --static const struct or32_reloc_map or32_reloc_map[] = --{ -- { BFD_RELOC_NONE, R_OR32_NONE }, -- { BFD_RELOC_32, R_OR32_32 }, -- { BFD_RELOC_16, R_OR32_16 }, -- { BFD_RELOC_8, R_OR32_8 }, -- { BFD_RELOC_LO16, R_OR32_CONST }, -- { BFD_RELOC_HI16, R_OR32_CONSTH }, -- { BFD_RELOC_32_GOT_PCREL, R_OR32_JUMPTARG }, -- { BFD_RELOC_VTABLE_INHERIT, R_OR32_GNU_VTINHERIT }, -- { BFD_RELOC_VTABLE_ENTRY, R_OR32_GNU_VTENTRY }, --}; -- --static reloc_howto_type * --bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, -- bfd_reloc_code_real_type code) --{ -- unsigned int i; -- -- for (i = ARRAY_SIZE (or32_reloc_map); i--;) -- if (or32_reloc_map[i].bfd_reloc_val == code) -- return &elf_or32_howto_table[or32_reloc_map[i].elf_reloc_val]; -- -- return NULL; --} -- --static reloc_howto_type * --bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, -- const char *r_name) --{ -- unsigned int i; -- -- for (i = 0; -- i < sizeof (elf_or32_howto_table) / sizeof (elf_or32_howto_table[0]); -- i++) -- if (elf_or32_howto_table[i].name != NULL -- && strcasecmp (elf_or32_howto_table[i].name, r_name) == 0) -- return &elf_or32_howto_table[i]; -- -- return NULL; --} -- --/* Set the howto pointer for an OR32 ELF reloc. */ -- --static void --or32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, -- arelent *cache_ptr, -- Elf_Internal_Rela *dst) --{ -- unsigned int r_type; -- -- r_type = ELF32_R_TYPE (dst->r_info); -- BFD_ASSERT (r_type < (unsigned int) R_OR32_max); -- cache_ptr->howto = &elf_or32_howto_table[r_type]; --} -- --#define TARGET_LITTLE_SYM bfd_elf32_or32_little_vec --#define TARGET_LITTLE_NAME "elf32-littleor32" --#define TARGET_BIG_SYM bfd_elf32_or32_big_vec --#define TARGET_BIG_NAME "elf32-or32" --#define ELF_ARCH bfd_arch_or32 --#define ELF_MACHINE_CODE EM_OR32 --#define ELF_MAXPAGESIZE 0x1000 -- --#define elf_info_to_howto 0 --#define elf_info_to_howto_rel or32_info_to_howto_rel --#define elf_backend_object_p or32_elf_object_p --#define elf_backend_final_write_processing \ -- or32_elf_final_write_processing -- --#include "elf32-target.h" -diff -rNU3 dist.orig/bfd/elf32-ppc.c dist/bfd/elf32-ppc.c ---- dist.orig/bfd/elf32-ppc.c 2013-03-25 09:06:19.000000000 +0100 -+++ dist/bfd/elf32-ppc.c 2015-10-18 13:11:12.000000000 +0200 -@@ -3898,7 +3898,7 @@ - sec->has_tls_get_addr_call = 1; - } - -- switch (r_type) -+ switch ((int)r_type) - { - case R_PPC_TLSGD: - case R_PPC_TLSLD: -@@ -7766,7 +7766,7 @@ - howto = NULL; - if (r_type < R_PPC_max) - howto = ppc_elf_howto_table[r_type]; -- switch (r_type) -+ switch ((int)r_type) - { - default: - info->callbacks->einfo -diff -rNU3 dist.orig/bfd/elf32-sh.c dist/bfd/elf32-sh.c ---- dist.orig/bfd/elf32-sh.c 2013-03-25 09:06:20.000000000 +0100 -+++ dist/bfd/elf32-sh.c 2015-10-18 13:11:12.000000000 +0200 -@@ -2808,6 +2808,7 @@ - /* Make sure we know what is going on here. */ - BFD_ASSERT (htab->root.dynobj != NULL - && (h->needs_plt -+ || h->type == STT_GNU_IFUNC - || h->u.weakdef != NULL - || (h->def_dynamic - && h->ref_regular -@@ -2816,7 +2817,7 @@ - /* If this is a function, put it in the procedure linkage table. We - will fill in the contents of the procedure linkage table later, - when we know the address of the .got section. */ -- if (h->type == STT_FUNC -+ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) - || h->needs_plt) - { - if (h->plt.refcount <= 0 -@@ -3285,6 +3286,10 @@ - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; - -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ h->root.root.string); - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ -diff -rNU3 dist.orig/bfd/elf32-vax.c dist/bfd/elf32-vax.c ---- dist.orig/bfd/elf32-vax.c 2012-09-04 15:32:53.000000000 +0200 -+++ dist/bfd/elf32-vax.c 2015-10-18 13:11:13.000000000 +0200 -@@ -490,6 +490,24 @@ - return TRUE; - } - -+/* Copy vax-specific data from one module to another */ -+static bfd_boolean -+elf32_vax_copy_private_bfd_data (bfd *ibfd, bfd *obfd) -+{ -+ flagword in_flags; -+ -+ if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour -+ || bfd_get_flavour (obfd) != bfd_target_elf_flavour) -+ return TRUE; -+ -+ in_flags = elf_elfheader (ibfd)->e_flags; -+ -+ elf_elfheader (obfd)->e_flags = in_flags; -+ elf_flags_init (obfd) = TRUE; -+ -+ return TRUE; -+} -+ - /* Merge backend specific data from an object file to the output - object file when linking. */ - static bfd_boolean -@@ -752,7 +770,13 @@ - return FALSE; - - if (sec->flags & SEC_READONLY) -- info->flags |= DF_TEXTREL; -+ { -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ sec->name); -+ info->flags |= DF_TEXTREL; -+ } - } - - sreloc->size += sizeof (Elf32_External_Rela); -@@ -922,6 +946,7 @@ - /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL - && (h->needs_plt -+ || h->type == STT_GNU_IFUNC - || h->u.weakdef != NULL - || (h->def_dynamic - && h->ref_regular -@@ -930,7 +955,7 @@ - /* If this is a function, put it in the procedure linkage table. We - will fill in the contents of the procedure linkage table later, - when we know the address of the .got section. */ -- if (h->type == STT_FUNC -+ if ((h->type == STT_FUNC || h->type == STT_GNU_IFUNC) - || h->needs_plt) - { - if (h->plt.refcount <= 0 -@@ -1186,7 +1211,12 @@ - continue; - - /* Allocate memory for the section contents. */ -- s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size); -+ /* FIXME: This should be a call to bfd_alloc not bfd_zalloc. -+ Unused entries should be reclaimed before the section's contents -+ are written out, but at the moment this does not happen. Thus in -+ order to prevent writing out garbage, we initialise the section's -+ contents to zero. */ -+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); - if (s->contents == NULL) - return FALSE; - } -@@ -1285,6 +1315,7 @@ - - if (!elf_hash_table (info)->dynamic_sections_created - || (info->shared && info->symbolic) -+ || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT - || h->forced_local) - { - h->got.refcount = 0; -@@ -1305,9 +1336,7 @@ - - dyn = elf_hash_table (info)->dynamic_sections_created; - /* Allocate space in the .got and .rela.got sections. */ -- if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -- && (info->shared -- || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) -+ if (info->shared || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) - { - sgot->size += 4; - srelgot->size += sizeof (Elf32_External_Rela); -@@ -1631,9 +1660,9 @@ - { - relocate = TRUE; - outrel.r_info = ELF32_R_INFO (0, R_VAX_RELATIVE); -- BFD_ASSERT (bfd_get_signed_32 (input_bfd, -- &contents[rel->r_offset]) == 0); -- outrel.r_addend = relocation + rel->r_addend; -+ outrel.r_addend = bfd_get_signed_32(input_bfd, -+ &contents[rel->r_offset]) -+ + relocation + rel->r_addend; - } - else - { -@@ -1672,6 +1701,9 @@ - } - } - -+ if (input_section->flags & SEC_CODE) -+ info->flags |= DF_TEXTREL; -+ - if ((input_section->flags & SEC_CODE) != 0 - || (ELF32_R_TYPE (outrel.r_info) != R_VAX_32 - && ELF32_R_TYPE (outrel.r_info) != R_VAX_RELATIVE -@@ -2051,12 +2083,15 @@ - #define TARGET_LITTLE_SYM bfd_elf32_vax_vec - #define TARGET_LITTLE_NAME "elf32-vax" - #define ELF_MACHINE_CODE EM_VAX --#define ELF_MAXPAGESIZE 0x1000 -+#define ELF_MAXPAGESIZE 0x10000 - - #define elf_backend_create_dynamic_sections \ - _bfd_elf_create_dynamic_sections - #define bfd_elf32_bfd_link_hash_table_create \ - elf_vax_link_hash_table_create -+#define bfd_elf32_bfd_copy_private_bfd_data \ -+ elf32_vax_copy_private_bfd_data -+ - #define bfd_elf32_bfd_final_link bfd_elf_gc_common_final_link - - #define elf_backend_check_relocs elf_vax_check_relocs -diff -rNU3 dist.orig/bfd/elf64-alpha.c dist/bfd/elf64-alpha.c ---- dist.orig/bfd/elf64-alpha.c 2012-07-24 23:06:58.000000000 +0200 -+++ dist/bfd/elf64-alpha.c 2015-10-18 13:11:13.000000000 +0200 -@@ -100,6 +100,11 @@ - #define PLT_ENTRY_SIZE \ - (elf64_alpha_use_secureplt ? NEW_PLT_ENTRY_SIZE : OLD_PLT_ENTRY_SIZE) - -+/* ld --traditional-format uses this older format instead. */ -+#define OLD_PLT_ENTRY_WORD1 0x279f0000 /* ldah $28, 0($31) */ -+#define OLD_PLT_ENTRY_WORD2 0x239c0000 /* lda $28, 0($28) */ -+#define OLD_PLT_ENTRY_WORD3 0xc3e00000 /* br $31, plt0 */ -+ - #define MAX_GOT_SIZE (64*1024) - - #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so" -@@ -4821,6 +4826,32 @@ - plt_index = ((gotent->plt_offset - NEW_PLT_HEADER_SIZE) - / NEW_PLT_ENTRY_SIZE); - } -+ else if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) -+ { -+ long hi, lo; -+ -+ /* decompose the reloc offset for the plt for ldah+lda */ -+ hi = plt_index * sizeof(Elf64_External_Rela); -+ lo = ((hi & 0xffff) ^ 0x8000) - 0x8000; -+ hi = (hi - lo) >> 16; -+ -+ insn = INSN_ABO (INSN_LDAH, 28, 31, hi); -+ bfd_put_32 (output_bfd, insn, -+ splt->contents + gotent->plt_offset); -+ -+ insn = INSN_ABO (INSN_LDA, 28, 28, lo); -+ bfd_put_32 (output_bfd, insn, -+ splt->contents + gotent->plt_offset + 4); -+ -+ disp = -(gotent->plt_offset + 12); -+ insn = INSN_AD (INSN_BR, 31, disp); -+ -+ bfd_put_32 (output_bfd, insn, -+ splt->contents + gotent->plt_offset + 8); -+ -+ plt_index = ((gotent->plt_offset - OLD_PLT_HEADER_SIZE) -+ / OLD_PLT_ENTRY_SIZE); -+ } - else - { - disp = -(gotent->plt_offset + 4); -diff -rNU3 dist.orig/bfd/elf64-mips.c dist/bfd/elf64-mips.c ---- dist.orig/bfd/elf64-mips.c 2012-09-04 16:13:07.000000000 +0200 -+++ dist/bfd/elf64-mips.c 2015-10-18 13:11:13.000000000 +0200 -@@ -123,6 +123,8 @@ - (bfd *, asymbol *, bfd_boolean, char **, bfd_vma *); - static bfd_boolean mips_elf64_object_p - (bfd *); -+static bfd_boolean mips_elf64_is_local_label_name -+ (bfd *, const char *); - static irix_compat_t elf64_mips_irix_compat - (bfd *); - static bfd_boolean elf64_mips_grok_prstatus -@@ -3917,7 +3919,18 @@ - bfd_default_set_arch_mach (abfd, bfd_arch_mips, mach); - return TRUE; - } -+ -+/* MIPS ELF local labels start with "$L". */ -+static bfd_boolean -+mips_elf64_is_local_label_name (bfd *abfd, const char *name) -+{ -+ if (name[0] == '$' && name[1] == 'L') -+ return TRUE; - -+ /* We accept the generic ELF local label syntax as well. */ -+ return _bfd_elf_is_local_label_name (abfd, name); -+} -+ - /* Depending on the target vector we generate some version of Irix - executables or "normal" MIPS ELF ABI executables. */ - static irix_compat_t -@@ -4141,9 +4154,8 @@ - - #define elf_backend_write_section _bfd_mips_elf_write_section - --/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit -- MIPS-specific function only applies to IRIX5, which had no 64-bit -- ABI. */ -+#define bfd_elf64_bfd_is_local_label_name \ -+ mips_elf64_is_local_label_name - #define bfd_elf64_bfd_is_target_special_symbol \ - _bfd_mips_elf_is_target_special_symbol - #define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line -diff -rNU3 dist.orig/bfd/elf64-ppc.c dist/bfd/elf64-ppc.c ---- dist.orig/bfd/elf64-ppc.c 2013-03-25 09:06:20.000000000 +0100 -+++ dist/bfd/elf64-ppc.c 2015-10-18 13:11:13.000000000 +0200 -@@ -3618,9 +3618,6 @@ - struct ppc_link_hash_entry *h; - struct plt_entry *plt_ent; - -- /* And the reloc addend that this was derived from. */ -- bfd_vma addend; -- - /* Where this stub is being called from, or, in the case of combined - stub sections, the first input section in the group. */ - asection *id_sec; -@@ -9112,6 +9109,10 @@ - { - struct bfd_link_info *info = inf; - -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ h->root.root.string); - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ -@@ -9192,7 +9193,13 @@ - srel = htab->reliplt; - srel->size += p->count * sizeof (Elf64_External_Rela); - if ((p->sec->output_section->flags & SEC_READONLY) != 0) -- info->flags |= DF_TEXTREL; -+ { -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ p->sec->output_section->name); -+ info->flags |= DF_TEXTREL; -+ } - } - } - } -@@ -11659,7 +11666,6 @@ - } - stub_entry->h = hash; - stub_entry->plt_ent = plt_ent; -- stub_entry->addend = irela->r_addend; - - if (stub_entry->h != NULL) - htab->stub_globals += 1; -@@ -12900,60 +12906,96 @@ - { - bfd_boolean can_plt_call = FALSE; - -+ /* All of these stubs will modify r2, so there must be a -+ branch and link followed by a nop. The nop is -+ replaced by an insn to restore r2. */ - if (rel->r_offset + 8 <= input_section->size) - { -- unsigned long nop; -- nop = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); -- if (nop == NOP -- || nop == CROR_151515 || nop == CROR_313131) -- { -- if (h != NULL -- && (h == htab->tls_get_addr_fd -- || h == htab->tls_get_addr) -- && !htab->no_tls_get_addr_opt) -+ unsigned long br; -+ -+ br = bfd_get_32 (input_bfd, -+ contents + rel->r_offset); -+ if ((br & 1) != 0) -+ { -+ unsigned long nop; -+ -+ nop = bfd_get_32 (input_bfd, -+ contents + rel->r_offset + 4); -+ if (nop == NOP -+ || nop == CROR_151515 || nop == CROR_313131) - { -- /* Special stub used, leave nop alone. */ -+ if (h != NULL -+ && (h == htab->tls_get_addr_fd -+ || h == htab->tls_get_addr) -+ && !htab->no_tls_get_addr_opt) -+ { -+ /* Special stub used, leave nop alone. */ -+ } -+ else -+ bfd_put_32 (input_bfd, LD_R2_40R1, -+ contents + rel->r_offset + 4); -+ can_plt_call = TRUE; - } -- else -- bfd_put_32 (input_bfd, LD_R2_40R1, -- contents + rel->r_offset + 4); -- can_plt_call = TRUE; - } - } - -- if (!can_plt_call) -+ if (!can_plt_call && h != NULL) - { -- if (stub_entry->stub_type == ppc_stub_plt_call -- || stub_entry->stub_type == ppc_stub_plt_call_r2save) -- { -- /* If this is a plain branch rather than a branch -- and link, don't require a nop. However, don't -- allow tail calls in a shared library as they -- will result in r2 being corrupted. */ -- unsigned long br; -- br = bfd_get_32 (input_bfd, contents + rel->r_offset); -- if (info->executable && (br & 1) == 0) -- can_plt_call = TRUE; -- else -- stub_entry = NULL; -- } -- else if (h != NULL -- && strcmp (h->elf.root.root.string, -- ".__libc_start_main") == 0) -+ const char *name = h->elf.root.root.string; -+ -+ if (*name == '.') -+ ++name; -+ -+ if (strncmp (name, "__libc_start_main", 17) == 0 -+ && (name[17] == 0 || name[17] == '@')) - { -- /* Allow crt1 branch to go via a toc adjusting stub. */ -+ /* Allow crt1 branch to go via a toc adjusting -+ stub. Other calls that never return could do -+ the same, if we could detect such. */ - can_plt_call = TRUE; - } -- else -+ } -+ -+ if (!can_plt_call) -+ { -+ /* g++ as of 20130507 emits self-calls without a -+ following nop. This is arguably wrong since we -+ have conflicting information. On the one hand a -+ global symbol and on the other a local call -+ sequence, but don't error for this special case. -+ It isn't possible to cheaply verify we have -+ exactly such a call. Allow all calls to the same -+ section. */ -+ asection *code_sec = sec; -+ -+ if (get_opd_info (sec) != NULL) - { -- info->callbacks->einfo -- (_("%P: %H: call to `%T' lacks nop, can't restore toc; " -- "recompile with -fPIC"), -- input_bfd, input_section, rel->r_offset, sym_name); -+ bfd_vma off = (relocation + addend -+ - sec->output_section->vma -+ - sec->output_offset); - -- bfd_set_error (bfd_error_bad_value); -- ret = FALSE; -+ opd_entry_value (sec, off, &code_sec, NULL, FALSE); - } -+ if (code_sec == input_section) -+ can_plt_call = TRUE; -+ } -+ -+ if (!can_plt_call) -+ { -+ -+ if (stub_entry->stub_type == ppc_stub_plt_call -+ || stub_entry->stub_type == ppc_stub_plt_call_r2save) -+ info->callbacks->einfo -+ (_("%P: %H: call to `%T' lacks nop, can't restore toc; " -+ "recompile with -fPIC"), -+ input_bfd, input_section, rel->r_offset, sym_name); -+ else -+ info->callbacks->einfo -+ (_("%P: %H: call to `%T' lacks nop, can't restore toc; " -+ "(-mcmodel=small toc adjust stub)"), -+ input_bfd, input_section, rel->r_offset, sym_name); -+ bfd_set_error (bfd_error_bad_value); -+ ret = FALSE; - } - - if (can_plt_call -diff -rNU3 dist.orig/bfd/elf64-x86-64.c dist/bfd/elf64-x86-64.c ---- dist.orig/bfd/elf64-x86-64.c 2013-03-25 09:06:20.000000000 +0100 -+++ dist/bfd/elf64-x86-64.c 2015-10-18 13:11:13.000000000 +0200 -@@ -2589,6 +2589,10 @@ - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; - -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ h->root.root.string); - info->flags |= DF_TEXTREL; - - if (info->warn_shared_textrel && info->shared) -diff -rNU3 dist.orig/bfd/elflink.c dist/bfd/elflink.c ---- dist.orig/bfd/elflink.c 2013-03-25 09:06:20.000000000 +0100 -+++ dist/bfd/elflink.c 2015-10-18 13:11:13.000000000 +0200 -@@ -1442,7 +1442,10 @@ - if (!(oldbfd != NULL - && (oldbfd->flags & BFD_PLUGIN) != 0 - && (abfd->flags & BFD_PLUGIN) == 0)) -- *skip = TRUE; -+ { -+ newdef = FALSE; -+ *skip = TRUE; -+ } - - /* Merge st_other. If the symbol already has a dynamic index, - but visibility says it should not be visible, turn it into a -@@ -10183,7 +10186,14 @@ - if (bed->s->arch_size == 32) - irel[0].r_info = ELF32_R_INFO (indx, howto->type); - else -- irel[0].r_info = ELF64_R_INFO (indx, howto->type); -+#ifdef BFD64 -+ { -+ bfd_uint64_t indx64 = indx; -+ irel[0].r_info = ELF64_R_INFO (indx64, howto->type); -+ } -+#else -+ BFD_FAIL(); -+#endif - - rel_hdr = reldata->hdr; - erel = rel_hdr->contents; -diff -rNU3 dist.orig/bfd/elfn32-mips.c dist/bfd/elfn32-mips.c ---- dist.orig/bfd/elfn32-mips.c 2012-09-04 16:13:08.000000000 +0200 -+++ dist/bfd/elfn32-mips.c 2015-10-18 13:11:13.000000000 +0200 -@@ -81,6 +81,8 @@ - (bfd *, Elf_Internal_Note *); - static bfd_boolean elf32_mips_grok_psinfo - (bfd *, Elf_Internal_Note *); -+static bfd_boolean mips_elf_n32_is_local_label_name -+ (bfd *, const char *); - static irix_compat_t elf_n32_mips_irix_compat - (bfd *); - -@@ -3241,6 +3243,17 @@ - return TRUE; - } - -+/* MIPS ELF local labels start with "$L". */ -+static bfd_boolean -+mips_elf_n32_is_local_label_name (bfd *abfd, const char *name) -+{ -+ if (name[0] == '$' && name[1] == 'L') -+ return TRUE; -+ -+ /* We accept the generic ELF local label syntax as well. */ -+ return _bfd_elf_is_local_label_name (abfd, name); -+} -+ - /* Depending on the target vector we generate some version of Irix - executables or "normal" MIPS ELF ABI executables. */ - static irix_compat_t -@@ -3364,6 +3377,9 @@ - #define elf_backend_write_section _bfd_mips_elf_write_section - #define elf_backend_mips_irix_compat elf_n32_mips_irix_compat - #define elf_backend_mips_rtype_to_howto mips_elf_n32_rtype_to_howto -+ -+#define bfd_elf32_bfd_is_local_label_name \ -+ mips_elf_n32_is_local_label_name - #define bfd_elf32_bfd_is_target_special_symbol \ - _bfd_mips_elf_is_target_special_symbol - #define bfd_elf32_find_nearest_line _bfd_mips_elf_find_nearest_line -diff -rNU3 dist.orig/bfd/elfnn-riscv.c dist/bfd/elfnn-riscv.c ---- dist.orig/bfd/elfnn-riscv.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/bfd/elfnn-riscv.c 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,2957 @@ -+/* RISC-V-specific support for NN-bit ELF. -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on TILE-Gx and MIPS targets. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+ -+/* This file handles RISC-V ELF targets. */ -+ -+#include "sysdep.h" -+#include "bfd.h" -+#include "libbfd.h" -+#include "bfdlink.h" -+#include "genlink.h" -+#include "elf-bfd.h" -+#include "elfxx-riscv.h" -+#include "elf/riscv.h" -+#include "opcode/riscv.h" -+ -+#define ARCH_SIZE NN -+ -+#define MINUS_ONE ((bfd_vma)0 - 1) -+ -+#define RISCV_ELF_LOG_WORD_BYTES (ARCH_SIZE == 32 ? 2 : 3) -+ -+#define RISCV_ELF_WORD_BYTES (1 << RISCV_ELF_LOG_WORD_BYTES) -+ -+/* The name of the dynamic interpreter. This is put in the .interp -+ section. */ -+ -+#define ELF64_DYNAMIC_INTERPRETER "/lib/ld.so.1" -+#define ELF32_DYNAMIC_INTERPRETER "/lib32/ld.so.1" -+ -+/* The RISC-V linker needs to keep track of the number of relocs that it -+ decides to copy as dynamic relocs in check_relocs for each symbol. -+ This is so that it can later discard them if they are found to be -+ unnecessary. We store the information in a field extending the -+ regular ELF linker hash table. */ -+ -+struct riscv_elf_dyn_relocs -+{ -+ struct riscv_elf_dyn_relocs *next; -+ -+ /* The input section of the reloc. */ -+ asection *sec; -+ -+ /* Total number of relocs copied for the input section. */ -+ bfd_size_type count; -+ -+ /* Number of pc-relative relocs copied for the input section. */ -+ bfd_size_type pc_count; -+}; -+ -+/* RISC-V ELF linker hash entry. */ -+ -+struct riscv_elf_link_hash_entry -+{ -+ struct elf_link_hash_entry elf; -+ -+ /* Track dynamic relocs copied for this symbol. */ -+ struct riscv_elf_dyn_relocs *dyn_relocs; -+ -+#define GOT_UNKNOWN 0 -+#define GOT_NORMAL 1 -+#define GOT_TLS_GD 2 -+#define GOT_TLS_IE 4 -+#define GOT_TLS_LE 8 -+ char tls_type; -+}; -+ -+#define riscv_elf_hash_entry(ent) \ -+ ((struct riscv_elf_link_hash_entry *)(ent)) -+ -+struct _bfd_riscv_elf_obj_tdata -+{ -+ struct elf_obj_tdata root; -+ -+ /* tls_type for each local got entry. */ -+ char *local_got_tls_type; -+}; -+ -+#define _bfd_riscv_elf_tdata(abfd) \ -+ ((struct _bfd_riscv_elf_obj_tdata *) (abfd)->tdata.any) -+ -+#define _bfd_riscv_elf_local_got_tls_type(abfd) \ -+ (_bfd_riscv_elf_tdata (abfd)->local_got_tls_type) -+ -+#define _bfd_riscv_elf_tls_type(abfd, h, symndx) \ -+ (*((h) != NULL ? &riscv_elf_hash_entry(h)->tls_type \ -+ : &_bfd_riscv_elf_local_got_tls_type (abfd) [symndx])) -+ -+#define is_riscv_elf(bfd) \ -+ (bfd_get_flavour (bfd) == bfd_target_elf_flavour \ -+ && elf_tdata (bfd) != NULL \ -+ && elf_object_id (bfd) == RISCV_ELF_DATA) -+ -+#include "elf/common.h" -+#include "elf/internal.h" -+ -+struct riscv_elf_link_hash_table -+{ -+ struct elf_link_hash_table elf; -+ -+ /* Short-cuts to get to dynamic linker sections. */ -+ asection *sdynbss; -+ asection *srelbss; -+ asection *sdyntdata; -+ -+ /* Small local sym to section mapping cache. */ -+ struct sym_cache sym_cache; -+}; -+ -+ -+/* Get the RISC-V ELF linker hash table from a link_info structure. */ -+#define riscv_elf_hash_table(p) \ -+ (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ -+ == RISCV_ELF_DATA ? ((struct riscv_elf_link_hash_table *) ((p)->hash)) : NULL) -+ -+static void -+riscv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, -+ arelent *cache_ptr, -+ Elf_Internal_Rela *dst) -+{ -+ cache_ptr->howto = riscv_elf_rtype_to_howto (ELFNN_R_TYPE (dst->r_info)); -+} -+ -+static void -+riscv_elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel) -+{ -+ const struct elf_backend_data *bed; -+ bfd_byte *loc; -+ -+ bed = get_elf_backend_data (abfd); -+ loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela); -+ bed->s->swap_reloca_out (abfd, rel, loc); -+} -+ -+/* PLT/GOT stuff */ -+ -+#define PLT_HEADER_INSNS 8 -+#define PLT_ENTRY_INSNS 4 -+#define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4) -+#define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4) -+ -+#define GOT_ENTRY_SIZE RISCV_ELF_WORD_BYTES -+ -+#define GOTPLT_HEADER_SIZE (2 * GOT_ENTRY_SIZE) -+ -+#define sec_addr(sec) ((sec)->output_section->vma + (sec)->output_offset) -+ -+static bfd_vma -+riscv_elf_got_plt_val (bfd_vma plt_index, struct bfd_link_info *info) -+{ -+ return sec_addr (riscv_elf_hash_table (info)->elf.sgotplt) -+ + GOTPLT_HEADER_SIZE + (plt_index * GOT_ENTRY_SIZE); -+} -+ -+#if ARCH_SIZE == 32 -+# define MATCH_LREG MATCH_LW -+#else -+# define MATCH_LREG MATCH_LD -+#endif -+ -+/* The format of the first PLT entry. */ -+ -+static void -+riscv_make_plt0_entry(bfd_vma gotplt_addr, bfd_vma addr, uint32_t *entry) -+{ -+ /* auipc t2, %hi(.got.plt) -+ sub t1, t1, t0 # shifted .got.plt offset + hdr size + 12 -+ l[w|d] t3, %lo(.got.plt)(t2) # _dl_runtime_resolve -+ addi t1, t1, -(hdr size + 12) # shifted .got.plt offset -+ addi t0, t2, %lo(.got.plt) # &.got.plt -+ srli t1, t1, log2(16/PTRSIZE) # .got.plt offset -+ l[w|d] t0, PTRSIZE(t0) # link map -+ jr t3 */ -+ -+ entry[0] = RISCV_UTYPE (AUIPC, X_T2, RISCV_PCREL_HIGH_PART (gotplt_addr, addr)); -+ entry[1] = RISCV_RTYPE (SUB, X_T1, X_T1, X_T0); -+ entry[2] = RISCV_ITYPE (LREG, X_T3, X_T2, RISCV_PCREL_LOW_PART (gotplt_addr, addr)); -+ entry[3] = RISCV_ITYPE (ADDI, X_T1, X_T1, -(PLT_HEADER_SIZE + 12)); -+ entry[4] = RISCV_ITYPE (ADDI, X_T0, X_T2, RISCV_PCREL_LOW_PART (gotplt_addr, addr)); -+ entry[5] = RISCV_ITYPE (SRLI, X_T1, X_T1, 4 - RISCV_ELF_LOG_WORD_BYTES); -+ entry[6] = RISCV_ITYPE (LREG, X_T0, X_T0, RISCV_ELF_WORD_BYTES); -+ entry[7] = RISCV_ITYPE (JALR, 0, X_T3, 0); -+} -+ -+/* The format of subsequent PLT entries. */ -+ -+static void -+riscv_make_plt_entry(bfd_vma got_address, bfd_vma addr, uint32_t *entry) -+{ -+ /* auipc t1, %hi(.got.plt entry) -+ l[w|d] t0, %lo(.got.plt entry)(t1) -+ jalr t1, t0 -+ nop */ -+ -+ entry[0] = RISCV_UTYPE (AUIPC, X_T1, RISCV_PCREL_HIGH_PART (got_address, addr)); -+ entry[1] = RISCV_ITYPE (LREG, X_T0, X_T1, RISCV_PCREL_LOW_PART(got_address, addr)); -+ entry[2] = RISCV_ITYPE (JALR, X_T1, X_T0, 0); -+ entry[3] = RISCV_NOP; -+} -+ -+/* Create an entry in an RISC-V ELF linker hash table. */ -+ -+static struct bfd_hash_entry * -+link_hash_newfunc (struct bfd_hash_entry *entry, -+ struct bfd_hash_table *table, const char *string) -+{ -+ /* Allocate the structure if it has not already been allocated by a -+ subclass. */ -+ if (entry == NULL) -+ { -+ entry = -+ bfd_hash_allocate (table, -+ sizeof (struct riscv_elf_link_hash_entry)); -+ if (entry == NULL) -+ return entry; -+ } -+ -+ /* Call the allocation method of the superclass. */ -+ entry = _bfd_elf_link_hash_newfunc (entry, table, string); -+ if (entry != NULL) -+ { -+ struct riscv_elf_link_hash_entry *eh; -+ -+ eh = (struct riscv_elf_link_hash_entry *) entry; -+ eh->dyn_relocs = NULL; -+ eh->tls_type = GOT_UNKNOWN; -+ } -+ -+ return entry; -+} -+ -+/* Create a RISC-V ELF linker hash table. */ -+ -+static struct bfd_link_hash_table * -+riscv_elf_link_hash_table_create (bfd *abfd) -+{ -+ struct riscv_elf_link_hash_table *ret; -+ bfd_size_type amt = sizeof (struct riscv_elf_link_hash_table); -+ -+ ret = (struct riscv_elf_link_hash_table *) bfd_zmalloc (amt); -+ if (ret == NULL) -+ return NULL; -+ -+ if (!_bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc, -+ sizeof (struct riscv_elf_link_hash_entry), -+ RISCV_ELF_DATA)) -+ { -+ free (ret); -+ return NULL; -+ } -+ -+ return &ret->elf.root; -+} -+ -+/* Create the .got section. */ -+ -+static bfd_boolean -+riscv_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) -+{ -+ flagword flags; -+ asection *s, *s_got; -+ struct elf_link_hash_entry *h; -+ const struct elf_backend_data *bed = get_elf_backend_data (abfd); -+ struct elf_link_hash_table *htab = elf_hash_table (info); -+ -+ /* This function may be called more than once. */ -+ s = bfd_get_linker_section (abfd, ".got"); -+ if (s != NULL) -+ return TRUE; -+ -+ flags = bed->dynamic_sec_flags; -+ -+ s = bfd_make_section_anyway_with_flags (abfd, -+ (bed->rela_plts_and_copies_p -+ ? ".rela.got" : ".rel.got"), -+ (bed->dynamic_sec_flags -+ | SEC_READONLY)); -+ if (s == NULL -+ || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) -+ return FALSE; -+ htab->srelgot = s; -+ -+ s = s_got = bfd_make_section_anyway_with_flags (abfd, ".got", flags); -+ if (s == NULL -+ || !bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) -+ return FALSE; -+ htab->sgot = s; -+ -+ /* The first bit of the global offset table is the header. */ -+ s->size += bed->got_header_size; -+ -+ if (bed->want_got_plt) -+ { -+ s = bfd_make_section_anyway_with_flags (abfd, ".got.plt", flags); -+ if (s == NULL -+ || !bfd_set_section_alignment (abfd, s, -+ bed->s->log_file_align)) -+ return FALSE; -+ htab->sgotplt = s; -+ -+ /* Reserve room for the header. */ -+ s->size += GOTPLT_HEADER_SIZE; -+ } -+ -+ if (bed->want_got_sym) -+ { -+ /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the .got -+ section. We don't do this in the linker script because we don't want -+ to define the symbol if we are not creating a global offset -+ table. */ -+ h = _bfd_elf_define_linkage_sym (abfd, info, s_got, -+ "_GLOBAL_OFFSET_TABLE_"); -+ elf_hash_table (info)->hgot = h; -+ if (h == NULL) -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+ -+/* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and -+ .rela.bss sections in DYNOBJ, and set up shortcuts to them in our -+ hash table. */ -+ -+static bfd_boolean -+riscv_elf_create_dynamic_sections (bfd *dynobj, -+ struct bfd_link_info *info) -+{ -+ struct riscv_elf_link_hash_table *htab; -+ -+ htab = riscv_elf_hash_table (info); -+ BFD_ASSERT (htab != NULL); -+ -+ if (!riscv_elf_create_got_section (dynobj, info)) -+ return FALSE; -+ -+ if (!_bfd_elf_create_dynamic_sections (dynobj, info)) -+ return FALSE; -+ -+ htab->sdynbss = bfd_get_linker_section (dynobj, ".dynbss"); -+ if (!info->shared) -+ { -+ htab->srelbss = bfd_get_linker_section (dynobj, ".rela.bss"); -+ htab->sdyntdata = -+ bfd_make_section_anyway_with_flags (dynobj, ".tdata.dyn", -+ SEC_ALLOC | SEC_THREAD_LOCAL); -+ } -+ -+ if (!htab->elf.splt || !htab->elf.srelplt || !htab->sdynbss -+ || (!info->shared && (!htab->srelbss || !htab->sdyntdata))) -+ abort (); -+ -+ return TRUE; -+} -+ -+/* Copy the extra info we tack onto an elf_link_hash_entry. */ -+ -+static void -+riscv_elf_copy_indirect_symbol (struct bfd_link_info *info, -+ struct elf_link_hash_entry *dir, -+ struct elf_link_hash_entry *ind) -+{ -+ struct riscv_elf_link_hash_entry *edir, *eind; -+ -+ edir = (struct riscv_elf_link_hash_entry *) dir; -+ eind = (struct riscv_elf_link_hash_entry *) ind; -+ -+ if (eind->dyn_relocs != NULL) -+ { -+ if (edir->dyn_relocs != NULL) -+ { -+ struct riscv_elf_dyn_relocs **pp; -+ struct riscv_elf_dyn_relocs *p; -+ -+ /* Add reloc counts against the indirect sym to the direct sym -+ list. Merge any entries against the same section. */ -+ for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) -+ { -+ struct riscv_elf_dyn_relocs *q; -+ -+ for (q = edir->dyn_relocs; q != NULL; q = q->next) -+ if (q->sec == p->sec) -+ { -+ q->pc_count += p->pc_count; -+ q->count += p->count; -+ *pp = p->next; -+ break; -+ } -+ if (q == NULL) -+ pp = &p->next; -+ } -+ *pp = edir->dyn_relocs; -+ } -+ -+ edir->dyn_relocs = eind->dyn_relocs; -+ eind->dyn_relocs = NULL; -+ } -+ -+ if (ind->root.type == bfd_link_hash_indirect -+ && dir->got.refcount <= 0) -+ { -+ edir->tls_type = eind->tls_type; -+ eind->tls_type = GOT_UNKNOWN; -+ } -+ _bfd_elf_link_hash_copy_indirect (info, dir, ind); -+} -+ -+static bfd_boolean -+riscv_elf_record_tls_type (bfd *abfd, struct elf_link_hash_entry *h, -+ unsigned long symndx, char tls_type) -+{ -+ char *new_tls_type = &_bfd_riscv_elf_tls_type (abfd, h, symndx); -+ *new_tls_type |= tls_type; -+ if ((*new_tls_type & GOT_NORMAL) && (*new_tls_type & ~GOT_NORMAL)) -+ { -+ (*_bfd_error_handler) -+ (_("%B: `%s' accessed both as normal and thread local symbol"), -+ abfd, h ? h->root.root.string : ""); -+ return FALSE; -+ } -+ return TRUE; -+} -+ -+static bfd_boolean -+riscv_elf_record_got_reference (bfd *abfd, struct bfd_link_info *info, -+ struct elf_link_hash_entry *h, long symndx) -+{ -+ struct riscv_elf_link_hash_table *htab = riscv_elf_hash_table (info); -+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr; -+ -+ if (htab->elf.sgot == NULL) -+ { -+ if (!riscv_elf_create_got_section (htab->elf.dynobj, info)) -+ return FALSE; -+ } -+ -+ if (h != NULL) -+ { -+ h->got.refcount += 1; -+ return TRUE; -+ } -+ -+ /* This is a global offset table entry for a local symbol. */ -+ if (elf_local_got_refcounts (abfd) == NULL) -+ { -+ bfd_size_type size = symtab_hdr->sh_info * (sizeof (bfd_vma) + 1); -+ if (!(elf_local_got_refcounts (abfd) = bfd_zalloc (abfd, size))) -+ return FALSE; -+ _bfd_riscv_elf_local_got_tls_type (abfd) -+ = (char *) (elf_local_got_refcounts (abfd) + symtab_hdr->sh_info); -+ } -+ elf_local_got_refcounts (abfd) [symndx] += 1; -+ -+ return TRUE; -+} -+ -+static bfd_boolean -+bad_static_reloc (bfd *abfd, unsigned r_type, struct elf_link_hash_entry *h) -+{ -+ (*_bfd_error_handler) -+ (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), -+ abfd, riscv_elf_rtype_to_howto (r_type)->name, -+ h != NULL ? h->root.root.string : "a local symbol"); -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+} -+/* Look through the relocs for a section during the first phase, and -+ allocate space in the global offset table or procedure linkage -+ table. */ -+ -+static bfd_boolean -+riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, -+ asection *sec, const Elf_Internal_Rela *relocs) -+{ -+ struct riscv_elf_link_hash_table *htab; -+ Elf_Internal_Shdr *symtab_hdr; -+ struct elf_link_hash_entry **sym_hashes; -+ const Elf_Internal_Rela *rel; -+ asection *sreloc = NULL; -+ -+ if (info->relocatable) -+ return TRUE; -+ -+ htab = riscv_elf_hash_table (info); -+ symtab_hdr = &elf_tdata (abfd)->symtab_hdr; -+ sym_hashes = elf_sym_hashes (abfd); -+ -+ if (htab->elf.dynobj == NULL) -+ htab->elf.dynobj = abfd; -+ -+ for (rel = relocs; rel < relocs + sec->reloc_count; rel++) -+ { -+ unsigned int r_type; -+ unsigned long r_symndx; -+ struct elf_link_hash_entry *h; -+ -+ r_symndx = ELFNN_R_SYM (rel->r_info); -+ r_type = ELFNN_R_TYPE (rel->r_info); -+ -+ if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) -+ { -+ (*_bfd_error_handler) (_("%B: bad symbol index: %d"), -+ abfd, r_symndx); -+ return FALSE; -+ } -+ -+ if (r_symndx < symtab_hdr->sh_info) -+ h = NULL; -+ else -+ { -+ h = sym_hashes[r_symndx - symtab_hdr->sh_info]; -+ while (h->root.type == bfd_link_hash_indirect -+ || h->root.type == bfd_link_hash_warning) -+ h = (struct elf_link_hash_entry *) h->root.u.i.link; -+ -+ /* PR15323, ref flags aren't set for references in the same -+ object. */ -+ h->root.non_ir_ref = 1; -+ } -+ -+ switch (r_type) -+ { -+ case R_RISCV_TLS_GD_HI20: -+ if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx) -+ || !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_GD)) -+ return FALSE; -+ break; -+ -+ case R_RISCV_TLS_GOT_HI20: -+ if (info->shared) -+ info->flags |= DF_STATIC_TLS; -+ if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx) -+ || !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_IE)) -+ return FALSE; -+ break; -+ -+ case R_RISCV_GOT_HI20: -+ if (!riscv_elf_record_got_reference (abfd, info, h, r_symndx) -+ || !riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_NORMAL)) -+ return FALSE; -+ break; -+ -+ case R_RISCV_CALL_PLT: -+ /* This symbol requires a procedure linkage table entry. We -+ actually build the entry in adjust_dynamic_symbol, -+ because this might be a case of linking PIC code without -+ linking in any dynamic objects, in which case we don't -+ need to generate a procedure linkage table after all. */ -+ -+ if (h != NULL) -+ { -+ h->needs_plt = 1; -+ h->plt.refcount += 1; -+ } -+ break; -+ -+ case R_RISCV_CALL: -+ case R_RISCV_JAL: -+ case R_RISCV_BRANCH: -+ case R_RISCV_PCREL_HI20: -+ /* In shared libs, these relocs are known to bind locally. */ -+ if (info->shared) -+ break; -+ goto static_reloc; -+ -+ case R_RISCV_TPREL_HI20: -+ if (!info->executable) -+ return bad_static_reloc (abfd, r_type, h); -+ if (h != NULL) -+ riscv_elf_record_tls_type (abfd, h, r_symndx, GOT_TLS_LE); -+ goto static_reloc; -+ -+ case R_RISCV_HI20: -+ if (info->shared) -+ return bad_static_reloc (abfd, r_type, h); -+ /* Fall through. */ -+ -+ case R_RISCV_COPY: -+ case R_RISCV_JUMP_SLOT: -+ case R_RISCV_RELATIVE: -+ case R_RISCV_64: -+ case R_RISCV_32: -+ /* Fall through. */ -+ -+ static_reloc: -+ if (h != NULL) -+ h->non_got_ref = 1; -+ -+ if (h != NULL && !info->shared) -+ { -+ /* We may need a .plt entry if the function this reloc -+ refers to is in a shared lib. */ -+ h->plt.refcount += 1; -+ } -+ -+ /* If we are creating a shared library, and this is a reloc -+ against a global symbol, or a non PC relative reloc -+ against a local symbol, then we need to copy the reloc -+ into the shared library. However, if we are linking with -+ -Bsymbolic, we do not need to copy a reloc against a -+ global symbol which is defined in an object we are -+ including in the link (i.e., DEF_REGULAR is set). At -+ this point we have not seen all the input files, so it is -+ possible that DEF_REGULAR is not set now but will be set -+ later (it is never cleared). In case of a weak definition, -+ DEF_REGULAR may be cleared later by a strong definition in -+ a shared library. We account for that possibility below by -+ storing information in the relocs_copied field of the hash -+ table entry. A similar situation occurs when creating -+ shared libraries and symbol visibility changes render the -+ symbol local. -+ -+ If on the other hand, we are creating an executable, we -+ may need to keep relocations for symbols satisfied by a -+ dynamic library if we manage to avoid copy relocs for the -+ symbol. */ -+ if ((info->shared -+ && (sec->flags & SEC_ALLOC) != 0 -+ && (! riscv_elf_rtype_to_howto (r_type)->pc_relative -+ || (h != NULL -+ && (! info->symbolic -+ || h->root.type == bfd_link_hash_defweak -+ || !h->def_regular)))) -+ || (!info->shared -+ && (sec->flags & SEC_ALLOC) != 0 -+ && h != NULL -+ && (h->root.type == bfd_link_hash_defweak -+ || !h->def_regular))) -+ { -+ struct riscv_elf_dyn_relocs *p; -+ struct riscv_elf_dyn_relocs **head; -+ -+ /* When creating a shared object, we must copy these -+ relocs into the output file. We create a reloc -+ section in dynobj and make room for the reloc. */ -+ if (sreloc == NULL) -+ { -+ sreloc = _bfd_elf_make_dynamic_reloc_section -+ (sec, htab->elf.dynobj, RISCV_ELF_LOG_WORD_BYTES, -+ abfd, /*rela?*/ TRUE); -+ -+ if (sreloc == NULL) -+ return FALSE; -+ } -+ -+ /* If this is a global symbol, we count the number of -+ relocations we need for this symbol. */ -+ if (h != NULL) -+ head = &((struct riscv_elf_link_hash_entry *) h)->dyn_relocs; -+ else -+ { -+ /* Track dynamic relocs needed for local syms too. -+ We really need local syms available to do this -+ easily. Oh well. */ -+ -+ asection *s; -+ void *vpp; -+ Elf_Internal_Sym *isym; -+ -+ isym = bfd_sym_from_r_symndx (&htab->sym_cache, -+ abfd, r_symndx); -+ if (isym == NULL) -+ return FALSE; -+ -+ s = bfd_section_from_elf_index (abfd, isym->st_shndx); -+ if (s == NULL) -+ s = sec; -+ -+ vpp = &elf_section_data (s)->local_dynrel; -+ head = (struct riscv_elf_dyn_relocs **) vpp; -+ } -+ -+ p = *head; -+ if (p == NULL || p->sec != sec) -+ { -+ bfd_size_type amt = sizeof *p; -+ p = ((struct riscv_elf_dyn_relocs *) -+ bfd_alloc (htab->elf.dynobj, amt)); -+ if (p == NULL) -+ return FALSE; -+ p->next = *head; -+ *head = p; -+ p->sec = sec; -+ p->count = 0; -+ p->pc_count = 0; -+ } -+ -+ p->count += 1; -+ p->pc_count += riscv_elf_rtype_to_howto (r_type)->pc_relative; -+ } -+ -+ break; -+ -+ case R_RISCV_GNU_VTINHERIT: -+ if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) -+ return FALSE; -+ break; -+ -+ case R_RISCV_GNU_VTENTRY: -+ if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) -+ return FALSE; -+ break; -+ -+ default: -+ break; -+ } -+ } -+ -+ return TRUE; -+} -+ -+static asection * -+riscv_elf_gc_mark_hook (asection *sec, -+ struct bfd_link_info *info, -+ Elf_Internal_Rela *rel, -+ struct elf_link_hash_entry *h, -+ Elf_Internal_Sym *sym) -+{ -+ if (h != NULL) -+ switch (ELFNN_R_TYPE (rel->r_info)) -+ { -+ case R_RISCV_GNU_VTINHERIT: -+ case R_RISCV_GNU_VTENTRY: -+ return NULL; -+ } -+ -+ return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); -+} -+ -+/* Update the got entry reference counts for the section being removed. */ -+static bfd_boolean -+riscv_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, -+ asection *sec, const Elf_Internal_Rela *relocs) -+{ -+ const Elf_Internal_Rela *rel, *relend; -+ Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd); -+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); -+ bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (abfd); -+ -+ if (info->relocatable) -+ return TRUE; -+ -+ elf_section_data (sec)->local_dynrel = NULL; -+ -+ for (rel = relocs, relend = relocs + sec->reloc_count; rel < relend; rel++) -+ { -+ unsigned long r_symndx; -+ struct elf_link_hash_entry *h = NULL; -+ -+ r_symndx = ELFNN_R_SYM (rel->r_info); -+ if (r_symndx >= symtab_hdr->sh_info) -+ { -+ struct riscv_elf_link_hash_entry *eh; -+ struct riscv_elf_dyn_relocs **pp; -+ struct riscv_elf_dyn_relocs *p; -+ -+ h = sym_hashes[r_symndx - symtab_hdr->sh_info]; -+ while (h->root.type == bfd_link_hash_indirect -+ || h->root.type == bfd_link_hash_warning) -+ h = (struct elf_link_hash_entry *) h->root.u.i.link; -+ eh = (struct riscv_elf_link_hash_entry *) h; -+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) -+ if (p->sec == sec) -+ { -+ /* Everything must go for SEC. */ -+ *pp = p->next; -+ break; -+ } -+ } -+ -+ switch (ELFNN_R_TYPE (rel->r_info)) -+ { -+ case R_RISCV_GOT_HI20: -+ case R_RISCV_TLS_GOT_HI20: -+ case R_RISCV_TLS_GD_HI20: -+ if (h != NULL) -+ { -+ if (h->got.refcount > 0) -+ h->got.refcount--; -+ } -+ else -+ { -+ if (local_got_refcounts && -+ local_got_refcounts[r_symndx] > 0) -+ local_got_refcounts[r_symndx]--; -+ } -+ break; -+ -+ case R_RISCV_HI20: -+ case R_RISCV_PCREL_HI20: -+ case R_RISCV_COPY: -+ case R_RISCV_JUMP_SLOT: -+ case R_RISCV_RELATIVE: -+ case R_RISCV_64: -+ case R_RISCV_32: -+ case R_RISCV_BRANCH: -+ case R_RISCV_CALL: -+ case R_RISCV_JAL: -+ if (info->shared) -+ break; -+ /* Fall through. */ -+ -+ case R_RISCV_CALL_PLT: -+ if (h != NULL) -+ { -+ if (h->plt.refcount > 0) -+ h->plt.refcount--; -+ } -+ break; -+ -+ default: -+ break; -+ } -+ } -+ -+ return TRUE; -+} -+ -+/* Adjust a symbol defined by a dynamic object and referenced by a -+ regular object. The current definition is in some section of the -+ dynamic object, but we're not including those sections. We have to -+ change the definition to something the rest of the link can -+ understand. */ -+ -+static bfd_boolean -+riscv_elf_adjust_dynamic_symbol (struct bfd_link_info *info, -+ struct elf_link_hash_entry *h) -+{ -+ struct riscv_elf_link_hash_table *htab; -+ struct riscv_elf_link_hash_entry * eh; -+ struct riscv_elf_dyn_relocs *p; -+ bfd *dynobj; -+ asection *s; -+ -+ htab = riscv_elf_hash_table (info); -+ BFD_ASSERT (htab != NULL); -+ -+ dynobj = htab->elf.dynobj; -+ -+ /* Make sure we know what is going on here. */ -+ BFD_ASSERT (dynobj != NULL -+ && (h->needs_plt -+ || h->type == STT_GNU_IFUNC -+ || h->u.weakdef != NULL -+ || (h->def_dynamic -+ && h->ref_regular -+ && !h->def_regular))); -+ -+ /* If this is a function, put it in the procedure linkage table. We -+ will fill in the contents of the procedure linkage table later -+ (although we could actually do it here). */ -+ if (h->type == STT_FUNC || h->type == STT_GNU_IFUNC || h->needs_plt) -+ { -+ if (h->plt.refcount <= 0 -+ || SYMBOL_CALLS_LOCAL (info, h) -+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT -+ && h->root.type == bfd_link_hash_undefweak)) -+ { -+ /* This case can occur if we saw a R_RISCV_CALL_PLT reloc in an -+ input file, but the symbol was never referred to by a dynamic -+ object, or if all references were garbage collected. In such -+ a case, we don't actually need to build a PLT entry. */ -+ h->plt.offset = (bfd_vma) -1; -+ h->needs_plt = 0; -+ } -+ -+ return TRUE; -+ } -+ else -+ h->plt.offset = (bfd_vma) -1; -+ -+ /* If this is a weak symbol, and there is a real definition, the -+ processor independent code will have arranged for us to see the -+ real definition first, and we can just use the same value. */ -+ if (h->u.weakdef != NULL) -+ { -+ BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined -+ || h->u.weakdef->root.type == bfd_link_hash_defweak); -+ h->root.u.def.section = h->u.weakdef->root.u.def.section; -+ h->root.u.def.value = h->u.weakdef->root.u.def.value; -+ return TRUE; -+ } -+ -+ /* This is a reference to a symbol defined by a dynamic object which -+ is not a function. */ -+ -+ /* If we are creating a shared library, we must presume that the -+ only references to the symbol are via the global offset table. -+ For such cases we need not do anything here; the relocations will -+ be handled correctly by relocate_section. */ -+ if (info->shared) -+ return TRUE; -+ -+ /* If there are no references to this symbol that do not use the -+ GOT, we don't need to generate a copy reloc. */ -+ if (!h->non_got_ref) -+ return TRUE; -+ -+ /* If -z nocopyreloc was given, we won't generate them either. */ -+ if (info->nocopyreloc) -+ { -+ h->non_got_ref = 0; -+ return TRUE; -+ } -+ -+ eh = (struct riscv_elf_link_hash_entry *) h; -+ for (p = eh->dyn_relocs; p != NULL; p = p->next) -+ { -+ s = p->sec->output_section; -+ if (s != NULL && (s->flags & SEC_READONLY) != 0) -+ break; -+ } -+ -+ /* If we didn't find any dynamic relocs in read-only sections, then -+ we'll be keeping the dynamic relocs and avoiding the copy reloc. */ -+ if (p == NULL) -+ { -+ h->non_got_ref = 0; -+ return TRUE; -+ } -+ -+ /* We must allocate the symbol in our .dynbss section, which will -+ become part of the .bss section of the executable. There will be -+ an entry for this symbol in the .dynsym section. The dynamic -+ object will contain position independent code, so all references -+ from the dynamic object to this symbol will go through the global -+ offset table. The dynamic linker will use the .dynsym entry to -+ determine the address it must put in the global offset table, so -+ both the dynamic object and the regular object will refer to the -+ same memory location for the variable. */ -+ -+ /* We must generate a R_RISCV_COPY reloc to tell the dynamic linker -+ to copy the initial value out of the dynamic object and into the -+ runtime process image. We need to remember the offset into the -+ .rel.bss section we are going to use. */ -+ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0 && h->size != 0) -+ { -+ htab->srelbss->size += sizeof (ElfNN_External_Rela); -+ h->needs_copy = 1; -+ } -+ -+ if (eh->tls_type & ~GOT_NORMAL) -+ return _bfd_elf_adjust_dynamic_copy (h, htab->sdyntdata); -+ -+ return _bfd_elf_adjust_dynamic_copy (h, htab->sdynbss); -+} -+ -+/* Allocate space in .plt, .got and associated reloc sections for -+ dynamic relocs. */ -+ -+static bfd_boolean -+allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) -+{ -+ struct bfd_link_info *info; -+ struct riscv_elf_link_hash_table *htab; -+ struct riscv_elf_link_hash_entry *eh; -+ struct riscv_elf_dyn_relocs *p; -+ -+ if (h->root.type == bfd_link_hash_indirect) -+ return TRUE; -+ -+ info = (struct bfd_link_info *) inf; -+ htab = riscv_elf_hash_table (info); -+ BFD_ASSERT (htab != NULL); -+ -+ if (htab->elf.dynamic_sections_created -+ && h->plt.refcount > 0) -+ { -+ /* Make sure this symbol is output as a dynamic symbol. -+ Undefined weak syms won't yet be marked as dynamic. */ -+ if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ -+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) -+ { -+ asection *s = htab->elf.splt; -+ -+ if (s->size == 0) -+ s->size = PLT_HEADER_SIZE; -+ -+ h->plt.offset = s->size; -+ -+ /* Make room for this entry. */ -+ s->size += PLT_ENTRY_SIZE; -+ -+ /* We also need to make an entry in the .got.plt section. */ -+ htab->elf.sgotplt->size += GOT_ENTRY_SIZE; -+ -+ /* We also need to make an entry in the .rela.plt section. */ -+ htab->elf.srelplt->size += sizeof (ElfNN_External_Rela); -+ -+ /* If this symbol is not defined in a regular file, and we are -+ not generating a shared library, then set the symbol to this -+ location in the .plt. This is required to make function -+ pointers compare as equal between the normal executable and -+ the shared library. */ -+ if (! info->shared -+ && !h->def_regular) -+ { -+ h->root.u.def.section = s; -+ h->root.u.def.value = h->plt.offset; -+ } -+ } -+ else -+ { -+ h->plt.offset = (bfd_vma) -1; -+ h->needs_plt = 0; -+ } -+ } -+ else -+ { -+ h->plt.offset = (bfd_vma) -1; -+ h->needs_plt = 0; -+ } -+ -+ if (h->got.refcount > 0) -+ { -+ asection *s; -+ bfd_boolean dyn; -+ int tls_type = riscv_elf_hash_entry(h)->tls_type; -+ -+ /* Make sure this symbol is output as a dynamic symbol. -+ Undefined weak syms won't yet be marked as dynamic. */ -+ if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ -+ s = htab->elf.sgot; -+ h->got.offset = s->size; -+ dyn = htab->elf.dynamic_sections_created; -+ if (tls_type & (GOT_TLS_GD | GOT_TLS_IE)) -+ { -+ /* TLS_GD needs two dynamic relocs and two GOT slots. */ -+ if (tls_type & GOT_TLS_GD) -+ { -+ s->size += 2 * RISCV_ELF_WORD_BYTES; -+ htab->elf.srelgot->size += 2 * sizeof (ElfNN_External_Rela); -+ } -+ -+ /* TLS_IE needs one dynamic reloc and one GOT slot. */ -+ if (tls_type & GOT_TLS_IE) -+ { -+ s->size += RISCV_ELF_WORD_BYTES; -+ htab->elf.srelgot->size += sizeof (ElfNN_External_Rela); -+ } -+ } -+ else -+ { -+ s->size += RISCV_ELF_WORD_BYTES; -+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)) -+ htab->elf.srelgot->size += sizeof (ElfNN_External_Rela); -+ } -+ } -+ else -+ h->got.offset = (bfd_vma) -1; -+ -+ eh = (struct riscv_elf_link_hash_entry *) h; -+ if (eh->dyn_relocs == NULL) -+ return TRUE; -+ -+ /* In the shared -Bsymbolic case, discard space allocated for -+ dynamic pc-relative relocs against symbols which turn out to be -+ defined in regular objects. For the normal shared case, discard -+ space for pc-relative relocs that have become local due to symbol -+ visibility changes. */ -+ -+ if (info->shared) -+ { -+ if (SYMBOL_CALLS_LOCAL (info, h)) -+ { -+ struct riscv_elf_dyn_relocs **pp; -+ -+ for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) -+ { -+ p->count -= p->pc_count; -+ p->pc_count = 0; -+ if (p->count == 0) -+ *pp = p->next; -+ else -+ pp = &p->next; -+ } -+ } -+ -+ /* Also discard relocs on undefined weak syms with non-default -+ visibility. */ -+ if (eh->dyn_relocs != NULL -+ && h->root.type == bfd_link_hash_undefweak) -+ { -+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) -+ eh->dyn_relocs = NULL; -+ -+ /* Make sure undefined weak symbols are output as a dynamic -+ symbol in PIEs. */ -+ else if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ } -+ } -+ else -+ { -+ /* For the non-shared case, discard space for relocs against -+ symbols which turn out to need copy relocs or are not -+ dynamic. */ -+ -+ if (!h->non_got_ref -+ && ((h->def_dynamic -+ && !h->def_regular) -+ || (htab->elf.dynamic_sections_created -+ && (h->root.type == bfd_link_hash_undefweak -+ || h->root.type == bfd_link_hash_undefined)))) -+ { -+ /* Make sure this symbol is output as a dynamic symbol. -+ Undefined weak syms won't yet be marked as dynamic. */ -+ if (h->dynindx == -1 -+ && !h->forced_local) -+ { -+ if (! bfd_elf_link_record_dynamic_symbol (info, h)) -+ return FALSE; -+ } -+ -+ /* If that succeeded, we know we'll be keeping all the -+ relocs. */ -+ if (h->dynindx != -1) -+ goto keep; -+ } -+ -+ eh->dyn_relocs = NULL; -+ -+ keep: ; -+ } -+ -+ /* Finally, allocate space. */ -+ for (p = eh->dyn_relocs; p != NULL; p = p->next) -+ { -+ asection *sreloc = elf_section_data (p->sec)->sreloc; -+ sreloc->size += p->count * sizeof (ElfNN_External_Rela); -+ } -+ -+ return TRUE; -+} -+ -+/* Find any dynamic relocs that apply to read-only sections. */ -+ -+static bfd_boolean -+readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) -+{ -+ struct riscv_elf_link_hash_entry *eh; -+ struct riscv_elf_dyn_relocs *p; -+ -+ eh = (struct riscv_elf_link_hash_entry *) h; -+ for (p = eh->dyn_relocs; p != NULL; p = p->next) -+ { -+ asection *s = p->sec->output_section; -+ -+ if (s != NULL && (s->flags & SEC_READONLY) != 0) -+ { -+ ((struct bfd_link_info *) inf)->flags |= DF_TEXTREL; -+ -+ /* Short-circuit the traversal. */ -+ return FALSE; -+ } -+ } -+ return TRUE; -+} -+ -+static bfd_boolean -+riscv_elf_size_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) -+{ -+ struct riscv_elf_link_hash_table *htab; -+ bfd *dynobj; -+ asection *s; -+ bfd *ibfd; -+ -+ htab = riscv_elf_hash_table (info); -+ BFD_ASSERT (htab != NULL); -+ dynobj = htab->elf.dynobj; -+ BFD_ASSERT (dynobj != NULL); -+ -+ if (elf_hash_table (info)->dynamic_sections_created) -+ { -+ /* Set the contents of the .interp section to the interpreter. */ -+ if (info->executable) -+ { -+ s = bfd_get_linker_section (dynobj, ".interp"); -+ BFD_ASSERT (s != NULL); -+ s->size = strlen (ELFNN_DYNAMIC_INTERPRETER) + 1; -+ s->contents = (unsigned char *) ELFNN_DYNAMIC_INTERPRETER; -+ } -+ } -+ -+ /* Set up .got offsets for local syms, and space for local dynamic -+ relocs. */ -+ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) -+ { -+ bfd_signed_vma *local_got; -+ bfd_signed_vma *end_local_got; -+ char *local_tls_type; -+ bfd_size_type locsymcount; -+ Elf_Internal_Shdr *symtab_hdr; -+ asection *srel; -+ -+ if (! is_riscv_elf (ibfd)) -+ continue; -+ -+ for (s = ibfd->sections; s != NULL; s = s->next) -+ { -+ struct riscv_elf_dyn_relocs *p; -+ -+ for (p = elf_section_data (s)->local_dynrel; p != NULL; p = p->next) -+ { -+ if (!bfd_is_abs_section (p->sec) -+ && bfd_is_abs_section (p->sec->output_section)) -+ { -+ /* Input section has been discarded, either because -+ it is a copy of a linkonce section or due to -+ linker script /DISCARD/, so we'll be discarding -+ the relocs too. */ -+ } -+ else if (p->count != 0) -+ { -+ srel = elf_section_data (p->sec)->sreloc; -+ srel->size += p->count * sizeof (ElfNN_External_Rela); -+ if ((p->sec->output_section->flags & SEC_READONLY) != 0) -+ info->flags |= DF_TEXTREL; -+ } -+ } -+ } -+ -+ local_got = elf_local_got_refcounts (ibfd); -+ if (!local_got) -+ continue; -+ -+ symtab_hdr = &elf_symtab_hdr (ibfd); -+ locsymcount = symtab_hdr->sh_info; -+ end_local_got = local_got + locsymcount; -+ local_tls_type = _bfd_riscv_elf_local_got_tls_type (ibfd); -+ s = htab->elf.sgot; -+ srel = htab->elf.srelgot; -+ for (; local_got < end_local_got; ++local_got, ++local_tls_type) -+ { -+ if (*local_got > 0) -+ { -+ *local_got = s->size; -+ s->size += RISCV_ELF_WORD_BYTES; -+ if (*local_tls_type & GOT_TLS_GD) -+ s->size += RISCV_ELF_WORD_BYTES; -+ if (info->shared -+ || (*local_tls_type & (GOT_TLS_GD | GOT_TLS_IE))) -+ srel->size += sizeof (ElfNN_External_Rela); -+ } -+ else -+ *local_got = (bfd_vma) -1; -+ } -+ } -+ -+ /* Allocate global sym .plt and .got entries, and space for global -+ sym dynamic relocs. */ -+ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); -+ -+ if (htab->elf.sgotplt) -+ { -+ struct elf_link_hash_entry *got; -+ got = elf_link_hash_lookup (elf_hash_table (info), -+ "_GLOBAL_OFFSET_TABLE_", -+ FALSE, FALSE, FALSE); -+ -+ /* Don't allocate .got.plt section if there are no GOT nor PLT -+ entries and there is no refeence to _GLOBAL_OFFSET_TABLE_. */ -+ if ((got == NULL -+ || !got->ref_regular_nonweak) -+ && (htab->elf.sgotplt->size == GOTPLT_HEADER_SIZE) -+ && (htab->elf.splt == NULL -+ || htab->elf.splt->size == 0) -+ && (htab->elf.sgot == NULL -+ || (htab->elf.sgot->size -+ == get_elf_backend_data (output_bfd)->got_header_size))) -+ htab->elf.sgotplt->size = 0; -+ } -+ -+ /* The check_relocs and adjust_dynamic_symbol entry points have -+ determined the sizes of the various dynamic sections. Allocate -+ memory for them. */ -+ for (s = dynobj->sections; s != NULL; s = s->next) -+ { -+ if ((s->flags & SEC_LINKER_CREATED) == 0) -+ continue; -+ -+ if (s == htab->elf.splt -+ || s == htab->elf.sgot -+ || s == htab->elf.sgotplt -+ || s == htab->sdynbss) -+ { -+ /* Strip this section if we don't need it; see the -+ comment below. */ -+ } -+ else if (strncmp (s->name, ".rela", 5) == 0) -+ { -+ if (s->size != 0) -+ { -+ /* We use the reloc_count field as a counter if we need -+ to copy relocs into the output file. */ -+ s->reloc_count = 0; -+ } -+ } -+ else -+ { -+ /* It's not one of our sections. */ -+ continue; -+ } -+ -+ if (s->size == 0) -+ { -+ /* If we don't need this section, strip it from the -+ output file. This is mostly to handle .rela.bss and -+ .rela.plt. We must create both sections in -+ create_dynamic_sections, because they must be created -+ before the linker maps input sections to output -+ sections. The linker does that before -+ adjust_dynamic_symbol is called, and it is that -+ function which decides whether anything needs to go -+ into these sections. */ -+ s->flags |= SEC_EXCLUDE; -+ continue; -+ } -+ -+ if ((s->flags & SEC_HAS_CONTENTS) == 0) -+ continue; -+ -+ /* Allocate memory for the section contents. Zero the memory -+ for the benefit of .rela.plt, which has 4 unused entries -+ at the beginning, and we don't want garbage. */ -+ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size); -+ if (s->contents == NULL) -+ return FALSE; -+ } -+ -+ if (elf_hash_table (info)->dynamic_sections_created) -+ { -+ /* Add some entries to the .dynamic section. We fill in the -+ values later, in riscv_elf_finish_dynamic_sections, but we -+ must add the entries now so that we get the correct size for -+ the .dynamic section. The DT_DEBUG entry is filled in by the -+ dynamic linker and used by the debugger. */ -+#define add_dynamic_entry(TAG, VAL) \ -+ _bfd_elf_add_dynamic_entry (info, TAG, VAL) -+ -+ if (info->executable) -+ { -+ if (!add_dynamic_entry (DT_DEBUG, 0)) -+ return FALSE; -+ } -+ -+ if (htab->elf.srelplt->size != 0) -+ { -+ if (!add_dynamic_entry (DT_PLTGOT, 0) -+ || !add_dynamic_entry (DT_PLTRELSZ, 0) -+ || !add_dynamic_entry (DT_PLTREL, DT_RELA) -+ || !add_dynamic_entry (DT_JMPREL, 0)) -+ return FALSE; -+ } -+ -+ if (!add_dynamic_entry (DT_RELA, 0) -+ || !add_dynamic_entry (DT_RELASZ, 0) -+ || !add_dynamic_entry (DT_RELAENT, sizeof (ElfNN_External_Rela))) -+ return FALSE; -+ -+ /* If any dynamic relocs apply to a read-only section, -+ then we need a DT_TEXTREL entry. */ -+ if ((info->flags & DF_TEXTREL) == 0) -+ elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info); -+ -+ if (info->flags & DF_TEXTREL) -+ { -+ if (!add_dynamic_entry (DT_TEXTREL, 0)) -+ return FALSE; -+ } -+ } -+#undef add_dynamic_entry -+ -+ return TRUE; -+} -+ -+#define TP_OFFSET 0 -+#define DTP_OFFSET 0x800 -+ -+/* Return the relocation value for a TLS dtp-relative reloc. */ -+ -+static bfd_vma -+dtpoff (struct bfd_link_info *info, bfd_vma address) -+{ -+ /* If tls_sec is NULL, we should have signalled an error already. */ -+ if (elf_hash_table (info)->tls_sec == NULL) -+ return 0; -+ return address - elf_hash_table (info)->tls_sec->vma - DTP_OFFSET; -+} -+ -+/* Return the relocation value for a static TLS tp-relative relocation. */ -+ -+static bfd_vma -+tpoff (struct bfd_link_info *info, bfd_vma address) -+{ -+ /* If tls_sec is NULL, we should have signalled an error already. */ -+ if (elf_hash_table (info)->tls_sec == NULL) -+ return 0; -+ return address - elf_hash_table (info)->tls_sec->vma - TP_OFFSET; -+} -+ -+/* Return the global pointer's value, or 0 if it is not in use. */ -+ -+static bfd_vma -+riscv_global_pointer_value (struct bfd_link_info *info) -+{ -+ struct bfd_link_hash_entry *h; -+ -+ h = bfd_link_hash_lookup (info->hash, "_gp", FALSE, FALSE, TRUE); -+ if (h == NULL || h->type != bfd_link_hash_defined) -+ return 0; -+ -+ return h->u.def.value + sec_addr (h->u.def.section); -+} -+ -+/* Emplace a static relocation. */ -+ -+static bfd_reloc_status_type -+perform_relocation (const reloc_howto_type *howto, -+ const Elf_Internal_Rela *rel, -+ bfd_vma value, -+ asection *input_section, -+ bfd *input_bfd, -+ bfd_byte *contents) -+{ -+ if (howto->pc_relative) -+ value -= sec_addr (input_section) + rel->r_offset; -+ value += rel->r_addend; -+ -+ switch (ELFNN_R_TYPE (rel->r_info)) -+ { -+ case R_RISCV_HI20: -+ case R_RISCV_TPREL_HI20: -+ case R_RISCV_PCREL_HI20: -+ case R_RISCV_GOT_HI20: -+ case R_RISCV_TLS_GOT_HI20: -+ case R_RISCV_TLS_GD_HI20: -+ value = ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)); -+ break; -+ -+ case R_RISCV_LO12_I: -+ case R_RISCV_TPREL_LO12_I: -+ case R_RISCV_PCREL_LO12_I: -+ value = ENCODE_ITYPE_IMM (value); -+ break; -+ -+ case R_RISCV_LO12_S: -+ case R_RISCV_TPREL_LO12_S: -+ case R_RISCV_PCREL_LO12_S: -+ value = ENCODE_STYPE_IMM (value); -+ break; -+ -+ case R_RISCV_CALL: -+ case R_RISCV_CALL_PLT: -+ if (!VALID_UTYPE_IMM (RISCV_CONST_HIGH_PART (value))) -+ return bfd_reloc_overflow; -+ value = ENCODE_UTYPE_IMM (RISCV_CONST_HIGH_PART (value)) -+ | (ENCODE_ITYPE_IMM (value) << 32); -+ break; -+ -+ case R_RISCV_JAL: -+ if (!VALID_UJTYPE_IMM (value)) -+ return bfd_reloc_overflow; -+ value = ENCODE_UJTYPE_IMM (value); -+ break; -+ -+ case R_RISCV_BRANCH: -+ if (!VALID_SBTYPE_IMM (value)) -+ return bfd_reloc_overflow; -+ value = ENCODE_SBTYPE_IMM (value); -+ break; -+ -+ case R_RISCV_32: -+ case R_RISCV_64: -+ case R_RISCV_ADD8: -+ case R_RISCV_ADD16: -+ case R_RISCV_ADD32: -+ case R_RISCV_ADD64: -+ case R_RISCV_SUB8: -+ case R_RISCV_SUB16: -+ case R_RISCV_SUB32: -+ case R_RISCV_SUB64: -+ case R_RISCV_TLS_DTPREL32: -+ case R_RISCV_TLS_DTPREL64: -+ break; -+ -+ default: -+ return bfd_reloc_notsupported; -+ } -+ -+ bfd_vma word = bfd_get (howto->bitsize, input_bfd, contents + rel->r_offset); -+ word = (word & ~howto->dst_mask) | (value & howto->dst_mask); -+ bfd_put (howto->bitsize, input_bfd, word, contents + rel->r_offset); -+ -+ return bfd_reloc_ok; -+} -+ -+/* Remember all PC-relative high-part relocs we've encountered to help us -+ later resolve the corresponding low-part relocs. */ -+ -+typedef struct { -+ bfd_vma address; -+ bfd_vma value; -+} riscv_pcrel_hi_reloc; -+ -+typedef struct riscv_pcrel_lo_reloc { -+ asection *input_section; -+ struct bfd_link_info *info; -+ reloc_howto_type *howto; -+ const Elf_Internal_Rela *reloc; -+ bfd_vma addr; -+ const char *name; -+ bfd_byte *contents; -+ struct riscv_pcrel_lo_reloc *next; -+} riscv_pcrel_lo_reloc; -+ -+typedef struct { -+ htab_t hi_relocs; -+ riscv_pcrel_lo_reloc *lo_relocs; -+} riscv_pcrel_relocs; -+ -+static hashval_t -+riscv_pcrel_reloc_hash (const void *entry) -+{ -+ const riscv_pcrel_hi_reloc *e = entry; -+ return (hashval_t)(e->address >> 2); -+} -+ -+static bfd_boolean -+riscv_pcrel_reloc_eq (const void *entry1, const void *entry2) -+{ -+ const riscv_pcrel_hi_reloc *e1 = entry1, *e2 = entry2; -+ return e1->address == e2->address; -+} -+ -+static bfd_boolean -+riscv_init_pcrel_relocs (riscv_pcrel_relocs *p) -+{ -+ -+ p->lo_relocs = NULL; -+ p->hi_relocs = htab_create (1024, riscv_pcrel_reloc_hash, -+ riscv_pcrel_reloc_eq, free); -+ return p->hi_relocs != NULL; -+} -+ -+static void -+riscv_free_pcrel_relocs (riscv_pcrel_relocs *p) -+{ -+ riscv_pcrel_lo_reloc *cur = p->lo_relocs; -+ while (cur != NULL) -+ { -+ riscv_pcrel_lo_reloc *next = cur->next; -+ free (cur); -+ cur = next; -+ } -+ -+ htab_delete (p->hi_relocs); -+} -+ -+static bfd_boolean -+riscv_record_pcrel_hi_reloc (riscv_pcrel_relocs *p, bfd_vma addr, bfd_vma value) -+{ -+ riscv_pcrel_hi_reloc entry = {addr, value - addr}; -+ riscv_pcrel_hi_reloc **slot = -+ (riscv_pcrel_hi_reloc **) htab_find_slot (p->hi_relocs, &entry, INSERT); -+ BFD_ASSERT (*slot == NULL); -+ *slot = (riscv_pcrel_hi_reloc *) bfd_malloc (sizeof (riscv_pcrel_hi_reloc)); -+ if (*slot == NULL) -+ return FALSE; -+ **slot = entry; -+ return TRUE; -+} -+ -+static bfd_boolean -+riscv_record_pcrel_lo_reloc (riscv_pcrel_relocs *p, -+ asection *input_section, -+ struct bfd_link_info *info, -+ reloc_howto_type *howto, -+ const Elf_Internal_Rela *reloc, -+ bfd_vma addr, -+ const char *name, -+ bfd_byte *contents) -+{ -+ riscv_pcrel_lo_reloc *entry; -+ entry = (riscv_pcrel_lo_reloc *) bfd_malloc (sizeof (riscv_pcrel_lo_reloc)); -+ if (entry == NULL) -+ return FALSE; -+ *entry = (riscv_pcrel_lo_reloc) {input_section, info, howto, reloc, addr, -+ name, contents, p->lo_relocs}; -+ p->lo_relocs = entry; -+ return TRUE; -+} -+ -+static bfd_boolean -+riscv_resolve_pcrel_lo_relocs (riscv_pcrel_relocs *p) -+{ -+ riscv_pcrel_lo_reloc *r; -+ for (r = p->lo_relocs; r != NULL; r = r->next) -+ { -+ bfd *input_bfd = r->input_section->owner; -+ riscv_pcrel_hi_reloc search = {r->addr, 0}; -+ riscv_pcrel_hi_reloc *entry = htab_find (p->hi_relocs, &search); -+ if (entry == NULL) -+ return ((*r->info->callbacks->reloc_overflow) -+ (r->info, NULL, r->name, r->howto->name, (bfd_vma) 0, -+ input_bfd, r->input_section, r->reloc->r_offset)); -+ -+ perform_relocation (r->howto, r->reloc, entry->value, r->input_section, -+ input_bfd, r->contents); -+ } -+ -+ return TRUE; -+} -+ -+/* Relocate a RISC-V ELF section. -+ -+ The RELOCATE_SECTION function is called by the new ELF backend linker -+ to handle the relocations for a section. -+ -+ The relocs are always passed as Rela structures. -+ -+ This function is responsible for adjusting the section contents as -+ necessary, and (if generating a relocatable output file) adjusting -+ the reloc addend as necessary. -+ -+ This function does not have to worry about setting the reloc -+ address or the reloc symbol index. -+ -+ LOCAL_SYMS is a pointer to the swapped in local symbols. -+ -+ LOCAL_SECTIONS is an array giving the section in the input file -+ corresponding to the st_shndx field of each local symbol. -+ -+ The global hash table entry for the global symbols can be found -+ via elf_sym_hashes (input_bfd). -+ -+ When generating relocatable output, this function must handle -+ STB_LOCAL/STT_SECTION symbols specially. The output symbol is -+ going to be the section symbol corresponding to the output -+ section, which means that the addend must be adjusted -+ accordingly. */ -+ -+static bfd_boolean -+riscv_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, -+ bfd *input_bfd, asection *input_section, -+ bfd_byte *contents, Elf_Internal_Rela *relocs, -+ Elf_Internal_Sym *local_syms, -+ asection **local_sections) -+{ -+ Elf_Internal_Rela *rel; -+ Elf_Internal_Rela *relend; -+ riscv_pcrel_relocs pcrel_relocs; -+ bfd_boolean ret = FALSE; -+ asection *sreloc = elf_section_data (input_section)->sreloc; -+ struct riscv_elf_link_hash_table *htab = riscv_elf_hash_table (info); -+ Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (input_bfd); -+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); -+ bfd_vma *local_got_offsets = elf_local_got_offsets (input_bfd); -+ -+ if (!riscv_init_pcrel_relocs (&pcrel_relocs)) -+ return FALSE; -+ -+ relend = relocs + input_section->reloc_count; -+ for (rel = relocs; rel < relend; rel++) -+ { -+ unsigned long r_symndx; -+ struct elf_link_hash_entry *h; -+ Elf_Internal_Sym *sym; -+ asection *sec; -+ bfd_vma relocation; -+ bfd_reloc_status_type r = bfd_reloc_ok; -+ const char *name; -+ bfd_vma off, ie_off; -+ bfd_boolean unresolved_reloc, is_ie = FALSE; -+ bfd_vma pc = sec_addr (input_section) + rel->r_offset; -+ int r_type = ELFNN_R_TYPE (rel->r_info), tls_type; -+ reloc_howto_type *howto = riscv_elf_rtype_to_howto (r_type); -+ const char *msg = NULL; -+ -+ if (r_type == R_RISCV_GNU_VTINHERIT || r_type == R_RISCV_GNU_VTENTRY) -+ continue; -+ -+ /* This is a final link. */ -+ r_symndx = ELFNN_R_SYM (rel->r_info); -+ h = NULL; -+ sym = NULL; -+ sec = NULL; -+ unresolved_reloc = FALSE; -+ if (r_symndx < symtab_hdr->sh_info) -+ { -+ sym = local_syms + r_symndx; -+ sec = local_sections[r_symndx]; -+ relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); -+ } -+ else -+ { -+ bfd_boolean warned; -+ /* bfd_boolean ignored; */ -+ -+ RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, -+ r_symndx, symtab_hdr, sym_hashes, -+ h, sec, relocation, -+ unresolved_reloc, warned /*, ignored */); -+ if (warned) -+ { -+ /* To avoid generating warning messages about truncated -+ relocations, set the relocation's address to be the same as -+ the start of this section. */ -+ if (input_section->output_section != NULL) -+ relocation = input_section->output_section->vma; -+ else -+ relocation = 0; -+ } -+ } -+ -+ if (sec != NULL && discarded_section (sec)) -+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, -+ rel, 1, relend, howto, 0, contents); -+ -+ if (info->relocatable) -+ continue; -+ -+ if (h != NULL) -+ name = h->root.root.string; -+ else -+ { -+ name = (bfd_elf_string_from_elf_section -+ (input_bfd, symtab_hdr->sh_link, sym->st_name)); -+ if (name == NULL || *name == '\0') -+ name = bfd_section_name (input_bfd, sec); -+ } -+ -+ switch (r_type) -+ { -+ case R_RISCV_NONE: -+ case R_RISCV_TPREL_ADD: -+ case R_RISCV_COPY: -+ case R_RISCV_JUMP_SLOT: -+ case R_RISCV_RELATIVE: -+ /* These require nothing of us at all. */ -+ continue; -+ -+ case R_RISCV_BRANCH: -+ case R_RISCV_HI20: -+ /* These require no special handling beyond perform_relocation. */ -+ break; -+ -+ case R_RISCV_GOT_HI20: -+ if (h != NULL) -+ { -+ bfd_boolean dyn; -+ -+ off = h->got.offset; -+ BFD_ASSERT (off != (bfd_vma) -1); -+ dyn = elf_hash_table (info)->dynamic_sections_created; -+ -+ if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) -+ || (info->shared -+ && SYMBOL_REFERENCES_LOCAL (info, h))) -+ { -+ /* This is actually a static link, or it is a -+ -Bsymbolic link and the symbol is defined -+ locally, or the symbol was forced to be local -+ because of a version file. We must initialize -+ this entry in the global offset table. Since the -+ offset must always be a multiple of the word size, -+ we use the least significant bit to record whether -+ we have initialized it already. -+ -+ When doing a dynamic link, we create a .rela.got -+ relocation entry to initialize the value. This -+ is done in the finish_dynamic_symbol routine. */ -+ if ((off & 1) != 0) -+ off &= ~1; -+ else -+ { -+ bfd_put_NN (output_bfd, relocation, -+ htab->elf.sgot->contents + off); -+ h->got.offset |= 1; -+ } -+ } -+ else -+ unresolved_reloc = FALSE; -+ } -+ else -+ { -+ BFD_ASSERT (local_got_offsets != NULL -+ && local_got_offsets[r_symndx] != (bfd_vma) -1); -+ -+ off = local_got_offsets[r_symndx]; -+ -+ /* The offset must always be a multiple of 8 on 64-bit. -+ We use the least significant bit to record -+ whether we have already processed this entry. */ -+ if ((off & 1) != 0) -+ off &= ~1; -+ else -+ { -+ if (info->shared) -+ { -+ asection *s; -+ Elf_Internal_Rela outrel; -+ -+ /* We need to generate a R_RISCV_RELATIVE reloc -+ for the dynamic linker. */ -+ s = htab->elf.srelgot; -+ BFD_ASSERT (s != NULL); -+ -+ outrel.r_offset = sec_addr (htab->elf.sgot) + off; -+ outrel.r_info = -+ ELFNN_R_INFO (0, R_RISCV_RELATIVE); -+ outrel.r_addend = relocation; -+ relocation = 0; -+ riscv_elf_append_rela (output_bfd, s, &outrel); -+ } -+ -+ bfd_put_NN (output_bfd, relocation, -+ htab->elf.sgot->contents + off); -+ local_got_offsets[r_symndx] |= 1; -+ } -+ } -+ relocation = sec_addr (htab->elf.sgot) + off; -+ if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, relocation)) -+ r = bfd_reloc_overflow; -+ break; -+ -+ case R_RISCV_ADD8: -+ case R_RISCV_ADD16: -+ case R_RISCV_ADD32: -+ case R_RISCV_ADD64: -+ { -+ bfd_vma old_value = bfd_get (howto->bitsize, input_bfd, -+ contents + rel->r_offset); -+ relocation = old_value + relocation; -+ } -+ break; -+ -+ case R_RISCV_SUB8: -+ case R_RISCV_SUB16: -+ case R_RISCV_SUB32: -+ case R_RISCV_SUB64: -+ { -+ bfd_vma old_value = bfd_get (howto->bitsize, input_bfd, -+ contents + rel->r_offset); -+ relocation = old_value - relocation; -+ } -+ break; -+ -+ case R_RISCV_CALL_PLT: -+ case R_RISCV_CALL: -+ case R_RISCV_JAL: -+ if (info->shared && h != NULL && h->plt.offset != MINUS_ONE) -+ { -+ /* Refer to the PLT entry. */ -+ relocation = sec_addr (htab->elf.splt) + h->plt.offset; -+ unresolved_reloc = FALSE; -+ } -+ break; -+ -+ case R_RISCV_TPREL_HI20: -+ relocation = tpoff (info, relocation); -+ break; -+ -+ case R_RISCV_TPREL_LO12_I: -+ case R_RISCV_TPREL_LO12_S: -+ relocation = tpoff (info, relocation); -+ if (VALID_ITYPE_IMM (relocation + rel->r_addend)) -+ { -+ /* We can use tp as the base register. */ -+ bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); -+ insn &= ~(OP_MASK_RS1 << OP_SH_RS1); -+ insn |= X_TP << OP_SH_RS1; -+ bfd_put_32 (input_bfd, insn, contents + rel->r_offset); -+ } -+ break; -+ -+ case R_RISCV_LO12_I: -+ case R_RISCV_LO12_S: -+ { -+ bfd_vma gp = riscv_global_pointer_value (info); -+ bfd_boolean x0_base = VALID_ITYPE_IMM (relocation + rel->r_addend); -+ if (x0_base || VALID_ITYPE_IMM (relocation + rel->r_addend - gp)) -+ { -+ /* We can use x0 or gp as the base register. */ -+ bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); -+ insn &= ~(OP_MASK_RS1 << OP_SH_RS1); -+ if (!x0_base) -+ { -+ rel->r_addend -= gp; -+ insn |= X_GP << OP_SH_RS1; -+ } -+ bfd_put_32 (input_bfd, insn, contents + rel->r_offset); -+ } -+ break; -+ } -+ -+ case R_RISCV_PCREL_HI20: -+ if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, -+ relocation + rel->r_addend)) -+ r = bfd_reloc_overflow; -+ break; -+ -+ case R_RISCV_PCREL_LO12_I: -+ case R_RISCV_PCREL_LO12_S: -+ if (riscv_record_pcrel_lo_reloc (&pcrel_relocs, input_section, info, -+ howto, rel, relocation, name, -+ contents)) -+ continue; -+ r = bfd_reloc_overflow; -+ break; -+ -+ case R_RISCV_TLS_DTPREL32: -+ case R_RISCV_TLS_DTPREL64: -+ relocation = dtpoff (info, relocation); -+ break; -+ -+ case R_RISCV_32: -+ case R_RISCV_64: -+ if ((input_section->flags & SEC_ALLOC) == 0) -+ break; -+ -+ if ((info->shared -+ && (h == NULL -+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ || h->root.type != bfd_link_hash_undefweak) -+ && (! howto->pc_relative -+ || !SYMBOL_CALLS_LOCAL (info, h))) -+ || (!info->shared -+ && h != NULL -+ && h->dynindx != -1 -+ && !h->non_got_ref -+ && ((h->def_dynamic -+ && !h->def_regular) -+ || h->root.type == bfd_link_hash_undefweak -+ || h->root.type == bfd_link_hash_undefined))) -+ { -+ Elf_Internal_Rela outrel; -+ bfd_boolean skip_static_relocation, skip_dynamic_relocation; -+ -+ /* When generating a shared object, these relocations -+ are copied into the output file to be resolved at run -+ time. */ -+ -+ outrel.r_offset = -+ _bfd_elf_section_offset (output_bfd, info, input_section, -+ rel->r_offset); -+ skip_static_relocation = outrel.r_offset != (bfd_vma) -2; -+ skip_dynamic_relocation = outrel.r_offset >= (bfd_vma) -2; -+ outrel.r_offset += sec_addr (input_section); -+ -+ if (skip_dynamic_relocation) -+ memset (&outrel, 0, sizeof outrel); -+ else if (h != NULL && h->dynindx != -1 -+ && !(info->shared -+ && SYMBOLIC_BIND (info, h) -+ && h->def_regular)) -+ { -+ outrel.r_info = ELFNN_R_INFO (h->dynindx, r_type); -+ outrel.r_addend = rel->r_addend; -+ } -+ else -+ { -+ outrel.r_info = ELFNN_R_INFO (0, R_RISCV_RELATIVE); -+ outrel.r_addend = relocation + rel->r_addend; -+ } -+ -+ riscv_elf_append_rela (output_bfd, sreloc, &outrel); -+ if (skip_static_relocation) -+ continue; -+ } -+ break; -+ -+ case R_RISCV_TLS_GOT_HI20: -+ is_ie = TRUE; -+ /* Fall through. */ -+ -+ case R_RISCV_TLS_GD_HI20: -+ if (h != NULL) -+ { -+ off = h->got.offset; -+ h->got.offset |= 1; -+ } -+ else -+ { -+ off = local_got_offsets[r_symndx]; -+ local_got_offsets[r_symndx] |= 1; -+ } -+ -+ tls_type = _bfd_riscv_elf_tls_type (input_bfd, h, r_symndx); -+ BFD_ASSERT (tls_type & (GOT_TLS_IE | GOT_TLS_GD)); -+ /* If this symbol is referenced by both GD and IE TLS, the IE -+ reference's GOT slot follows the GD reference's slots. */ -+ ie_off = 0; -+ if ((tls_type & GOT_TLS_GD) && (tls_type & GOT_TLS_IE)) -+ ie_off = 2 * GOT_ENTRY_SIZE; -+ -+ if ((off & 1) != 0) -+ off &= ~1; -+ else -+ { -+ Elf_Internal_Rela outrel; -+ int indx = 0; -+ bfd_boolean need_relocs = FALSE; -+ -+ if (htab->elf.srelgot == NULL) -+ abort (); -+ -+ if (h != NULL) -+ { -+ bfd_boolean dyn; -+ dyn = htab->elf.dynamic_sections_created; -+ -+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) -+ && (!info->shared -+ || !SYMBOL_REFERENCES_LOCAL (info, h))) -+ { -+ indx = h->dynindx; -+ } -+ } -+ -+ /* The GOT entries have not been initialized yet. Do it -+ now, and emit any relocations. */ -+ if ((info->shared || indx != 0) -+ && (h == NULL -+ || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT -+ || h->root.type != bfd_link_hash_undefweak)) -+ need_relocs = TRUE; -+ -+ if (tls_type & GOT_TLS_GD) -+ { -+ if (need_relocs) -+ { -+ outrel.r_offset = sec_addr (htab->elf.sgot) + off; -+ outrel.r_addend = 0; -+ outrel.r_info = ELFNN_R_INFO (indx, R_RISCV_TLS_DTPMODNN); -+ bfd_put_NN (output_bfd, 0, -+ htab->elf.sgot->contents + off); -+ riscv_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel); -+ if (indx == 0) -+ { -+ BFD_ASSERT (! unresolved_reloc); -+ bfd_put_NN (output_bfd, -+ dtpoff (info, relocation), -+ (htab->elf.sgot->contents + off + -+ RISCV_ELF_WORD_BYTES)); -+ } -+ else -+ { -+ bfd_put_NN (output_bfd, 0, -+ (htab->elf.sgot->contents + off + -+ RISCV_ELF_WORD_BYTES)); -+ outrel.r_info = ELFNN_R_INFO (indx, R_RISCV_TLS_DTPRELNN); -+ outrel.r_offset += RISCV_ELF_WORD_BYTES; -+ riscv_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel); -+ } -+ } -+ else -+ { -+ /* If we are not emitting relocations for a -+ general dynamic reference, then we must be in a -+ static link or an executable link with the -+ symbol binding locally. Mark it as belonging -+ to module 1, the executable. */ -+ bfd_put_NN (output_bfd, 1, -+ htab->elf.sgot->contents + off); -+ bfd_put_NN (output_bfd, -+ dtpoff (info, relocation), -+ (htab->elf.sgot->contents + off + -+ RISCV_ELF_WORD_BYTES)); -+ } -+ } -+ -+ if (tls_type & GOT_TLS_IE) -+ { -+ if (need_relocs) -+ { -+ bfd_put_NN (output_bfd, 0, -+ htab->elf.sgot->contents + off + ie_off); -+ outrel.r_offset = sec_addr (htab->elf.sgot) -+ + off + ie_off; -+ outrel.r_addend = 0; -+ if (indx == 0) -+ outrel.r_addend = tpoff (info, relocation); -+ outrel.r_info = ELFNN_R_INFO (indx, R_RISCV_TLS_TPRELNN); -+ riscv_elf_append_rela (output_bfd, htab->elf.srelgot, &outrel); -+ } -+ else -+ { -+ bfd_put_NN (output_bfd, tpoff (info, relocation), -+ htab->elf.sgot->contents + off + ie_off); -+ } -+ } -+ } -+ -+ BFD_ASSERT (off < (bfd_vma) -2); -+ relocation = sec_addr (htab->elf.sgot) + off + (is_ie ? ie_off : 0); -+ if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, relocation)) -+ r = bfd_reloc_overflow; -+ unresolved_reloc = FALSE; -+ break; -+ -+ default: -+ r = bfd_reloc_notsupported; -+ } -+ -+ /* Dynamic relocs are not propagated for SEC_DEBUGGING sections -+ because such sections are not SEC_ALLOC and thus ld.so will -+ not process them. */ -+ if (unresolved_reloc -+ && !((input_section->flags & SEC_DEBUGGING) != 0 -+ && h->def_dynamic) -+ && _bfd_elf_section_offset (output_bfd, info, input_section, -+ rel->r_offset) != (bfd_vma) -1) -+ { -+ (*_bfd_error_handler) -+ (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"), -+ input_bfd, -+ input_section, -+ (long) rel->r_offset, -+ howto->name, -+ h->root.root.string); -+ continue; -+ } -+ -+ if (r == bfd_reloc_ok) -+ r = perform_relocation (howto, rel, relocation, input_section, -+ input_bfd, contents); -+ -+ switch (r) -+ { -+ case bfd_reloc_ok: -+ continue; -+ -+ case bfd_reloc_overflow: -+ r = info->callbacks->reloc_overflow -+ (info, (h ? &h->root : NULL), name, howto->name, -+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset); -+ break; -+ -+ case bfd_reloc_undefined: -+ r = info->callbacks->undefined_symbol -+ (info, name, input_bfd, input_section, rel->r_offset, -+ TRUE); -+ break; -+ -+ case bfd_reloc_outofrange: -+ msg = _("internal error: out of range error"); -+ break; -+ -+ case bfd_reloc_notsupported: -+ msg = _("internal error: unsupported relocation error"); -+ break; -+ -+ case bfd_reloc_dangerous: -+ msg = _("internal error: dangerous relocation"); -+ break; -+ -+ default: -+ msg = _("internal error: unknown error"); -+ break; -+ } -+ -+ if (msg) -+ r = info->callbacks->warning -+ (info, msg, name, input_bfd, input_section, rel->r_offset); -+ goto out; -+ } -+ -+ ret = riscv_resolve_pcrel_lo_relocs (&pcrel_relocs); -+out: -+ riscv_free_pcrel_relocs (&pcrel_relocs); -+ return ret; -+} -+ -+/* Finish up dynamic symbol handling. We set the contents of various -+ dynamic sections here. */ -+ -+static bfd_boolean -+riscv_elf_finish_dynamic_symbol (bfd *output_bfd, -+ struct bfd_link_info *info, -+ struct elf_link_hash_entry *h, -+ Elf_Internal_Sym *sym) -+{ -+ struct riscv_elf_link_hash_table *htab = riscv_elf_hash_table (info); -+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); -+ -+ if (h->plt.offset != (bfd_vma) -1) -+ { -+ /* We've decided to create a PLT entry for this symbol. */ -+ bfd_byte *loc; -+ bfd_vma i, header_address, plt_idx, got_address; -+ uint32_t plt_entry[PLT_ENTRY_INSNS]; -+ Elf_Internal_Rela rela; -+ -+ BFD_ASSERT (h->dynindx != -1); -+ -+ /* Calculate the address of the PLT header. */ -+ header_address = sec_addr (htab->elf.splt); -+ -+ /* Calculate the index of the entry. */ -+ plt_idx = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE; -+ -+ /* Calculate the address of the .got.plt entry. */ -+ got_address = riscv_elf_got_plt_val (plt_idx, info); -+ -+ /* Find out where the .plt entry should go. */ -+ loc = htab->elf.splt->contents + h->plt.offset; -+ -+ /* Fill in the PLT entry itself. */ -+ riscv_make_plt_entry (got_address, header_address + h->plt.offset, -+ plt_entry); -+ for (i = 0; i < PLT_ENTRY_INSNS; i++) -+ bfd_put_32 (output_bfd, plt_entry[i], loc + 4*i); -+ -+ /* Fill in the initial value of the .got.plt entry. */ -+ loc = htab->elf.sgotplt->contents -+ + (got_address - sec_addr (htab->elf.sgotplt)); -+ bfd_put_NN (output_bfd, sec_addr (htab->elf.splt), loc); -+ -+ /* Fill in the entry in the .rela.plt section. */ -+ rela.r_offset = got_address; -+ rela.r_addend = 0; -+ rela.r_info = ELFNN_R_INFO (h->dynindx, R_RISCV_JUMP_SLOT); -+ -+ loc = htab->elf.srelplt->contents + plt_idx * sizeof (ElfNN_External_Rela); -+ bed->s->swap_reloca_out (output_bfd, &rela, loc); -+ -+ if (!h->def_regular) -+ { -+ /* Mark the symbol as undefined, rather than as defined in -+ the .plt section. Leave the value alone. */ -+ sym->st_shndx = SHN_UNDEF; -+ /* If the symbol is weak, we do need to clear the value. -+ Otherwise, the PLT entry would provide a definition for -+ the symbol even if the symbol wasn't defined anywhere, -+ and so the symbol would never be NULL. */ -+ if (!h->ref_regular_nonweak) -+ sym->st_value = 0; -+ } -+ } -+ -+ if (h->got.offset != (bfd_vma) -1 -+ && !(riscv_elf_hash_entry(h)->tls_type & (GOT_TLS_GD | GOT_TLS_IE))) -+ { -+ asection *sgot; -+ asection *srela; -+ Elf_Internal_Rela rela; -+ -+ /* This symbol has an entry in the GOT. Set it up. */ -+ -+ sgot = htab->elf.sgot; -+ srela = htab->elf.srelgot; -+ BFD_ASSERT (sgot != NULL && srela != NULL); -+ -+ rela.r_offset = sec_addr (sgot) + (h->got.offset &~ (bfd_vma) 1); -+ -+ /* If this is a -Bsymbolic link, and the symbol is defined -+ locally, we just want to emit a RELATIVE reloc. Likewise if -+ the symbol was forced to be local because of a version file. -+ The entry in the global offset table will already have been -+ initialized in the relocate_section function. */ -+ if (info->shared -+ && (info->symbolic || h->dynindx == -1) -+ && h->def_regular) -+ { -+ asection *sec = h->root.u.def.section; -+ rela.r_info = ELFNN_R_INFO (0, R_RISCV_RELATIVE); -+ rela.r_addend = (h->root.u.def.value -+ + sec->output_section->vma -+ + sec->output_offset); -+ } -+ else -+ { -+ BFD_ASSERT (h->dynindx != -1); -+ rela.r_info = ELFNN_R_INFO (h->dynindx, R_RISCV_NN); -+ rela.r_addend = 0; -+ } -+ -+ bfd_put_NN (output_bfd, 0, -+ sgot->contents + (h->got.offset & ~(bfd_vma) 1)); -+ riscv_elf_append_rela (output_bfd, srela, &rela); -+ } -+ -+ if (h->needs_copy) -+ { -+ Elf_Internal_Rela rela; -+ -+ /* This symbols needs a copy reloc. Set it up. */ -+ BFD_ASSERT (h->dynindx != -1); -+ -+ rela.r_offset = sec_addr (h->root.u.def.section) + h->root.u.def.value; -+ rela.r_info = ELFNN_R_INFO (h->dynindx, R_RISCV_COPY); -+ rela.r_addend = 0; -+ riscv_elf_append_rela (output_bfd, htab->srelbss, &rela); -+ } -+ -+ /* Mark some specially defined symbols as absolute. */ -+ if (/*h == htab->elf.hdynamic*/ -+ strcmp (h->root.root.string, "_DYNAMIC") == 0 -+ || (h == htab->elf.hgot || h == htab->elf.hplt)) -+ sym->st_shndx = SHN_ABS; -+ -+ return TRUE; -+} -+ -+/* Finish up the dynamic sections. */ -+ -+static bfd_boolean -+riscv_finish_dyn (bfd *output_bfd, struct bfd_link_info *info, -+ bfd *dynobj, asection *sdyn) -+{ -+ struct riscv_elf_link_hash_table *htab = riscv_elf_hash_table (info); -+ const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); -+ size_t dynsize = bed->s->sizeof_dyn; -+ bfd_byte *dyncon, *dynconend; -+ -+ dynconend = sdyn->contents + sdyn->size; -+ for (dyncon = sdyn->contents; dyncon < dynconend; dyncon += dynsize) -+ { -+ Elf_Internal_Dyn dyn; -+ asection *s; -+ -+ bed->s->swap_dyn_in (dynobj, dyncon, &dyn); -+ -+ switch (dyn.d_tag) -+ { -+ case DT_PLTGOT: -+ s = htab->elf.sgotplt; -+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; -+ break; -+ case DT_JMPREL: -+ s = htab->elf.srelplt; -+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; -+ break; -+ case DT_PLTRELSZ: -+ s = htab->elf.srelplt; -+ dyn.d_un.d_val = s->size; -+ break; -+ default: -+ continue; -+ } -+ -+ bed->s->swap_dyn_out (output_bfd, &dyn, dyncon); -+ } -+ return TRUE; -+} -+ -+static bfd_boolean -+riscv_elf_finish_dynamic_sections (bfd *output_bfd, -+ struct bfd_link_info *info) -+{ -+ bfd *dynobj; -+ asection *sdyn; -+ struct riscv_elf_link_hash_table *htab; -+ -+ htab = riscv_elf_hash_table (info); -+ BFD_ASSERT (htab != NULL); -+ dynobj = htab->elf.dynobj; -+ -+ sdyn = bfd_get_linker_section (dynobj, ".dynamic"); -+ -+ if (elf_hash_table (info)->dynamic_sections_created) -+ { -+ asection *splt; -+ bfd_boolean ret; -+ -+ splt = htab->elf.splt; -+ BFD_ASSERT (splt != NULL && sdyn != NULL); -+ -+ ret = riscv_finish_dyn (output_bfd, info, dynobj, sdyn); -+ -+ if (ret != TRUE) -+ return ret; -+ -+ /* Fill in the head and tail entries in the procedure linkage table. */ -+ if (splt->size > 0) -+ { -+ int i; -+ uint32_t plt_header[PLT_HEADER_INSNS]; -+ riscv_make_plt0_entry (sec_addr (htab->elf.sgotplt), -+ sec_addr (splt), plt_header); -+ -+ for (i = 0; i < PLT_HEADER_INSNS; i++) -+ bfd_put_32 (output_bfd, plt_header[i], splt->contents + 4*i); -+ } -+ -+ elf_section_data (splt->output_section)->this_hdr.sh_entsize -+ = PLT_ENTRY_SIZE; -+ } -+ -+ if (htab->elf.sgotplt) -+ { -+ if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) -+ { -+ (*_bfd_error_handler) -+ (_("discarded output section: `%A'"), htab->elf.sgotplt); -+ return FALSE; -+ } -+ -+ if (htab->elf.sgotplt->size > 0) -+ { -+ /* Write the first two entries in .got.plt, needed for the dynamic -+ linker. */ -+ bfd_put_NN (output_bfd, (bfd_vma) -1, htab->elf.sgotplt->contents); -+ bfd_put_NN (output_bfd, (bfd_vma) 0, -+ htab->elf.sgotplt->contents + GOT_ENTRY_SIZE); -+ } -+ -+ elf_section_data (htab->elf.sgotplt->output_section)->this_hdr.sh_entsize = -+ GOT_ENTRY_SIZE; -+ } -+ -+ if (htab->elf.sgot) -+ { -+ if (htab->elf.sgot->size > 0) -+ { -+ /* Set the first entry in the global offset table to the address of -+ the dynamic section. */ -+ bfd_vma val = sdyn ? sec_addr (sdyn) : 0; -+ bfd_put_NN (output_bfd, val, htab->elf.sgot->contents); -+ } -+ -+ elf_section_data (htab->elf.sgot->output_section)->this_hdr.sh_entsize = -+ GOT_ENTRY_SIZE; -+ } -+ -+ return TRUE; -+} -+ -+/* Return address for Ith PLT stub in section PLT, for relocation REL -+ or (bfd_vma) -1 if it should not be included. */ -+ -+static bfd_vma -+riscv_elf_plt_sym_val (bfd_vma i, const asection *plt, -+ const arelent *rel ATTRIBUTE_UNUSED) -+{ -+ return plt->vma + PLT_HEADER_SIZE + i * PLT_ENTRY_SIZE; -+} -+ -+static enum elf_reloc_type_class -+riscv_reloc_type_class (/*const struct bfd_link_info *info ATTRIBUTE_UNUSED, -+ const asection *rel_sec ATTRIBUTE_UNUSED,*/ -+ const Elf_Internal_Rela *rela) -+{ -+ switch (ELFNN_R_TYPE (rela->r_info)) -+ { -+ case R_RISCV_RELATIVE: -+ return reloc_class_relative; -+ case R_RISCV_JUMP_SLOT: -+ return reloc_class_plt; -+ case R_RISCV_COPY: -+ return reloc_class_copy; -+ default: -+ return reloc_class_normal; -+ } -+} -+ -+/* Return true if bfd machine EXTENSION is an extension of machine BASE. */ -+ -+static bfd_boolean -+riscv_mach_extends_p (unsigned long base, unsigned long extension) -+{ -+ return extension == base; -+} -+ -+/* Merge backend specific data from an object file to the output -+ object file when linking. */ -+ -+static bfd_boolean -+_bfd_riscv_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) -+{ -+ flagword old_flags; -+ flagword new_flags; -+ -+ if (!is_riscv_elf (ibfd) || !is_riscv_elf (obfd)) -+ return TRUE; -+ -+ if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0) -+ { -+ (*_bfd_error_handler) -+ (_("%B: ABI is incompatible with that of the selected emulation"), -+ ibfd); -+ return FALSE; -+ } -+ -+ if (!_bfd_elf_merge_object_attributes (ibfd, obfd)) -+ return FALSE; -+ -+ new_flags = elf_elfheader (ibfd)->e_flags; -+ old_flags = elf_elfheader (obfd)->e_flags; -+ -+ if (! elf_flags_init (obfd)) -+ { -+ elf_flags_init (obfd) = TRUE; -+ elf_elfheader (obfd)->e_flags = new_flags; -+ elf_elfheader (obfd)->e_ident[EI_CLASS] -+ = elf_elfheader (ibfd)->e_ident[EI_CLASS]; -+ -+ if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) -+ && (bfd_get_arch_info (obfd)->the_default -+ || riscv_mach_extends_p (bfd_get_mach (obfd), -+ bfd_get_mach (ibfd)))) -+ { -+ if (! bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), -+ bfd_get_mach (ibfd))) -+ return FALSE; -+ } -+ -+ return TRUE; -+ } -+ -+ /* Check flag compatibility. */ -+ -+ if (new_flags == old_flags) -+ return TRUE; -+ -+ /* Don't link RV32 and RV64. */ -+ if (elf_elfheader (ibfd)->e_ident[EI_CLASS] -+ != elf_elfheader (obfd)->e_ident[EI_CLASS]) -+ { -+ (*_bfd_error_handler) -+ (_("%B: ELF class mismatch: can't link 32- and 64-bit modules"), ibfd); -+ goto fail; -+ } -+ -+ /* Warn about any other mismatches. */ -+ if (new_flags != old_flags) -+ { -+ if (!EF_IS_RISCV_EXT_Xcustom (new_flags) && -+ !EF_IS_RISCV_EXT_Xcustom (old_flags)) -+ { -+ (*_bfd_error_handler) -+ (_("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), -+ ibfd, (unsigned long) new_flags, -+ (unsigned long) old_flags); -+ goto fail; -+ } -+ else if (EF_IS_RISCV_EXT_Xcustom(new_flags)) -+ EF_SET_RISCV_EXT (elf_elfheader (obfd)->e_flags, -+ EF_GET_RISCV_EXT (old_flags)); -+ } -+ -+ return TRUE; -+ -+fail: -+ bfd_set_error (bfd_error_bad_value); -+ return FALSE; -+} -+ -+/* Delete some bytes from a section while relaxing. */ -+ -+static bfd_boolean -+riscv_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, size_t count) -+{ -+ unsigned int i, symcount; -+ bfd_vma toaddr = sec->size; -+ struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); -+ Elf_Internal_Shdr *symtab_hdr = &elf_tdata (abfd)->symtab_hdr; -+ unsigned int sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec); -+ struct bfd_elf_section_data *data = elf_section_data (sec); -+ bfd_byte *contents = data->this_hdr.contents; -+ -+ /* Actually delete the bytes. */ -+ sec->size -= count; -+ memmove (contents + addr, contents + addr + count, toaddr - addr - count); -+ -+ /* Adjust the location of all of the relocs. Note that we need not -+ adjust the addends, since all PC-relative references must be against -+ symbols, which we will adjust below. */ -+ for (i = 0; i < sec->reloc_count; i++) -+ if (data->relocs[i].r_offset > addr && data->relocs[i].r_offset < toaddr) -+ data->relocs[i].r_offset -= count; -+ -+ /* Adjust the local symbols defined in this section. */ -+ for (i = 0; i < symtab_hdr->sh_info; i++) -+ { -+ Elf_Internal_Sym *sym = (Elf_Internal_Sym *) symtab_hdr->contents + i; -+ if (sym->st_shndx == sec_shndx) -+ { -+ /* If the symbol is in the range of memory we just moved, we -+ have to adjust its value. */ -+ if (sym->st_value > addr && sym->st_value <= toaddr) -+ sym->st_value -= count; -+ -+ /* If the symbol *spans* the bytes we just deleted (i.e. its -+ *end* is in the moved bytes but its *start* isn't), then we -+ must adjust its size. */ -+ if (sym->st_value <= addr -+ && sym->st_value + sym->st_size > addr -+ && sym->st_value + sym->st_size <= toaddr) -+ sym->st_size -= count; -+ } -+ } -+ -+ /* Now adjust the global symbols defined in this section. */ -+ symcount = ((symtab_hdr->sh_size / sizeof(ElfNN_External_Sym)) -+ - symtab_hdr->sh_info); -+ -+ for (i = 0; i < symcount; i++) -+ { -+ struct elf_link_hash_entry *sym_hash = sym_hashes[i]; -+ -+ if ((sym_hash->root.type == bfd_link_hash_defined -+ || sym_hash->root.type == bfd_link_hash_defweak) -+ && sym_hash->root.u.def.section == sec) -+ { -+ /* As above, adjust the value if needed. */ -+ if (sym_hash->root.u.def.value > addr -+ && sym_hash->root.u.def.value <= toaddr) -+ sym_hash->root.u.def.value -= count; -+ -+ /* As above, adjust the size if needed. */ -+ if (sym_hash->root.u.def.value <= addr -+ && sym_hash->root.u.def.value + sym_hash->size > addr -+ && sym_hash->root.u.def.value + sym_hash->size <= toaddr) -+ sym_hash->size -= count; -+ } -+ } -+ -+ return TRUE; -+} -+ -+/* Relax AUIPC + JALR into JAL. */ -+ -+static bfd_boolean -+_bfd_riscv_relax_call (bfd *abfd, asection *sec, -+ struct bfd_link_info *link_info, -+ Elf_Internal_Rela *rel, -+ bfd_vma symval, -+ bfd_boolean *again) -+{ -+ bfd_byte *contents = elf_section_data (sec)->this_hdr.contents; -+ bfd_signed_vma foff = symval - (sec_addr (sec) + rel->r_offset); -+ bfd_boolean near_zero = (symval + RISCV_IMM_REACH/2) < RISCV_IMM_REACH; -+ bfd_vma auipc, jalr; -+ int r_type; -+ -+ /* See if this function call can be shortened. */ -+ if (!VALID_UJTYPE_IMM (foff) && !(!link_info->shared && near_zero)) -+ return TRUE; -+ -+ /* Shorten the function call. */ -+ BFD_ASSERT (rel->r_offset + 8 <= sec->size); -+ -+ auipc = bfd_get_32 (abfd, contents + rel->r_offset); -+ jalr = bfd_get_32 (abfd, contents + rel->r_offset + 4); -+ -+ if (VALID_UJTYPE_IMM (foff)) -+ { -+ /* Relax to JAL rd, addr. */ -+ r_type = R_RISCV_JAL; -+ auipc = (jalr & (OP_MASK_RD << OP_SH_RD)) | MATCH_JAL; -+ } -+ else /* near_zero */ -+ { -+ /* Relax to JALR rd, x0, addr. */ -+ r_type = R_RISCV_LO12_I; -+ auipc = (jalr & (OP_MASK_RD << OP_SH_RD)) | MATCH_JALR; -+ } -+ -+ /* Replace the R_RISCV_CALL reloc. */ -+ rel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (rel->r_info), r_type); -+ /* Replace the AUIPC. */ -+ bfd_put_32 (abfd, auipc, contents + rel->r_offset); -+ -+ /* Delete unnecessary JALR. */ -+ *again = TRUE; -+ return riscv_relax_delete_bytes (abfd, sec, rel->r_offset + 4, 4); -+} -+ -+/* Relax non-PIC global variable references. */ -+ -+static bfd_boolean -+_bfd_riscv_relax_lui (bfd *abfd, asection *sec, -+ struct bfd_link_info *link_info, -+ Elf_Internal_Rela *rel, -+ bfd_vma symval, -+ bfd_boolean *again) -+{ -+ bfd_vma gp = riscv_global_pointer_value (link_info); -+ -+ /* Bail out if this symbol isn't in range of either gp or x0. */ -+ if (!VALID_ITYPE_IMM (symval - gp) && !(symval < RISCV_IMM_REACH/2)) -+ return TRUE; -+ -+ /* We can delete the unnecessary AUIPC. The corresponding LO12 reloc -+ will be converted to GPREL during relocation. */ -+ BFD_ASSERT (rel->r_offset + 4 <= sec->size); -+ rel->r_info = ELFNN_R_INFO (0, R_RISCV_NONE); -+ -+ *again = TRUE; -+ return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4); -+} -+ -+/* Relax non-PIC TLS references. */ -+ -+static bfd_boolean -+_bfd_riscv_relax_tls_le (bfd *abfd, asection *sec, -+ struct bfd_link_info *link_info, -+ Elf_Internal_Rela *rel, -+ bfd_vma symval, -+ bfd_boolean *again) -+{ -+ /* See if this symbol is in range of tp. */ -+ if (RISCV_CONST_HIGH_PART (tpoff (link_info, symval)) != 0) -+ return TRUE; -+ -+ /* We can delete the unnecessary LUI and tp add. The LO12 reloc will be -+ made directly tp-relative. */ -+ BFD_ASSERT (rel->r_offset + 4 <= sec->size); -+ rel->r_info = ELFNN_R_INFO (0, R_RISCV_NONE); -+ -+ *again = TRUE; -+ return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4); -+} -+ -+/* Implement R_RISCV_ALIGN by deleting excess alignment NOPs. */ -+ -+static bfd_boolean -+_bfd_riscv_relax_align (bfd *abfd, asection *sec, -+ struct bfd_link_info *link_info ATTRIBUTE_UNUSED, -+ Elf_Internal_Rela *rel, -+ bfd_vma symval, -+ bfd_boolean *again ATTRIBUTE_UNUSED) -+{ -+ bfd_vma alignment = 1; -+ while (alignment <= rel->r_addend) -+ alignment *= 2; -+ -+ symval -= rel->r_addend; -+ bfd_vma aligned_addr = ((symval - 1) & ~(alignment - 1)) + alignment; -+ bfd_vma nop_bytes_needed = aligned_addr - symval; -+ -+ /* Make sure there are enough NOPs to actually achieve the alignment. */ -+ if (rel->r_addend < nop_bytes_needed) -+ return FALSE; -+ -+ /* Delete the reloc. */ -+ rel->r_info = ELFNN_R_INFO (0, R_RISCV_NONE); -+ -+ /* If the number of NOPs is already correct, there's nothing to do. */ -+ if (nop_bytes_needed == rel->r_addend) -+ return TRUE; -+ -+ /* Delete the excess NOPs. */ -+ return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, -+ rel->r_addend - nop_bytes_needed); -+} -+ -+/* Relax a section. Pass 0 shortens code sequences unless disabled. -+ Pass 1, which cannot be disabled, handles code alignment directives. */ -+ -+static bfd_boolean -+_bfd_riscv_relax_section (bfd *abfd, asection *sec, -+ struct bfd_link_info *info, bfd_boolean *again) -+{ -+ Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (abfd); -+ struct riscv_elf_link_hash_table *htab = riscv_elf_hash_table (info); -+ struct bfd_elf_section_data *data = elf_section_data (sec); -+ Elf_Internal_Rela *relocs; -+ bfd_boolean ret = FALSE; -+ unsigned int i; -+ -+ *again = FALSE; -+ -+ if (info->relocatable -+ || (sec->flags & SEC_RELOC) == 0 -+ || sec->reloc_count == 0 -+ || (/*info->disable_target_specific_optimizations*/ 0 -+ && info->relax_pass == 0)) -+ return TRUE; -+ -+ /* Read this BFD's relocs if we haven't done so already. */ -+ if (data->relocs) -+ relocs = data->relocs; -+ else if (!(relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, -+ info->keep_memory))) -+ goto fail; -+ -+ /* Examine and consider relaxing each reloc. */ -+ for (i = 0; i < sec->reloc_count; i++) -+ { -+ Elf_Internal_Rela *rel = data->relocs + i; -+ typeof(&_bfd_riscv_relax_call) relax_func = NULL; -+ int type = ELFNN_R_TYPE (rel->r_info); -+ bfd_vma symval; -+ -+ if (info->relax_pass == 0) -+ { -+ if (type == R_RISCV_CALL || type == R_RISCV_CALL_PLT) -+ relax_func = _bfd_riscv_relax_call; -+ else if (type == R_RISCV_HI20) -+ relax_func = _bfd_riscv_relax_lui; -+ else if (type == R_RISCV_TPREL_HI20 || type == R_RISCV_TPREL_ADD) -+ relax_func = _bfd_riscv_relax_tls_le; -+ } -+ else if (type == R_RISCV_ALIGN) -+ relax_func = _bfd_riscv_relax_align; -+ -+ if (!relax_func) -+ continue; -+ -+ data->relocs = relocs; -+ -+ /* Read this BFD's contents if we haven't done so already. */ -+ if (!data->this_hdr.contents -+ && !bfd_malloc_and_get_section (abfd, sec, &data->this_hdr.contents)) -+ goto fail; -+ -+ /* Read this BFD's symbols if we haven't done so already. */ -+ if (symtab_hdr->sh_info != 0 -+ && !symtab_hdr->contents -+ && !(symtab_hdr->contents = -+ (unsigned char *) bfd_elf_get_elf_syms (abfd, symtab_hdr, -+ symtab_hdr->sh_info, -+ 0, NULL, NULL, NULL))) -+ goto fail; -+ -+ /* Get the value of the symbol referred to by the reloc. */ -+ if (ELFNN_R_SYM (rel->r_info) < symtab_hdr->sh_info) -+ { -+ /* A local symbol. */ -+ Elf_Internal_Sym *isym = ((Elf_Internal_Sym *) symtab_hdr->contents -+ + ELFNN_R_SYM (rel->r_info)); -+ -+ if (isym->st_shndx == SHN_UNDEF) -+ symval = sec_addr (sec) + rel->r_offset; -+ else -+ { -+ asection *isec; -+ BFD_ASSERT (isym->st_shndx < elf_numsections (abfd)); -+ isec = elf_elfsections (abfd)[isym->st_shndx]->bfd_section; -+ if (sec_addr (isec) == 0) -+ continue; -+ symval = sec_addr (isec) + isym->st_value; -+ } -+ } -+ else -+ { -+ unsigned long indx; -+ struct elf_link_hash_entry *h; -+ -+ indx = ELFNN_R_SYM (rel->r_info) - symtab_hdr->sh_info; -+ h = elf_sym_hashes (abfd)[indx]; -+ -+ while (h->root.type == bfd_link_hash_indirect -+ || h->root.type == bfd_link_hash_warning) -+ h = (struct elf_link_hash_entry *) h->root.u.i.link; -+ -+ if (h->plt.offset != MINUS_ONE) -+ symval = sec_addr (htab->elf.splt) + h->plt.offset; -+ else if (h->root.type == bfd_link_hash_undefweak) -+ symval = 0; -+ else if (h->root.u.def.section->output_section == NULL -+ || (h->root.type != bfd_link_hash_defined -+ && h->root.type != bfd_link_hash_defweak)) -+ continue; -+ else -+ symval = sec_addr (h->root.u.def.section) + h->root.u.def.value; -+ } -+ -+ symval += rel->r_addend; -+ -+ if (!relax_func (abfd, sec, info, rel, symval, again)) -+ goto fail; -+ } -+ -+ ret = TRUE; -+ -+fail: -+ if (relocs != data->relocs) -+ free (relocs); -+ -+ return ret; -+} -+ -+#define ELF_ARCH bfd_arch_riscv -+#define ELF_TARGET_ID RISCV_ELF_DATA -+#define ELF_MACHINE_CODE EM_RISCV -+#define ELF_MAXPAGESIZE 0x2000 -+#define ELF_COMMONPAGESIZE 0x2000 -+ -+#define TARGET_LITTLE_SYM bfd_elfNN_riscv_vec -+#define TARGET_LITTLE_NAME "elfNN-littleriscv" -+ -+#define elf_backend_reloc_type_class riscv_reloc_type_class -+ -+#define bfd_elfNN_bfd_reloc_name_lookup riscv_reloc_name_lookup -+#define bfd_elfNN_bfd_link_hash_table_create riscv_elf_link_hash_table_create -+#define bfd_elfNN_bfd_reloc_type_lookup riscv_reloc_type_lookup -+#define bfd_elfNN_bfd_merge_private_bfd_data \ -+ _bfd_riscv_elf_merge_private_bfd_data -+ -+#define elf_backend_copy_indirect_symbol riscv_elf_copy_indirect_symbol -+#define elf_backend_create_dynamic_sections riscv_elf_create_dynamic_sections -+#define elf_backend_check_relocs riscv_elf_check_relocs -+#define elf_backend_adjust_dynamic_symbol riscv_elf_adjust_dynamic_symbol -+#define elf_backend_size_dynamic_sections riscv_elf_size_dynamic_sections -+#define elf_backend_relocate_section riscv_elf_relocate_section -+#define elf_backend_finish_dynamic_symbol riscv_elf_finish_dynamic_symbol -+#define elf_backend_finish_dynamic_sections riscv_elf_finish_dynamic_sections -+#define elf_backend_gc_mark_hook riscv_elf_gc_mark_hook -+#define elf_backend_gc_sweep_hook riscv_elf_gc_sweep_hook -+#define elf_backend_plt_sym_val riscv_elf_plt_sym_val -+#define elf_info_to_howto_rel NULL -+#define elf_info_to_howto riscv_info_to_howto_rela -+#define bfd_elfNN_bfd_relax_section _bfd_riscv_relax_section -+ -+#define elf_backend_init_index_section _bfd_elf_init_1_index_section -+ -+#define elf_backend_can_gc_sections 1 -+#define elf_backend_can_refcount 1 -+#define elf_backend_want_got_plt 1 -+#define elf_backend_plt_readonly 1 -+#define elf_backend_plt_alignment 4 -+#define elf_backend_want_plt_sym 1 -+#define elf_backend_got_header_size (ARCH_SIZE / 8) -+#define elf_backend_rela_normal 1 -+#define elf_backend_default_execstack 0 -+ -+#include "elfNN-target.h" -diff -rNU3 dist.orig/bfd/elfxx-mips.c dist/bfd/elfxx-mips.c ---- dist.orig/bfd/elfxx-mips.c 2013-03-25 09:06:20.000000000 +0100 -+++ dist/bfd/elfxx-mips.c 2015-10-18 13:11:13.000000000 +0200 -@@ -8191,10 +8191,24 @@ - reloc types into the output file as R_MIPS_REL32 - relocs. Make room for this reloc in .rel(a).dyn. */ - mips_elf_allocate_dynamic_relocations (dynobj, info, 1); -- if (MIPS_ELF_READONLY_SECTION (sec)) -- /* We tell the dynamic linker that there are -- relocations against the text segment. */ -- info->flags |= DF_TEXTREL; -+ /* In the N32 and 64-bit ABIs there may be multiple -+ consecutive relocations for the same offset. If we have -+ a R_MIPS_GPREL32 followed by a R_MIPS_64 then that -+ relocation is complete and needs no futher adjustment. */ -+ if ((rel == relocs -+ || rel[-1].r_offset != rel->r_offset -+ || r_type != R_MIPS_64 -+ || ELF_R_TYPE(abfd, rel[-1].r_info) != R_MIPS_GPREL32) -+ && MIPS_ELF_READONLY_SECTION (sec)) -+ { -+ /* We tell the dynamic linker that there are -+ relocations against the text segment. */ -+ info->flags |= DF_TEXTREL; -+ info->callbacks->warning -+ (info, -+ _("relocation emitted against readonly section"), -+ NULL, abfd, sec, rel->r_offset); -+ } - } - else - { -@@ -8612,6 +8626,7 @@ - /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL - && (h->needs_plt -+ || h->type == STT_GNU_IFUNC - || h->u.weakdef != NULL - || (h->def_dynamic - && h->ref_regular -diff -rNU3 dist.orig/bfd/elfxx-riscv.c dist/bfd/elfxx-riscv.c ---- dist.orig/bfd/elfxx-riscv.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/bfd/elfxx-riscv.c 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,730 @@ -+/* RISC-V-specific support for ELF. -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on TILE-Gx and MIPS targets. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+#include "sysdep.h" -+#include "bfd.h" -+#include "libbfd.h" -+#include "elf-bfd.h" -+#include "elf/riscv.h" -+#include "opcode/riscv.h" -+#include "libiberty.h" -+#include "elfxx-riscv.h" -+#include -+ -+#define MINUS_ONE ((bfd_vma)0 - 1) -+ -+/* The relocation table used for SHT_RELA sections. */ -+ -+static reloc_howto_type howto_table[] = -+{ -+ /* No relocation. */ -+ HOWTO (R_RISCV_NONE, /* type */ -+ 0, /* rightshift */ -+ 0, /* size (0 = byte, 1 = short, 2 = long) */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_NONE", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 32 bit relocation. */ -+ HOWTO (R_RISCV_32, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_32", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 64 bit relocation. */ -+ HOWTO (R_RISCV_64, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_64", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* Relocation against a local symbol in a shared object. */ -+ HOWTO (R_RISCV_RELATIVE, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_RELATIVE", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0xffffffff, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_COPY, /* type */ -+ 0, /* rightshift */ -+ 0, /* this one is variable size */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_bitfield, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_COPY", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0x0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_JUMP_SLOT, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_bitfield, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_JUMP_SLOT", /* name */ -+ FALSE, /* partial_inplace */ -+ 0x0, /* src_mask */ -+ 0x0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* Dynamic TLS relocations. */ -+ HOWTO (R_RISCV_TLS_DTPMOD32, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_DTPMOD32", /* name */ -+ FALSE, /* partial_inplace */ -+ MINUS_ONE, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_TLS_DTPMOD64, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_DTPMOD64", /* name */ -+ FALSE, /* partial_inplace */ -+ MINUS_ONE, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_TLS_DTPREL32, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_DTPREL32", /* name */ -+ TRUE, /* partial_inplace */ -+ MINUS_ONE, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_TLS_DTPREL64, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_DTPREL64", /* name */ -+ TRUE, /* partial_inplace */ -+ MINUS_ONE, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_TLS_TPREL32, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_TPREL32", /* name */ -+ FALSE, /* partial_inplace */ -+ MINUS_ONE, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ HOWTO (R_RISCV_TLS_TPREL64, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_TPREL64", /* name */ -+ FALSE, /* partial_inplace */ -+ MINUS_ONE, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ EMPTY_HOWTO (12), -+ EMPTY_HOWTO (13), -+ EMPTY_HOWTO (14), -+ EMPTY_HOWTO (15), -+ -+ /* 12-bit PC-relative branch offset. */ -+ HOWTO (R_RISCV_BRANCH, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_BRANCH", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_SBTYPE_IMM(-1U),/* dst_mask */ -+ TRUE), /* pcrel_offset */ -+ -+ /* 20-bit PC-relative jump offset. */ -+ HOWTO (R_RISCV_JAL, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ /* This needs complex overflow -+ detection, because the upper 36 -+ bits must match the PC + 4. */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_JAL", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UJTYPE_IMM(-1U), /* dst_mask */ -+ TRUE), /* pcrel_offset */ -+ -+ /* 32-bit PC-relative function call (AUIPC/JALR). */ -+ HOWTO (R_RISCV_CALL, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_CALL", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U) | ((bfd_vma) ENCODE_ITYPE_IMM(-1U) << 32), /* dst_mask */ -+ TRUE), /* pcrel_offset */ -+ -+ /* 32-bit PC-relative function call (AUIPC/JALR). */ -+ HOWTO (R_RISCV_CALL_PLT, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_CALL_PLT", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U) | ((bfd_vma) ENCODE_ITYPE_IMM(-1U) << 32), /* dst_mask */ -+ TRUE), /* pcrel_offset */ -+ -+ /* High 20 bits of 32-bit PC-relative GOT access. */ -+ HOWTO (R_RISCV_GOT_HI20, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_GOT_HI20", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 20 bits of 32-bit PC-relative TLS IE GOT access. */ -+ HOWTO (R_RISCV_TLS_GOT_HI20, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_GOT_HI20", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 20 bits of 32-bit PC-relative TLS GD GOT reference. */ -+ HOWTO (R_RISCV_TLS_GD_HI20, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TLS_GD_HI20", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 20 bits of 32-bit PC-relative reference. */ -+ HOWTO (R_RISCV_PCREL_HI20, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ TRUE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_PCREL_HI20", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U), /* dst_mask */ -+ TRUE), /* pcrel_offset */ -+ -+ /* Low 12 bits of a 32-bit PC-relative load or add. */ -+ HOWTO (R_RISCV_PCREL_LO12_I, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_PCREL_LO12_I",/* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_ITYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* Low 12 bits of a 32-bit PC-relative store. */ -+ HOWTO (R_RISCV_PCREL_LO12_S, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_PCREL_LO12_S",/* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_STYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 20 bits of 32-bit absolute address. */ -+ HOWTO (R_RISCV_HI20, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_HI20", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 12 bits of 32-bit load or add. */ -+ HOWTO (R_RISCV_LO12_I, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_LO12_I", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_ITYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 12 bits of 32-bit store. */ -+ HOWTO (R_RISCV_LO12_S, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_LO12_S", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_STYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* High 20 bits of TLS LE thread pointer offset. */ -+ HOWTO (R_RISCV_TPREL_HI20, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TPREL_HI20", /* name */ -+ TRUE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_UTYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* Low 12 bits of TLS LE thread pointer offset for loads and adds. */ -+ HOWTO (R_RISCV_TPREL_LO12_I, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TPREL_LO12_I",/* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_ITYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* Low 12 bits of TLS LE thread pointer offset for stores. */ -+ HOWTO (R_RISCV_TPREL_LO12_S, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_signed, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TPREL_LO12_S",/* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ ENCODE_STYPE_IMM(-1U), /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* TLS LE thread pointer usage. */ -+ HOWTO (R_RISCV_TPREL_ADD, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont,/* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_TPREL_ADD", /* name */ -+ TRUE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 8-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_ADD8, /* type */ -+ 0, /* rightshift */ -+ 0, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_ADD8", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 16-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_ADD16, /* type */ -+ 0, /* rightshift */ -+ 1, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_ADD16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 32-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_ADD32, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_ADD32", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 64-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_ADD64, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_ADD64", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 8-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_SUB8, /* type */ -+ 0, /* rightshift */ -+ 0, /* size (0 = byte, 1 = short, 2 = long) */ -+ 8, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_SUB8", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 16-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_SUB16, /* type */ -+ 0, /* rightshift */ -+ 1, /* size (0 = byte, 1 = short, 2 = long) */ -+ 16, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_SUB16", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 32-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_SUB32, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 32, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_SUB32", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* 64-bit in-place addition, for local label subtraction. */ -+ HOWTO (R_RISCV_SUB64, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 64, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_SUB64", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ MINUS_ONE, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* GNU extension to record C++ vtable hierarchy */ -+ HOWTO (R_RISCV_GNU_VTINHERIT, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont,/* complain_on_overflow */ -+ NULL, /* special_function */ -+ "R_RISCV_GNU_VTINHERIT", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* GNU extension to record C++ vtable member usage */ -+ HOWTO (R_RISCV_GNU_VTENTRY, /* type */ -+ 0, /* rightshift */ -+ 4, /* size (0 = byte, 1 = short, 2 = long) */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont,/* complain_on_overflow */ -+ _bfd_elf_rel_vtable_reloc_fn, /* special_function */ -+ "R_RISCV_GNU_VTENTRY", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ FALSE), /* pcrel_offset */ -+ -+ /* Indicates an alignment statement. The addend field encodes how many -+ bytes of NOPs follow the statement. The desired alignment is the -+ addend rounded up to the next power of two. */ -+ HOWTO (R_RISCV_ALIGN, /* type */ -+ 0, /* rightshift */ -+ 2, /* size (0 = byte, 1 = short, 2 = long) */ -+ 0, /* bitsize */ -+ FALSE, /* pc_relative */ -+ 0, /* bitpos */ -+ complain_overflow_dont, /* complain_on_overflow */ -+ bfd_elf_generic_reloc, /* special_function */ -+ "R_RISCV_ALIGN", /* name */ -+ FALSE, /* partial_inplace */ -+ 0, /* src_mask */ -+ 0, /* dst_mask */ -+ TRUE), /* pcrel_offset */ -+}; -+ -+/* A mapping from BFD reloc types to RISC-V ELF reloc types. */ -+ -+struct elf_reloc_map { -+ bfd_reloc_code_real_type bfd_val; -+ enum elf_riscv_reloc_type elf_val; -+}; -+ -+static const struct elf_reloc_map riscv_reloc_map[] = -+{ -+ { BFD_RELOC_NONE, R_RISCV_NONE }, -+ { BFD_RELOC_32, R_RISCV_32 }, -+ { BFD_RELOC_64, R_RISCV_64 }, -+ { BFD_RELOC_RISCV_ADD8, R_RISCV_ADD8 }, -+ { BFD_RELOC_RISCV_ADD16, R_RISCV_ADD16 }, -+ { BFD_RELOC_RISCV_ADD32, R_RISCV_ADD32 }, -+ { BFD_RELOC_RISCV_ADD64, R_RISCV_ADD64 }, -+ { BFD_RELOC_RISCV_SUB8, R_RISCV_SUB8 }, -+ { BFD_RELOC_RISCV_SUB16, R_RISCV_SUB16 }, -+ { BFD_RELOC_RISCV_SUB32, R_RISCV_SUB32 }, -+ { BFD_RELOC_RISCV_SUB64, R_RISCV_SUB64 }, -+ { BFD_RELOC_CTOR, R_RISCV_64 }, -+ { BFD_RELOC_12_PCREL, R_RISCV_BRANCH }, -+ { BFD_RELOC_RISCV_HI20, R_RISCV_HI20 }, -+ { BFD_RELOC_RISCV_LO12_I, R_RISCV_LO12_I }, -+ { BFD_RELOC_RISCV_LO12_S, R_RISCV_LO12_S }, -+ { BFD_RELOC_RISCV_PCREL_LO12_I, R_RISCV_PCREL_LO12_I }, -+ { BFD_RELOC_RISCV_PCREL_LO12_S, R_RISCV_PCREL_LO12_S }, -+ { BFD_RELOC_RISCV_CALL, R_RISCV_CALL }, -+ { BFD_RELOC_RISCV_CALL_PLT, R_RISCV_CALL_PLT }, -+ { BFD_RELOC_RISCV_PCREL_HI20, R_RISCV_PCREL_HI20 }, -+ { BFD_RELOC_RISCV_JMP, R_RISCV_JAL }, -+ { BFD_RELOC_RISCV_GOT_HI20, R_RISCV_GOT_HI20 }, -+ { BFD_RELOC_RISCV_TLS_DTPMOD32, R_RISCV_TLS_DTPMOD32 }, -+ { BFD_RELOC_RISCV_TLS_DTPREL32, R_RISCV_TLS_DTPREL32 }, -+ { BFD_RELOC_RISCV_TLS_DTPMOD64, R_RISCV_TLS_DTPMOD64 }, -+ { BFD_RELOC_RISCV_TLS_DTPREL64, R_RISCV_TLS_DTPREL64 }, -+ { BFD_RELOC_RISCV_TLS_TPREL32, R_RISCV_TLS_TPREL32 }, -+ { BFD_RELOC_RISCV_TLS_TPREL64, R_RISCV_TLS_TPREL64 }, -+ { BFD_RELOC_RISCV_TPREL_HI20, R_RISCV_TPREL_HI20 }, -+ { BFD_RELOC_RISCV_TPREL_ADD, R_RISCV_TPREL_ADD }, -+ { BFD_RELOC_RISCV_TPREL_LO12_S, R_RISCV_TPREL_LO12_S }, -+ { BFD_RELOC_RISCV_TPREL_LO12_I, R_RISCV_TPREL_LO12_I }, -+ { BFD_RELOC_RISCV_TLS_GOT_HI20, R_RISCV_TLS_GOT_HI20 }, -+ { BFD_RELOC_RISCV_TLS_GD_HI20, R_RISCV_TLS_GD_HI20 }, -+ { BFD_RELOC_RISCV_ALIGN, R_RISCV_ALIGN }, -+}; -+ -+/* Given a BFD reloc type, return a howto structure. */ -+ -+reloc_howto_type * -+riscv_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, -+ bfd_reloc_code_real_type code) -+{ -+ unsigned int i; -+ -+ for (i = 0; i < ARRAY_SIZE (riscv_reloc_map); i++) -+ if (riscv_reloc_map[i].bfd_val == code) -+ return &howto_table[(int) riscv_reloc_map[i].elf_val]; -+ -+ bfd_set_error (bfd_error_bad_value); -+ return NULL; -+} -+ -+reloc_howto_type * -+riscv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, -+ const char *r_name) -+{ -+ unsigned int i; -+ -+ for (i = 0; i < ARRAY_SIZE (howto_table); i++) -+ if (howto_table[i].name && strcasecmp (howto_table[i].name, r_name) == 0) -+ return &howto_table[i]; -+ -+ return NULL; -+} -+ -+reloc_howto_type * -+riscv_elf_rtype_to_howto (unsigned int r_type) -+{ -+ if ((unsigned int)r_type >= ARRAY_SIZE (howto_table)) -+ { -+ (*_bfd_error_handler)(_("unrecognized relocation (0x%x)"), r_type); -+ bfd_set_error (bfd_error_bad_value); -+ return NULL; -+ } -+ return &howto_table[r_type]; -+} -diff -rNU3 dist.orig/bfd/elfxx-riscv.h dist/bfd/elfxx-riscv.h ---- dist.orig/bfd/elfxx-riscv.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/bfd/elfxx-riscv.h 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,34 @@ -+/* RISC-V ELF specific backend routines. -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on MIPS target. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+#include "elf/common.h" -+#include "elf/internal.h" -+ -+extern reloc_howto_type * -+riscv_reloc_name_lookup (bfd *, const char *); -+ -+extern reloc_howto_type * -+riscv_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -+ -+extern reloc_howto_type * -+riscv_elf_rtype_to_howto (unsigned int r_type); -diff -rNU3 dist.orig/bfd/elfxx-sparc.c dist/bfd/elfxx-sparc.c ---- dist.orig/bfd/elfxx-sparc.c 2013-03-25 09:06:20.000000000 +0100 -+++ dist/bfd/elfxx-sparc.c 2015-10-18 13:11:13.000000000 +0200 -@@ -2508,6 +2508,10 @@ - { - struct bfd_link_info *info = (struct bfd_link_info *) inf; - -+ if (info->warn_shared_textrel) -+ (*_bfd_error_handler) -+ (_("warning: dynamic relocation in readonly section `%s'"), -+ h->root.root.string); - info->flags |= DF_TEXTREL; - - /* Not an error, just cut short the traversal. */ -@@ -3460,10 +3464,8 @@ - memset (&outrel, 0, sizeof outrel); - /* h->dynindx may be -1 if the symbol was marked to - become local. */ -- else if (h != NULL && -- h->dynindx != -1 -- && (! is_plt -- || !info->shared -+ else if (h != NULL && h->dynindx != -1 && ! is_plt -+ && (!info->shared - || !SYMBOLIC_BIND (info, h) - || !h->def_regular)) - { -diff -rNU3 dist.orig/bfd/libbfd.h dist/bfd/libbfd.h ---- dist.orig/bfd/libbfd.h 2012-09-04 14:53:42.000000000 +0200 -+++ dist/bfd/libbfd.h 2015-10-18 13:11:13.000000000 +0200 -@@ -2295,8 +2295,65 @@ - "BFD_RELOC_860_HIGH", - "BFD_RELOC_860_HIGOT", - "BFD_RELOC_860_HIGOTOFF", -- "BFD_RELOC_OPENRISC_ABS_26", -- "BFD_RELOC_OPENRISC_REL_26", -+ "BFD_RELOC_OR1K_REL_26", -+ "BFD_RELOC_OR1K_GOTPC_HI16", -+ "BFD_RELOC_OR1K_GOTPC_LO16", -+ "BFD_RELOC_OR1K_GOT16", -+ "BFD_RELOC_OR1K_PLT26", -+ "BFD_RELOC_OR1K_GOTOFF_HI16", -+ "BFD_RELOC_OR1K_GOTOFF_LO16", -+ "BFD_RELOC_OR1K_COPY", -+ "BFD_RELOC_OR1K_GLOB_DAT", -+ "BFD_RELOC_OR1K_JMP_SLOT", -+ "BFD_RELOC_OR1K_RELATIVE", -+ "BFD_RELOC_OR1K_TLS_GD_HI16", -+ "BFD_RELOC_OR1K_TLS_GD_LO16", -+ "BFD_RELOC_OR1K_TLS_LDM_HI16", -+ "BFD_RELOC_OR1K_TLS_LDM_LO16", -+ "BFD_RELOC_OR1K_TLS_LDO_HI16", -+ "BFD_RELOC_OR1K_TLS_LDO_LO16", -+ "BFD_RELOC_OR1K_TLS_IE_HI16", -+ "BFD_RELOC_OR1K_TLS_IE_LO16", -+ "BFD_RELOC_OR1K_TLS_LE_HI16", -+ "BFD_RELOC_OR1K_TLS_LE_LO16", -+ "BFD_RELOC_OR1K_TLS_TPOFF", -+ "BFD_RELOC_OR1K_TLS_DTPOFF", -+ "BFD_RELOC_OR1K_TLS_DTPMOD", -+ "BFD_RELOC_RISCV_ADD32", -+ "BFD_RELOC_RISCV_ADD64", -+ "BFD_RELOC_RISCV_SUB32", -+ "BFD_RELOC_RISCV_SUB64", -+ "BFD_RELOC_RISCV_HI20", -+ "BFD_RELOC_RISCV_LO12_I", -+ "BFD_RELOC_RISCV_LO12_S", -+ "BFD_RELOC_RISCV_PCREL_LO12_I", -+ "BFD_RELOC_RISCV_PCREL_LO12_S", -+ "BFD_RELOC_RISCV_CALL", -+ "BFD_RELOC_RISCV_CALL_PLT", -+ "BFD_RELOC_RISCV_PCREL_HI20", -+ "BFD_RELOC_RISCV_JMP", -+ "BFD_RELOC_RISCV_GOT_HI20", -+ "BFD_RELOC_RISCV_GOT_LO12", -+ "BFD_RELOC_RISCV_TLS_DTPMOD32", -+ "BFD_RELOC_RISCV_TLS_DTPREL32", -+ "BFD_RELOC_RISCV_TLS_DTPMOD64", -+ "BFD_RELOC_RISCV_TLS_DTPREL64", -+ "BFD_RELOC_RISCV_TLS_TPREL32", -+ "BFD_RELOC_RISCV_TLS_TPREL64", -+ "BFD_RELOC_RISCV_TPREL_HI20", -+ "BFD_RELOC_RISCV_TPREL_ADD", -+ "BFD_RELOC_RISCV_TPREL_LO12_S", -+ "BFD_RELOC_RISCV_TPREL_LO12_I", -+ "BFD_RELOC_RISCV_TLS_IE_HI20", -+ "BFD_RELOC_RISCV_TLS_IE_LO12", -+ "BFD_RELOC_RISCV_TLS_IE_ADD", -+ "BFD_RELOC_RISCV_TLS_IE_LO12_S", -+ "BFD_RELOC_RISCV_TLS_IE_LO12_I", -+ "BFD_RELOC_RISCV_TLS_GOT_HI20", -+ "BFD_RELOC_RISCV_TLS_GOT_LO12", -+ "BFD_RELOC_RISCV_TLS_GD_HI20", -+ "BFD_RELOC_RISCV_TLS_GD_LO12", -+ "BFD_RELOC_RISCV_TLS_PCREL_LO12", - "BFD_RELOC_H8_DIR16A8", - "BFD_RELOC_H8_DIR16R8", - "BFD_RELOC_H8_DIR24A8", -@@ -2313,6 +2370,7 @@ - "BFD_RELOC_XC16X_SEG", - "BFD_RELOC_XC16X_SOF", - "BFD_RELOC_VAX_GLOB_DAT", -+ "BFD_RELOC_VAX_GLOB_REF", - "BFD_RELOC_VAX_JMP_SLOT", - "BFD_RELOC_VAX_RELATIVE", - "BFD_RELOC_MT_PC16", -diff -rNU3 dist.orig/bfd/reloc.c dist/bfd/reloc.c ---- dist.orig/bfd/reloc.c 2012-09-04 14:53:42.000000000 +0200 -+++ dist/bfd/reloc.c 2015-10-18 13:11:13.000000000 +0200 -@@ -1776,6 +1776,17 @@ - Relocations used by 68K ELF. - - ENUM -+ BFD_RELOC_VAX_GLOB_DAT -+ENUMX -+ BFD_RELOC_VAX_GLOB_REF -+ENUMX -+ BFD_RELOC_VAX_JMP_SLOT -+ENUMX -+ BFD_RELOC_VAX_RELATIVE -+ENUMDOC -+ Relocations used by VAX ELF. -+ -+ENUM - BFD_RELOC_32_BASEREL - ENUMX - BFD_RELOC_16_BASEREL -diff -rNU3 dist.orig/bfd/targets.c dist/bfd/targets.c ---- dist.orig/bfd/targets.c 2012-09-04 14:53:42.000000000 +0200 -+++ dist/bfd/targets.c 2015-10-18 13:11:13.000000000 +0200 -@@ -670,13 +670,14 @@ - extern const bfd_target bfd_elf32_ntradbigmips_freebsd_vec; - extern const bfd_target bfd_elf32_ntradlittlemips_freebsd_vec; - extern const bfd_target bfd_elf32_openrisc_vec; --extern const bfd_target bfd_elf32_or32_big_vec; -+extern const bfd_target bfd_elf32_or1k_big_vec; - extern const bfd_target bfd_elf32_pj_vec; - extern const bfd_target bfd_elf32_pjl_vec; - extern const bfd_target bfd_elf32_powerpc_vec; - extern const bfd_target bfd_elf32_powerpcle_vec; - extern const bfd_target bfd_elf32_powerpc_freebsd_vec; - extern const bfd_target bfd_elf32_powerpc_vxworks_vec; -+extern const bfd_target bfd_elf32_riscv_vec; - extern const bfd_target bfd_elf32_rl78_vec; - extern const bfd_target bfd_elf32_rx_le_vec; - extern const bfd_target bfd_elf32_rx_be_vec; -@@ -729,8 +730,8 @@ - extern const bfd_target bfd_elf64_alpha_freebsd_vec; - extern const bfd_target bfd_elf64_alpha_vec; - extern const bfd_target bfd_elf64_big_generic_vec; --extern const bfd_target bfd_elf64_bigmips_vec; - extern const bfd_target bfd_elf64_bigaarch64_vec; -+extern const bfd_target bfd_elf64_bigmips_vec; - extern const bfd_target bfd_elf64_hppa_linux_vec; - extern const bfd_target bfd_elf64_hppa_vec; - extern const bfd_target bfd_elf64_ia64_big_vec; -@@ -738,12 +739,13 @@ - extern const bfd_target bfd_elf64_ia64_little_vec; - extern const bfd_target bfd_elf64_ia64_vms_vec; - extern const bfd_target bfd_elf64_little_generic_vec; --extern const bfd_target bfd_elf64_littlemips_vec; - extern const bfd_target bfd_elf64_littleaarch64_vec; -+extern const bfd_target bfd_elf64_littlemips_vec; - extern const bfd_target bfd_elf64_mmix_vec; - extern const bfd_target bfd_elf64_powerpc_vec; - extern const bfd_target bfd_elf64_powerpcle_vec; - extern const bfd_target bfd_elf64_powerpc_freebsd_vec; -+extern const bfd_target bfd_elf64_riscv_vec; - extern const bfd_target bfd_elf64_s390_vec; - extern const bfd_target bfd_elf64_sh64_vec; - extern const bfd_target bfd_elf64_sh64l_vec; -@@ -833,7 +835,7 @@ - extern const bfd_target nlm32_powerpc_vec; - extern const bfd_target nlm32_sparc_vec; - extern const bfd_target oasys_vec; --extern const bfd_target or32coff_big_vec; -+extern const bfd_target or1kcoff_big_vec; - extern const bfd_target pc532machaout_vec; - extern const bfd_target pc532netbsd_vec; - extern const bfd_target pdp11_aout_vec; -@@ -1046,13 +1048,14 @@ - &bfd_elf32_ntradlittlemips_freebsd_vec, - #endif - &bfd_elf32_openrisc_vec, -- &bfd_elf32_or32_big_vec, -+ &bfd_elf32_or1k_big_vec, - &bfd_elf32_pj_vec, - &bfd_elf32_pjl_vec, - &bfd_elf32_powerpc_vec, - &bfd_elf32_powerpc_vxworks_vec, - &bfd_elf32_powerpcle_vec, - &bfd_elf32_powerpc_freebsd_vec, -+ &bfd_elf32_riscv_vec, - &bfd_elf32_rl78_vec, - &bfd_elf32_rx_be_vec, - &bfd_elf32_rx_be_ns_vec, -@@ -1106,8 +1109,8 @@ - &bfd_elf64_alpha_freebsd_vec, - &bfd_elf64_alpha_vec, - &bfd_elf64_big_generic_vec, -- &bfd_elf64_bigmips_vec, - &bfd_elf64_bigaarch64_vec, -+ &bfd_elf64_bigmips_vec, - &bfd_elf64_hppa_linux_vec, - &bfd_elf64_hppa_vec, - &bfd_elf64_ia64_big_vec, -@@ -1115,12 +1118,13 @@ - &bfd_elf64_ia64_little_vec, - &bfd_elf64_ia64_vms_vec, - &bfd_elf64_little_generic_vec, -- &bfd_elf64_littlemips_vec, - &bfd_elf64_littleaarch64_vec, -+ &bfd_elf64_littlemips_vec, - &bfd_elf64_mmix_vec, - &bfd_elf64_powerpc_vec, - &bfd_elf64_powerpcle_vec, - &bfd_elf64_powerpc_freebsd_vec, -+ &bfd_elf64_riscv_vec, - &bfd_elf64_s390_vec, - &bfd_elf64_sh64_vec, - &bfd_elf64_sh64l_vec, -@@ -1252,7 +1256,7 @@ - &oasys_vec, - #endif - /* Entry for the OpenRISC family. */ -- &or32coff_big_vec, -+ &or1kcoff_big_vec, - - &pc532machaout_vec, - &pc532netbsd_vec, -diff -rNU3 dist.orig/binutils/Makefile.in dist/binutils/Makefile.in ---- dist.orig/binutils/Makefile.in 2012-05-18 00:23:39.000000000 +0200 -+++ dist/binutils/Makefile.in 2015-10-18 13:11:13.000000000 +0200 -@@ -1,4 +1,4 @@ --# Makefile.in generated by automake 1.11.1 from Makefile.am. -+# Makefile.in generated by automake 1.11 from Makefile.am. - # @configure_input@ - - # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -@@ -49,10 +49,12 @@ - DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(srcdir)/config.in \ -- $(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in arparse.h \ -- arparse.c arlex.c defparse.h defparse.c deflex.c nlmheader.h \ -- nlmheader.c arparse.h arparse.c arlex.c mcparse.h mcparse.c \ -- rcparse.h rcparse.c $(srcdir)/../depcomp $(srcdir)/../ylwrap -+ $(srcdir)/../mkinstalldirs $(srcdir)/../mkinstalldirs \ -+ $(top_srcdir)/po/Make-in arparse.h arparse.c arlex.c \ -+ defparse.h defparse.c deflex.c nlmheader.h nlmheader.c \ -+ arparse.h arparse.c arlex.c mcparse.h mcparse.c rcparse.h \ -+ rcparse.c $(srcdir)/../depcomp $(srcdir)/../depcomp \ -+ $(srcdir)/../ylwrap $(srcdir)/../ylwrap - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ - $(top_srcdir)/../config/zlib.m4 \ -@@ -385,6 +387,7 @@ - libexecdir = @libexecdir@ - localedir = @localedir@ - localstatedir = @localstatedir@ -+lt_ECHO = @lt_ECHO@ - mandir = @mandir@ - mkdir_p = @mkdir_p@ - oldincludedir = @oldincludedir@ -@@ -931,7 +934,7 @@ - # (which will cause the Makefiles to be regenerated when you run `make'); - # (2) otherwise, pass the desired values on the `make' command line. - $(RECURSIVE_TARGETS): -- @fail= failcom='exit 1'; \ -+ @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ -@@ -956,7 +959,7 @@ - fi; test -z "$$fail" - - $(RECURSIVE_CLEAN_TARGETS): -- @fail= failcom='exit 1'; \ -+ @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ -diff -rNU3 dist.orig/binutils/aclocal.m4 dist/binutils/aclocal.m4 ---- dist.orig/binutils/aclocal.m4 2012-05-18 00:23:39.000000000 +0200 -+++ dist/binutils/aclocal.m4 2015-10-18 13:11:13.000000000 +0200 -@@ -1,4 +1,4 @@ --# generated automatically by aclocal 1.11.1 -*- Autoconf -*- -+# generated automatically by aclocal 1.11 -*- Autoconf -*- - - # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -@@ -19,6 +19,31 @@ - If you have problems, you may need to regenerate the build system entirely. - To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -+# isc-posix.m4 serial 2 (gettext-0.11.2) -+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. -+dnl This file is free software; the Free Software Foundation -+dnl gives unlimited permission to copy and/or distribute it, -+dnl with or without modifications, as long as this notice is preserved. -+ -+# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. -+ -+# This test replaces the one in autoconf. -+# Currently this macro should have the same name as the autoconf macro -+# because gettext's gettext.m4 (distributed in the automake package) -+# still uses it. Otherwise, the use in gettext.m4 makes autoheader -+# give these diagnostics: -+# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX -+# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX -+ -+undefine([AC_ISC_POSIX]) -+ -+AC_DEFUN([AC_ISC_POSIX], -+ [ -+ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. -+ AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) -+ ] -+) -+ - # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - # - # This file is free software; the Free Software Foundation -@@ -34,7 +59,7 @@ - [am__api_version='1.11' - dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to - dnl require some minimum version. Point them to the right macro. --m4_if([$1], [1.11.1], [], -+m4_if([$1], [1.11], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl - ]) - -@@ -50,7 +75,7 @@ - # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. - # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. - AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], --[AM_AUTOMAKE_VERSION([1.11.1])dnl -+[AM_AUTOMAKE_VERSION([1.11])dnl - m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl - _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -diff -rNU3 dist.orig/binutils/bucomm.c dist/binutils/bucomm.c ---- dist.orig/binutils/bucomm.c 2012-06-29 14:59:49.000000000 +0200 -+++ dist/binutils/bucomm.c 2015-10-18 13:11:13.000000000 +0200 -@@ -580,7 +580,14 @@ - file_name, strerror (errno)); - } - else if (! S_ISREG (statbuf.st_mode)) -- non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); -+ { -+ if (!S_ISCHR(statbuf.st_mode)) -+ { -+ non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); -+ return 0; -+ } -+ return statbuf.st_size ? statbuf.st_size : 1; -+ } - else if (statbuf.st_size < 0) - non_fatal (_("Warning: '%s' has negative size, probably it is too large"), - file_name); -diff -rNU3 dist.orig/binutils/doc/Makefile.am dist/binutils/doc/Makefile.am ---- dist.orig/binutils/doc/Makefile.am 2010-01-06 17:52:14.000000000 +0100 -+++ dist/binutils/doc/Makefile.am 2015-10-18 13:11:13.000000000 +0200 -@@ -42,6 +42,8 @@ - - # Man page generation from texinfo - addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_addr2line.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod - -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -49,6 +51,8 @@ - rm -f addr2line.pod - - ar.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_ar.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod - -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -56,6 +60,8 @@ - rm -f ar.pod - - dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_dlltool.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod - -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -63,6 +69,8 @@ - rm -f dlltool.pod - - nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_nlmconv.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod - -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -70,6 +78,8 @@ - rm -f nlmconv.pod - - nm.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_nm.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod - -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -77,6 +87,8 @@ - rm -f nm.pod - - objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_objcopy.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod - -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -84,6 +96,8 @@ - rm -f objcopy.pod - - objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_objdump.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod - -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -91,6 +105,8 @@ - rm -f objdump.pod - - ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_ranlib.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod - -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -98,6 +114,8 @@ - rm -f ranlib.pod - - readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_readelf.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod - -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -105,6 +123,8 @@ - rm -f readelf.pod - - size.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_size.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod - -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -112,6 +132,8 @@ - rm -f size.pod - - strings.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_strings.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod - -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -119,6 +141,8 @@ - rm -f strings.pod - - strip.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_strip.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod - -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -133,6 +157,8 @@ - rm -f elfedit.pod - - windres.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_windres.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod - -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -140,6 +166,8 @@ - rm -f windres.pod - - windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_windmc.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod - -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -147,6 +175,8 @@ - rm -f windmc.pod - - cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_cxxfilt.man: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod - -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -diff -rNU3 dist.orig/binutils/doc/Makefile.in dist/binutils/doc/Makefile.in ---- dist.orig/binutils/doc/Makefile.in 2012-09-04 14:53:44.000000000 +0200 -+++ dist/binutils/doc/Makefile.in 2015-10-18 13:11:13.000000000 +0200 -@@ -1,4 +1,4 @@ --# Makefile.in generated by automake 1.11.1 from Makefile.am. -+# Makefile.in generated by automake 1.11 from Makefile.am. - # @configure_input@ - - # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -@@ -242,6 +242,7 @@ - libexecdir = @libexecdir@ - localedir = @localedir@ - localstatedir = @localstatedir@ -+lt_ECHO = @lt_ECHO@ - mandir = @mandir@ - mkdir_p = @mkdir_p@ - oldincludedir = @oldincludedir@ -@@ -349,6 +350,8 @@ - -rm -rf .libs _libs - - binutils.info: binutils.texi -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_binutils.info: binutils.texi - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ -@@ -735,6 +738,8 @@ - - # Man page generation from texinfo - addr2line.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_addr2line.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod - -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -742,6 +747,8 @@ - rm -f addr2line.pod - - ar.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_ar.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod - -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -749,6 +756,8 @@ - rm -f ar.pod - - dlltool.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_dlltool.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod - -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -756,6 +765,8 @@ - rm -f dlltool.pod - - nlmconv.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_nlmconv.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod - -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -763,6 +774,8 @@ - rm -f nlmconv.pod - - nm.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_nm.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod - -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -770,6 +783,8 @@ - rm -f nm.pod - - objcopy.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_objcopy.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod - -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -777,6 +792,8 @@ - rm -f objcopy.pod - - objdump.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_objdump.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod - -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -784,6 +801,8 @@ - rm -f objdump.pod - - ranlib.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_ranlib.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod - -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -791,6 +810,8 @@ - rm -f ranlib.pod - - readelf.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_readelf.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod - -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -798,6 +819,8 @@ - rm -f readelf.pod - - size.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_size.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod - -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -805,6 +828,8 @@ - rm -f size.pod - - strings.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_strings.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod - -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -812,6 +837,8 @@ - rm -f strings.pod - - strip.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_strip.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod - -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -819,6 +846,8 @@ - rm -f strip.pod - - elfedit.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_elfedit.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Delfedit < $(binutils_TEXI) > elfedit.pod - -($(POD2MAN) elfedit.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -826,6 +855,8 @@ - rm -f elfedit.pod - - windres.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_windres.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod - -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -833,6 +864,8 @@ - rm -f windres.pod - - windmc.1: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_windmc.1: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dwindmc < $(binutils_TEXI) > windmc.pod - -($(POD2MAN) windmc.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -@@ -840,6 +873,8 @@ - rm -f windmc.pod - - cxxfilt.man: $(binutils_TEXI) $(binutils_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_cxxfilt.man: - touch $@ - -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod - -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ -diff -rNU3 dist.orig/binutils/doc/readelf.1 dist/binutils/doc/readelf.1 ---- dist.orig/binutils/doc/readelf.1 2013-03-25 10:10:25.000000000 +0100 -+++ dist/binutils/doc/readelf.1 2015-10-18 13:11:13.000000000 +0200 -@@ -146,6 +146,7 @@ - [\fB\-r\fR|\fB\-\-relocs\fR] - [\fB\-u\fR|\fB\-\-unwind\fR] - [\fB\-d\fR|\fB\-\-dynamic\fR] -+ [\fB\-f\fR|\fB\-\-special-files\fR] - [\fB\-V\fR|\fB\-\-version\-info\fR] - [\fB\-A\fR|\fB\-\-arch\-specific\fR] - [\fB\-D\fR|\fB\-\-use\-dynamic\fR] -@@ -282,6 +283,13 @@ - .IX Item "--dynamic" - .PD - Displays the contents of the file's dynamic section, if it has one. -+.IP "\fB\-f\fR" 4 -+.IX Item "-f" -+.PD 0 -+.IP "\fB\-\-special-files\fR" 4 -+.IX Item "--special-files" -+.PD -+Allows processing of non-plain files. - .IP "\fB\-V\fR" 4 - .IX Item "-V" - .PD 0 -diff -rNU3 dist.orig/binutils/doc/strings.1 dist/binutils/doc/strings.1 ---- dist.orig/binutils/doc/strings.1 2013-03-25 10:10:26.000000000 +0100 -+++ dist/binutils/doc/strings.1 2015-10-18 13:11:13.000000000 +0200 -@@ -208,7 +208,7 @@ - characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR = - single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = - 16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit --littleendian. Useful for finding wide character strings. (\fBl\fR -+littleendian. Useful for finding wide-character strings. (\fBl\fR - and \fBb\fR apply to, for example, Unicode \s-1UTF\-16/UCS\-2\s0 encodings). - .IP "\fB\-T\fR \fIbfdname\fR" 4 - .IX Item "-T bfdname" -diff -rNU3 dist.orig/binutils/objcopy.c dist/binutils/objcopy.c ---- dist.orig/binutils/objcopy.c 2013-03-25 09:06:21.000000000 +0100 -+++ dist/binutils/objcopy.c 2015-10-18 13:11:13.000000000 +0200 -@@ -30,6 +30,8 @@ - #include "filenames.h" - #include "fnmatch.h" - #include "elf-bfd.h" -+#include -+#include - #include "libbfd.h" - #include "coff/internal.h" - #include "libcoff.h" -diff -rNU3 dist.orig/binutils/readelf.c dist/binutils/readelf.c ---- dist.orig/binutils/readelf.c 2013-03-25 09:06:21.000000000 +0100 -+++ dist/binutils/readelf.c 2015-10-18 13:11:13.000000000 +0200 -@@ -126,13 +126,14 @@ - #include "elf/mep.h" - #include "elf/microblaze.h" - #include "elf/mips.h" -+#include "elf/riscv.h" - #include "elf/mmix.h" - #include "elf/mn10200.h" - #include "elf/mn10300.h" - #include "elf/moxie.h" - #include "elf/mt.h" - #include "elf/msp430.h" --#include "elf/or32.h" -+#include "elf/or1k.h" - #include "elf/pj.h" - #include "elf/ppc.h" - #include "elf/ppc64.h" -@@ -184,6 +185,7 @@ - static Elf_Internal_Dyn * dynamic_section; - static Elf_Internal_Shdr * symtab_shndx_hdr; - static int show_name; -+static int do_special_files; - static int do_dynamic; - static int do_syms; - static int do_dyn_syms; -@@ -555,8 +557,7 @@ - case EM_MIPS: - case EM_MIPS_RS3_LE: - case EM_CYGNUS_M32R: -- case EM_OPENRISC: -- case EM_OR32: -+ case EM_OR1K: - case EM_SCORE: - case EM_XGATE: - return FALSE; -@@ -604,6 +605,7 @@ - case EM_NIOS32: - case EM_PPC64: - case EM_PPC: -+ case EM_RISCV: - case EM_RL78: - case EM_RX: - case EM_S390: -@@ -1134,9 +1136,8 @@ - rtype = elf_h8_reloc_type (type); - break; - -- case EM_OPENRISC: -- case EM_OR32: -- rtype = elf_or32_reloc_type (type); -+ case EM_OR1K: -+ rtype = elf_or1k_reloc_type (type); - break; - - case EM_PJ: -@@ -1234,6 +1235,10 @@ - rtype = elf_microblaze_reloc_type (type); - break; - -+ case EM_RISCV: -+ rtype = elf_riscv_reloc_type (type); -+ break; -+ - case EM_RL78: - rtype = elf_rl78_reloc_type (type); - break; -@@ -1941,8 +1946,7 @@ - case EM_S390: return "IBM S/390"; - case EM_SCORE: return "SUNPLUS S+Core"; - case EM_XSTORMY16: return "Sanyo XStormy16 CPU core"; -- case EM_OPENRISC: -- case EM_OR32: return "OpenRISC"; -+ case EM_OR1K: return "OpenRISC"; - case EM_ARC_A5: return "ARC International ARCompact processor"; - case EM_CRX: return "National Semiconductor CRX microprocessor"; - case EM_ADAPTEVA_EPIPHANY: return "Adapteva EPIPHANY"; -@@ -2005,6 +2009,7 @@ - case EM_CR16: - case EM_MICROBLAZE: - case EM_MICROBLAZE_OLD: return "Xilinx MicroBlaze"; -+ case EM_RISCV: return "RISC-V"; - case EM_RL78: return "Renesas RL78"; - case EM_RX: return "Renesas RX"; - case EM_METAG: return "Imagination Technologies META processor architecture"; -@@ -2488,6 +2493,14 @@ - strcat (buf, ", fdpic"); - break; - -+ case EM_RISCV: -+ { -+ unsigned int riscv_extension = EF_GET_RISCV_EXT(e_flags); -+ strcat (buf, ", "); -+ strcat (buf, riscv_elf_flag_to_name (riscv_extension)); -+ } -+ break; -+ - case EM_SH: - switch ((e_flags & EF_SH_MACH_MASK)) - { -@@ -3198,6 +3211,7 @@ - {"relocs", no_argument, 0, 'r'}, - {"notes", no_argument, 0, 'n'}, - {"dynamic", no_argument, 0, 'd'}, -+ {"special-files", no_argument, 0, 'f'}, - {"arch-specific", no_argument, 0, 'A'}, - {"version-info", no_argument, 0, 'V'}, - {"use-dynamic", no_argument, 0, 'D'}, -@@ -3243,6 +3257,7 @@ - -r --relocs Display the relocations (if present)\n\ - -u --unwind Display the unwind info (if present)\n\ - -d --dynamic Display the dynamic section (if present)\n\ -+ -f --special-files Process non-plain files too\n\ - -V --version-info Display the version sections (if present)\n\ - -A --arch-specific Display architecture specific information (if any)\n\ - -c --archive-index Display the symbol/file index in an archive\n\ -@@ -3362,7 +3377,7 @@ - usage (stderr); - - while ((c = getopt_long -- (argc, argv, "ADHINR:SVWacdeghi:lnp:rstuvw::x:", options, NULL)) != EOF) -+ (argc, argv, "ADHINR:SVWacdefghi:lnp:rstuvw::x:", options, NULL)) != EOF) - { - switch (c) - { -@@ -3412,6 +3427,9 @@ - case 'u': - do_unwind++; - break; -+ case 'f': -+ do_special_files++; -+ break; - case 'h': - do_header++; - break; -@@ -3801,7 +3819,7 @@ - if (elf_header.e_phnum > 1) - printf (_("\nProgram Headers:\n")); - else -- printf (_("\nProgram Headers:\n")); -+ printf (_("\nProgram Header:\n")); - - if (is_32bit_elf) - printf -@@ -6974,6 +6992,11 @@ - - remaining = 4; - } -+ else -+ { -+ addr.section = SHN_UNDEF; -+ addr.offset = 0; -+ } - - if ((word & 0x80000000) == 0) - { -@@ -8842,6 +8865,20 @@ - } - - static const char * -+get_alpha_symbol_other (unsigned int other) -+{ -+ switch (other) -+ { -+ case STO_ALPHA_NOPV: -+ return "NOPV"; -+ case STO_ALPHA_STD_GPLOAD: -+ return "STD GPLOAD"; -+ default: -+ return NULL; -+ } -+} -+ -+static const char * - get_mips_symbol_other (unsigned int other) - { - switch (other) -@@ -8935,6 +8972,9 @@ - - switch (elf_header.e_machine) - { -+ case EM_ALPHA: -+ result = get_alpha_symbol_other (other); -+ break; - case EM_MIPS: - result = get_mips_symbol_other (other); - break; -@@ -9902,9 +9942,8 @@ - case EM_ALTERA_NIOS2: - case EM_NIOS32: - return reloc_type == 1; /* R_NIOS_32. */ -- case EM_OPENRISC: -- case EM_OR32: -- return reloc_type == 1; /* R_OR32_32. */ -+ case EM_OR1K: -+ return reloc_type == 1; /* R_OR1K_32. */ - case EM_PARISC: - return (reloc_type == 1 /* R_PARISC_DIR32. */ - || reloc_type == 41); /* R_PARISC_SECREL32. */ -@@ -9915,6 +9954,8 @@ - return reloc_type == 1; /* R_PPC64_ADDR32. */ - case EM_PPC: - return reloc_type == 1; /* R_PPC_ADDR32. */ -+ case EM_RISCV: -+ return reloc_type == 1; /* R_RISCV_32. */ - case EM_RL78: - return reloc_type == 1; /* R_RL78_DIR32. */ - case EM_RX: -@@ -10015,6 +10056,8 @@ - case EM_L1OM: - case EM_K1OM: - return reloc_type == 2; /* R_X86_64_PC32. */ -+ case EM_VAX: -+ return reloc_type == 4; /* R_VAX_PCREL32. */ - case EM_XTENSA_OLD: - case EM_XTENSA: - return reloc_type == 14; /* R_XTENSA_32_PCREL. */ -@@ -10046,6 +10089,8 @@ - return reloc_type == 80; /* R_PARISC_DIR64. */ - case EM_PPC64: - return reloc_type == 38; /* R_PPC64_ADDR64. */ -+ case EM_RISCV: -+ return reloc_type == 2; /* R_RISCV_64. */ - case EM_SPARC32PLUS: - case EM_SPARCV9: - case EM_SPARC: -@@ -10187,6 +10232,7 @@ - case EM_ADAPTEVA_EPIPHANY: - case EM_PPC: /* R_PPC_NONE. */ - case EM_PPC64: /* R_PPC64_NONE. */ -+ case EM_RISCV: /* R_RISCV_NONE. */ - case EM_ARM: /* R_ARM_NONE. */ - case EM_IA_64: /* R_IA64_NONE. */ - case EM_SH: /* R_SH_NONE. */ -@@ -12665,6 +12711,48 @@ - return buff; - } - -+static int -+process_netbsd_elf_note (Elf_Internal_Note * pnote) -+{ -+ unsigned int version; -+ -+ switch (pnote->type) -+ { -+ case NT_NETBSD_IDENT: -+ version = byte_get((unsigned char *)pnote->descdata, sizeof(version)); -+ if ((version / 10000) % 100) -+ printf (" NetBSD\t0x%08lx\tIDENT %u (%u.%u%s%c)\n", pnote->descsz, -+ version, version / 100000000, (version / 1000000) % 100, -+ (version / 10000) % 100 > 26 ? "Z" : "", -+ 'A' + (version / 10000) % 26); -+ else -+ printf (" NetBSD\t\t0x%08lx\tIDENT %u (%u.%u.%u)\n", pnote->descsz, -+ version, version / 100000000, (version / 1000000) % 100, -+ (version / 100) % 100); -+ return 1; -+ case NT_NETBSD_MARCH: -+ printf (" NetBSD\t\t0x%08lx\tMARCH <%s>\n", pnote->descsz, -+ pnote->descdata); -+ return 1; -+ case NT_NETBSD_PAX: -+ version = byte_get((unsigned char *)pnote->descdata, sizeof(version)); -+ printf (" NetBSD\t\t0x%08lx\tPaX <%s%s%s%s%s%s>\n", pnote->descsz, -+ ((version & NT_NETBSD_PAX_MPROTECT) ? "+mprotect" : ""), -+ ((version & NT_NETBSD_PAX_NOMPROTECT) ? "-mprotect" : ""), -+ ((version & NT_NETBSD_PAX_GUARD) ? "+guard" : ""), -+ ((version & NT_NETBSD_PAX_NOGUARD) ? "-guard" : ""), -+ ((version & NT_NETBSD_PAX_ASLR) ? "+ASLR" : ""), -+ ((version & NT_NETBSD_PAX_NOASLR) ? "-ASLR" : "")); -+ return 1; -+ default: -+ break; -+ } -+ -+ printf (" NetBSD\t0x%08lx\tUnknown note type: (0x%08lx)\n", pnote->descsz, -+ pnote->type); -+ return 1; -+} -+ - static int - print_gnu_note (Elf_Internal_Note *pnote) - { -@@ -12765,6 +12853,23 @@ - } - break; - -+ /* On SuperH, PT_GETREGS == mach+3 and PT_GETFPREGS == mach+5. -+ There's also old PT___GETREGS40 == mach + 1 for old reg -+ structure which lacks GBR. */ -+ case EM_SH: -+ switch (e_type) -+ { -+ case NT_NETBSDCORE_FIRSTMACH + 1: -+ return _("PT___GETREGS40 (old reg structure)"); -+ case NT_NETBSDCORE_FIRSTMACH + 3: -+ return _("PT_GETREGS (reg structure)"); -+ case NT_NETBSDCORE_FIRSTMACH + 5: -+ return _("PT_GETFPREGS (fpreg structure)"); -+ default: -+ break; -+ } -+ break; -+ - /* On all other arch's, PT_GETREGS == mach+1 and - PT_GETFPREGS == mach+3. */ - default: -@@ -12971,6 +13076,14 @@ - /* GNU-specific object file notes. */ - nt = get_gnu_elf_note_type (pnote->type); - -+ else if (const_strneq (pnote->namedata, "NetBSD")) -+ /* NetBSD-specific core file notes. */ -+ return process_netbsd_elf_note (pnote); -+ -+ else if (const_strneq (pnote->namedata, "PaX")) -+ /* NetBSD-specific core file notes. */ -+ return process_netbsd_elf_note (pnote); -+ - else if (const_strneq (pnote->namedata, "NetBSD-CORE")) - /* NetBSD-specific core file notes. */ - nt = get_netbsd_elfcore_note_type (pnote->type); -@@ -13710,7 +13823,7 @@ - return 1; - } - -- if (! S_ISREG (statbuf.st_mode)) -+ if (!do_special_files && ! S_ISREG (statbuf.st_mode)) - { - error (_("'%s' is not an ordinary file\n"), file_name); - return 1; -diff -rNU3 dist.orig/binutils/strings.c dist/binutils/strings.c ---- dist.orig/binutils/strings.c 2012-02-09 05:51:44.000000000 +0100 -+++ dist/binutils/strings.c 2015-10-18 13:11:13.000000000 +0200 -@@ -598,7 +598,7 @@ - else - #elif !BFD_HOST_64BIT_LONG - if (start != (unsigned long) start) -- printf ("++%7ld ", (unsigned long) start); -+ printf ("++%7llu ", (unsigned long) start); - else - #endif - printf ("%7ld ", (long) start); -diff -rNU3 dist.orig/config.guess dist/config.guess ---- dist.orig/config.guess 2011-06-06 12:36:06.000000000 +0200 -+++ dist/config.guess 2015-10-18 13:11:13.000000000 +0200 -@@ -160,14 +160,28 @@ - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; -+ coldfire) machine=m5407-unknown ;; -+ earm*eb*) machine=armeb-unknown ;; -+ earm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched -- # to ELF recently, or will in the future. -+ # to ELF recently, or will in the future and ABI. - case "${UNAME_MACHINE_ARCH}" in -+ coldfire) os=netbsdelf ;; -+ earm*) -+ eval $set_cc_for_build -+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ -+ | grep -q __ARM_PCS_VFP -+ then -+ os=netbsdelf-eabi -+ else -+ os=netbsdelf-eabihf -+ fi -+ ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ -diff -rNU3 dist.orig/config.sub dist/config.sub ---- dist.orig/config.sub 2012-04-25 17:53:25.000000000 +0200 -+++ dist/config.sub 2015-10-18 13:11:13.000000000 +0200 -@@ -122,9 +122,9 @@ - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in -- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ -- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ -- knetbsd*-gnu* | netbsd*-gnu* | \ -+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ -+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | \ -+ netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os -@@ -300,7 +300,7 @@ - | nios | nios2 \ - | ns16k | ns32k \ - | open8 \ -- | or32 \ -+ | or1k | or1knd \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ -@@ -332,12 +332,21 @@ - basic_machine=$basic_machine-unknown - os=-none - ;; -- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) -+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | m5407 \ -+ | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - -+ riscv32-*) -+ basic_machine=riscv32-ucb -+ ;; -+ -+ riscv*-*) -+ basic_machine=riscv-ucb -+ ;; -+ - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; -@@ -375,7 +384,7 @@ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ -- | c[123]* | c30-* | [cjt]90-* | c4x-* \ -+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ -@@ -388,6 +397,7 @@ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ -+ | m5200-* | m5407-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ -@@ -528,15 +538,6 @@ - basic_machine=powerpc-ibm - os=-cnk - ;; -- c54x-*) -- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- c55x-*) -- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- c6x-*) -- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; - c90) - basic_machine=c90-cray - os=-unicos -@@ -916,8 +917,11 @@ - basic_machine=hppa1.1-oki - os=-proelf - ;; -- openrisc | openrisc-*) -- basic_machine=or32-unknown -+ or1k | or1k-*) -+ basic_machine=or1k-unknown -+ ;; -+ or1knd | or1knd-*) -+ basic_machine=or1knd-unknown - ;; - os400) - basic_machine=powerpc-ibm -@@ -1543,15 +1547,6 @@ - c4x-* | tic4x-*) - os=-coff - ;; -- tic54x-*) -- os=-coff -- ;; -- tic55x-*) -- os=-coff -- ;; -- tic6x-*) -- os=-coff -- ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 -@@ -1583,8 +1578,11 @@ - mips*-*) - os=-elf - ;; -- or32-*) -- os=-coff -+ or1k-*) -+ os=-elf -+ ;; -+ or1knd-*) -+ os=-elf - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 -diff -rNU3 dist.orig/cpu/openrisc.cpu dist/cpu/openrisc.cpu ---- dist.orig/cpu/openrisc.cpu 2011-08-22 17:25:07.000000000 +0200 -+++ dist/cpu/openrisc.cpu 1970-01-01 01:00:00.000000000 +0100 -@@ -1,774 +0,0 @@ --; OpenRISC family. -*- Scheme -*- --; Copyright 2000, 2001, 2011 Free Software Foundation, Inc. --; Contributed by Johan Rydberg, jrydberg@opencores.org --; --; This program is free software; you can redistribute it and/or modify --; it under the terms of the GNU General Public License as published by --; the Free Software Foundation; either version 2 of the License, or --; (at your option) any later version. --; --; This program is distributed in the hope that it will be useful, --; but WITHOUT ANY WARRANTY; without even the implied warranty of --; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --; GNU General Public License for more details. --; --; You should have received a copy of the GNU General Public License --; along with this program; if not, write to the Free Software --; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -- --(include "simplify.inc") -- --; OpenRISC 1000 is an architecture of a family of open source, --; synthesizeable RISC microprocessor cores. It is a 32-bit load --; and store RISC architecture designed with emphasis on speed, --; compact instruction set and scalability. OpenRISC 1000 targets --; wide range of embedded environments. -- --(define-arch -- (name openrisc) -- (comment "OpenRISC 1000") -- (insn-lsb0? #t) -- (machs openrisc or1300) -- (isas or32) --) -- -- --; Attributes -- --; An attribute to describe if a model has insn and/or data caches. --(define-attr -- (for model) -- (type enum) -- (name HAS-CACHE) -- (comment "if this model has caches") -- (values DATA-CACHE INSN-CACHE) --) -- --; An attribute to describe if an insn can be in the delay slot or not. --(define-attr -- (for insn) -- (type boolean) -- (name NOT-IN-DELAY-SLOT) -- (comment "insn can't go in delay slot") --) -- --; IDOC attribute for instruction documentation. -- --(define-attr -- (for insn) -- (type enum) -- (name IDOC) -- (comment "insn kind for documentation") -- (attrs META) -- (values -- (MEM - () "Memory") -- (ALU - () "ALU") -- (FPU - () "FPU") -- (BR - () "Branch") -- (PRIV - () "Priviledged") -- (MISC - () "Miscellaneous") -- ) --) -- --; Enum for exception vectors. --(define-enum -- (name e-exception) -- (comment "exception vectors") -- (attrs) -- (prefix E_) -- (values (("RESET") ("BUSERR" -) ("DPF" -) ("IPF" -) ("EXTINT" -) ("ALIGN" -) -- ("ILLEGAL" -) ("PEINT" -) ("DTLBMISS" -) ("ITLBMISS" -) ("RRANGE" -) -- ("SYSCALL" -) ("BREAK" -) ("RESERVED" -))) --) -- -- --; Instruction set parameters. -- --(define-isa -- ; Name of the ISA. -- (name or32) -- -- ; Base insturction length. The insns is always 32 bits wide. -- (base-insn-bitsize 32) -- -- ; Address of insn in delay slot -- (setup-semantics (set-quiet (reg h-delay-insn) (add pc 4))) --) -- -- --; CPU family definitions. -- --(define-cpu -- ; CPU names must be distinct from the architecture name and machine names. -- ; The "b" suffix stands for "base" and is the convention. -- ; The "f" suffix stands for "family" and is the convention. -- (name openriscbf) -- (comment "OpenRISC base family") -- (endian big) -- (word-bitsize 32) --) -- --; Generic machine --(define-mach -- (name openrisc) -- (comment "Generic OpenRISC cpu") -- (cpu openriscbf) -- (bfd-name "openrisc") --) -- --; OpenRISC 1300 machine --(define-mach -- (name or1300) -- (comment "OpenRISC 1300") -- (cpu openriscbf) -- (bfd-name "openrisc:1300") --) -- -- --; Model descriptions -- --; Generic OpenRISC model --(define-model -- (name openrisc-1) (comment "OpenRISC generic model") (attrs) -- (mach openrisc) -- -- ; Nothing special about this. -- (unit u-exec "Execution Unit" () 1 1 () () () ()) --) -- --; OpenRISC 1320 --(define-model -- (name or1320-1) (comment "OpenRISC 1320 model") -- -- ; This model has both instruction and data cache -- (attrs (HAS-CACHE INSN-CACHE,DATA-CACHE)) -- (mach or1300) -- -- ; Nothing special about this. -- (unit u-exec "Execution Unit" () 1 1 () () () ()) --) -- -- --; Instruction fields. -- --; Attributes: --; . PCREL-ADDR pc relative value (for reloc and disassembly purposes) --; . ABS-ADDR absolute address (for reloc and disassembly purposes?) --; . RESERVED bits are not used to decode insn, must be all 0 -- --; Instruction classes. --(dnf f-class "insn class" () 31 2) --(dnf f-sub "sub class" () 29 4) -- --; Register fields. --(dnf f-r1 "r1" () 25 5) --(dnf f-r2 "r2" () 20 5) --(dnf f-r3 "r3" () 15 5) -- --; Immediates. --(df f-simm16 "signed imm (16)" () 15 16 INT #f #f) --(dnf f-uimm16 "unsigned imm (16)" () 15 16) --(dnf f-uimm5 "unsigned imm (5)" () 4 5) --(df f-hi16 "high 16" () 15 16 INT #f #f) --(df f-lo16 "low 16" () 15 16 INT #f #f) -- --; Sub fields --(dnf f-op1 "op1" () 31 2) --(dnf f-op2 "op2" () 29 4) --(dnf f-op3 "op3" () 25 2) --(dnf f-op4 "op4" () 23 3) --(dnf f-op5 "op3" () 25 5) --(dnf f-op6 "op4" () 7 3) --(dnf f-op7 "op5" () 3 4) -- --(dnf f-i16-1 "uimm16-1" () 10 11) --(dnf f-i16-2 "uimm16-2" () 25 5) -- --; PC relative, 26-bit (2 shifted to right) --(df f-disp26 "disp26" (PCREL-ADDR) 25 26 INT -- ((value pc) (sra WI (sub WI value pc) (const 2))) -- ((value pc) (add WI (sll WI value (const 2)) pc))) -- --; absolute, 26-bit (2 shifted to right) --(df f-abs26 "abs26" (ABS-ADDR) 25 26 INT -- ((value pc) (sra WI pc (const 2))) -- ((value pc) (sll WI value (const 2)))) -- --(define-multi-ifield -- (name f-i16nc) -- (comment "16 bit signed") -- (attrs SIGN-OPT) -- (mode HI) -- (subfields f-i16-1 f-i16-2) -- (insert (sequence () -- (set (ifield f-i16-2) (and (sra (ifield f-i16nc) -- (const 11)) -- (const #x1f))) -- (set (ifield f-i16-1) (and (ifield f-i16nc) -- (const #x7ff))))) -- (extract (sequence () -- (set (ifield f-i16nc) (c-raw-call SI "@arch@_sign_extend_16bit" -- (or (sll (ifield f-i16-2) -- (const 11)) -- (ifield f-i16-1)))))) --) -- -- --; Enums. -- --; insn-class: bits 31-30 --(define-normal-insn-enum insn-class "FIXME" () OP1_ f-class -- (.map .str (.iota 4)) --) -- --(define-normal-insn-enum insn-sub "FIXME" () OP2_ f-sub -- (.map .str (.iota 16)) --) -- --(define-normal-insn-enum insn-op3 "FIXME" () OP3_ f-op3 -- (.map .str (.iota 4)) --) -- --(define-normal-insn-enum insn-op4 "FIXME" () OP4_ f-op4 -- (.map .str (.iota 8)) --) -- --(define-normal-insn-enum insn-op5 "FIXME" () OP5_ f-op5 -- (.map .str (.iota 32)) --) -- --(define-normal-insn-enum insn-op6 "FIXME" () OP6_ f-op6 -- (.map .str (.iota 8)) --) -- --(define-normal-insn-enum insn-op7 "FIXME" () OP7_ f-op7 -- (.map .str (.iota 16)) --) -- -- -- --; Hardware pieces. --; These entries list the elements of the raw hardware. --; They're also used to provide tables and other elements of the assembly --; language. -- --(dnh h-pc "program counter" (PC PROFILE) (pc) () () ()) -- --(define-hardware -- (name h-gr) (comment "general registers") (attrs PROFILE) -- (type register WI (32)) -- (indices keyword "" -- ((r0 0) (r1 1) (r2 2) (r3 3) (r4 4) (r5 5) (r6 6) (r7 7) -- (r8 8) (r9 9) (r10 10) (r11 11) (r12 12) (r13 13) (r14 14) -- (r15 15) (r16 16) (r17 17) (r18 18) (r19 19) (r20 20) -- (r21 21) (r22 22) (r23 23) (r24 24) (r25 25) (r26 26) -- (r27 27) (r28 28) (r29 29) (r30 30) (r31 31) (lr 11) -- (sp 1) (fp 2))) --) -- --(define-hardware -- (name h-sr) (comment "special registers") -- (type register WI (#x20000)) -- (get (index) (c-call SI "@arch@_h_sr_get_handler" index)) -- (set (index newval) (c-call VOID "@arch@_h_sr_set_handler" index newval)) --) -- --(dnh h-hi16 "high 16 bits" () (immediate (INT 16)) () () ()) --(dnh h-lo16 "low 16 bits" () (immediate (INT 16)) () () ()) -- --(dsh h-cbit "condition bit" () (register BI)) --(dsh h-delay-insn "delay insn addr" () (register SI)) -- -- --; Instruction operands. -- --(dnop sr "special register" (SEM-ONLY) h-sr f-nil) --(dnop cbit "condition bit" (SEM-ONLY) h-cbit f-nil) --(dnop simm-16 "16 bit signed immediate" () h-sint f-simm16) --(dnop uimm-16 "16 bit unsigned immediate" () h-uint f-uimm16) --(dnop disp-26 "pc-rel 26 bit" () h-iaddr f-disp26) --(dnop abs-26 "abs 26 bit" () h-iaddr f-abs26) --(dnop uimm-5 "imm5" () h-uint f-uimm5) -- --(dnop rD "destination register" () h-gr f-r1) --(dnop rA "source register A" () h-gr f-r2) --(dnop rB "source register B" () h-gr f-r3) -- --(dnop op-f-23 "f-op23" () h-uint f-op4) --(dnop op-f-3 "f-op3" () h-uint f-op5) -- --; For hi(foo). --(define-operand -- (name hi16) (comment "high 16 bit immediate, sign optional") -- (attrs SIGN-OPT) -- (type h-hi16) -- (index f-simm16) -- (handlers (parse "hi16")) --) -- --; For lo(foo) --(define-operand -- (name lo16) (comment "low 16 bit immediate, sign optional") -- (attrs SIGN-OPT) -- (type h-lo16) -- (index f-lo16) -- (handlers (parse "lo16")) --) -- --(define-operand -- (name ui16nc) -- (comment "16 bit immediate, sign optional") -- (attrs) -- (type h-lo16) -- (index f-i16nc) -- (handlers (parse "lo16")) --) -- -- --; Instructions. -- --; Branch releated instructions -- --(dni l-j "jump (absolute iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.j ${abs-26}" -- (+ OP1_0 OP2_0 abs-26) -- -- ; We execute the delay slot before doin' the real branch -- (delay 1 (set pc abs-26)) -- () --) -- --(dni l-jal "jump and link (absolute iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.jal ${abs-26}" -- (+ OP1_0 OP2_1 abs-26) -- -- ; We execute the delay slot before doin' the real branch -- ; Set LR to (delay insn addr + 4) -- (sequence () -- (set (reg h-gr 11) (add (reg h-delay-insn) 4)) -- (delay 1 (set pc abs-26))) -- () --) -- --(dni l-jr "jump register (absolute iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.jr $rA" -- (+ OP1_0 OP2_5 OP3_0 OP4_0 rA uimm-16) -- -- ; We execute the delay slot before doin' the real branch -- (delay 1 (set pc rA)) -- () --) -- --(dni l-jalr "jump register and link (absolute iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.jalr $rA" -- (+ OP1_0 OP2_5 OP3_0 OP4_1 rA uimm-16) -- -- ; We save the value of rA in a temporary slot before setting -- ; the link register. This because "l.jalr r11" would cause -- ; a forever-and-ever loop otherwise. -- ; -- ; We execute the delay slot before doin' the real branch -- (sequence ((WI tmp-slot)) -- (set tmp-slot rA) -- (set (reg h-gr 11) (add (reg h-delay-insn) 4)) -- (delay 1 (set pc tmp-slot))) -- () --) -- --(dni l-bal "branch and link (pc relative iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.bal ${disp-26}" -- (+ OP1_0 OP2_2 disp-26) -- -- ; We execute the delay slot before doin' the real branch -- ; Set LR to (delay insn addr + 4) -- (sequence () -- (set (reg h-gr 11) (add (reg h-delay-insn) 4)) -- (delay 1 (set pc disp-26))) -- () --) -- --(dni l-bnf "branch if condition bit not set (pc relative iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.bnf ${disp-26}" -- (+ OP1_0 OP2_3 disp-26) -- -- ; We execute the delay slot before doin' the real branch -- (if (eq cbit 0) -- (sequence () -- (delay 1 (set pc disp-26)))) -- () --) -- --(dni l-bf "branch if condition bit is set (pc relative iaddr)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.bf ${disp-26}" -- (+ OP1_0 OP2_4 disp-26) -- -- ; We execute the delay slot before doin' the real branch -- (if (eq cbit 1) -- (sequence () -- (delay 1 (set pc disp-26)))) -- () --) -- --(dni l-brk "break (exception)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.brk ${uimm-16}" -- (+ OP1_0 OP2_5 OP3_3 OP4_0 rA uimm-16) -- -- ; FIXME should we do it like this ?? -- (c-call VOID "@cpu@_cpu_brk" uimm-16) -- () --) -- --(dni l-rfe "return from exception" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.rfe $rA" -- (+ OP1_0 OP2_5 OP3_0 OP4_2 rA uimm-16) -- (sequence () -- (delay 1 (set pc (c-call SI "@cpu@_cpu_rfe" rA)))) -- () --) -- --(dni l-sys "syscall (exception)" -- ; This function may not be in delay slot -- (NOT-IN-DELAY-SLOT) -- -- "l.sys ${uimm-16}" -- (+ OP1_0 OP2_5 OP3_2 OP4_0 rA uimm-16) -- (sequence() -- (delay 1 (set pc (c-call SI "@cpu@_except" pc -- #xc00 uimm-16)))) -- () --) -- -- --; Misc instructions -- --(dni l-nop "nop" -- () -- "l.nop" -- (+ OP1_0 OP2_5 OP3_1 OP4_0 rA uimm-16) -- (nop) -- () --) -- --(dnmi l-ret "ret" () -- "l.ret" -- (emit l-jr (rA 11) (uimm-16 0)) --) -- --(dni l-movhi "movhi" -- (DELAY-SLOT) -- "l.movhi $rD,$hi16" -- (+ OP1_0 OP2_6 hi16 rD rA) -- (set rD (sll WI hi16 (const 16))) -- () --) -- -- --; System releated instructions -- --(dni l-mfsr "mfsr" -- (DELAY-SLOT) -- "l.mfsr $rD,$rA" -- (+ OP1_0 OP2_7 rD rA uimm-16) -- (set rD (c-call SI "@cpu@_cpu_mfsr" rA)) -- () --) -- --(dni l-mtsr "mtsr" -- (DELAY-SLOT) -- "l.mtsr $rA,$rB" -- (+ OP1_1 OP2_0 rA rB rD (f-i16-1 0)) -- (c-call VOID "@cpu@_cpu_mtsr" rA rB) -- () --) -- -- -- --; Load instructions -- --(dni l-lw "load word" -- (DELAY-SLOT) -- "l.lw $rD,${simm-16}($rA)" -- (+ OP1_2 OP2_0 rD rA simm-16) -- (set rD (mem SI (add rA simm-16))) -- () --) -- --(dni l-lbz "load byte (zero extend)" -- (DELAY-SLOT) -- "l.lbz $rD,${simm-16}($rA)" -- (+ OP1_2 OP2_1 rD rA simm-16) -- (set rD (zext SI (mem QI (add rA simm-16)))) -- () --) -- --(dni l-lbs "load byte (sign extend)" -- (DELAY-SLOT) -- "l.lbs $rD,${simm-16}($rA)" -- (+ OP1_2 OP2_2 rD rA simm-16) -- (set rD (ext SI (mem QI (add rA simm-16)))) -- () --) -- --(dni l-lhz "load halfword (zero extend)" -- (DELAY-SLOT) -- "l.lhz $rD,${simm-16}($rA)" -- (+ OP1_2 OP2_3 rD simm-16 rA) -- (set rD (zext SI (mem HI (add rA simm-16)))) -- () --) -- --(dni l-lhs "load halfword (sign extend)" -- (DELAY-SLOT) -- "l.lhs $rD,${simm-16}($rA)" -- (+ OP1_2 OP2_4 rD rA simm-16) -- (set rD (ext SI (mem HI (add rA simm-16)))) -- () --) -- -- --; Store instructions --; --; We have to use a multi field since the integer is splited over 2 fields -- --(define-pmacro (store-insn mnemonic op2-op mode-op) -- (begin -- (dni (.sym l- mnemonic) -- (.str "l." mnemonic " imm(reg)/reg") -- (DELAY-SLOT) -- (.str "l." mnemonic " ${ui16nc}($rA),$rB") -- (+ OP1_3 op2-op rB rD ui16nc) -- (set (mem mode-op (add rA ui16nc)) rB) -- () -- ) -- ) --) -- --(store-insn sw OP2_5 SI) --(store-insn sb OP2_6 QI) --(store-insn sh OP2_7 HI) -- -- -- --; Shift and rotate instructions -- --; Reserved fields. --(dnf f-f-15-8 "nop" (RESERVED) 15 8) --(dnf f-f-10-3 "nop" (RESERVED) 10 3) --(dnf f-f-4-1 "nop" (RESERVED) 4 1) --(dnf f-f-7-3 "nop" (RESERVED) 7 3) -- --(define-pmacro (shift-insn mnemonic op4-op) -- (begin -- (dni (.sym l- mnemonic) -- (.str "l." mnemonic " reg/reg/reg") -- () -- (.str "l." mnemonic " $rD,$rA,$rB") -- (+ OP1_3 OP2_8 rD rA rB (f-f-10-3 0) op4-op (f-f-4-1 0) OP7_8) -- (set rD (mnemonic rA rB)) -- () -- ) -- (dni (.sym l- mnemonic "i") -- (.str "l." mnemonic " reg/reg/imm") -- () -- (.str "l." mnemonic "i $rD,$rA,${uimm-5}") -- (+ OP1_2 OP2_13 rD rA (f-f-15-8 0) op4-op uimm-5) -- (set rD (mnemonic rA uimm-5)) -- () -- ) -- ) --) -- --(shift-insn sll OP6_0) --(shift-insn srl OP6_1) --(shift-insn sra OP6_2) --(shift-insn ror OP6_4) -- -- --; Arethmetic insns -- --; Reserved fields. --(dnf f-f-10-7 "nop" (RESERVED) 10 7) -- --(define-pmacro (ar-insn-u mnemonic op2-op op5-op) -- (begin -- (dni (.sym l- mnemonic) -- (.str "l." mnemonic " reg/reg/reg") -- () -- (.str "l." mnemonic " $rD,$rA,$rB") -- (+ OP1_3 OP2_8 rD rA rB (f-f-10-7 0) op5-op) -- (set rD (mnemonic rA rB)) -- () -- ) -- (dni (.sym l- mnemonic "i") -- (.str "l." mnemonic " reg/reg/lo16") -- () -- (.str "l." mnemonic "i $rD,$rA,$lo16") -- (+ OP1_2 op2-op rD rA lo16) -- (set rD (mnemonic rA (and lo16 #xffff))) -- () -- ) -- ) --) -- --(define-pmacro (ar-insn-s mnemonic op2-op op5-op) -- (begin -- (dni (.sym l- mnemonic) -- (.str "l." mnemonic " reg/reg/reg") -- () -- (.str "l." mnemonic " $rD,$rA,$rB") -- (+ OP1_3 OP2_8 rD rA rB (f-f-10-7 0) op5-op) -- (set rD (mnemonic rA rB)) -- () -- ) -- (dni (.sym l- mnemonic "i") -- (.str "l." mnemonic " reg/reg/lo16") -- () -- (.str "l." mnemonic "i $rD,$rA,$lo16") -- (+ OP1_2 op2-op rD rA lo16) -- (set rD (mnemonic rA lo16)) -- () -- ) -- ) --) -- --(ar-insn-s add OP2_5 OP7_0) --;;(ar-op-s addc OP2_5 OP7_0) --(ar-insn-s sub OP2_7 OP7_2) --(ar-insn-u and OP2_8 OP7_3) --(ar-insn-u or OP2_9 OP7_4) --(ar-insn-u xor OP2_10 OP7_5) --(ar-insn-u mul OP2_11 OP7_6) --;;(ar-op-u mac OP2_12 OP7_7) -- -- --(dni l-div "divide (signed)" -- (DELAY-SLOT) -- "l.div $rD,$rA,$rB" -- (+ OP1_3 OP2_8 rD rA rB (f-f-10-7 0) OP7_9) -- (if VOID (eq rB (const 0)) -- (c-call VOID "@arch@_cpu_trap" pc (enum SI E_ILLEGAL)) -- (set rD (div rA rB))) -- () --) -- --(dni l-divu "divide (unsigned)" -- (DELAY-SLOT) -- "l.divu $rD,$rA,$rB" -- (+ OP1_3 OP2_8 rD rA rB (f-f-10-7 0) OP7_10) -- (if VOID (eq rB (const 0)) -- (c-call VOID "@arch@_cpu_trap" pc (enum SI E_ILLEGAL)) -- (set rD (udiv rA rB))) -- () --) -- -- --; Compare instructions -- --; Reserved fields. --(dnf f-f-10-11 "nop" (RESERVED) 10 11) -- --; Register compare (both signed and unsigned) --(define-pmacro (sf-insn-r op1-op op2-op op3-op op3-op-2 sem-op) -- (begin -- (dni (.sym l- "sf" (.sym sem-op "s")) -- (.str "l." mnemonic " reg/reg") -- (DELAY-SLOT) -- (.str "l.sf" (.str sem-op) "s $rA,$rB") -- (+ op1-op op2-op op3-op-2 rA rB (f-f-10-11 0)) -- (set cbit (sem-op rA rB)) -- () -- ) -- (dni (.sym l- "sf" (.sym sem-op "u")) -- (.str "l." mnemonic " reg/reg") -- (DELAY-SLOT) -- (.str "l.sf" (.str sem-op) "u $rA,$rB") -- (+ op1-op op2-op op3-op rA rB (f-f-10-11 0)) -- (set cbit (sem-op rA rB)) -- () -- ) -- ) --) -- --; Immediate compare (both signed and unsigned) --(define-pmacro (sf-insn-i op1-op op2-op op3-op op3-op-2 sem-op) -- (begin -- (dni (.sym l- "sf" (.sym sem-op "si")) -- (.str "l." mnemonic "si reg/imm") -- (DELAY-SLOT) -- (.str "l.sf" (.str sem-op) "si $rA,${simm-16}") -- (+ op1-op op2-op op3-op-2 rA simm-16) -- (set cbit (sem-op rA simm-16)) -- () -- ) -- (dni (.sym l- "sf" (.sym sem-op "ui")) -- (.str "l." mnemonic "ui reg/imm") -- (DELAY-SLOT) -- (.str "l.sf" (.str sem-op) "ui $rA,${uimm-16}") -- (+ op1-op op2-op op3-op rA uimm-16) -- (set cbit (sem-op rA uimm-16)) -- () -- ) -- ) --) -- --(define-pmacro (sf-insn op5-op sem-op) -- (begin -- (dni (.sym l- "sf" sem-op) -- (.str "l." mnemonic " reg/reg") -- (DELAY-SLOT) -- (.str "l.sf" (.str sem-op) " $rA,$rB") -- (+ OP1_3 OP2_9 op5-op rA rB (f-f-10-11 0)) -- (set cbit (sem-op rA rB)) -- () -- ) -- (dni (.sym l- "sf" (.sym sem-op "i")) -- (.str "l." mnemonic "i reg/imm") -- (DELAY-SLOT) -- (.str "l.sf" (.str sem-op) "i $rA,${simm-16}") -- (+ OP1_2 OP2_14 op5-op rA simm-16) -- (set cbit (sem-op rA simm-16)) -- () -- ) -- ) --) -- -- --(sf-insn-r OP1_3 OP2_9 OP5_2 OP5_6 gt) --(sf-insn-r OP1_3 OP2_9 OP5_3 OP5_7 ge) --(sf-insn-r OP1_3 OP2_9 OP5_4 OP5_8 lt) --(sf-insn-r OP1_3 OP2_9 OP5_5 OP5_9 le) -- --(sf-insn-i OP1_2 OP2_14 OP5_2 OP5_6 gt) --(sf-insn-i OP1_2 OP2_14 OP5_3 OP5_7 ge) --(sf-insn-i OP1_2 OP2_14 OP5_4 OP5_8 lt) --(sf-insn-i OP1_2 OP2_14 OP5_5 OP5_9 le) -- --(sf-insn OP5_0 eq) --(sf-insn OP5_1 ne) -diff -rNU3 dist.orig/cpu/openrisc.opc dist/cpu/openrisc.opc ---- dist.orig/cpu/openrisc.opc 2011-08-22 17:25:07.000000000 +0200 -+++ dist/cpu/openrisc.opc 1970-01-01 01:00:00.000000000 +0100 -@@ -1,164 +0,0 @@ --/* OpenRISC opcode support. -*- C -*- -- Copyright 2000, 2001, 2003, 2005, 2011 Free Software Foundation, Inc. -- -- Contributed by Red Hat Inc; -- -- This file is part of the GNU Binutils. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --/* This file is an addendum to or32.cpu. Heavy use of C code isn't -- appropriate in .cpu files, so it resides here. This especially applies -- to assembly/disassembly where parsing/printing can be quite involved. -- Such things aren't really part of the specification of the cpu, per se, -- so .cpu files provide the general framework and .opc files handle the -- nitty-gritty details as necessary. -- -- Each section is delimited with start and end markers. -- -- -opc.h additions use: "-- opc.h" -- -opc.c additions use: "-- opc.c" -- -asm.c additions use: "-- asm.c" -- -dis.c additions use: "-- dis.c" -- -ibd.h additions use: "-- ibd.h" */ -- --/* -- opc.h */ --#undef CGEN_DIS_HASH_SIZE --#define CGEN_DIS_HASH_SIZE 64 --#undef CGEN_DIS_HASH --#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2) -- --extern long openrisc_sign_extend_16bit (long); --/* -- */ -- --/* -- opc.c */ --/* -- */ -- --/* -- asm.c */ -- --static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'"); -- --#define CGEN_VERBOSE_ASSEMBLER_ERRORS -- --long --openrisc_sign_extend_16bit (long value) --{ -- return ((value & 0xffff) ^ 0x8000) - 0x8000; --} -- --/* Handle hi(). */ -- --static const char * --parse_hi16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep) --{ -- const char *errmsg; -- enum cgen_parse_operand_result result_type; -- unsigned long ret; -- -- if (**strp == '#') -- ++*strp; -- -- if (strncasecmp (*strp, "hi(", 3) == 0) -- { -- bfd_vma value; -- -- *strp += 3; -- errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16, -- & result_type, & value); -- if (**strp != ')') -- return MISSING_CLOSING_PARENTHESIS; -- -- ++*strp; -- if (errmsg == NULL -- && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -- value >>= 16; -- ret = value; -- } -- else -- { -- if (**strp == '-') -- { -- long value; -- -- errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); -- ret = value; -- } -- else -- { -- unsigned long value; -- -- errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value); -- ret = value; -- } -- } -- -- *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000; -- return errmsg; --} -- --/* Handle lo(). */ -- --static const char * --parse_lo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep) --{ -- const char *errmsg; -- enum cgen_parse_operand_result result_type; -- unsigned long ret; -- -- if (**strp == '#') -- ++*strp; -- -- if (strncasecmp (*strp, "lo(", 3) == 0) -- { -- bfd_vma value; -- -- *strp += 3; -- errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16, -- & result_type, & value); -- if (**strp != ')') -- return MISSING_CLOSING_PARENTHESIS; -- -- ++*strp; -- ret = value; -- } -- else -- { -- if (**strp == '-') -- { -- long value; -- -- errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); -- ret = value; -- } -- else -- { -- unsigned long value; -- -- errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value); -- ret = value; -- } -- } -- -- *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000; -- return errmsg; --} -- --/* -- */ -- --/* -- ibd.h */ --extern long openrisc_sign_extend_16bit (long); -- --/* -- */ -diff -rNU3 dist.orig/cpu/or1k.cpu dist/cpu/or1k.cpu ---- dist.orig/cpu/or1k.cpu 1970-01-01 01:00:00.000000000 +0100 -+++ dist/cpu/or1k.cpu 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,131 @@ -+; OpenRISC 1000 architecture. -*- Scheme -*- -+; Copyright 2000-2014 Free Software Foundation, Inc. -+; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org -+; Modified by Julius Baxter, juliusbaxter@gmail.com -+; Modified by Peter Gavin, pgavin@gmail.com -+; -+; This program is free software; you can redistribute it and/or modify -+; it under the terms of the GNU General Public License as published by -+; the Free Software Foundation; either version 3 of the License, or -+; (at your option) any later version. -+; -+; This program is distributed in the hope that it will be useful, -+; but WITHOUT ANY WARRANTY; without even the implied warranty of -+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+; GNU General Public License for more details. -+; -+; You should have received a copy of the GNU General Public License -+; along with this program; if not, see -+ -+(include "simplify.inc") -+ -+; The OpenRISC family is a set of RISC microprocessor architectures with an -+; emphasis on scalability and is targetted at embedded use. -+; The CPU RTL development is a collaborative open source effort. -+; http://opencores.org/or1k -+; http://openrisc.net -+ -+(define-arch -+ (name or1k) -+ (comment "OpenRISC 1000") -+ (default-alignment aligned) -+ (insn-lsb0? #t) -+ (machs or32 or32nd or64 or64nd) -+ (isas openrisc) -+) -+ -+; Instruction set parameters. -+(define-isa -+ ; Name of the ISA. -+ (name openrisc) -+ ; Base insturction length. The insns are always 32 bits wide. -+ (base-insn-bitsize 32) -+ ) -+ -+(define-pmacro OR32-MACHS or32,or32nd) -+(define-pmacro OR64-MACHS or64,or64nd) -+(define-pmacro ORBIS-MACHS or32,or32nd,or64,or64nd) -+(define-pmacro ORFPX-MACHS or32,or32nd,or64,or64nd) -+(define-pmacro ORFPX32-MACHS or32,or32nd,or64,or64nd) -+(define-pmacro ORFPX64-MACHS or64,or64nd) -+ -+(define-attr -+ (for model) -+ (type boolean) -+ (name NO-DELAY-SLOT) -+ (comment "does not have delay slots") -+ ) -+ -+(if (keep-mach? (or32 or32nd)) -+ (begin -+ (define-cpu -+ (name or1k32bf) -+ (comment "OpenRISC 1000 32-bit CPU family") -+ (insn-endian big) -+ (data-endian big) -+ (word-bitsize 32) -+ (file-transform "") -+ ) -+ -+ (define-mach -+ (name or32) -+ (comment "Generic OpenRISC 1000 32-bit CPU") -+ (cpu or1k32bf) -+ (bfd-name "or1k") -+ ) -+ -+ (define-mach -+ (name or32nd) -+ (comment "Generic OpenRISC 1000 32-bit CPU") -+ (cpu or1k32bf) -+ (bfd-name "or1knd") -+ ) -+ -+ ; OpenRISC 1200 - 32-bit or1k CPU implementation -+ (define-model -+ (name or1200) (comment "OpenRISC 1200 model") -+ (attrs) -+ (mach or32) -+ (unit u-exec "Execution Unit" () 1 1 () () () ()) -+ ) -+ -+ ; OpenRISC 1200 - 32-bit or1k CPU implementation -+ (define-model -+ (name or1200nd) (comment "OpenRISC 1200 model") -+ (attrs NO-DELAY-SLOT) -+ (mach or32nd) -+ (unit u-exec "Execution Unit" () 1 1 () () () ()) -+ ) -+ ) -+ ) -+ -+(if (keep-mach? (or64 or64nd)) -+ (begin -+ (define-cpu -+ (name or1k64bf) -+ (comment "OpenRISC 1000 64-bit CPU family") -+ (insn-endian big) -+ (data-endian big) -+ (word-bitsize 64) -+ (file-transform "64") -+ ) -+ -+ (define-mach -+ (name or64) -+ (comment "Generic OpenRISC 1000 64-bit CPU") -+ (cpu or1k64bf) -+ (bfd-name "or1k64") -+ ) -+ -+ (define-mach -+ (name or64nd) -+ (comment "Generic OpenRISC 1000 ND 64-bit CPU") -+ (cpu or1k64bf) -+ (bfd-name "or1k64nd") -+ ) -+ ) -+ ) -+ -+(include "or1kcommon.cpu") -+(include "or1korbis.cpu") -+(include "or1korfpx.cpu") -diff -rNU3 dist.orig/cpu/or1k.opc dist/cpu/or1k.opc ---- dist.orig/cpu/or1k.opc 1970-01-01 01:00:00.000000000 +0100 -+++ dist/cpu/or1k.opc 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,421 @@ -+/* OpenRISC 1000 opcode support. -*- C -*- -+ Copyright 2000-2014 Free Software Foundation, Inc. -+ -+ Originally ontributed for OR32 by Red Hat Inc; -+ -+ This file is part of the GNU Binutils. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, see . */ -+ -+/* This file is an addendum to or1k.cpu. Heavy use of C code isn't -+ appropriate in .cpu files, so it resides here. This especially applies -+ to assembly/disassembly where parsing/printing can be quite involved. -+ Such things aren't really part of the specification of the cpu, per se, -+ so .cpu files provide the general framework and .opc files handle the -+ nitty-gritty details as necessary. -+ -+ Each section is delimited with start and end markers. -+ -+ -opc.h additions use: "-- opc.h" -+ -opc.c additions use: "-- opc.c" -+ -asm.c additions use: "-- asm.c" -+ -dis.c additions use: "-- dis.c" -+ -ibd.h additions use: "-- ibd.h" */ -+ -+/* -- opc.h */ -+ -+#undef CGEN_DIS_HASH_SIZE -+#define CGEN_DIS_HASH_SIZE 256 -+#undef CGEN_DIS_HASH -+#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2) -+ -+/* -- */ -+ -+/* -- opc.c */ -+/* -- */ -+ -+/* -- asm.c */ -+ -+static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'"); -+ -+#define CGEN_VERBOSE_ASSEMBLER_ERRORS -+ -+static const char * -+parse_disp26 (CGEN_CPU_DESC cd, -+ const char ** strp, -+ int opindex, -+ int opinfo, -+ enum cgen_parse_operand_result * resultp, -+ bfd_vma * valuep) -+{ -+ const char *errmsg = NULL; -+ enum cgen_parse_operand_result result_type; -+ -+ if (strncasecmp (*strp, "plt(", 4) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 4; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_OR1K_PLT26, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 2) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ return cgen_parse_address (cd, strp, opindex, opinfo, resultp, valuep); -+} -+ -+static const char * -+parse_simm16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep) -+{ -+ const char *errmsg; -+ enum cgen_parse_operand_result result_type; -+ long ret; -+ -+ if (**strp == '#') -+ ++*strp; -+ -+ if (strncasecmp (*strp, "hi(", 3) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 3; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16, -+ & result_type, & value); -+ if (**strp != ')') -+ errmsg = MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ -+ ret = value; -+ -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ { -+ ret >>= 16; -+ ret &= 0xffff; -+ ret = (ret ^ 0x8000) - 0x8000; -+ } -+ } -+ else if (strncasecmp (*strp, "lo(", 3) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 3; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ -+ ret = value; -+ -+ if (result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ { -+ ret &= 0xffff; -+ ret = (ret ^ 0x8000) - 0x8000; -+ } -+ } -+ else if (strncasecmp (*strp, "got(", 4) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 4; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_OR1K_GOT16, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotpchi(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTPC_HI16, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotpclo(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTPC_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotoffhi(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTOFF_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotofflo(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTOFF_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsgdhi(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_GD_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsgdlo(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_GD_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsldmhi(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDM_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsldmlo(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDM_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "dtpoffhi(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDO_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "dtpofflo(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDO_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gottpoffhi(", 11) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 11; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_IE_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gottpofflo(", 11) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 11; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_IE_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tpoffhi(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LE_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tpofflo(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LE_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else -+ { -+ long value; -+ errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); -+ ret = value; -+ } -+ -+ if (errmsg == NULL) -+ *valuep = ret; -+ -+ return errmsg; -+} -+ -+static const char * -+parse_uimm16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, unsigned long * valuep) -+{ -+ const char *errmsg = parse_simm16(cd, strp, opindex, (long *) valuep); -+ -+ if (errmsg == NULL) -+ *valuep &= 0xffff; -+ return errmsg; -+} -+ -+/* -- */ -+ -+/* -- ibd.h */ -+ -+/* -- */ -diff -rNU3 dist.orig/cpu/or1kcommon.cpu dist/cpu/or1kcommon.cpu ---- dist.orig/cpu/or1kcommon.cpu 1970-01-01 01:00:00.000000000 +0100 -+++ dist/cpu/or1kcommon.cpu 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,360 @@ -+; OpenRISC 1000 32-bit CPU hardware description. -*- Scheme -*- -+; Copyright 2000-2014 Free Software Foundation, Inc. -+; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org -+; Modified by Julius Baxter, juliusbaxter@gmail.com -+; -+; This program is free software; you can redistribute it and/or modify -+; it under the terms of the GNU General Public License as published by -+; the Free Software Foundation; either version 3 of the License, or -+; (at your option) any later version. -+; -+; This program is distributed in the hope that it will be useful, -+; but WITHOUT ANY WARRANTY; without even the implied warranty of -+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+; GNU General Public License for more details. -+; -+; You should have received a copy of the GNU General Public License -+; along with this program; if not, see -+ -+; Hardware pieces. -+; These entries list the elements of the raw hardware. -+; They're also used to provide tables and other elements of the assembly -+; language. -+ -+(define-hardware -+ (name h-pc) -+ (comment "program counter") -+ (attrs PC (MACH ORBIS-MACHS)) -+ (type pc UWI) -+ ) -+ -+(define-pmacro REG-INDICES -+ ((r0 0) -+ (r1 1) -+ (r2 2) -+ (r3 3) -+ (r4 4) -+ (r5 5) -+ (r6 6) -+ (r7 7) -+ (r8 8) -+ (r9 9) -+ (r10 10) -+ (r11 11) -+ (r12 12) -+ (r13 13) -+ (r14 14) -+ (r15 15) -+ (r16 16) -+ (r17 17) -+ (r18 18) -+ (r19 19) -+ (r20 20) -+ (r21 21) -+ (r22 22) -+ (r23 23) -+ (r24 24) -+ (r25 25) -+ (r26 26) -+ (r27 27) -+ (r28 28) -+ (r29 29) -+ (r30 30) -+ (r31 31) -+ (lr 9) -+ (sp 1) -+ (fp 2)) -+ ) -+ -+(define-hardware -+ (name h-fsr) -+ (comment "floating point registers (single, virtual)") -+ (attrs VIRTUAL (MACH ORFPX32-MACHS)) -+ (type register SF (32)) -+ (indices keyword "" REG-INDICES) -+ (get (index) (subword SF (trunc SI (reg h-gpr index)) 0)) -+ (set (index newval) (set UWI (reg h-gpr index) (zext UWI (subword SI newval 0)))) -+ ) -+ -+(define-hardware -+ (name h-fdr) (comment "floating point registers (double, virtual)") -+ (attrs VIRTUAL (MACH ORFPX64-MACHS)) -+ (type register DF (32)) -+ (indices keyword "" REG-INDICES) -+ (get (index) (subword DF (trunc DI (reg h-gpr index)) 0)) -+ (set (index newval) (set UDI (reg h-gpr index) (zext UDI (subword DI newval 0)))) -+ ) -+ -+(define-hardware -+ (name h-spr) (comment "special purpose registers") -+ (attrs VIRTUAL (MACH ORBIS-MACHS)) -+ (type register UWI (#x20000)) -+ (get (index) (c-call UWI "@cpu@_h_spr_get_raw" index)) -+ (set (index newval) (c-call VOID "@cpu@_h_spr_set_raw" index newval)) -+) -+ -+(define-pmacro spr-shift 11) -+(define-pmacro (spr-address spr-group spr-index) -+ (or (sll UWI (enum UWI (.sym "SPR-GROUP-" spr-group)) spr-shift) -+ (enum UWI (.sym "SPR-INDEX-" spr-group "-" spr-index)))) -+ -+(define-hardware -+ (name h-gpr) (comment "general registers") -+ (attrs (MACH ORBIS-MACHS)) -+ (type register UWI (32)) -+ (indices keyword "" REG-INDICES) -+ (get (index) (reg UWI h-spr (add index (spr-address SYS GPR0)))) -+ (set (index newval) (set UWI (reg UWI h-spr (add index (spr-address SYS GPR0))) newval)) -+ ) -+ -+(define-normal-enum -+ except-number -+ "Exception numbers" -+ () -+ EXCEPT- -+ (("NONE" #x00) -+ ("RESET" #x01) -+ ("BUSERR" #x02) -+ ("DPF" #x03) -+ ("IPF" #x04) -+ ("TICK" #x05) -+ ("ALIGN" #x06) -+ ("ILLEGAL" #x07) -+ ("INT" #x08) -+ ("DTLBMISS" #x09) -+ ("ITLBMISS" #x0a) -+ ("RANGE" #x0b) -+ ("SYSCALL" #x0c) -+ ("FPE" #x0d) -+ ("TRAP" #x0e) -+ ) -+ ) -+ -+(define-pmacro (raise-exception exnum) -+ (c-call VOID "@cpu@_exception" pc exnum)) -+ -+(define-normal-enum -+ spr-groups -+ "special purpose register groups" -+ () -+ SPR-GROUP- -+ (("SYS" #x0) -+ ("DMMU" #x1) -+ ("IMMU" #x2) -+ ("DCACHE" #x3) -+ ("ICACHE" #x4) -+ ("MAC" #x5) -+ ("DEBUG" #x6) -+ ("PERF" #x7) -+ ("POWER" #x8) -+ ("PIC" #x9) -+ ("TICK" #xa) -+ ("FPU" #xb) -+ ) -+ ) -+ -+(define-pmacro (spr-reg-info) -+ (.splice -+ (SYS VR #x000 "version register") -+ (SYS UPR #x001 "unit present register") -+ (SYS CPUCFGR #x002 "cpu configuration register") -+ (SYS DMMUCFGR #x003 "Data MMU configuration register") -+ (SYS IMMUCFGR #x004 "Insn MMU configuration register") -+ (SYS DCCFGR #x005 "Data cache configuration register") -+ (SYS ICCFGR #x006 "Insn cache configuration register") -+ (SYS DCFGR #x007 "Debug configuration register") -+ (SYS PCCFGR #x008 "Performance counters configuration register") -+ (SYS NPC #x010 "Next program counter") -+ (SYS SR #x011 "Supervision Regsiter") -+ (SYS PPC #x012 "Previous program counter") -+ (SYS FPCSR #x014 "Floating point control status register") -+ (.unsplice -+ (.map (.pmacro (n) (.splice SYS (.sym "EPCR" n) (.add n #x20) (.str "Exception PC register " n))) -+ (.iota #x10))) -+ (.unsplice -+ (.map (.pmacro (n) (.splice SYS (.sym "EEAR" n) (.add n #x30) (.str "Exception effective address register " n))) -+ (.iota #x10))) -+ (.unsplice -+ (.map (.pmacro (n) (.splice SYS (.sym "ESR" n) (.add n #x40) (.str "Exception supervision register " n))) -+ (.iota #x10))) -+ (.unsplice -+ (.map (.pmacro (n) (.splice SYS (.sym "GPR" n) (.add n #x400) (.str "General purpose register " n))) -+ (.iota #x200))) -+ -+ (MAC MACLO #x001 "Multiply and accumulate result (low)") -+ (MAC MACHI #x002 "Multiply and accumulate result (high)") -+ (TICK TTMR #x000 "Tick timer mode register") -+ ) -+ ) -+ -+(define-normal-enum -+ spr-reg-indices -+ "special purpose register indicies" -+ () -+ SPR-INDEX- -+ (.map (.pmacro (args) -+ (.apply (.pmacro (group index n comment) -+ ((.sym group "-" index) n)) -+ args) -+ ) -+ (spr-reg-info) -+ ) -+ ) -+ -+(define-pmacro (define-h-spr-reg spr-group spr-index n spr-comment) -+ (define-hardware -+ (name (.sym "h-" (.downcase spr-group) "-" (.downcase spr-index))) -+ (comment spr-comment) -+ (attrs VIRTUAL (MACH ORBIS-MACHS)) -+ (type register UWI) -+ (get () (reg UWI h-spr (spr-address spr-group spr-index))) -+ (set (newval) (set (reg UWI h-spr (spr-address spr-group spr-index)) newval)) -+ ) -+ ) -+(.splice begin (.unsplice (.map (.pmacro (args) (.apply define-h-spr-reg args)) (spr-reg-info)))) -+ -+(define-pmacro (spr-field-info) -+ ((SYS VR REV 5 0 "revision field") -+ (SYS VR CFG 23 16 "configuration template field") -+ (SYS VR VER 31 24 "version field") -+ (SYS UPR UP 0 0 "UPR present bit") -+ (SYS UPR DCP 1 1 "data cache present bit") -+ (SYS UPR ICP 2 2 "insn cache present bit") -+ (SYS UPR DMP 3 3 "data MMU present bit") -+ (SYS UPR MP 4 4 "MAC unit present bit") -+ (SYS UPR IMP 5 5 "insn MMU present bit") -+ (SYS UPR DUP 6 6 "debug unit present bit") -+ (SYS UPR PCUP 7 7 "performance counters unit present bit") -+ (SYS UPR PICP 8 8 "programmable interrupt controller present bit") -+ (SYS UPR PMP 9 9 "power management present bit") -+ (SYS UPR TTP 10 10 "tick timer present bit") -+ (SYS UPR CUP 31 24 "custom units present field") -+ (SYS CPUCFGR NSGR 3 0 "number of shadow GPR files field") -+ (SYS CPUCFGR CGF 4 4 "custom GPR file bit") -+ (SYS CPUCFGR OB32S 5 5 "ORBIS32 supported bit") -+ (SYS CPUCFGR OB64S 6 6 "ORBIS64 supported bit") -+ (SYS CPUCFGR OF32S 7 7 "ORFPX32 supported bit") -+ (SYS CPUCFGR OF64S 8 8 "ORFPX64 supported bit") -+ (SYS CPUCFGR OV64S 9 9 "ORVDX64 supported bit") -+ (SYS CPUCFGR ND 10 10 "no transfer delay bit") -+ (SYS SR SM 0 0 "supervisor mode bit") -+ (SYS SR TEE 1 1 "tick timer exception enabled bit") -+ (SYS SR IEE 2 2 "interrupt exception enabled bit") -+ (SYS SR DCE 3 3 "data cache enabled bit") -+ (SYS SR ICE 4 4 "insn cache enabled bit") -+ (SYS SR DME 5 5 "data MMU enabled bit") -+ (SYS SR IME 6 6 "insn MMU enabled bit") -+ (SYS SR LEE 7 7 "little endian enabled bit") -+ (SYS SR CE 8 8 "CID enable bit") -+ (SYS SR F 9 9 "flag bit") -+ (SYS SR CY 10 10 "carry bit") -+ (SYS SR OV 11 11 "overflow bit") -+ (SYS SR OVE 12 12 "overflow exception enabled bit") -+ (SYS SR DSX 13 13 "delay slot exception bit") -+ (SYS SR EPH 14 14 "exception prefix high bit") -+ (SYS SR FO 15 15 "fixed one bit") -+ (SYS SR SUMRA 16 16 "SPRs user mode read access bit") -+ (SYS SR CID 31 28 "context ID field") -+ (SYS FPCSR FPEE 0 0 "floating point exceptions enabled bit") -+ (SYS FPCSR RM 2 1 "floating point rounding mode field") -+ (SYS FPCSR OVF 3 3 "floating point overflow flag bit") -+ (SYS FPCSR UNF 4 4 "floating point underflow bit") -+ (SYS FPCSR SNF 5 5 "floating point SNAN flag bit") -+ (SYS FPCSR QNF 6 6 "floating point QNAN flag bit") -+ (SYS FPCSR ZF 7 7 "floating point zero flag bit") -+ (SYS FPCSR IXF 8 8 "floating point inexact flag bit") -+ (SYS FPCSR IVF 9 9 "floating point invalid flag bit") -+ (SYS FPCSR INF 10 10 "floating point infinity flag bit") -+ (SYS FPCSR DZF 11 11 "floating point divide by zero flag bit") -+ ) -+ ) -+ -+(define-normal-enum -+ spr-field-msbs -+ "SPR field msb positions" -+ () -+ SPR-FIELD-MSB- -+ (.map (.pmacro (args) -+ (.apply (.pmacro (group index field msb lsb comment) -+ ((.sym group "-" index "-" field) msb) -+ ) -+ args -+ ) -+ ) -+ (spr-field-info) -+ ) -+ ) -+ -+(define-normal-enum -+ spr-field-lsbs -+ "SPR field lsb positions" -+ () -+ SPR-FIELD-SIZE- -+ (.map (.pmacro (args) -+ (.apply (.pmacro (group index field msb lsb comment) -+ ((.sym group "-" index "-" field) lsb) -+ ) -+ args -+ ) -+ ) -+ (spr-field-info) -+ ) -+ ) -+ -+(define-normal-enum -+ spr-field-masks -+ "SPR field masks" -+ () -+ SPR-FIELD-MASK- -+ (.map (.pmacro (args) -+ (.apply (.pmacro (group index field msb lsb comment) -+ (.splice (.str group "-" index "-" field) (.sll (.inv (.sll (.inv 0) (.add (.sub msb lsb) 1))) lsb)) -+ ) -+ args -+ ) -+ ) -+ (spr-field-info) -+ ) -+ ) -+ -+(define-pmacro (define-h-spr-field spr-group spr-index spr-field spr-field-msb spr-field-lsb spr-field-comment) -+ (.let ((spr-field-name (.sym "h-" (.downcase spr-group) "-" (.downcase spr-index) "-" (.downcase spr-field))) -+ ) -+ (begin -+ (define-hardware -+ (name spr-field-name) -+ (comment spr-field-comment) -+ (attrs VIRTUAL (MACH ORBIS-MACHS)) -+ (type register UWI) -+ (get () (c-call UWI "@cpu@_h_spr_field_get_raw" (spr-address spr-group spr-index) spr-field-msb spr-field-lsb)) -+ (set (value) (c-call VOID "@cpu@_h_spr_field_set_raw" (spr-address spr-group spr-index) spr-field-msb spr-field-lsb value)) -+ ) -+ ) -+ ) -+ ) -+(.splice begin (.unsplice (.map (.pmacro (args) (.apply define-h-spr-field args)) (spr-field-info)))) -+ -+(define-attr -+ (type boolean) -+ (for insn) -+ (name DELAYED-CTI) -+ (comment "delayed control transfer instruction") -+ (values #f #t) -+ (default #f) -+ ) -+ -+(define-attr -+ (for insn) -+ (type boolean) -+ (name NOT-IN-DELAY-SLOT) -+ (comment "instruction cannot be in delay slot") -+ (values #f #t) -+ (default #f) -+ ) -+ -+(define-attr -+ (for insn) -+ (type boolean) -+ (name FORCED-CTI) -+ (comment "instruction may forcefully transfer control (e.g., rfe)") -+ ) -diff -rNU3 dist.orig/cpu/or1korbis.cpu dist/cpu/or1korbis.cpu ---- dist.orig/cpu/or1korbis.cpu 1970-01-01 01:00:00.000000000 +0100 -+++ dist/cpu/or1korbis.cpu 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,1145 @@ -+; OpenRISC Basic Instruction Set 32-bit (ORBIS) -*- Scheme -*- -+; Copyright 2000-2014 Free Software Foundation, Inc. -+; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org -+; Modified by Julius Baxter, juliusbaxter@gmail.com -+; Modified by Peter Gavin, pgavin@gmail.com -+; -+; This program is free software; you can redistribute it and/or modify -+; it under the terms of the GNU General Public License as published by -+; the Free Software Foundation; either version 3 of the License, or -+; (at your option) any later version. -+; -+; This program is distributed in the hope that it will be useful, -+; but WITHOUT ANY WARRANTY; without even the implied warranty of -+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+; GNU General Public License for more details. -+; -+; You should have received a copy of the GNU General Public License -+; along with this program; if not, see -+ -+; Instruction fields. -+ -+; Hardware for immediate operands -+(dnh h-simm16 "16-bit signed immediate" ((MACH ORBIS-MACHS)) (immediate (INT 16)) () () ()) -+(dnh h-uimm16 "16-bit unsigned immediate" () (immediate (UINT 16)) () () ()) -+(dnh h-uimm6 "6-bit unsigned immediate" () (immediate (UINT 6)) () () ()) -+ -+; Hardware for the (internal) atomic registers -+(dsh h-atomic-reserve "atomic reserve flag" () (register BI)) -+(dsh h-atomic-address "atomic reserve address" () (register SI)) -+ -+; Instruction classes. -+(dnf f-opcode "insn opcode" ((MACH ORBIS-MACHS)) 31 6) -+ -+; Register fields. -+(dnf f-r1 "r1" ((MACH ORBIS-MACHS)) 25 5) -+(dnf f-r2 "r2" ((MACH ORBIS-MACHS)) 20 5) -+(dnf f-r3 "r3" ((MACH ORBIS-MACHS)) 15 5) -+ -+; Sub fields -+(dnf f-op-25-2 "op-25-2" ((MACH ORBIS-MACHS)) 25 2) ;; nop -+(dnf f-op-25-5 "op-25-5" ((MACH ORBIS-MACHS)) 25 5) ;; sys, trap, *sync, sf* -+(dnf f-op-16-1 "op-16-1" ((MACH ORBIS-MACHS)) 16 1) ;; movhi,macrc -+(dnf f-op-7-4 "op-7-4" ((MACH ORBIS-MACHS)) 7 4) -+(dnf f-op-3-4 "op-3-4" ((MACH ORBIS-MACHS)) 3 4) -+(dnf f-op-9-2 "op-9-2" ((MACH ORBIS-MACHS)) 9 2) ;; alu ops upper opcode -+(dnf f-op-9-4 "op-9-4" ((MACH ORBIS-MACHS)) 9 4) ;; -+(dnf f-op-7-8 "op-7-8" ((MACH ORBIS-MACHS)) 7 8) -+(dnf f-op-7-2 "op-7-2" ((MACH ORBIS-MACHS)) 7 2) ;; alu lower upper opc,shroti -+ -+; Reserved fields -+(dnf f-resv-25-26 "resv-25-26" ((MACH ORBIS-MACHS) RESERVED) 25 26) -+(dnf f-resv-25-10 "resv-25-10" ((MACH ORBIS-MACHS) RESERVED) 25 10) -+(dnf f-resv-25-5 "resv-25-5" ((MACH ORBIS-MACHS) RESERVED) 25 5) -+(dnf f-resv-23-8 "resv-23-8" ((MACH ORBIS-MACHS) RESERVED) 23 8) -+(dnf f-resv-20-21 "resv-20-21" ((MACH ORBIS-MACHS) RESERVED) 20 21) -+(dnf f-resv-20-5 "resv-20-5" ((MACH ORBIS-MACHS) RESERVED) 20 5) -+(dnf f-resv-20-4 "resv-20-4" ((MACH ORBIS-MACHS) RESERVED) 20 4) -+(dnf f-resv-15-8 "resv-15-8" ((MACH ORBIS-MACHS) RESERVED) 15 8) -+(dnf f-resv-15-6 "resv-15-6" ((MACH ORBIS-MACHS) RESERVED) 15 6) -+(dnf f-resv-10-11 "resv-10-11" ((MACH ORBIS-MACHS) RESERVED) 10 11) -+(dnf f-resv-10-7 "resv-10-7" ((MACH ORBIS-MACHS) RESERVED) 10 7) -+(dnf f-resv-10-3 "resv-10-3" ((MACH ORBIS-MACHS) RESERVED) 10 3) -+(dnf f-resv-10-1 "resv-10-1" ((MACH ORBIS-MACHS) RESERVED) 10 1) -+(dnf f-resv-7-4 "resv-7-4" ((MACH ORBIS-MACHS) RESERVED) 7 4) -+(dnf f-resv-5-2 "resv-5-2" ((MACH ORBIS-MACHS) RESERVED) 5 2) -+ -+(dnf f-imm16-25-5 "imm16-25-5" ((MACH ORBIS-MACHS)) 25 5) -+(dnf f-imm16-10-11 "imm16-10-11" ((MACH ORBIS-MACHS)) 10 11) -+ -+; PC relative, 26-bit (2 shifted to right) -+(df f-disp26 -+ "disp26" -+ ((MACH ORBIS-MACHS) PCREL-ADDR) -+ 25 -+ 26 -+ INT -+ ((value pc) (sra SI (sub IAI value pc) (const 2))) -+ ((value pc) (add IAI (sll IAI value (const 2)) pc)) -+ ) -+ -+; Immediates. -+(dnf f-uimm16 "uimm16" ((MACH ORBIS-MACHS)) 15 16) -+(df f-simm16 "simm16" ((MACH ORBIS-MACHS) SIGN-OPT) 15 16 INT #f #f) -+(dnf f-uimm6 "uimm6" ((MACH ORBIS-MACHS)) 5 6) ;; shroti -+ -+(define-multi-ifield -+ (name f-uimm16-split) -+ (comment "16-bit split unsigned immediate") -+ (attrs (MACH ORBIS-MACHS)) -+ (mode UINT) -+ (subfields f-imm16-25-5 f-imm16-10-11) -+ (insert (sequence () -+ (set (ifield f-imm16-25-5) -+ (and (srl (ifield f-uimm16-split) -+ (const 11)) -+ (const #x1f))) -+ (set (ifield f-imm16-10-11) -+ (and (ifield f-uimm16-split) -+ (const #x7ff))))) -+ (extract -+ (set (ifield f-uimm16-split) -+ (trunc UHI -+ (or (sll (ifield f-imm16-25-5) -+ (const 11)) -+ (ifield f-imm16-10-11))))) -+ ) -+ -+(define-multi-ifield -+ (name f-simm16-split) -+ (comment "16-bit split signed immediate") -+ (attrs (MACH ORBIS-MACHS) SIGN-OPT) -+ (mode INT) -+ (subfields f-imm16-25-5 f-imm16-10-11) -+ (insert (sequence () -+ (set (ifield f-imm16-25-5) -+ (and (sra (ifield f-simm16-split) -+ (const 11)) -+ (const #x1f))) -+ (set (ifield f-imm16-10-11) -+ (and (ifield f-simm16-split) -+ (const #x7ff))))) -+ (extract -+ (set (ifield f-simm16-split) -+ (trunc HI -+ (or (sll (ifield f-imm16-25-5) -+ (const 11)) -+ (ifield f-imm16-10-11))))) -+ ) -+ -+; Enums. -+ -+; insn-opcode: bits 31-26 -+(define-normal-insn-enum -+ insn-opcode "insn main opcode enums" ((MACH ORBIS-MACHS)) OPC_ f-opcode -+ (("J" #x00) -+ ("JAL" #x01) -+ ("BNF" #x03) -+ ("BF" #x04) -+ ("NOP" #x05) -+ ("MOVHIMACRC" #x06) -+ ("SYSTRAPSYNCS" #x08) -+ ("RFE" #x09) -+ ("VECTOR" #x0a) -+ ("JR" #x11) -+ ("JALR" #x12) -+ ("MACI" #x13) -+ ("LWA" #x1b) -+ ("CUST1" #x1c) -+ ("CUST2" #x1d) -+ ("CUST3" #x1e) -+ ("CUST4" #x1f) -+ ("LD" #x20) -+ ("LWZ" #x21) -+ ("LWS" #x22) -+ ("LBZ" #x23) -+ ("LBS" #x24) -+ ("LHZ" #x25) -+ ("LHS" #x26) -+ ("ADDI" #x27) -+ ("ADDIC" #x28) -+ ("ANDI" #x29) -+ ("ORI" #x2a) -+ ("XORI" #x2b) -+ ("MULI" #x2c) -+ ("MFSPR" #x2d) -+ ("SHROTI" #x2e) -+ ("SFI" #x2f) -+ ("MTSPR" #x30) -+ ("MAC" #x31) -+ ("FLOAT" #x32) -+ ("SWA" #x33) -+ ("SD" #x34) -+ ("SW" #x35) -+ ("SB" #x36) -+ ("SH" #x37) -+ ("ALU" #x38) -+ ("SF" #x39) -+ ("CUST5" #x3c) -+ ("CUST6" #x3d) -+ ("CUST7" #x3e) -+ ("CUST8" #x3f) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-systrapsyncs -+ "systrapsync insn opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_SYSTRAPSYNCS_ f-op-25-5 -+ (("SYSCALL" #x00 ) -+ ("TRAP" #x08 ) -+ ("MSYNC" #x10 ) -+ ("PSYNC" #x14 ) -+ ("CSYNC" #x18 ) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-movehimacrc -+ "movhi/macrc insn opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_MOVHIMACRC_ f-op-16-1 -+ (("MOVHI" #x0) -+ ("MACRC" #x1) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-mac -+ "multiply/accumulate insn opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_MAC_ f-op-3-4 -+ (("MAC" #x1) -+ ("MSB" #x2) -+ ) -+ ) -+ -+(define-normal-insn-enum insn-opcode-shorts -+ "shift/rotate insn opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_SHROTS_ f-op-7-2 -+ (("SLL" #x0 ) -+ ("SRL" #x1 ) -+ ("SRA" #x2 ) -+ ("ROR" #x3 ) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-extbhs -+ "extend byte/half opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_EXTBHS_ f-op-9-4 -+ (("EXTHS" #x0) -+ ("EXTBS" #x1) -+ ("EXTHZ" #x2) -+ ("EXTBZ" #x3) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-extws -+ "extend word opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_EXTWS_ f-op-9-4 -+ (("EXTWS" #x0) -+ ("EXTWZ" #x1) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-alu-regreg -+ "alu reg/reg insn opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_ALU_REGREG_ f-op-3-4 -+ (("ADD" #x0) -+ ("ADDC" #x1) -+ ("SUB" #x2) -+ ("AND" #x3) -+ ("OR" #x4) -+ ("XOR" #x5) -+ ("MUL" #x6) -+ ("SHROT" #x8) -+ ("DIV" #x9) -+ ("DIVU" #xA) -+ ("MULU" #xB) -+ ("EXTBH" #xC) -+ ("EXTW" #xD) -+ ("CMOV" #xE) -+ ("FFL1" #xF) -+ ) -+) -+ -+(define-normal-insn-enum insn-opcode-setflag -+ "setflag insn opcode enums" ((MACH ORBIS-MACHS)) -+ OPC_SF_ f-op-25-5 -+ (("EQ" #x00) -+ ("NE" #x01) -+ ("GTU" #x02) -+ ("GEU" #x03) -+ ("LTU" #x04) -+ ("LEU" #x05) -+ ("GTS" #x0A) -+ ("GES" #x0B) -+ ("LTS" #x0C) -+ ("LES" #x0D) -+ ) -+) -+ -+ -+; Instruction operands. -+ -+(dnop sys-sr "supervision register" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-sr f-nil) -+(dnop sys-esr0 "exception supervision register 0" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-esr0 f-nil) -+(dnop sys-epcr0 "exception PC register 0" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-epcr0 f-nil) -+ -+(dnop sys-sr-lee "SR little endian enable bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-sr-lee f-nil) -+(dnop sys-sr-f "SR flag bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-sr-f f-nil) -+(dnop sys-sr-cy "SR carry bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-sr-cy f-nil) -+(dnop sys-sr-ov "SR overflow bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-sr-ov f-nil) -+(dnop sys-sr-ove "SR overflow exception enable bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-sr-ove f-nil) -+(dnop sys-cpucfgr-ob64s "CPUCFGR ORBIS64 supported bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-cpucfgr-ob64s f-nil) -+(dnop sys-cpucfgr-nd "CPUCFGR no delay bit" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-cpucfgr-nd f-nil) -+(dnop sys-fpcsr-rm "floating point round mode" ((MACH ORBIS-MACHS) SEM-ONLY) h-sys-fpcsr-rm f-nil) -+ -+(dnop mac-machi "MAC HI result register" ((MACH ORBIS-MACHS) SEM-ONLY) h-mac-machi f-nil) -+(dnop mac-maclo "MAC LO result register" ((MACH ORBIS-MACHS) SEM-ONLY) h-mac-maclo f-nil) -+ -+(dnop atomic-reserve "atomic reserve flag" ((MACH ORBIS-MACHS) SEM-ONLY) h-atomic-reserve f-nil) -+(dnop atomic-address "atomic address" ((MACH ORBIS-MACHS) SEM-ONLY) h-atomic-address f-nil) -+ -+(dnop uimm6 "uimm6" ((MACH ORBIS-MACHS)) h-uimm6 f-uimm6) -+ -+(dnop rD "destination register" ((MACH ORBIS-MACHS)) h-gpr f-r1) -+(dnop rA "source register A" ((MACH ORBIS-MACHS)) h-gpr f-r2) -+(dnop rB "source register B" ((MACH ORBIS-MACHS)) h-gpr f-r3) -+ -+(define-operand -+ (name disp26) -+ (comment "pc-rel 26 bit") -+ (attrs (MACH ORBIS-MACHS)) -+ (type h-iaddr) -+ (index f-disp26) -+ (handlers (parse "disp26")) -+ ) -+ -+(define-operand -+ (name simm16) -+ (comment "16-bit signed immediate") -+ (attrs (MACH ORBIS-MACHS) SIGN-OPT) -+ (type h-simm16) -+ (index f-simm16) -+ (handlers (parse "simm16")) -+ ) -+ -+(define-operand -+ (name uimm16) -+ (comment "16-bit unsigned immediate") -+ (attrs (MACH ORBIS-MACHS)) -+ (type h-uimm16) -+ (index f-uimm16) -+ (handlers (parse "uimm16")) -+ ) -+ -+(define-operand -+ (name simm16-split) -+ (comment "split 16-bit signed immediate") -+ (attrs (MACH ORBIS-MACHS) SIGN-OPT) -+ (type h-simm16) -+ (index f-simm16-split) -+ (handlers (parse "simm16")) -+) -+ -+(define-operand -+ (name uimm16-split) -+ (comment "split 16-bit unsigned immediate") -+ (attrs (MACH ORBIS-MACHS)) -+ (type h-uimm16) -+ (index f-uimm16-split) -+ (handlers (parse "uimm16")) -+) -+ -+; Instructions. -+ -+; Branch releated instructions -+ -+(define-pmacro (cti-link-return) -+ (set IAI (reg h-gpr 9) (add pc (if sys-cpucfgr-nd 4 8))) -+ ) -+(define-pmacro (cti-transfer-control condition target) -+ ;; this mess is necessary because we're -+ ;; skipping the delay slot, but it's -+ ;; actually the start of the next basic -+ ;; block -+ (sequence () -+ (if condition -+ (delay 1 (set IAI pc target)) -+ (if sys-cpucfgr-nd -+ (delay 1 (set IAI pc (add pc 4)))) -+ ) -+ (if sys-cpucfgr-nd -+ (skip 1) -+ ) -+ ) -+ ) -+ -+(define-pmacro -+ (define-cti -+ cti-name -+ cti-comment -+ cti-attrs -+ cti-syntax -+ cti-format -+ cti-semantics) -+ (begin -+ (dni -+ cti-name -+ cti-comment -+ (.splice (MACH ORBIS-MACHS) DELAYED-CTI NOT-IN-DELAY-SLOT (.unsplice cti-attrs)) -+ cti-syntax -+ cti-format -+ (cti-semantics) -+ () -+ ) -+ ) -+ ) -+ -+(define-cti -+ l-j -+ "jump (pc-relative iaddr)" -+ (!COND-CTI UNCOND-CTI) -+ "l.j ${disp26}" -+ (+ OPC_J disp26) -+ (.pmacro () -+ (cti-transfer-control 1 disp26) -+ ) -+ ) -+ -+(define-cti -+ l-jal -+ "jump and link (pc-relative iaddr)" -+ (!COND-CTI UNCOND-CTI) -+ "l.jal ${disp26}" -+ (+ OPC_JAL disp26) -+ (.pmacro () -+ (sequence () -+ (cti-link-return) -+ (cti-transfer-control 1 disp26) -+ ) -+ ) -+ ) -+ -+(define-cti -+ l-jr -+ "jump register (absolute iaddr)" -+ (!COND-CTI UNCOND-CTI) -+ "l.jr $rB" -+ (+ OPC_JR (f-resv-25-10 0) rB (f-resv-10-11 0)) -+ (.pmacro () -+ (cti-transfer-control 1 rB) -+ ) -+ ) -+ -+(define-cti -+ l-jalr -+ "jump register and link (absolute iaddr)" -+ (!COND-CTI UNCOND-CTI) -+ "l.jalr $rB" -+ (+ OPC_JALR (f-resv-25-10 0) rB (f-resv-10-11 0) ) -+ (.pmacro () -+ (sequence () -+ (cti-link-return) -+ (cti-transfer-control 1 rB) -+ ) -+ ) -+ ) -+ -+(define-cti -+ l-bnf -+ "branch if condition bit not set (pc relative iaddr)" -+ (COND-CTI !UNCOND-CTI) -+ "l.bnf ${disp26}" -+ (+ OPC_BNF disp26) -+ (.pmacro () -+ (cti-transfer-control (not sys-sr-f) disp26) -+ ) -+ ) -+ -+(define-cti -+ l-bf -+ "branch if condition bit set (pc relative iaddr)" -+ (COND-CTI !UNCOND-CTI) -+ "l.bf ${disp26}" -+ (+ OPC_BF disp26) -+ (.pmacro () -+ (cti-transfer-control sys-sr-f disp26) -+ ) -+ ) -+ -+(dni l-trap "trap (exception)" -+ ((MACH ORBIS-MACHS) NOT-IN-DELAY-SLOT) -+ "l.trap ${uimm16}" -+ (+ OPC_SYSTRAPSYNCS OPC_SYSTRAPSYNCS_TRAP (f-resv-20-5 0) uimm16) -+ ; Do exception entry handling in C function, PC set based on SR state -+ (raise-exception EXCEPT-TRAP) -+ () -+) -+ -+ -+(dni l-sys "syscall (exception)" -+ ; This function may not be in delay slot -+ ((MACH ORBIS-MACHS) NOT-IN-DELAY-SLOT) -+ -+ "l.sys ${uimm16}" -+ (+ OPC_SYSTRAPSYNCS OPC_SYSTRAPSYNCS_SYSCALL (f-resv-20-5 0) uimm16) -+ ; Do exception entry handling in C function, PC set based on SR state -+ (raise-exception EXCEPT-SYSCALL) -+ () -+) -+ -+(dni l-msync "memory sync" -+ ((MACH ORBIS-MACHS)) -+ "l.msync" -+ (+ OPC_SYSTRAPSYNCS OPC_SYSTRAPSYNCS_MSYNC (f-resv-20-21 0)) -+ (nop) -+ () -+) -+ -+(dni l-psync "pipeline sync" -+ ((MACH ORBIS-MACHS)) -+ "l.psync" -+ (+ OPC_SYSTRAPSYNCS OPC_SYSTRAPSYNCS_PSYNC (f-resv-20-21 0)) -+ (nop) -+ () -+) -+ -+(dni l-csync "context sync" -+ ((MACH ORBIS-MACHS)) -+ "l.csync" -+ (+ OPC_SYSTRAPSYNCS OPC_SYSTRAPSYNCS_CSYNC (f-resv-20-21 0)) -+ (nop) -+ () -+) -+ -+(dni l-rfe "return from exception" -+ ; This function may not be in delay slot -+ ((MACH ORBIS-MACHS) NOT-IN-DELAY-SLOT FORCED-CTI) -+ -+ "l.rfe" -+ (+ OPC_RFE (f-resv-25-26 0)) -+ (c-call VOID "@cpu@_rfe") -+ () -+) -+ -+ -+; Misc instructions -+ -+; l.nop with immediate must be first so it handles all l.nops in sim -+(dni l-nop-imm "nop uimm16" -+ ((MACH ORBIS-MACHS)) -+ "l.nop ${uimm16}" -+ (+ OPC_NOP (f-op-25-2 #x1) (f-resv-23-8 0) uimm16) -+ (c-call VOID "@cpu@_nop" (zext UWI uimm16)) -+ () -+ ) -+ -+(if (application-is? SIMULATOR) -+ (begin) -+ (begin -+ (dni l-nop "nop" -+ ((MACH ORBIS-MACHS)) -+ "l.nop" -+ (+ OPC_NOP (f-op-25-2 #x1) (f-resv-23-8 0) uimm16) -+ (nop) -+ () -+ ) -+ ) -+) -+ -+(dni l-movhi "movhi reg/uimm16" -+ ((MACH ORBIS-MACHS)) -+ "l.movhi $rD,$uimm16" -+ (+ OPC_MOVHIMACRC rD (f-resv-20-4 0) OPC_MOVHIMACRC_MOVHI uimm16) -+ (set UWI rD (sll UWI (zext UWI uimm16) (const 16))) -+ () -+) -+ -+(dni l-macrc "macrc reg" -+ ((MACH ORBIS-MACHS)) -+ "l.macrc $rD" -+ (+ OPC_MOVHIMACRC rD (f-resv-20-4 0) OPC_MOVHIMACRC_MACRC (f-uimm16 0)) -+ (sequence () -+ (set UWI rD mac-maclo) -+ (set UWI mac-maclo 0) -+ (set UWI mac-machi 0) -+ ) -+ () -+ ) -+ -+ -+; System releated instructions -+ -+(dni l-mfspr "mfspr" -+ ((MACH ORBIS-MACHS)) -+ "l.mfspr $rD,$rA,${uimm16}" -+ (+ OPC_MFSPR rD rA uimm16) -+ (set UWI rD (c-call UWI "@cpu@_mfspr" (or rA (zext UWI uimm16)))) -+ () -+) -+ -+(dni l-mtspr "mtspr" -+ ((MACH ORBIS-MACHS)) -+ "l.mtspr $rA,$rB,${uimm16-split}" -+ (+ OPC_MTSPR rA rB uimm16-split ) -+ (c-call VOID "@cpu@_mtspr" (or rA (zext WI uimm16-split)) rB) -+ () -+) -+ -+ -+; Load instructions -+(define-pmacro (load-store-addr base offset size) -+ (c-call AI "@cpu@_make_load_store_addr" base (ext SI offset) size)) -+ -+(dni l-lwz "l.lwz reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lwz $rD,${simm16}($rA)" -+ (+ OPC_LWZ rD rA simm16) -+ (set UWI rD (zext UWI (mem USI (load-store-addr rA simm16 4)))) -+ () -+) -+ -+ -+(dni l-lws "l.lws reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lws $rD,${simm16}($rA)" -+ (+ OPC_LWS rD rA simm16) -+ (set WI rD (ext WI (mem SI (load-store-addr rA simm16 4)))) -+ () -+) -+ -+(dni l-lwa "l.lwa reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lwa $rD,${simm16}($rA)" -+ (+ OPC_LWA rD rA simm16) -+ (sequence () -+ (set UWI rD (zext UWI (mem USI (load-store-addr rA simm16 4)))) -+ (set atomic-reserve (const 1)) -+ (set atomic-address (load-store-addr rA simm16 4)) -+ ) -+ () -+) -+ -+(dni l-lbz "l.lbz reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lbz $rD,${simm16}($rA)" -+ (+ OPC_LBZ rD rA simm16) -+ (set UWI rD (zext UWI (mem UQI (load-store-addr rA simm16 1)))) -+ () -+) -+ -+(dni l-lbs "l.lbs reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lbs $rD,${simm16}($rA)" -+ (+ OPC_LBS rD rA simm16) -+ (set WI rD (ext WI (mem QI (load-store-addr rA simm16 1)))) -+ () -+) -+ -+(dni l-lhz "l.lhz reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lhz $rD,${simm16}($rA)" -+ (+ OPC_LHZ rD simm16 rA) -+ (set UWI rD (zext UWI (mem UHI (load-store-addr rA simm16 2)))) -+ () -+) -+ -+(dni l-lhs "l.lhs reg/simm16(reg)" -+ ((MACH ORBIS-MACHS)) -+ "l.lhs $rD,${simm16}($rA)" -+ (+ OPC_LHS rD rA simm16) -+ (set WI rD (ext WI (mem HI (load-store-addr rA simm16 2)))) -+ () -+) -+ -+ -+; Store instructions -+ -+(define-pmacro (store-insn mnemonic opc-op mode size) -+ (begin -+ (dni (.sym l- mnemonic) -+ (.str "l." mnemonic " simm16(reg)/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic " ${simm16-split}($rA),$rB") -+ (+ opc-op rA rB simm16-split) -+ (sequence ((SI addr)) -+ (set addr (load-store-addr rA simm16-split size)) -+ (set mode (mem mode addr) (trunc mode rB)) -+ (if (eq (and addr #xffffffc) atomic-address) -+ (set atomic-reserve (const 0)) -+ ) -+ ) -+ () -+ ) -+ ) -+) -+ -+(store-insn sw OPC_SW USI 4) -+(store-insn sb OPC_SB UQI 1) -+(store-insn sh OPC_SH UHI 2) -+ -+(dni l-swa "l.swa simm16(reg)/reg" -+ ((MACH ORBIS-MACHS)) -+ "l.swa ${simm16-split}($rA),$rB" -+ (+ OPC_SWA rA rB simm16) -+ (sequence ((SI addr) (BI flag)) -+ (set addr (load-store-addr rA simm16-split 4)) -+ (set sys-sr-f (and atomic-reserve (eq addr atomic-address))) -+ (if sys-sr-f -+ (set USI (mem USI addr) (trunc USI rB)) -+ ) -+ (set atomic-reserve (const 0)) -+ ) -+ () -+) -+ -+ -+; Shift and rotate instructions -+ -+(define-pmacro (shift-insn mnemonic) -+ (begin -+ (dni (.sym l- mnemonic) -+ (.str "l." mnemonic " reg/reg/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic " $rD,$rA,$rB") -+ (+ OPC_ALU rD rA rB (f-resv-10-3 0) (.sym OPC_SHROTS_ (.upcase mnemonic)) (f-resv-5-2 0) -+ OPC_ALU_REGREG_SHROT ) -+ (set UWI rD (mnemonic rA rB)) -+ () -+ ) -+ (dni (.sym l- mnemonic "i") -+ (.str "l." mnemonic " reg/reg/uimm6") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic "i $rD,$rA,${uimm6}") -+ (+ OPC_SHROTI rD rA (f-resv-15-8 0) (.sym OPC_SHROTS_ (.upcase mnemonic)) uimm6) -+ (set rD (mnemonic rA uimm6)) -+ () -+ ) -+ ) -+) -+ -+(shift-insn sll) -+(shift-insn srl) -+(shift-insn sra) -+(shift-insn ror) -+ -+ -+; Arithmetic insns -+ -+; ALU op macro -+(define-pmacro (alu-insn mnemonic) -+ (begin -+ (dni (.sym l- mnemonic) -+ (.str "l." mnemonic " reg/reg/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic " $rD,$rA,$rB") -+ (+ OPC_ALU rD rA rB (f-resv-10-7 0) (.sym OPC_ALU_REGREG_ (.upcase mnemonic))) -+ (set rD (mnemonic rA rB)) -+ () -+ ) -+ ) -+) -+ -+(alu-insn and) -+(alu-insn or) -+(alu-insn xor) -+ -+(define-pmacro (alu-carry-insn mnemonic) -+ (begin -+ (dni (.sym l- mnemonic) -+ (.str "l." mnemonic " reg/reg/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic " $rD,$rA,$rB") -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x00) (.sym OPC_ALU_REGREG_ (.upcase mnemonic))) -+ (sequence () -+ (sequence () -+ (set BI sys-sr-cy ((.sym mnemonic "c-cflag") WI rA rB 0)) -+ (set BI sys-sr-ov ((.sym mnemonic "c-oflag") WI rA rB 0)) -+ (set rD (mnemonic WI rA rB)) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+ ) -+ ) -+ ) -+ -+(alu-carry-insn add) -+(alu-carry-insn sub) -+ -+(dni (l-addc) "l.addc reg/reg/reg" -+ ((MACH ORBIS-MACHS)) -+ ("l.addc $rD,$rA,$rB") -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x00) OPC_ALU_REGREG_ADDC) -+ (sequence () -+ (sequence ((BI tmp-sys-sr-cy)) -+ (set BI tmp-sys-sr-cy sys-sr-cy) -+ (set BI sys-sr-cy (addc-cflag WI rA rB tmp-sys-sr-cy)) -+ (set BI sys-sr-ov (addc-oflag WI rA rB tmp-sys-sr-cy)) -+ (set rD (addc WI rA rB tmp-sys-sr-cy)) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+) -+ -+(dni (l-mul) "l.mul reg/reg/reg" -+ ((MACH ORBIS-MACHS)) -+ ("l.mul $rD,$rA,$rB") -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x30) OPC_ALU_REGREG_MUL) -+ (sequence () -+ (sequence () -+ ; 2's complement overflow -+ (set BI sys-sr-ov (mul-o2flag WI rA rB)) -+ ; 1's complement overflow -+ (set BI sys-sr-cy (mul-o1flag WI rA rB)) -+ (set rD (mul WI rA rB)) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+) -+ -+(dni (l-mulu) "l.mulu reg/reg/reg" -+ ((MACH ORBIS-MACHS)) -+ ("l.mulu $rD,$rA,$rB") -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x30) OPC_ALU_REGREG_MULU) -+ (sequence () -+ (sequence () -+ ; 2's complement overflow -+ (set BI sys-sr-ov 0) -+ ; 1's complement overflow -+ (set BI sys-sr-cy (mul-o1flag UWI rA rB)) -+ (set rD (mul UWI rA rB)) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+) -+ -+(dni l-div "divide (signed)" -+ ((MACH ORBIS-MACHS)) -+ "l.div $rD,$rA,$rB" -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x30) OPC_ALU_REGREG_DIV) -+ (sequence () -+ (if (ne rB 0) -+ (sequence () -+ (set BI sys-sr-cy 0) -+ (set WI rD (div WI rA rB)) -+ ) -+ (set BI sys-sr-cy 1) -+ ) -+ (set BI sys-sr-ov 0) -+ (if (andif sys-sr-cy sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+) -+ -+(dni l-divu "divide (unsigned)" -+ ((MACH ORBIS-MACHS)) -+ "l.divu $rD,$rA,$rB" -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x30) OPC_ALU_REGREG_DIVU) -+ (sequence () -+ (if (ne rB 0) -+ (sequence () -+ (set BI sys-sr-cy 0) -+ (set rD (udiv UWI rA rB)) -+ ) -+ (set BI sys-sr-cy 1) -+ ) -+ (set BI sys-sr-ov 0) -+ (if (andif sys-sr-cy sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+) -+ -+(dni l-ff1 "find first '1'" -+ ((MACH ORBIS-MACHS)) -+ "l.ff1 $rD,$rA" -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x00) OPC_ALU_REGREG_FFL1) -+ (set rD (c-call UWI "@cpu@_ff1" rA)) -+ () -+) -+ -+(dni l-fl1 "find last '1'" -+ ((MACH ORBIS-MACHS)) -+ "l.fl1 $rD,$rA" -+ (+ OPC_ALU rD rA rB (f-resv-10-7 #x10) OPC_ALU_REGREG_FFL1) -+ (set rD (c-call UWI "@cpu@_fl1" rA)) -+ () -+) -+ -+ -+(define-pmacro (alu-insn-simm mnemonic) -+ (begin -+ (dni (.sym l- mnemonic "i") -+ (.str "l." mnemonic " reg/reg/simm16") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic "i $rD,$rA,$simm16") -+ (+ (.sym OPC_ (.upcase mnemonic) "I") rD rA simm16) -+ (set rD (mnemonic rA (ext WI simm16))) -+ () -+ ) -+ ) -+) -+ -+(define-pmacro (alu-insn-uimm mnemonic) -+ (begin -+ (dni (.sym l- mnemonic "i") -+ (.str "l." mnemonic " reg/reg/uimm16") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic "i $rD,$rA,$uimm16") -+ (+ (.sym OPC_ (.upcase mnemonic) "I") rD rA uimm16) -+ (set rD (mnemonic rA (zext UWI uimm16))) -+ () -+ ) -+ ) -+) -+ -+(alu-insn-uimm and) -+(alu-insn-uimm or) -+(alu-insn-simm xor) -+ -+(define-pmacro (alu-carry-insn-simm mnemonic) -+ (begin -+ (dni (.sym l- mnemonic "i") -+ (.str "l." mnemonic "i reg/reg/simm16") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic "i $rD,$rA,$simm16") -+ (+ (.sym OPC_ (.upcase mnemonic) "I") rD rA simm16) -+ (sequence () -+ (sequence () -+ (set BI sys-sr-cy ((.sym mnemonic "c-cflag") WI rA (ext WI simm16) 0)) -+ (set BI sys-sr-ov ((.sym mnemonic "c-oflag") WI rA (ext WI simm16) 0)) -+ (set rD (mnemonic WI rA (ext WI simm16))) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+ ) -+ ) -+ ) -+ -+(alu-carry-insn-simm add) -+ -+(dni (l-addic) -+ ("l.addic reg/reg/simm16") -+ ((MACH ORBIS-MACHS)) -+ ("l.addic $rD,$rA,$simm16") -+ (+ OPC_ADDIC rD rA simm16) -+ (sequence () -+ (sequence ((BI tmp-sys-sr-cy)) -+ (set BI tmp-sys-sr-cy sys-sr-cy) -+ (set BI sys-sr-cy (addc-cflag WI rA (ext WI simm16) tmp-sys-sr-cy)) -+ (set BI sys-sr-ov (addc-oflag WI rA (ext WI simm16) tmp-sys-sr-cy)) -+ (set WI rD (addc WI rA (ext WI simm16) tmp-sys-sr-cy)) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+) -+ -+(dni (l-muli) -+ "l.muli reg/reg/simm16" -+ ((MACH ORBIS-MACHS)) -+ ("l.muli $rD,$rA,$simm16") -+ (+ OPC_MULI rD rA simm16) -+ (sequence () -+ (sequence () -+ ; 2's complement overflow -+ (set sys-sr-ov (mul-o2flag WI rA (ext WI simm16))) -+ ; 1's complement overflow -+ (set sys-sr-cy (mul-o1flag UWI rA (ext UWI simm16))) -+ (set rD (mul WI rA (ext WI simm16))) -+ ) -+ (if (andif sys-sr-ov sys-sr-ove) -+ (raise-exception EXCEPT-RANGE)) -+ ) -+ () -+ ) -+ -+(define-pmacro (extbh-insn mnemonic extop extmode truncmode) -+ (begin -+ (dni (.sym l- mnemonic) -+ (.str "l." mnemonic " reg/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic " $rD,$rA") -+ (+ OPC_ALU rD rA (f-resv-15-6 0) (.sym OPC_EXTBHS_ (.upcase mnemonic)) (f-resv-5-2 0) OPC_ALU_REGREG_EXTBH) -+ (set rD (extop extmode (trunc truncmode rA))) -+ () -+ ) -+ ) -+ ) -+ -+(extbh-insn exths ext WI HI) -+(extbh-insn extbs ext WI QI) -+(extbh-insn exthz zext UWI UHI) -+(extbh-insn extbz zext UWI UQI) -+ -+(define-pmacro (extw-insn mnemonic extop extmode truncmode) -+ (begin -+ (dni (.sym l- mnemonic) -+ (.str "l." mnemonic " reg/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l." mnemonic " $rD,$rA") -+ (+ OPC_ALU rD rA (f-resv-15-6 0) (.sym OPC_EXTWS_ (.upcase mnemonic)) (f-resv-5-2 0) OPC_ALU_REGREG_EXTW) -+ (set rD (extop extmode (trunc truncmode rA))) -+ () -+ ) -+ ) -+ ) -+ -+(extw-insn extws ext WI SI) -+(extw-insn extwz zext USI USI) -+ -+(dni l-cmov -+ "l.cmov reg/reg/reg" -+ ((MACH ORBIS-MACHS)) -+ "l.cmov $rD,$rA,$rB" -+ (+ OPC_ALU rD rA rB (f-resv-10-1 0) (f-op-9-2 0) (f-resv-7-4 0) OPC_ALU_REGREG_CMOV) -+ (if sys-sr-f -+ (set UWI rD rA) -+ (set UWI rD rB) -+ ) -+ () -+ ) -+ -+; Compare instructions -+ -+; Ordering compare -+(define-pmacro (sf-insn op) -+ (begin -+ (dni (.sym l- "sf" op "s") ; l-sfgts -+ (.str "l.sf" op "s reg/reg") ; "l.sfgts reg/reg" -+ ((MACH ORBIS-MACHS)) -+ (.str "l.sf" op "s $rA,$rB") ; "l.sfgts $rA,$rB" -+ (+ OPC_SF (.sym "OPC_SF_" (.upcase op) "S") rA rB (f-resv-10-11 0)) ; (+ OPC_SF OPC_SF_GTS rA rB (f-resv-10-11 0)) -+ (set sys-sr-f (op WI rA rB)) ; (set sys-sr-f (gt WI rA rB)) -+ () -+ ) -+ (dni (.sym l- "sf" op "si") ; l-sfgtsi -+ (.str "l.sf" op "si reg/simm16") ; "l.sfgtsi reg/simm16" -+ ((MACH ORBIS-MACHS)) -+ (.str "l.sf" op "si $rA,$simm16") ; "l.sfgtsi $rA,$simm16" -+ (+ OPC_SFI (.sym "OPC_SF_" (.upcase op) "S") rA simm16) ; (+ OPC_SFI OPC_SF_GTS rA simm16) -+ (set sys-sr-f (op WI rA (ext WI simm16))) ; (set sys-sr-f (gt WI rA (ext WI simm16))) -+ () -+ ) -+ (dni (.sym l- "sf" op "u") ; l-sfgtu -+ (.str "l.sf" op "u reg/reg") ; "l.sfgtu reg/reg" -+ ((MACH ORBIS-MACHS)) -+ (.str "l.sf" op "u $rA,$rB") ; "l.sfgtu $rA,$rB" -+ (+ OPC_SF (.sym "OPC_SF_" (.upcase op) "U") rA rB (f-resv-10-11 0)) ; (+ OPC_SF OPC_SF_GTU rA rB (f-resv-10-11 0)) -+ (set sys-sr-f ((.sym op "u") WI rA rB)) ; (set sys-sr-f (gtu WI rA rB)) -+ () -+ ) -+ ; immediate is sign extended even for unsigned compare -+ (dni (.sym l- "sf" op "ui") ; l-sfgtui -+ (.str "l.sf" op "ui reg/simm16") ; "l.sfgtui reg/uimm16" -+ ((MACH ORBIS-MACHS)) -+ (.str "l.sf" op "ui $rA,$simm16") ; "l.sfgtui $rA,$simm16" -+ (+ OPC_SFI (.sym "OPC_SF_" (.upcase op) "U") rA simm16) ; (+ OPC_SFI OPC_SF_GTU rA simm16) -+ (set sys-sr-f ((.sym op "u") WI rA (ext WI simm16))) ; (set sys-sr-f (gtu WI rA (ext WI simm16))) -+ () -+ ) -+ ) -+ ) -+ -+(sf-insn gt) -+(sf-insn ge) -+(sf-insn lt) -+(sf-insn le) -+ -+; Equality compare -+(define-pmacro (sf-insn-eq op) -+ (begin -+ (dni (.sym l- "sf" op) -+ (.str "l." op " reg/reg") -+ ((MACH ORBIS-MACHS)) -+ (.str "l.sf" op " $rA,$rB") -+ (+ OPC_SF (.sym "OPC_SF_" (.upcase op)) rA rB (f-resv-10-11 0)) -+ (set sys-sr-f (op WI rA rB)) -+ () -+ ) -+ (dni (.sym l- "sf" op "i") -+ (.str "l.sf" op "i reg/simm16") -+ ((MACH ORBIS-MACHS)) -+ (.str "l.sf" op "i $rA,$simm16") -+ (+ OPC_SFI (.sym "OPC_SF_" (.upcase op)) rA simm16) -+ (set sys-sr-f (op WI rA (ext WI simm16))) -+ () -+ ) -+ ) -+) -+ -+(sf-insn-eq eq) -+(sf-insn-eq ne) -+ -+(dni l-mac -+ "l.mac reg/reg" -+ ((MACH ORBIS-MACHS)) -+ "l.mac $rA,$rB" -+ (+ OPC_MAC (f-op-25-5 0) rA rB (f-resv-10-7 0) OPC_MAC_MAC) -+ (sequence ((WI prod) (DI result)) -+ (set WI prod (mul WI rA rB)) -+ (set DI result (add (join DI SI mac-machi mac-maclo) (ext DI prod))) -+ (set SI mac-machi (subword SI result 0)) -+ (set SI mac-maclo (subword SI result 1)) -+ ) -+ () -+ ) -+ -+(dni l-msb -+ "l.msb reg/reg" -+ ((MACH ORBIS-MACHS)) -+ "l.msb $rA,$rB" -+ (+ OPC_MAC (f-op-25-5 0) rA rB (f-resv-10-7 0) OPC_MAC_MSB) -+ (sequence ((WI prod) (DI result)) -+ (set WI prod (mul WI rA rB)) -+ (set DI result (sub (join DI SI mac-machi mac-maclo) (ext DI prod))) -+ (set SI mac-machi (subword SI result 0)) -+ (set SI mac-maclo (subword SI result 1)) -+ ) -+ () -+ ) -+ -+(dni l-maci -+ "l.maci reg/simm16" -+ ((MACH ORBIS-MACHS)) -+ "l.maci $rA,${simm16}" -+ (+ OPC_MACI (f-resv-25-5 0) rA simm16) -+ (sequence ((WI prod) (DI result)) -+ (set WI prod (mul WI (ext WI simm16) rA)) -+ (set DI result (add (join DI SI mac-machi mac-maclo) (ext DI prod))) -+ (set SI mac-machi (subword SI result 0)) -+ (set SI mac-maclo (subword SI result 1)) -+ ) -+ () -+ ) -+ -+(define-pmacro (cust-insn cust-num) -+ (begin -+ (dni (.sym l- "cust" cust-num) -+ (.str "l.cust" cust-num) -+ ((MACH ORBIS-MACHS)) -+ (.str "l.cust" cust-num) -+ (+ (.sym OPC_CUST cust-num) (f-resv-25-26 0)) -+ (nop) -+ () -+ ) -+ ) -+ ) -+ -+(cust-insn "1") -+(cust-insn "2") -+(cust-insn "3") -+(cust-insn "4") -+(cust-insn "5") -+(cust-insn "6") -+(cust-insn "7") -+(cust-insn "8") -diff -rNU3 dist.orig/cpu/or1korfpx.cpu dist/cpu/or1korfpx.cpu ---- dist.orig/cpu/or1korfpx.cpu 1970-01-01 01:00:00.000000000 +0100 -+++ dist/cpu/or1korfpx.cpu 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,222 @@ -+; OpenRISC 1000 architecture. -*- Scheme -*- -+; Copyright 2000-2014 Free Software Foundation, Inc. -+; Contributed by Peter Gavin, pgavin@gmail.com -+; -+; This program is free software; you can redistribute it and/or modify -+; it under the terms of the GNU General Public License as published by -+; the Free Software Foundation; either version 3 of the License, or -+; (at your option) any later version. -+; -+; This program is distributed in the hope that it will be useful, -+; but WITHOUT ANY WARRANTY; without even the implied warranty of -+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+; GNU General Public License for more details. -+; -+; You should have received a copy of the GNU General Public License -+; along with this program; if not, see -+ -+; Initial ORFPX32 instruction set -+ -+; I'm not sure how CGEN handles rounding in FP operations, except for -+; in conversions to/from integers. So lf.add, lf.sub, lf.mul, and -+; lf.div do not round according to the FPCSR RM field. -+; NaN, overflow, and underflow are not yet handled either. -+ -+(define-normal-insn-enum insn-opcode-float-regreg -+ "floating point reg/reg insn opcode enums" () -+ OPC_FLOAT_REGREG_ f-op-7-8 -+ (("ADD_S" #x00) -+ ("SUB_S" #x01) -+ ("MUL_S" #x02) -+ ("DIV_S" #x03) -+ ("ITOF_S" #x04) -+ ("FTOI_S" #x05) -+ ("REM_S" #x06) -+ ("MADD_S" #x07) -+ ("SFEQ_S" #x08) -+ ("SFNE_S" #x09) -+ ("SFGT_S" #x0a) -+ ("SFGE_S" #x0b) -+ ("SFLT_S" #x0c) -+ ("SFLE_S" #x0d) -+ ("ADD_D" #x10) -+ ("SUB_D" #x11) -+ ("MUL_D" #x12) -+ ("DIV_D" #x13) -+ ("ITOF_D" #x14) -+ ("FTOI_D" #x15) -+ ("REM_D" #x16) -+ ("MADD_D" #x17) -+ ("SFEQ_D" #x18) -+ ("SFNE_D" #x19) -+ ("SFGT_D" #x1a) -+ ("SFGE_D" #x1b) -+ ("SFLT_D" #x1c) -+ ("SFLE_D" #x1d) -+ ("CUST1_S" #xd0) -+ ("CUST1_D" #xe0) -+ ) -+ ) -+ -+(dnop rDSF "destination register (single floating point mode)" () h-fsr f-r1) -+(dnop rASF "source register A (single floating point mode)" () h-fsr f-r2) -+(dnop rBSF "source register B (single floating point mode)" () h-fsr f-r3) -+ -+(dnop rDDF "destination register (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1) -+(dnop rADF "source register A (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1) -+(dnop rBDF "source register B (double floating point mode)" ((MACH ORFPX64-MACHS)) h-fdr f-r1) -+ -+(define-pmacro (float-regreg-insn mnemonic) -+ (begin -+ (dni (.sym lf- mnemonic -s) -+ (.str "lf." mnemonic ".s reg/reg/reg") -+ ((MACH ORFPX-MACHS)) -+ (.str "lf." mnemonic ".s $rDSF,$rASF,$rBSF") -+ (+ OPC_FLOAT rDSF rASF rBSF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_ (.upcase mnemonic) _S)) -+ (set SF rDSF (mnemonic SF rASF rBSF)) -+ () -+ ) -+ (dni (.sym lf- mnemonic -d) -+ (.str "lf." mnemonic ".d reg/reg/reg") -+ ((MACH ORFPX64-MACHS)) -+ (.str "lf." mnemonic ".d $rDDF,$rADF,$rBDF") -+ (+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_ (.upcase mnemonic) _D)) -+ (set DF rDDF (mnemonic DF rADF rBDF)) -+ () -+ ) -+ ) -+ ) -+ -+(float-regreg-insn add) -+(float-regreg-insn sub) -+(float-regreg-insn mul) -+(float-regreg-insn div) -+ -+(dni lf-rem-s -+ "lf.rem.s reg/reg/reg" -+ ((MACH ORFPX-MACHS)) -+ "lf.rem.s $rDSF,$rASF,$rBSF" -+ (+ OPC_FLOAT rDSF rASF rBSF (f-resv-10-3 0) OPC_FLOAT_REGREG_REM_S) -+ (set SF rDSF (rem SF rASF rBSF)) -+ () -+ ) -+(dni lf-rem-d -+ "lf.rem.d reg/reg/reg" -+ ((MACH ORFPX64-MACHS)) -+ "lf.rem.d $rDDF,$rADF,$rBDF" -+ (+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) OPC_FLOAT_REGREG_REM_D) -+ (set DF rDDF (mod DF rADF rBDF)) -+ () -+ ) -+ -+(define-pmacro (get-rounding-mode) -+ (case INT sys-fpcsr-rm -+ ((0) 1) ; TIES-TO-EVEN -- I'm assuming this is what is meant by "round to nearest" -+ ((1) 3) ; TOWARD-ZERO -+ ((2) 4) ; TOWARD-POSITIVE -+ (else 5) ; TOWARD-NEGATIVE -+ ) -+ ) -+ -+(dni lf-itof-s -+ "lf.itof.s reg/reg" -+ ((MACH ORFPX-MACHS)) -+ "lf.itof.s $rDSF,$rA" -+ (+ OPC_FLOAT rDSF rA (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_ITOF_S) -+ (set SF rDSF (float SF (get-rounding-mode) (trunc SI rA))) -+ () -+ ) -+(dni lf-itof-d -+ "lf.itof.d reg/reg" -+ ((MACH ORFPX64-MACHS)) -+ "lf.itof.d $rDSF,$rA" -+ (+ OPC_FLOAT rDSF rA (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_ITOF_D) -+ (set DF rDDF (float DF (get-rounding-mode) rA)) -+ () -+ ) -+ -+(dni lf-ftoi-s -+ "lf.ftoi.s reg/reg" -+ ((MACH ORFPX-MACHS)) -+ "lf.ftoi.s $rD,$rASF" -+ (+ OPC_FLOAT rD rASF (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_FTOI_S) -+ (set WI rD (ext WI (fix SI (get-rounding-mode) rASF))) -+ () -+ ) -+ -+(dni lf-ftoi-d -+ "lf.ftoi.d reg/reg" -+ ((MACH ORFPX64-MACHS)) -+ "lf.ftoi.d $rD,$rADF" -+ (+ OPC_FLOAT rD rADF (f-r3 0) (f-resv-10-3 0) OPC_FLOAT_REGREG_FTOI_D) -+ (set DI rD (fix DI (get-rounding-mode) rADF)) -+ () -+ ) -+ -+(define-pmacro (float-setflag-insn mnemonic) -+ (begin -+ (dni (.sym lf- mnemonic -s) -+ (.str "lf.sf" mnemonic ".s reg/reg") -+ ((MACH ORFPX-MACHS)) -+ (.str "lf.sf" mnemonic ".s $rASF,$rBSF") -+ (+ OPC_FLOAT (f-r1 0) rASF rBSF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _S)) -+ (set BI sys-sr-f (mnemonic SF rASF rBSF)) -+ () -+ ) -+ (dni (.sym lf- mnemonic -d) -+ (.str "lf.sf" mnemonic ".d reg/reg") -+ ((MACH ORFPX64-MACHS)) -+ (.str "lf.sf" mnemonic ".d $rASF,$rBSF") -+ (+ OPC_FLOAT (f-r1 0) rASF rBSF (f-resv-10-3 0) (.sym OPC_FLOAT_REGREG_SF (.upcase mnemonic) _D)) -+ (set BI sys-sr-f (mnemonic DF rADF rBDF)) -+ () -+ ) -+ ) -+ ) -+ -+(float-setflag-insn eq) -+(float-setflag-insn ne) -+(float-setflag-insn ge) -+(float-setflag-insn gt) -+(float-setflag-insn lt) -+(float-setflag-insn le) -+ -+(dni lf-madd-s -+ "lf.madd.s reg/reg/reg" -+ ((MACH ORFPX-MACHS)) -+ "lf.madd.s $rDSF,$rASF,$rBSF" -+ (+ OPC_FLOAT rDSF rASF rBSF (f-resv-10-3 0) OPC_FLOAT_REGREG_MADD_S) -+ (set SF rDSF (add SF (mul SF rASF rBSF) rDSF)) -+ () -+ ) -+(dni lf-madd-d -+ "lf.madd.d reg/reg/reg" -+ ((MACH ORFPX64-MACHS)) -+ "lf.madd.d $rDDF,$rADF,$rBDF" -+ (+ OPC_FLOAT rDDF rADF rBDF (f-resv-10-3 0) OPC_FLOAT_REGREG_MADD_D) -+ (set DF rDDF (add DF (mul DF rADF rBDF) rDDF)) -+ () -+ ) -+ -+(define-pmacro (float-cust-insn cust-num) -+ (begin -+ (dni (.sym "lf-cust" cust-num "-s") -+ (.str "lf.cust" cust-num ".s") -+ ((MACH ORFPX-MACHS)) -+ (.str "lf.cust" cust-num ".s $rASF,$rBSF") -+ (+ OPC_FLOAT (f-resv-25-5 0) rASF rBSF (f-resv-10-3 0) (.sym "OPC_FLOAT_REGREG_CUST" cust-num "_S")) -+ (nop) -+ () -+ ) -+ (dni (.sym "lf-cust" cust-num "-d") -+ (.str "lf.cust" cust-num ".d") -+ ((MACH ORFPX64-MACHS)) -+ (.str "lf.cust" cust-num ".d") -+ (+ OPC_FLOAT (f-resv-25-5 0) rADF rBDF (f-resv-10-3 0) (.sym "OPC_FLOAT_REGREG_CUST" cust-num "_D")) -+ (nop) -+ () -+ ) -+ ) -+ ) -+ -+(float-cust-insn "1") -diff -rNU3 dist.orig/gas/Makefile.am dist/gas/Makefile.am ---- dist.orig/gas/Makefile.am 2012-09-04 14:53:45.000000000 +0200 -+++ dist/gas/Makefile.am 2015-10-18 13:11:13.000000000 +0200 -@@ -147,11 +147,11 @@ - config/tc-msp430.c \ - config/tc-mt.c \ - config/tc-ns32k.c \ -- config/tc-openrisc.c \ -- config/tc-or32.c \ -+ config/tc-or1k.c \ - config/tc-pdp11.c \ - config/tc-pj.c \ - config/tc-ppc.c \ -+ config/tc-riscv.c \ - config/tc-rl78.c \ - config/tc-rx.c \ - config/tc-s390.c \ -@@ -216,11 +216,11 @@ - config/tc-msp430.h \ - config/tc-mt.h \ - config/tc-ns32k.h \ -- config/tc-openrisc.h \ -- config/tc-or32.h \ -+ config/tc-or1k.h \ - config/tc-pdp11.h \ - config/tc-pj.h \ - config/tc-ppc.h \ -+ config/tc-riscv.h \ - config/tc-rl78.h \ - config/tc-rx.h \ - config/tc-s390.h \ -diff -rNU3 dist.orig/gas/Makefile.in dist/gas/Makefile.in ---- dist.orig/gas/Makefile.in 2012-09-04 14:53:45.000000000 +0200 -+++ dist/gas/Makefile.in 2015-10-18 13:11:13.000000000 +0200 -@@ -415,11 +415,11 @@ - config/tc-msp430.c \ - config/tc-mt.c \ - config/tc-ns32k.c \ -- config/tc-openrisc.c \ -- config/tc-or32.c \ -+ config/tc-or1k.c \ - config/tc-pdp11.c \ - config/tc-pj.c \ - config/tc-ppc.c \ -+ config/tc-riscv.c \ - config/tc-rl78.c \ - config/tc-rx.c \ - config/tc-s390.c \ -@@ -484,11 +484,11 @@ - config/tc-msp430.h \ - config/tc-mt.h \ - config/tc-ns32k.h \ -- config/tc-openrisc.h \ -- config/tc-or32.h \ -+ config/tc-or1k.h \ - config/tc-pdp11.h \ - config/tc-pj.h \ - config/tc-ppc.h \ -+ config/tc-riscv.h \ - config/tc-rl78.h \ - config/tc-rx.h \ - config/tc-s390.h \ -@@ -835,11 +835,11 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-msp430.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-mt.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-ns32k.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-openrisc.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-or32.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-or1k.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-pdp11.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-pj.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-ppc.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-riscv.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-rl78.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-rx.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tc-s390.Po@am__quote@ -@@ -1447,33 +1447,19 @@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-ns32k.obj `if test -f 'config/tc-ns32k.c'; then $(CYGPATH_W) 'config/tc-ns32k.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-ns32k.c'; fi` - --tc-openrisc.o: config/tc-openrisc.c --@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-openrisc.o -MD -MP -MF $(DEPDIR)/tc-openrisc.Tpo -c -o tc-openrisc.o `test -f 'config/tc-openrisc.c' || echo '$(srcdir)/'`config/tc-openrisc.c --@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-openrisc.Tpo $(DEPDIR)/tc-openrisc.Po --@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-openrisc.c' object='tc-openrisc.o' libtool=no @AMDEPBACKSLASH@ -+tc-or1k.o: config/tc-or1k.c -+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-or1k.o -MD -MP -MF $(DEPDIR)/tc-or1k.Tpo -c -o tc-or1k.o `test -f 'config/tc-or1k.c' || echo '$(srcdir)/'`config/tc-or1k.c -+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-or1k.Tpo $(DEPDIR)/tc-or1k.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-or1k.c' object='tc-or1k.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-or1k.o `test -f 'config/tc-or1k.c' || echo '$(srcdir)/'`config/tc-or1k.c -+ -+tc-or1k.obj: config/tc-or1k.c -+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-or1k.obj -MD -MP -MF $(DEPDIR)/tc-or1k.Tpo -c -o tc-or1k.obj `if test -f 'config/tc-or1k.c'; then $(CYGPATH_W) 'config/tc-or1k.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-or1k.c'; fi` -+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-or1k.Tpo $(DEPDIR)/tc-or1k.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-or1k.c' object='tc-or1k.obj' libtool=no @AMDEPBACKSLASH@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ --@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-openrisc.o `test -f 'config/tc-openrisc.c' || echo '$(srcdir)/'`config/tc-openrisc.c -- --tc-openrisc.obj: config/tc-openrisc.c --@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-openrisc.obj -MD -MP -MF $(DEPDIR)/tc-openrisc.Tpo -c -o tc-openrisc.obj `if test -f 'config/tc-openrisc.c'; then $(CYGPATH_W) 'config/tc-openrisc.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-openrisc.c'; fi` --@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-openrisc.Tpo $(DEPDIR)/tc-openrisc.Po --@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-openrisc.c' object='tc-openrisc.obj' libtool=no @AMDEPBACKSLASH@ --@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ --@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-openrisc.obj `if test -f 'config/tc-openrisc.c'; then $(CYGPATH_W) 'config/tc-openrisc.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-openrisc.c'; fi` -- --tc-or32.o: config/tc-or32.c --@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-or32.o -MD -MP -MF $(DEPDIR)/tc-or32.Tpo -c -o tc-or32.o `test -f 'config/tc-or32.c' || echo '$(srcdir)/'`config/tc-or32.c --@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-or32.Tpo $(DEPDIR)/tc-or32.Po --@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-or32.c' object='tc-or32.o' libtool=no @AMDEPBACKSLASH@ --@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ --@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-or32.o `test -f 'config/tc-or32.c' || echo '$(srcdir)/'`config/tc-or32.c -- --tc-or32.obj: config/tc-or32.c --@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-or32.obj -MD -MP -MF $(DEPDIR)/tc-or32.Tpo -c -o tc-or32.obj `if test -f 'config/tc-or32.c'; then $(CYGPATH_W) 'config/tc-or32.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-or32.c'; fi` --@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-or32.Tpo $(DEPDIR)/tc-or32.Po --@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-or32.c' object='tc-or32.obj' libtool=no @AMDEPBACKSLASH@ --@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ --@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-or32.obj `if test -f 'config/tc-or32.c'; then $(CYGPATH_W) 'config/tc-or32.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-or32.c'; fi` -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-or1k.obj `if test -f 'config/tc-or1k.c'; then $(CYGPATH_W) 'config/tc-or1k.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-or1k.c'; fi` - - tc-pdp11.o: config/tc-pdp11.c - @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-pdp11.o -MD -MP -MF $(DEPDIR)/tc-pdp11.Tpo -c -o tc-pdp11.o `test -f 'config/tc-pdp11.c' || echo '$(srcdir)/'`config/tc-pdp11.c -@@ -1517,6 +1503,20 @@ - @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-ppc.obj `if test -f 'config/tc-ppc.c'; then $(CYGPATH_W) 'config/tc-ppc.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-ppc.c'; fi` - -+tc-riscv.o: config/tc-riscv.c -+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-riscv.o -MD -MP -MF $(DEPDIR)/tc-riscv.Tpo -c -o tc-riscv.o `test -f 'config/tc-riscv.c' || echo '$(srcdir)/'`config/tc-riscv.c -+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-riscv.Tpo $(DEPDIR)/tc-riscv.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-riscv.c' object='tc-riscv.o' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-riscv.o `test -f 'config/tc-riscv.c' || echo '$(srcdir)/'`config/tc-riscv.c -+ -+tc-riscv.obj: config/tc-riscv.c -+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-riscv.obj -MD -MP -MF $(DEPDIR)/tc-riscv.Tpo -c -o tc-riscv.obj `if test -f 'config/tc-riscv.c'; then $(CYGPATH_W) 'config/tc-riscv.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-riscv.c'; fi` -+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-riscv.Tpo $(DEPDIR)/tc-riscv.Po -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='config/tc-riscv.c' object='tc-riscv.obj' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tc-riscv.obj `if test -f 'config/tc-riscv.c'; then $(CYGPATH_W) 'config/tc-riscv.c'; else $(CYGPATH_W) '$(srcdir)/config/tc-riscv.c'; fi` -+ - tc-rl78.o: config/tc-rl78.c - @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tc-rl78.o -MD -MP -MF $(DEPDIR)/tc-rl78.Tpo -c -o tc-rl78.o `test -f 'config/tc-rl78.c' || echo '$(srcdir)/'`config/tc-rl78.c - @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/tc-rl78.Tpo $(DEPDIR)/tc-rl78.Po -diff -rNU3 dist.orig/gas/atof-generic.c dist/gas/atof-generic.c ---- dist.orig/gas/atof-generic.c 2009-09-02 09:24:19.000000000 +0200 -+++ dist/gas/atof-generic.c 2015-10-18 13:11:13.000000000 +0200 -@@ -121,6 +121,32 @@ - - switch (first_digit[0]) - { -+ case 's': -+ case 'S': -+ if (!strncasecmp ("snan", first_digit, 4)) -+ { -+ address_of_generic_floating_point_number->sign = 0; -+ address_of_generic_floating_point_number->exponent = 0; -+ address_of_generic_floating_point_number->leader = -+ address_of_generic_floating_point_number->low; -+ *address_of_string_pointer = first_digit + 4; -+ return 0; -+ } -+ break; -+ -+ case 'q': -+ case 'Q': -+ if (!strncasecmp ("qnan", first_digit, 4)) -+ { -+ address_of_generic_floating_point_number->sign = 0; -+ address_of_generic_floating_point_number->exponent = 0; -+ address_of_generic_floating_point_number->leader = -+ address_of_generic_floating_point_number->low; -+ *address_of_string_pointer = first_digit + 4; -+ return 0; -+ } -+ break; -+ - case 'n': - case 'N': - if (!strncasecmp ("nan", first_digit, 3)) -diff -rNU3 dist.orig/gas/config/atof-vax.c dist/gas/config/atof-vax.c ---- dist.orig/gas/config/atof-vax.c 2007-10-17 18:45:54.000000000 +0200 -+++ dist/gas/config/atof-vax.c 2015-10-18 13:11:13.000000000 +0200 -@@ -268,10 +268,27 @@ - int exponent_skippage; - LITTLENUM_TYPE word1; - -- /* JF: Deal with new Nan, +Inf and -Inf codes. */ - if (f->sign != '-' && f->sign != '+') - { -- make_invalid_floating_point_number (words); -+ if (f->sign == 0) -+ { -+ /* All NaNs are 0. */ -+ memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision); -+ } -+ else if (f->sign == 'P') -+ { -+ /* Positive Infinity. */ -+ memset (words, 0xff, sizeof (LITTLENUM_TYPE) * precision); -+ words[0] &= 0x7fff; -+ } -+ else if (f->sign == 'N') -+ { -+ /* Negative Infinity. */ -+ memset (words, 0x00, sizeof (LITTLENUM_TYPE) * precision); -+ words[0] = 0x0080; -+ } -+ else -+ make_invalid_floating_point_number (words); - return return_value; - } - -diff -rNU3 dist.orig/gas/config/obj-elf.c dist/gas/config/obj-elf.c ---- dist.orig/gas/config/obj-elf.c 2012-06-30 08:32:29.000000000 +0200 -+++ dist/gas/config/obj-elf.c 2015-10-18 13:11:13.000000000 +0200 -@@ -1705,12 +1705,14 @@ - const struct elf_backend_data *bed; - - bed = get_elf_backend_data (stdoutput); -+#if 0 - if (!(bed->elf_osabi == ELFOSABI_GNU - || bed->elf_osabi == ELFOSABI_FREEBSD - /* GNU is still using the default value 0. */ - || bed->elf_osabi == ELFOSABI_NONE)) - as_bad (_("symbol type \"%s\" is supported only by GNU and FreeBSD targets"), - type_name); -+#endif - type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION; - } - else if (strcmp (type_name, "gnu_unique_object") == 0) -diff -rNU3 dist.orig/gas/config/tc-arm.c dist/gas/config/tc-arm.c ---- dist.orig/gas/config/tc-arm.c 2013-03-25 09:06:21.000000000 +0100 -+++ dist/gas/config/tc-arm.c 2015-10-18 13:11:13.000000000 +0200 -@@ -6936,7 +6936,7 @@ - - /* Functions for operand encoding. ARM, then Thumb. */ - --#define rotate_left(v, n) (v << n | v >> (32 - n)) -+#define rotate_left(v, n) (v << (n & 31) | v >> ((32 - n) & 31)) - - /* If VAL can be encoded in the immediate field of an ARM instruction, - return the encoded form. Otherwise, return FAIL. */ -@@ -17290,12 +17290,16 @@ - asection *sect; - - for (sect = stdoutput->sections; sect != NULL; sect = sect->next) -- if (seg_info (sect)->tc_segment_info_data.current_it.state -- == MANUAL_IT_BLOCK) -- { -- as_warn (_("section '%s' finished with an open IT block."), -- sect->name); -- } -+ { -+ segment_info_type *seginfo = seg_info (sect); -+ -+ if (seginfo && seginfo->tc_segment_info_data.current_it.state -+ == MANUAL_IT_BLOCK) -+ { -+ as_warn (_("section '%s' finished with an open IT block."), -+ sect->name); -+ } -+ } - #else - if (now_it.state == MANUAL_IT_BLOCK) - as_warn (_("file finished with an open IT block.")); -diff -rNU3 dist.orig/gas/config/tc-m68k.c dist/gas/config/tc-m68k.c ---- dist.orig/gas/config/tc-m68k.c 2012-05-16 12:26:47.000000000 +0200 -+++ dist/gas/config/tc-m68k.c 2015-10-18 13:11:13.000000000 +0200 -@@ -7426,12 +7426,12 @@ - } - } - -- /* Remove 'm' or 'mc' prefix from 68k variants. */ -+ /* Remove 'm' or 'mc' prefix from 68k or coldfire variants. */ - if (allow_m) - { - if (arg[0] == 'm') - { -- if (arg[1] == '6') -+ if (arg[1] == '6' || arg[1] == '5') - arg += 1; - else if (arg[1] == 'c' && arg[2] == '6') - arg += 2; -diff -rNU3 dist.orig/gas/config/tc-mips.c dist/gas/config/tc-mips.c ---- dist.orig/gas/config/tc-mips.c 2012-09-04 16:21:03.000000000 +0200 -+++ dist/gas/config/tc-mips.c 2015-10-18 13:11:13.000000000 +0200 -@@ -909,6 +909,9 @@ - NUM_FIX_VR4120_CLASSES - }; - -+/* ...likewise -mtrap-zero-jump. */ -+static bfd_boolean mips_trap_zero_jump; -+ - /* ...likewise -mfix-loongson2f-jump. */ - static bfd_boolean mips_fix_loongson2f_jump; - -@@ -941,6 +944,8 @@ - efficient expansion. */ - - static int mips_relax_branch; -+ -+static int mips_fix_loongson2f_btb; - - /* The expansion of many macros depends on the type of symbol that - they refer to. For example, when generating position-dependent code, -@@ -1316,6 +1321,7 @@ - static void mips16_macro_build - (expressionS *, const char *, const char *, va_list *); - static void load_register (int, expressionS *, int); -+static void macro_build (expressionS *, const char *, const char *, ...); - static void macro_start (void); - static void macro_end (void); - static void macro (struct mips_cl_insn * ip); -@@ -3626,6 +3632,35 @@ - return nops; - } - -+static void -+trap_zero_jump (struct mips_cl_insn * ip) -+{ -+ if (strcmp (ip->insn_mo->name, "j") == 0 -+ || strcmp (ip->insn_mo->name, "jr") == 0 -+ || strcmp (ip->insn_mo->name, "jalr") == 0) -+ { -+ int sreg; -+ -+ if (mips_opts.warn_about_macros) -+ return; -+ -+ sreg = EXTRACT_OPERAND (0, RS, *ip); -+ if (mips_opts.isa == ISA_MIPS32 -+ || mips_opts.isa == ISA_MIPS32R2 -+ || mips_opts.isa == ISA_MIPS64 -+ || mips_opts.isa == ISA_MIPS64R2) -+ { -+ expressionS ep; -+ ep.X_op = O_constant; -+ ep.X_add_number = 4096; -+ macro_build (&ep, "tltiu", "s,j", sreg, BFD_RELOC_LO16); -+ } -+ else if (mips_opts.isa != ISA_UNKNOWN -+ && mips_opts.isa != ISA_MIPS1) -+ macro_build (NULL, "teq", "s,t", sreg, 0); -+ } -+} -+ - /* Fix NOP issue: Replace nops by "or at,at,zero". */ - - static void -@@ -3663,6 +3698,16 @@ - ep.X_add_number = 0xffff; - macro_build (&ep, "ori", "t,r,i", ATREG, ATREG, BFD_RELOC_LO16); - macro_build (NULL, "and", "d,v,t", sreg, sreg, ATREG); -+ /* Hide these three instructions to avoid getting a ``macro expanded into -+ multiple instructions'' warning. */ -+ if (mips_relax.sequence != 2) { -+ mips_macro_warning.sizes[0] -= 3 * 4; -+ mips_macro_warning.insns[0] -= 3; -+ } -+ if (mips_relax.sequence != 1) { -+ mips_macro_warning.sizes[1] -= 3 * 4; -+ mips_macro_warning.insns[1] -= 3; -+ } - } - } - -@@ -3718,6 +3763,11 @@ - if (mips_opts.mips16 && history[0].fixp[0]) - return FALSE; - -+ if (mips_fix_loongson2f) -+ fix_loongson2f (ip); -+ if (mips_trap_zero_jump) -+ trap_zero_jump (ip); -+ - /* If the branch is itself the target of a branch, we can not swap. - We cheat on this; all we check for is whether there is a label on - this instruction. If there are any branches to anything other than -@@ -4764,6 +4814,45 @@ - r[i] = (bfd_reloc_code_real_type) va_arg (*args, int); - } - -+/* Fix jump through register issue on loongson2f processor for kernel code: -+ force a BTB clear before the jump to prevent it from being incorrectly -+ prefetched by the branch prediction engine. */ -+ -+static void -+macro_build_jrpatch (expressionS *ep, unsigned int sreg) -+{ -+ if (!mips_fix_loongson2f_btb) -+ return; -+ -+ if (sreg == ZERO || sreg == KT0 || sreg == KT1 || sreg == AT) -+ return; -+ -+ if (!mips_opts.at) -+ { -+ as_warn (_("unable to apply loongson2f BTB workaround when .set noat")); -+ return; -+ } -+ -+ /* li $at, COP_0_BTB_CLEAR | COP_0_RAS_DISABLE */ -+ ep->X_op = O_constant; -+ ep->X_add_number = 3; -+ macro_build (ep, "ori", "t,r,i", AT, ZERO, BFD_RELOC_LO16); -+ -+ /* dmtc0 $at, COP_0_DIAG */ -+ macro_build (NULL, "dmtc0", "t,G", AT, 22); -+ -+ /* Hide these two instructions to avoid getting a ``macro expanded into -+ multiple instructions'' warning. */ -+ if (mips_relax.sequence != 2) { -+ mips_macro_warning.sizes[0] -= 2 * 4; -+ mips_macro_warning.insns[0] -= 2; -+ } -+ if (mips_relax.sequence != 1) { -+ mips_macro_warning.sizes[1] -= 2 * 4; -+ mips_macro_warning.insns[1] -= 2; -+ } -+} -+ - /* Build an instruction created by a macro expansion. This is passed - a pointer to the count of instructions created so far, an - expression, the name of the instruction to build, an operand format -@@ -7637,6 +7726,26 @@ - macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", treg, tempreg, breg); - break; - -+ case M_JR_S: -+ macro_build_jrpatch (&expr1, sreg); -+ macro_build (NULL, "jr", "s", sreg); -+ return; /* didn't modify $at */ -+ -+ case M_J_S: -+ macro_build_jrpatch (&expr1, sreg); -+ macro_build (NULL, "j", "s", sreg); -+ return; /* didn't modify $at */ -+ -+ case M_JALR_S: -+ macro_build_jrpatch (&expr1, sreg); -+ macro_build (NULL, "jalr", "s", sreg); -+ return; /* didn't modify $at */ -+ -+ case M_JALR_DS: -+ macro_build_jrpatch (&expr1, sreg); -+ macro_build (NULL, "jalr", "d,s", dreg, sreg); -+ return; /* didn't modify $at */ -+ - case M_MSGSND: - gas_assert (!mips_opts.micromips); - { -@@ -9126,18 +9235,28 @@ - - - case M_SAA_AB: -- ab = 1; -+ ab = (offset_expr.X_op != O_constant || offset_expr.X_add_number != 0); - case M_SAA_OB: - s = "saa"; - off0 = 1; - fmt = "t,(b)"; -+ if (!ab) -+ { -+ tempreg = AT; -+ goto ld_noat; -+ } - goto ld_st; - case M_SAAD_AB: -- ab = 1; -+ ab = (offset_expr.X_op != O_constant || offset_expr.X_add_number != 0); - case M_SAAD_OB: - s = "saad"; - off0 = 1; - fmt = "t,(b)"; -+ if (!ab) -+ { -+ tempreg = AT; -+ goto ld_noat; -+ } - goto ld_st; - - /* New code added to support COPZ instructions. -@@ -14350,6 +14469,8 @@ - OPTION_SINGLE_FLOAT, - OPTION_DOUBLE_FLOAT, - OPTION_32, -+ OPTION_TRAP_ZERO_JUMP, -+ OPTION_NO_TRAP_ZERO_JUMP, - #ifdef OBJ_ELF - OPTION_CALL_SHARED, - OPTION_CALL_NONPIC, -@@ -14364,6 +14485,8 @@ - OPTION_NO_PDR, - OPTION_MVXWORKS_PIC, - #endif /* OBJ_ELF */ -+ OPTION_FIX_LOONGSON2F_BTB, -+ OPTION_NO_FIX_LOONGSON2F_BTB, - OPTION_END_OF_ENUM - }; - -@@ -14421,6 +14544,8 @@ - {"mno-fix-loongson2f-jump", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_JUMP}, - {"mfix-loongson2f-nop", no_argument, NULL, OPTION_FIX_LOONGSON2F_NOP}, - {"mno-fix-loongson2f-nop", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_NOP}, -+ {"mfix-loongson2f-btb", no_argument, NULL, OPTION_FIX_LOONGSON2F_BTB}, -+ {"mno-fix-loongson2f-btb", no_argument, NULL, OPTION_NO_FIX_LOONGSON2F_BTB}, - {"mfix-vr4120", no_argument, NULL, OPTION_FIX_VR4120}, - {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120}, - {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130}, -@@ -14459,6 +14584,9 @@ - make testing easier. */ - {"32", no_argument, NULL, OPTION_32}, - -+ {"mtrap-zero-jump", no_argument, NULL, OPTION_TRAP_ZERO_JUMP}, -+ {"mno-trap-zero-jump", no_argument, NULL, OPTION_NO_TRAP_ZERO_JUMP}, -+ - /* ELF-specific options. */ - #ifdef OBJ_ELF - {"KPIC", no_argument, NULL, OPTION_CALL_SHARED}, -@@ -14750,6 +14878,14 @@ - mips_fix_vr4130 = 0; - break; - -+ case OPTION_FIX_LOONGSON2F_BTB: -+ mips_fix_loongson2f_btb = 1; -+ break; -+ -+ case OPTION_NO_FIX_LOONGSON2F_BTB: -+ mips_fix_loongson2f_btb = 0; -+ break; -+ - case OPTION_FIX_CN63XXP1: - mips_fix_cn63xxp1 = TRUE; - break; -@@ -14782,6 +14918,14 @@ - mips_opts.sym32 = FALSE; - break; - -+ case OPTION_TRAP_ZERO_JUMP: -+ mips_trap_zero_jump = TRUE; -+ break; -+ -+ case OPTION_NO_TRAP_ZERO_JUMP: -+ mips_trap_zero_jump = FALSE; -+ break; -+ - #ifdef OBJ_ELF - /* When generating ELF code, we permit -KPIC and -call_shared to - select SVR4_PIC, and -non_shared to select no PIC. This is -@@ -19411,6 +19555,7 @@ - fprintf (stream, _("\ - -mfix-loongson2f-jump work around Loongson2F JUMP instructions\n\ - -mfix-loongson2f-nop work around Loongson2F NOP errata\n\ -+-mfix-loongson2f-btb work around Loongson2F BTB errata\n\ - -mfix-vr4120 work around certain VR4120 errata\n\ - -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\ - -mfix-24k insert a nop after ERET and DERET instructions\n\ -diff -rNU3 dist.orig/gas/config/tc-openrisc.c dist/gas/config/tc-openrisc.c ---- dist.orig/gas/config/tc-openrisc.c 2009-07-24 13:45:00.000000000 +0200 -+++ dist/gas/config/tc-openrisc.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,363 +0,0 @@ --/* tc-openrisc.c -- Assembler for the OpenRISC family. -- Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2009 -- Free Software Foundation. -- Contributed by Johan Rydberg, jrydberg@opencores.org -- -- This file is part of GAS, the GNU Assembler. -- -- GAS is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- GAS is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with GAS; see the file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street - Fifth Floor, -- Boston, MA 02110-1301, USA. */ -- --#include "as.h" --#include "subsegs.h" --#include "symcat.h" --#include "opcodes/openrisc-desc.h" --#include "opcodes/openrisc-opc.h" --#include "cgen.h" -- --/* Structure to hold all of the different components describing -- an individual instruction. */ --typedef struct openrisc_insn openrisc_insn; -- --struct openrisc_insn --{ -- const CGEN_INSN * insn; -- const CGEN_INSN * orig_insn; -- CGEN_FIELDS fields; --#if CGEN_INT_INSN_P -- CGEN_INSN_INT buffer [1]; --#define INSN_VALUE(buf) (*(buf)) --#else -- unsigned char buffer [CGEN_MAX_INSN_SIZE]; --#define INSN_VALUE(buf) (buf) --#endif -- char * addr; -- fragS * frag; -- int num_fixups; -- fixS * fixups [GAS_CGEN_MAX_FIXUPS]; -- int indices [MAX_OPERAND_INSTANCES]; --}; -- -- --const char comment_chars[] = "#"; --const char line_comment_chars[] = "#"; --const char line_separator_chars[] = ";"; --const char EXP_CHARS[] = "eE"; --const char FLT_CHARS[] = "dD"; -- -- --#define OPENRISC_SHORTOPTS "m:" --const char * md_shortopts = OPENRISC_SHORTOPTS; -- --struct option md_longopts[] = --{ -- {NULL, no_argument, NULL, 0} --}; --size_t md_longopts_size = sizeof (md_longopts); -- --unsigned long openrisc_machine = 0; /* default */ -- --int --md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED) --{ -- return 0; --} -- --void --md_show_usage (FILE * stream ATTRIBUTE_UNUSED) --{ --} -- --static void --ignore_pseudo (int val ATTRIBUTE_UNUSED) --{ -- discard_rest_of_line (); --} -- --const char openrisc_comment_chars [] = ";#"; -- --/* The target specific pseudo-ops which we support. */ --const pseudo_typeS md_pseudo_table[] = --{ -- { "word", cons, 4 }, -- { "proc", ignore_pseudo, 0 }, -- { "endproc", ignore_pseudo, 0 }, -- { NULL, NULL, 0 } --}; -- -- -- --void --md_begin (void) --{ -- /* Initialize the `cgen' interface. */ -- -- /* Set the machine number and endian. */ -- gas_cgen_cpu_desc = openrisc_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0, -- CGEN_CPU_OPEN_ENDIAN, -- CGEN_ENDIAN_BIG, -- CGEN_CPU_OPEN_END); -- openrisc_cgen_init_asm (gas_cgen_cpu_desc); -- -- /* This is a callback from cgen to gas to parse operands. */ -- cgen_set_parse_operand_fn (gas_cgen_cpu_desc, gas_cgen_parse_operand); --} -- --void --md_assemble (char * str) --{ -- static int last_insn_had_delay_slot = 0; -- openrisc_insn insn; -- char * errmsg; -- -- /* Initialize GAS's cgen interface for a new instruction. */ -- gas_cgen_init_parse (); -- -- insn.insn = openrisc_cgen_assemble_insn -- (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg); -- -- if (!insn.insn) -- { -- as_bad ("%s", errmsg); -- return; -- } -- -- /* Doesn't really matter what we pass for RELAX_P here. */ -- gas_cgen_finish_insn (insn.insn, insn.buffer, -- CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL); -- -- last_insn_had_delay_slot -- = CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_DELAY_SLOT); --} -- -- --/* The syntax in the manual says constants begin with '#'. -- We just ignore it. */ -- --void --md_operand (expressionS * expressionP) --{ -- if (* input_line_pointer == '#') -- { -- input_line_pointer ++; -- expression (expressionP); -- } --} -- --valueT --md_section_align (segT segment, valueT size) --{ -- int align = bfd_get_section_alignment (stdoutput, segment); -- return ((size + (1 << align) - 1) & (-1 << align)); --} -- --symbolS * --md_undefined_symbol (char * name ATTRIBUTE_UNUSED) --{ -- return 0; --} -- -- --/* Interface to relax_segment. */ -- --/* FIXME: Look through this. */ -- --const relax_typeS md_relax_table[] = --{ --/* The fields are: -- 1) most positive reach of this state, -- 2) most negative reach of this state, -- 3) how many bytes this mode will add to the size of the current frag -- 4) which index into the table to try if we can't fit into this one. */ -- -- /* The first entry must be unused because an `rlx_more' value of zero ends -- each list. */ -- {1, 1, 0, 0}, -- -- /* The displacement used by GAS is from the end of the 2 byte insn, -- so we subtract 2 from the following. */ -- /* 16 bit insn, 8 bit disp -> 10 bit range. -- This doesn't handle a branch in the right slot at the border: -- the "& -4" isn't taken into account. It's not important enough to -- complicate things over it, so we subtract an extra 2 (or + 2 in -ve -- case). */ -- {511 - 2 - 2, -512 - 2 + 2, 0, 2 }, -- /* 32 bit insn, 24 bit disp -> 26 bit range. */ -- {0x2000000 - 1 - 2, -0x2000000 - 2, 2, 0 }, -- /* Same thing, but with leading nop for alignment. */ -- {0x2000000 - 1 - 2, -0x2000000 - 2, 4, 0 } --}; -- --/* Return an initial guess of the length by which a fragment must grow to -- hold a branch to reach its destination. -- Also updates fr_type/fr_subtype as necessary. -- -- Called just before doing relaxation. -- Any symbol that is now undefined will not become defined. -- The guess for fr_var is ACTUALLY the growth beyond fr_fix. -- Whatever we do to grow fr_fix or fr_var contributes to our returned value. -- Although it may not be explicit in the frag, pretend fr_var starts with a -- 0 value. */ -- --int --md_estimate_size_before_relax (fragS * fragP, segT segment) --{ -- /* The only thing we have to handle here are symbols outside of the -- current segment. They may be undefined or in a different segment in -- which case linker scripts may place them anywhere. -- However, we can't finish the fragment here and emit the reloc as insn -- alignment requirements may move the insn about. */ -- -- if (S_GET_SEGMENT (fragP->fr_symbol) != segment) -- { -- /* The symbol is undefined in this segment. -- Change the relaxation subtype to the max allowable and leave -- all further handling to md_convert_frag. */ -- fragP->fr_subtype = 2; -- -- { -- const CGEN_INSN * insn; -- int i; -- -- /* Update the recorded insn. -- Fortunately we don't have to look very far. -- FIXME: Change this to record in the instruction the next higher -- relaxable insn to use. */ -- for (i = 0, insn = fragP->fr_cgen.insn; i < 4; i++, insn++) -- { -- if ((strcmp (CGEN_INSN_MNEMONIC (insn), -- CGEN_INSN_MNEMONIC (fragP->fr_cgen.insn)) -- == 0) -- && CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED)) -- break; -- } -- if (i == 4) -- abort (); -- -- fragP->fr_cgen.insn = insn; -- return 2; -- } -- } -- -- return md_relax_table[fragP->fr_subtype].rlx_length; --} -- --/* *fragP has been relaxed to its final size, and now needs to have -- the bytes inside it modified to conform to the new size. -- -- Called after relaxation is finished. -- fragP->fr_type == rs_machine_dependent. -- fragP->fr_subtype is the subtype of what the address relaxed to. */ -- --void --md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, -- segT sec ATTRIBUTE_UNUSED, -- fragS * fragP ATTRIBUTE_UNUSED) --{ -- /* FIXME */ --} -- -- --/* Functions concerning relocs. */ -- --/* The location from which a PC relative jump should be calculated, -- given a PC relative reloc. */ -- --long --md_pcrel_from_section (fixS * fixP, segT sec) --{ -- if (fixP->fx_addsy != (symbolS *) NULL -- && (! S_IS_DEFINED (fixP->fx_addsy) -- || S_GET_SEGMENT (fixP->fx_addsy) != sec)) -- /* The symbol is undefined (or is defined but not in this section). -- Let the linker figure it out. */ -- return 0; -- -- return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1; --} -- -- --/* Return the bfd reloc type for OPERAND of INSN at fixup FIXP. -- Returns BFD_RELOC_NONE if no reloc type can be found. -- *FIXP may be modified if desired. */ -- --bfd_reloc_code_real_type --md_cgen_lookup_reloc (const CGEN_INSN * insn ATTRIBUTE_UNUSED, -- const CGEN_OPERAND * operand, -- fixS * fixP) --{ -- bfd_reloc_code_real_type type; -- -- switch (operand->type) -- { -- case OPENRISC_OPERAND_ABS_26: -- fixP->fx_pcrel = 0; -- type = BFD_RELOC_OPENRISC_ABS_26; -- goto emit; -- case OPENRISC_OPERAND_DISP_26: -- fixP->fx_pcrel = 1; -- type = BFD_RELOC_OPENRISC_REL_26; -- goto emit; -- -- case OPENRISC_OPERAND_HI16: -- type = BFD_RELOC_HI16; -- goto emit; -- -- case OPENRISC_OPERAND_LO16: -- type = BFD_RELOC_LO16; -- goto emit; -- -- emit: -- return type; -- -- default : /* avoid -Wall warning */ -- break; -- } -- -- return BFD_RELOC_NONE; --} -- --/* Write a value out to the object file, using the appropriate endianness. */ -- --void --md_number_to_chars (char * buf, valueT val, int n) --{ -- number_to_chars_bigendian (buf, val, n); --} -- --/* Turn a string in input_line_pointer into a floating point constant of type -- type, and store the appropriate bytes in *litP. The number of LITTLENUMS -- emitted is stored in *sizeP . An error message is returned, or NULL on OK. --*/ -- --/* Equal to MAX_PRECISION in atof-ieee.c */ --#define MAX_LITTLENUMS 6 -- --char * --md_atof (int type, char * litP, int * sizeP) --{ -- return ieee_md_atof (type, litP, sizeP, TRUE); --} -- --bfd_boolean --openrisc_fix_adjustable (fixS * fixP) --{ -- /* We need the symbol name for the VTABLE entries. */ -- if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT -- || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) -- return 0; -- -- return 1; --} -diff -rNU3 dist.orig/gas/config/tc-openrisc.h dist/gas/config/tc-openrisc.h ---- dist.orig/gas/config/tc-openrisc.h 2007-07-03 13:01:04.000000000 +0200 -+++ dist/gas/config/tc-openrisc.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,61 +0,0 @@ --/* tc-openrisc.h -- Header file for tc-openrisc.c. -- Copyright 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. -- -- This file is part of GAS, the GNU Assembler. -- -- GAS is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- GAS is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with GAS; see the file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street - Fifth Floor, -- Boston, MA 02110-1301, USA. */ -- --#define TC_OPENRISC -- --#define LISTING_HEADER "OpenRISC GAS " -- --/* The target BFD architecture. */ --#define TARGET_ARCH bfd_arch_openrisc -- --extern unsigned long openrisc_machine; --#define TARGET_MACH (openrisc_machine) -- --#define TARGET_FORMAT "elf32-openrisc" --#define TARGET_BYTES_BIG_ENDIAN 1 -- --extern const char openrisc_comment_chars []; --#define tc_comment_chars openrisc_comment_chars -- --/* Permit temporary numeric labels. */ --#define LOCAL_LABELS_FB 1 -- --#define DIFF_EXPR_OK 1 /* .-foo gets turned into PC relative relocs */ -- --/* We don't need to handle .word strangely. */ --#define WORKING_DOT_WORD -- --/* Values passed to md_apply_fix don't include the symbol value. */ --#define MD_APPLY_SYM_VALUE(FIX) 0 -- --#define md_apply_fix gas_cgen_md_apply_fix -- --extern bfd_boolean openrisc_fix_adjustable (struct fix *); --#define tc_fix_adjustable(FIX) openrisc_fix_adjustable (FIX) -- --#define tc_gen_reloc gas_cgen_tc_gen_reloc -- --/* Call md_pcrel_from_section(), not md_pcrel_from(). */ --extern long md_pcrel_from_section (struct fix *, segT); --#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC) -- --/* For 8 vs 16 vs 32 bit branch selection. */ --extern const struct relax_type md_relax_table[]; --#define TC_GENERIC_RELAX_TABLE md_relax_table -diff -rNU3 dist.orig/gas/config/tc-or1k.c dist/gas/config/tc-or1k.c ---- dist.orig/gas/config/tc-or1k.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/tc-or1k.c 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,362 @@ -+/* tc-or1k.c -- Assembler for the OpenRISC family. -+ Copyright 2001-2014 Free Software Foundation. -+ Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org -+ -+ This file is part of GAS, the GNU Assembler. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ GAS is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, see */ -+#include "as.h" -+#include "safe-ctype.h" -+#include "subsegs.h" -+#include "symcat.h" -+#include "opcodes/or1k-desc.h" -+#include "opcodes/or1k-opc.h" -+#include "cgen.h" -+#include "elf/or1k.h" -+#include "dw2gencfi.h" -+ -+/* Structure to hold all of the different components describing -+ an individual instruction. */ -+ -+typedef struct -+{ -+ const CGEN_INSN * insn; -+ const CGEN_INSN * orig_insn; -+ CGEN_FIELDS fields; -+#if CGEN_INT_INSN_P -+ CGEN_INSN_INT buffer [1]; -+#define INSN_VALUE(buf) (*(buf)) -+#else -+ unsigned char buffer [CGEN_MAX_INSN_SIZE]; -+#define INSN_VALUE(buf) (buf) -+#endif -+ char * addr; -+ fragS * frag; -+ int num_fixups; -+ fixS * fixups [GAS_CGEN_MAX_FIXUPS]; -+ int indices [MAX_OPERAND_INSTANCES]; -+} -+or1k_insn; -+ -+const char comment_chars[] = "#"; -+const char line_comment_chars[] = "#"; -+const char line_separator_chars[] = ";"; -+const char EXP_CHARS[] = "eE"; -+const char FLT_CHARS[] = "dD"; -+ -+#define OR1K_SHORTOPTS "m:" -+const char * md_shortopts = OR1K_SHORTOPTS; -+ -+struct option md_longopts[] = -+{ -+ {NULL, no_argument, NULL, 0} -+}; -+size_t md_longopts_size = sizeof (md_longopts); -+ -+unsigned long or1k_machine = 0; /* default */ -+ -+int -+md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED) -+{ -+ return 0; -+} -+ -+void -+md_show_usage (FILE * stream ATTRIBUTE_UNUSED) -+{ -+} -+ -+static void -+ignore_pseudo (int val ATTRIBUTE_UNUSED) -+{ -+ discard_rest_of_line (); -+} -+ -+static bfd_boolean nodelay = FALSE; -+static void -+s_nodelay (int val ATTRIBUTE_UNUSED) -+{ -+ nodelay = TRUE; -+} -+ -+const char or1k_comment_chars [] = ";#"; -+ -+/* The target specific pseudo-ops which we support. */ -+const pseudo_typeS md_pseudo_table[] = -+{ -+ { "align", s_align_bytes, 0 }, -+ { "word", cons, 4 }, -+ { "proc", ignore_pseudo, 0 }, -+ { "endproc", ignore_pseudo, 0 }, -+ { "nodelay", s_nodelay, 0 }, -+ { NULL, NULL, 0 } -+}; -+ -+ -+void -+md_begin (void) -+{ -+ /* Initialize the `cgen' interface. */ -+ -+ /* Set the machine number and endian. */ -+ gas_cgen_cpu_desc = or1k_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0, -+ CGEN_CPU_OPEN_ENDIAN, -+ CGEN_ENDIAN_BIG, -+ CGEN_CPU_OPEN_END); -+ or1k_cgen_init_asm (gas_cgen_cpu_desc); -+ -+ /* This is a callback from cgen to gas to parse operands. */ -+ cgen_set_parse_operand_fn (gas_cgen_cpu_desc, gas_cgen_parse_operand); -+} -+ -+void -+md_assemble (char * str) -+{ -+ static int last_insn_had_delay_slot = 0; -+ or1k_insn insn; -+ char * errmsg; -+ -+ /* Initialize GAS's cgen interface for a new instruction. */ -+ gas_cgen_init_parse (); -+ -+ insn.insn = or1k_cgen_assemble_insn -+ (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg); -+ -+ if (!insn.insn) -+ { -+ as_bad ("%s", errmsg); -+ return; -+ } -+ -+ /* Doesn't really matter what we pass for RELAX_P here. */ -+ gas_cgen_finish_insn (insn.insn, insn.buffer, -+ CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL); -+ -+ last_insn_had_delay_slot -+ = CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_DELAY_SLOT); -+ (void) last_insn_had_delay_slot; -+} -+ -+ -+/* The syntax in the manual says constants begin with '#'. -+ We just ignore it. */ -+ -+void -+md_operand (expressionS * expressionP) -+{ -+ if (* input_line_pointer == '#') -+ { -+ input_line_pointer ++; -+ expression (expressionP); -+ } -+} -+ -+valueT -+md_section_align (segT segment, valueT size) -+{ -+ int align = bfd_get_section_alignment (stdoutput, segment); -+ return ((size + (1 << align) - 1) & (-1 << align)); -+} -+ -+symbolS * -+md_undefined_symbol (char * name ATTRIBUTE_UNUSED) -+{ -+ return 0; -+} -+ -+ -+/* Interface to relax_segment. */ -+ -+const relax_typeS md_relax_table[] = -+{ -+/* The fields are: -+ 1) most positive reach of this state, -+ 2) most negative reach of this state, -+ 3) how many bytes this mode will add to the size of the current frag -+ 4) which index into the table to try if we can't fit into this one. */ -+ -+ /* The first entry must be unused because an `rlx_more' value of zero ends -+ each list. */ -+ {1, 1, 0, 0}, -+ -+ /* The displacement used by GAS is from the end of the 4 byte insn, -+ so we subtract 4 from the following. */ -+ {(((1 << 25) - 1) << 2) - 4, -(1 << 25) - 4, 0, 0}, -+}; -+ -+int -+md_estimate_size_before_relax (fragS * fragP, segT segment ATTRIBUTE_UNUSED) -+{ -+ return md_relax_table[fragP->fr_subtype].rlx_length; -+} -+ -+/* *fragP has been relaxed to its final size, and now needs to have -+ the bytes inside it modified to conform to the new size. -+ -+ Called after relaxation is finished. -+ fragP->fr_type == rs_machine_dependent. -+ fragP->fr_subtype is the subtype of what the address relaxed to. */ -+ -+void -+md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, -+ segT sec ATTRIBUTE_UNUSED, -+ fragS * fragP ATTRIBUTE_UNUSED) -+{ -+ /* FIXME */ -+} -+ -+ -+/* Functions concerning relocs. */ -+ -+/* The location from which a PC relative jump should be calculated, -+ given a PC relative reloc. */ -+ -+long -+md_pcrel_from_section (fixS * fixP, segT sec) -+{ -+ if (fixP->fx_addsy != (symbolS *) NULL -+ && (! S_IS_DEFINED (fixP->fx_addsy) -+ || (S_GET_SEGMENT (fixP->fx_addsy) != sec) -+ || S_IS_EXTERNAL (fixP->fx_addsy) -+ || S_IS_WEAK (fixP->fx_addsy))) -+ { -+ /* The symbol is undefined (or is defined but not in this section). -+ Let the linker figure it out. */ -+ return 0; -+ } -+ -+ return fixP->fx_frag->fr_address + fixP->fx_where; -+} -+ -+ -+/* Return the bfd reloc type for OPERAND of INSN at fixup FIXP. -+ Returns BFD_RELOC_NONE if no reloc type can be found. -+ *FIXP may be modified if desired. */ -+ -+bfd_reloc_code_real_type -+md_cgen_lookup_reloc (const CGEN_INSN * insn ATTRIBUTE_UNUSED, -+ const CGEN_OPERAND * operand, -+ fixS * fixP) -+{ -+ if (fixP->fx_cgen.opinfo) -+ return fixP->fx_cgen.opinfo; -+ -+ switch (operand->type) -+ { -+ case OR1K_OPERAND_DISP26: -+ fixP->fx_pcrel = 1; -+ return BFD_RELOC_OR1K_REL_26; -+ -+ default: /* avoid -Wall warning */ -+ return BFD_RELOC_NONE; -+ } -+} -+ -+/* Write a value out to the object file, using the appropriate endianness. */ -+ -+void -+md_number_to_chars (char * buf, valueT val, int n) -+{ -+ number_to_chars_bigendian (buf, val, n); -+} -+ -+/* Turn a string in input_line_pointer into a floating point constant of type -+ type, and store the appropriate bytes in *litP. The number of LITTLENUMS -+ emitted is stored in *sizeP . An error message is returned, or NULL on OK. */ -+ -+/* Equal to MAX_PRECISION in atof-ieee.c. */ -+#define MAX_LITTLENUMS 6 -+ -+char * -+md_atof (int type, char * litP, int * sizeP) -+{ -+ return ieee_md_atof (type, litP, sizeP, TRUE); -+} -+ -+bfd_boolean -+or1k_fix_adjustable (fixS * fixP) -+{ -+ /* We need the symbol name for the VTABLE entries. */ -+ if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT -+ || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) -+ return FALSE; -+ -+ return TRUE; -+} -+ -+#define GOT_NAME "_GLOBAL_OFFSET_TABLE_" -+ -+arelent * -+tc_gen_reloc (asection *sec, fixS *fx) -+{ -+ bfd_reloc_code_real_type code = fx->fx_r_type; -+ -+ if (fx->fx_addsy != NULL -+ && strcmp (S_GET_NAME (fx->fx_addsy), GOT_NAME) == 0 -+ && (code == BFD_RELOC_OR1K_GOTPC_HI16 -+ || code == BFD_RELOC_OR1K_GOTPC_LO16)) -+ { -+ arelent * reloc; -+ -+ reloc = xmalloc (sizeof (* reloc)); -+ reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); -+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fx->fx_addsy); -+ reloc->address = fx->fx_frag->fr_address + fx->fx_where; -+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fx->fx_r_type); -+ reloc->addend = fx->fx_offset; -+ return reloc; -+ } -+ -+ return gas_cgen_tc_gen_reloc (sec, fx); -+} -+ -+void -+or1k_apply_fix (struct fix *f, valueT *t, segT s) -+{ -+ gas_cgen_md_apply_fix (f, t, s); -+ -+ switch (f->fx_r_type) -+ { -+ case BFD_RELOC_OR1K_TLS_GD_HI16: -+ case BFD_RELOC_OR1K_TLS_GD_LO16: -+ case BFD_RELOC_OR1K_TLS_LDM_HI16: -+ case BFD_RELOC_OR1K_TLS_LDM_LO16: -+ case BFD_RELOC_OR1K_TLS_LDO_HI16: -+ case BFD_RELOC_OR1K_TLS_LDO_LO16: -+ case BFD_RELOC_OR1K_TLS_IE_HI16: -+ case BFD_RELOC_OR1K_TLS_IE_LO16: -+ case BFD_RELOC_OR1K_TLS_LE_HI16: -+ case BFD_RELOC_OR1K_TLS_LE_LO16: -+ S_SET_THREAD_LOCAL (f->fx_addsy); -+ break; -+ default: -+ break; -+ } -+} -+ -+void -+or1k_elf_final_processing (void) -+{ -+ if (nodelay) -+ elf_elfheader (stdoutput)->e_flags |= EF_OR1K_NODELAY; -+} -+ -+/* Standard calling conventions leave the CFA at SP on entry. */ -+ -+void -+or1k_cfi_frame_initial_instructions (void) -+{ -+ cfi_add_CFA_def_cfa_register (1); -+} -+ -diff -rNU3 dist.orig/gas/config/tc-or1k.h dist/gas/config/tc-or1k.h ---- dist.orig/gas/config/tc-or1k.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/tc-or1k.h 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,79 @@ -+/* tc-or1k.h -- Header file for tc-or1k.c. -+ Copyright 2001-2014 Free Software Foundation, Inc. -+ -+ This file is part of GAS, the GNU Assembler. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ GAS is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, see */ -+ -+#define TC_OR1K -+ -+#define LISTING_HEADER "Or1k GAS " -+ -+/* The target BFD architecture. */ -+#define TARGET_ARCH bfd_arch_or1k -+ -+extern unsigned long or1k_machine; -+#define TARGET_MACH (or1k_machine) -+ -+#define TARGET_FORMAT "elf32-or1k" -+#define TARGET_BYTES_BIG_ENDIAN 1 -+ -+extern const char or1k_comment_chars []; -+#define tc_comment_chars or1k_comment_chars -+ -+/* Permit temporary numeric labels. */ -+#define LOCAL_LABELS_FB 1 -+ -+#define DIFF_EXPR_OK 1 /* .-foo gets turned into PC relative relocs. */ -+ -+/* We don't need to handle .word strangely. */ -+#define WORKING_DOT_WORD -+ -+/* Values passed to md_apply_fix don't include the symbol value. */ -+#define MD_APPLY_SYM_VALUE(FIX) 0 -+ -+#define md_apply_fix or1k_apply_fix -+extern void or1k_apply_fix (struct fix *, valueT *, segT); -+ -+extern bfd_boolean or1k_fix_adjustable (struct fix *); -+#define tc_fix_adjustable(FIX) or1k_fix_adjustable (FIX) -+ -+/* Call md_pcrel_from_section(), not md_pcrel_from(). */ -+extern long md_pcrel_from_section (struct fix *, segT); -+#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC) -+ -+/* For 8 vs 16 vs 32 bit branch selection. */ -+extern const struct relax_type md_relax_table[]; -+#define TC_GENERIC_RELAX_TABLE md_relax_table -+ -+#define GAS_CGEN_PCREL_R_TYPE(r_type) gas_cgen_pcrel_r_type(r_type) -+ -+#define elf_tc_final_processing or1k_elf_final_processing -+void or1k_elf_final_processing (void); -+ -+/* Enable cfi directives. */ -+#define TARGET_USE_CFIPOP 1 -+ -+/* Stack grows to lower addresses and wants 4 byte boundary. */ -+#define DWARF2_CIE_DATA_ALIGNMENT -4 -+ -+/* Define the column that represents the PC. */ -+#define DWARF2_DEFAULT_RETURN_COLUMN 9 -+ -+/* or1k instructions are 4 bytes long. */ -+#define DWARF2_LINE_MIN_INSN_LENGTH 4 -+ -+#define tc_cfi_frame_initial_instructions \ -+ or1k_cfi_frame_initial_instructions -+extern void or1k_cfi_frame_initial_instructions (void); -diff -rNU3 dist.orig/gas/config/tc-or32.c dist/gas/config/tc-or32.c ---- dist.orig/gas/config/tc-or32.c 2012-05-17 17:13:16.000000000 +0200 -+++ dist/gas/config/tc-or32.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,967 +0,0 @@ --/* Assembly backend for the OpenRISC 1000. -- Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2012 -- Free Software Foundation, Inc. -- Contributed by Damjan Lampret . -- Modified bu Johan Rydberg, . -- Based upon a29k port. -- -- This file is part of GAS, the GNU Assembler. -- -- GAS is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- GAS is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with GAS; see the file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street - Fifth Floor, -- Boston, MA 02110-1301, USA. */ -- --/* tc-a29k.c used as a template. */ -- --#include "as.h" --#include "safe-ctype.h" --#include "opcode/or32.h" --#include "elf/or32.h" -- --#define DEBUG 0 -- --#ifndef REGISTER_PREFIX --#define REGISTER_PREFIX '%' --#endif -- --/* Make it easier to clone this machine desc into another one. */ --#define machine_opcode or32_opcode --#define machine_opcodes or32_opcodes --#define machine_ip or32_ip --#define machine_it or32_it -- --/* Handle of the OPCODE hash table. */ --static struct hash_control *op_hash = NULL; -- --struct machine_it --{ -- char * error; -- unsigned long opcode; -- struct nlist * nlistp; -- expressionS exp; -- int pcrel; -- int reloc_offset; /* Offset of reloc within insn. */ -- int reloc; --} --the_insn; -- --const pseudo_typeS md_pseudo_table[] = --{ -- {"align", s_align_bytes, 4 }, -- {"space", s_space, 0 }, -- {"cputype", s_ignore, 0 }, -- {"reg", s_lsym, 0 }, /* Register equate, same as equ. */ -- {"sect", s_ignore, 0 }, /* Creation of coff sections. */ -- {"proc", s_ignore, 0 }, /* Start of a function. */ -- {"endproc", s_ignore, 0 }, /* Function end. */ -- {"word", cons, 4 }, -- {NULL, 0, 0 }, --}; -- --int md_short_jump_size = 4; --int md_long_jump_size = 4; -- --/* This array holds the chars that always start a comment. -- If the pre-processor is disabled, these aren't very useful. */ --const char comment_chars[] = "#"; -- --/* This array holds the chars that only start a comment at the beginning of -- a line. If the line seems to have the form '# 123 filename' -- .line and .file directives will appear in the pre-processed output. */ --/* Note that input_file.c hand checks for '#' at the beginning of the -- first line of the input file. This is because the compiler outputs -- #NO_APP at the beginning of its output. */ --/* Also note that comments like this one will always work. */ --const char line_comment_chars[] = "#"; -- --/* We needed an unused char for line separation to work around the -- lack of macros, using sed and such. */ --const char line_separator_chars[] = ";"; -- --/* Chars that can be used to separate mant from exp in floating point nums. */ --const char EXP_CHARS[] = "eE"; -- --/* Chars that mean this number is a floating point constant. -- As in 0f12.456 -- or 0d1.2345e12. */ --const char FLT_CHARS[] = "rRsSfFdDxXpP"; -- --/* "l.jalr r9" precalculated opcode. */ --static unsigned long jalr_r9_opcode; -- --static void machine_ip (char *); -- -- --/* Set bits in machine opcode according to insn->encoding -- description and passed operand. */ -- --static void --encode (const struct machine_opcode *insn, -- unsigned long *opcode, -- signed long param_val, -- char param_ch) --{ -- int opc_pos = 0; -- int param_pos = 0; -- char *enc; -- --#if DEBUG -- printf (" encode: opcode=%.8lx param_val=%.8lx abs=%.8lx param_ch=%c\n", -- *opcode, param_val, abs (param_val), param_ch); --#endif -- for (enc = insn->encoding; *enc != '\0'; enc++) -- if (*enc == param_ch) -- { -- if (enc - 2 >= insn->encoding && (*(enc - 2) == '0') && (*(enc - 1) == 'x')) -- continue; -- else -- param_pos ++; -- } -- -- opc_pos = 32; -- -- for (enc = insn->encoding; *enc != '\0';) -- { -- if ((*enc == '0') && (*(enc + 1) == 'x')) -- { -- int tmp = strtol (enc, NULL, 16); -- -- opc_pos -= 4; -- *opcode |= tmp << opc_pos; -- enc += 3; -- } -- else if ((*enc == '0') || (*enc == '-')) -- { -- opc_pos--; -- enc++; -- } -- else if (*enc == '1') -- { -- opc_pos--; -- *opcode |= 1 << opc_pos; -- enc++; -- } -- else if (*enc == param_ch) -- { -- opc_pos--; -- param_pos--; -- *opcode |= ((param_val >> param_pos) & 0x1) << opc_pos; -- enc++; -- } -- else if (ISALPHA (*enc)) -- { -- opc_pos--; -- enc++; -- } -- else -- enc++; -- } -- --#if DEBUG -- printf (" opcode=%.8lx\n", *opcode); --#endif --} -- --/* This function is called once, at assembler startup time. It should -- set up all the tables, etc., that the MD part of the assembler will -- need. */ -- --void --md_begin (void) --{ -- const char *retval = NULL; -- int lose = 0; -- int skipnext = 0; -- unsigned int i; -- -- /* Hash up all the opcodes for fast use later. */ -- op_hash = hash_new (); -- -- for (i = 0; i < or32_num_opcodes; i++) -- { -- const char *name = machine_opcodes[i].name; -- -- if (skipnext) -- { -- skipnext = 0; -- continue; -- } -- -- retval = hash_insert (op_hash, name, (void *) &machine_opcodes[i]); -- if (retval != NULL) -- { -- fprintf (stderr, "internal error: can't hash `%s': %s\n", -- machine_opcodes[i].name, retval); -- lose = 1; -- } -- } -- -- if (lose) -- as_fatal (_("Broken assembler. No assembly attempted.")); -- -- encode (&machine_opcodes[insn_index ("l.jalr")], &jalr_r9_opcode, 9, 'B'); --} -- --/* Returns non zero if instruction is to be used. */ -- --static int --check_invalid_opcode (unsigned long opcode) --{ -- return opcode == jalr_r9_opcode; --} -- --/* Assemble a single instruction. Its label has already been handled -- by the generic front end. We just parse opcode and operands, and -- produce the bytes of data and relocation. */ -- --void --md_assemble (char *str) --{ -- char *toP; -- --#if DEBUG -- printf ("NEW INSTRUCTION\n"); --#endif -- -- know (str); -- machine_ip (str); -- toP = frag_more (4); -- -- /* Put out the opcode. */ -- md_number_to_chars (toP, the_insn.opcode, 4); -- -- /* Put out the symbol-dependent stuff. */ -- if (the_insn.reloc != BFD_RELOC_NONE) -- { -- fix_new_exp (frag_now, -- (toP - frag_now->fr_literal + the_insn.reloc_offset), -- 4, /* size */ -- &the_insn.exp, -- the_insn.pcrel, -- the_insn.reloc); -- } --} -- --/* This is true of the we have issued a "lo(" or "hi"(. */ --static int waiting_for_shift = 0; -- --static int mask_or_shift = 0; -- --static char * --parse_operand (char *s, expressionS *operandp, int opt) --{ -- char *save = input_line_pointer; -- char *new_pointer; -- --#if DEBUG -- printf (" PROCESS NEW OPERAND(%s) == %c (%d)\n", s, opt ? opt : '!', opt); --#endif -- -- input_line_pointer = s; -- -- if (strncasecmp (s, "HI(", 3) == 0) -- { -- waiting_for_shift = 1; -- mask_or_shift = BFD_RELOC_HI16; -- -- input_line_pointer += 3; -- } -- else if (strncasecmp (s, "LO(", 3) == 0) -- { -- mask_or_shift = BFD_RELOC_LO16; -- -- input_line_pointer += 3; -- } -- else -- mask_or_shift = 0; -- -- if ((*s == '(') && (*(s+1) == 'r')) -- s++; -- -- if ((*s == 'r') && ISDIGIT (*(s + 1))) -- { -- operandp->X_add_number = strtol (s + 1, NULL, 10); -- operandp->X_op = O_register; -- for (; (*s != ',') && (*s != '\0');) -- s++; -- input_line_pointer = save; -- return s; -- } -- -- expression (operandp); -- -- if (operandp->X_op == O_absent) -- { -- if (! opt) -- as_bad (_("missing operand")); -- else -- { -- operandp->X_add_number = 0; -- operandp->X_op = O_constant; -- } -- } -- -- new_pointer = input_line_pointer; -- input_line_pointer = save; -- --#if DEBUG -- printf (" %s=parse_operand(%s): operandp->X_op = %u\n", new_pointer, s, -- operandp->X_op); --#endif -- -- return new_pointer; --} -- --/* Instruction parsing. Takes a string containing the opcode. -- Operands are at input_line_pointer. Output is in the_insn. -- Warnings or errors are generated. */ -- --static void --machine_ip (char *str) --{ -- char *s; -- const char *args; -- const struct machine_opcode *insn; -- unsigned long opcode; -- expressionS the_operand; -- expressionS *operand = &the_operand; -- unsigned int regno; -- int reloc = BFD_RELOC_NONE; -- --#if DEBUG -- printf ("machine_ip(%s)\n", str); --#endif -- -- s = str; -- for (; ISALNUM (*s) || *s == '.'; ++s) -- if (ISUPPER (*s)) -- *s = TOLOWER (*s); -- -- switch (*s) -- { -- case '\0': -- break; -- -- case ' ': /* FIXME-SOMEDAY more whitespace. */ -- *s++ = '\0'; -- break; -- -- default: -- as_bad (_("unknown opcode1: `%s'"), str); -- return; -- } -- -- if ((insn = (struct machine_opcode *) hash_find (op_hash, str)) == NULL) -- { -- as_bad (_("unknown opcode2 `%s'."), str); -- return; -- } -- -- opcode = 0; -- memset (&the_insn, '\0', sizeof (the_insn)); -- the_insn.reloc = BFD_RELOC_NONE; -- -- reloc = BFD_RELOC_NONE; -- -- /* Build the opcode, checking as we go to make sure that the -- operands match. -- -- If an operand matches, we modify the_insn or opcode appropriately, -- and do a "continue". If an operand fails to match, we "break". */ -- if (insn->args[0] != '\0') -- /* Prime the pump. */ -- s = parse_operand (s, operand, insn->args[0] == 'I'); -- -- for (args = insn->args;; ++args) -- { --#if DEBUG -- printf (" args = %s\n", args); --#endif -- switch (*args) -- { -- case '\0': /* End of args. */ -- /* We have have 0 args, do the bazoooka! */ -- if (args == insn->args) -- encode (insn, &opcode, 0, 0); -- -- if (*s == '\0') -- { -- /* We are truly done. */ -- the_insn.opcode = opcode; -- if (check_invalid_opcode (opcode)) -- as_bad (_("instruction not allowed: %s"), str); -- return; -- } -- as_bad (_("too many operands: %s"), s); -- break; -- -- case ',': /* Must match a comma. */ -- if (*s++ == ',') -- { -- reloc = BFD_RELOC_NONE; -- -- /* Parse next operand. */ -- s = parse_operand (s, operand, args[1] == 'I'); --#if DEBUG -- printf (" ',' case: operand->X_add_number = %d, *args = %s, *s = %s\n", -- operand->X_add_number, args, s); --#endif -- continue; -- } -- break; -- -- case '(': /* Must match a (. */ -- s = parse_operand (s, operand, args[1] == 'I'); -- continue; -- -- case ')': /* Must match a ). */ -- continue; -- -- case 'r': /* A general register. */ -- args++; -- -- if (operand->X_op != O_register) -- break; /* Only registers. */ -- -- know (operand->X_add_symbol == 0); -- know (operand->X_op_symbol == 0); -- regno = operand->X_add_number; -- encode (insn, &opcode, regno, *args); --#if DEBUG -- printf (" r: operand->X_op = %d\n", operand->X_op); --#endif -- continue; -- -- default: -- /* if (! ISALPHA (*args)) -- break; */ /* Only immediate values. */ -- -- if (mask_or_shift) -- { --#if DEBUG -- printf ("mask_or_shift = %d\n", mask_or_shift); --#endif -- reloc = mask_or_shift; -- } -- mask_or_shift = 0; -- -- if (strncasecmp (args, "LO(", 3) == 0) -- { --#if DEBUG -- printf ("reloc_const\n"); --#endif -- reloc = BFD_RELOC_LO16; -- } -- else if (strncasecmp (args, "HI(", 3) == 0) -- { --#if DEBUG -- printf ("reloc_consth\n"); --#endif -- reloc = BFD_RELOC_HI16; -- } -- -- if (*s == '(') -- operand->X_op = O_constant; -- else if (*s == ')') -- s += 1; --#if DEBUG -- printf (" default case: operand->X_add_number = %d, *args = %s, *s = %s\n", operand->X_add_number, args, s); --#endif -- if (operand->X_op == O_constant) -- { -- if (reloc == BFD_RELOC_NONE) -- { -- bfd_vma v, mask; -- -- mask = 0x3ffffff; -- v = abs (operand->X_add_number) & ~ mask; -- if (v) -- as_bad (_("call/jmp target out of range (1)")); -- } -- -- if (reloc == BFD_RELOC_HI16) -- operand->X_add_number = ((operand->X_add_number >> 16) & 0xffff); -- -- the_insn.pcrel = 0; -- encode (insn, &opcode, operand->X_add_number, *args); -- /* the_insn.reloc = BFD_RELOC_NONE; */ -- continue; -- } -- -- if (reloc == BFD_RELOC_NONE) -- the_insn.reloc = BFD_RELOC_32_GOT_PCREL; -- else -- the_insn.reloc = reloc; -- -- /* the_insn.reloc = insn->reloc; */ --#if DEBUG -- printf (" reloc sym=%d\n", the_insn.reloc); -- printf (" BFD_RELOC_NONE=%d\n", BFD_RELOC_NONE); --#endif -- the_insn.exp = *operand; -- -- /* the_insn.reloc_offset = 1; */ -- the_insn.pcrel = 1; /* Assume PC-relative jump. */ -- -- /* FIXME-SOON, Do we figure out whether abs later, after -- know sym val? */ -- if (reloc == BFD_RELOC_LO16 || reloc == BFD_RELOC_HI16) -- the_insn.pcrel = 0; -- -- encode (insn, &opcode, operand->X_add_number, *args); -- continue; -- } -- -- /* Types or values of args don't match. */ -- as_bad (_("invalid operands")); -- return; -- } --} -- --char * --md_atof (int type, char * litP, int * sizeP) --{ -- return ieee_md_atof (type, litP, sizeP, TRUE); --} -- --/* Write out big-endian. */ -- --void --md_number_to_chars (char *buf, valueT val, int n) --{ -- number_to_chars_bigendian (buf, val, n); --} -- --void --md_apply_fix (fixS * fixP, valueT * val, segT seg ATTRIBUTE_UNUSED) --{ -- char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; -- long t_val; -- -- t_val = (long) *val; -- --#if DEBUG -- printf ("md_apply_fix val:%x\n", t_val); --#endif -- -- fixP->fx_addnumber = t_val; /* Remember value for emit_reloc. */ -- -- switch (fixP->fx_r_type) -- { -- case BFD_RELOC_32: /* XXXXXXXX pattern in a word. */ --#if DEBUG -- printf ("reloc_const: val=%x\n", t_val); --#endif -- buf[0] = t_val >> 24; -- buf[1] = t_val >> 16; -- buf[2] = t_val >> 8; -- buf[3] = t_val; -- break; -- -- case BFD_RELOC_16: /* XXXX0000 pattern in a word. */ --#if DEBUG -- printf ("reloc_const: val=%x\n", t_val); --#endif -- buf[0] = t_val >> 8; -- buf[1] = t_val; -- break; -- -- case BFD_RELOC_8: /* XX000000 pattern in a word. */ --#if DEBUG -- printf ("reloc_const: val=%x\n", t_val); --#endif -- buf[0] = t_val; -- break; -- -- case BFD_RELOC_LO16: /* 0000XXXX pattern in a word. */ --#if DEBUG -- printf ("reloc_const: val=%x\n", t_val); --#endif -- buf[2] = t_val >> 8; /* Holds bits 0000XXXX. */ -- buf[3] = t_val; -- break; -- -- case BFD_RELOC_HI16: /* 0000XXXX pattern in a word. */ --#if DEBUG -- printf ("reloc_consth: val=%x\n", t_val); --#endif -- buf[2] = t_val >> 24; /* Holds bits XXXX0000. */ -- buf[3] = t_val >> 16; -- break; -- -- case BFD_RELOC_32_GOT_PCREL: /* 0000XXXX pattern in a word. */ -- if (!fixP->fx_done) -- ; -- else if (fixP->fx_pcrel) -- { -- long v = t_val >> 28; -- -- if (v != 0 && v != -1) -- as_bad_where (fixP->fx_file, fixP->fx_line, -- _("call/jmp target out of range (2)")); -- } -- else -- /* This case was supposed to be handled in machine_ip. */ -- abort (); -- -- buf[0] |= (t_val >> 26) & 0x03; /* Holds bits 0FFFFFFC of address. */ -- buf[1] = t_val >> 18; -- buf[2] = t_val >> 10; -- buf[3] = t_val >> 2; -- break; -- -- case BFD_RELOC_VTABLE_INHERIT: -- case BFD_RELOC_VTABLE_ENTRY: -- fixP->fx_done = 0; -- break; -- -- case BFD_RELOC_NONE: -- default: -- as_bad (_("bad relocation type: 0x%02x"), fixP->fx_r_type); -- break; -- } -- -- if (fixP->fx_addsy == (symbolS *) NULL) -- fixP->fx_done = 1; --} -- --/* Should never be called for or32. */ -- --void --md_create_short_jump (char * ptr ATTRIBUTE_UNUSED, -- addressT from_addr ATTRIBUTE_UNUSED, -- addressT to_addr ATTRIBUTE_UNUSED, -- fragS * frag ATTRIBUTE_UNUSED, -- symbolS * to_symbol ATTRIBUTE_UNUSED) --{ -- as_fatal ("or32_create_short_jmp\n"); --} -- --/* Should never be called for or32. */ -- --void --md_convert_frag (bfd * headers ATTRIBUTE_UNUSED, -- segT seg ATTRIBUTE_UNUSED, -- fragS * fragP ATTRIBUTE_UNUSED) --{ -- as_fatal ("or32_convert_frag\n"); --} -- --/* Should never be called for or32. */ -- --void --md_create_long_jump (char * ptr ATTRIBUTE_UNUSED, -- addressT from_addr ATTRIBUTE_UNUSED, -- addressT to_addr ATTRIBUTE_UNUSED, -- fragS * frag ATTRIBUTE_UNUSED, -- symbolS * to_symbol ATTRIBUTE_UNUSED) --{ -- as_fatal ("or32_create_long_jump\n"); --} -- --/* Should never be called for or32. */ -- --int --md_estimate_size_before_relax (fragS * fragP ATTRIBUTE_UNUSED, -- segT segtype ATTRIBUTE_UNUSED) --{ -- as_fatal ("or32_estimate_size_before_relax\n"); -- return 0; --} -- --/* Translate internal representation of relocation info to target format. -- -- On sparc/29k: first 4 bytes are normal unsigned long address, next three -- bytes are index, most sig. byte first. Byte 7 is broken up with -- bit 7 as external, bits 6 & 5 unused, and the lower -- five bits as relocation type. Next 4 bytes are long addend. */ --/* Thanx and a tip of the hat to Michael Bloom, mb@ttidca.tti.com. */ -- --#ifdef OBJ_AOUT --void --tc_aout_fix_to_chars (char *where, -- fixS *fixP, -- relax_addressT segment_address_in_file) --{ -- long r_symbolnum; -- --#if DEBUG -- printf ("tc_aout_fix_to_chars\n"); --#endif -- -- know (fixP->fx_r_type < BFD_RELOC_NONE); -- know (fixP->fx_addsy != NULL); -- -- md_number_to_chars -- (where, -- fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, -- 4); -- -- r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) -- ? S_GET_TYPE (fixP->fx_addsy) -- : fixP->fx_addsy->sy_number); -- -- where[4] = (r_symbolnum >> 16) & 0x0ff; -- where[5] = (r_symbolnum >> 8) & 0x0ff; -- where[6] = r_symbolnum & 0x0ff; -- where[7] = (((!S_IS_DEFINED (fixP->fx_addsy)) << 7) & 0x80) | (0 & 0x60) | (fixP->fx_r_type & 0x1F); -- -- /* Also easy. */ -- md_number_to_chars (&where[8], fixP->fx_addnumber, 4); --} -- --#endif /* OBJ_AOUT */ -- --const char *md_shortopts = ""; -- --struct option md_longopts[] = --{ -- { NULL, no_argument, NULL, 0 } --}; --size_t md_longopts_size = sizeof (md_longopts); -- --int --md_parse_option (int c ATTRIBUTE_UNUSED, char * arg ATTRIBUTE_UNUSED) --{ -- return 0; --} -- --void --md_show_usage (FILE * stream ATTRIBUTE_UNUSED) --{ --} -- --/* This is called when a line is unrecognized. This is used to handle -- definitions of or32 style local labels. */ -- --int --or32_unrecognized_line (int c) --{ -- int lab; -- char *s; -- -- if (c != '$' -- || ! ISDIGIT ((unsigned char) input_line_pointer[0])) -- return 0; -- -- s = input_line_pointer; -- -- lab = 0; -- while (ISDIGIT ((unsigned char) *s)) -- { -- lab = lab * 10 + *s - '0'; -- ++s; -- } -- -- if (*s != ':') -- /* Not a label definition. */ -- return 0; -- -- if (dollar_label_defined (lab)) -- { -- as_bad (_("label \"$%d\" redefined"), lab); -- return 0; -- } -- -- define_dollar_label (lab); -- colon (dollar_label_name (lab, 0)); -- input_line_pointer = s + 1; -- -- return 1; --} -- --/* Default the values of symbols known that should be "predefined". We -- don't bother to predefine them unless you actually use one, since there -- are a lot of them. */ -- --symbolS * --md_undefined_symbol (char *name ATTRIBUTE_UNUSED) --{ -- return NULL; --} -- --/* Parse an operand that is machine-specific. */ -- --void --md_operand (expressionS *expressionP) --{ --#if DEBUG -- printf (" md_operand(input_line_pointer = %s)\n", input_line_pointer); --#endif -- -- if (input_line_pointer[0] == REGISTER_PREFIX && input_line_pointer[1] == 'r') -- { -- /* We have a numeric register expression. No biggy. */ -- input_line_pointer += 2; /* Skip %r */ -- (void) expression (expressionP); -- -- if (expressionP->X_op != O_constant -- || expressionP->X_add_number > 255) -- as_bad (_("Invalid expression after %%%%\n")); -- expressionP->X_op = O_register; -- } -- else if (input_line_pointer[0] == '&') -- { -- /* We are taking the 'address' of a register...this one is not -- in the manual, but it *is* in traps/fpsymbol.h! What they -- seem to want is the register number, as an absolute number. */ -- input_line_pointer++; /* Skip & */ -- (void) expression (expressionP); -- -- if (expressionP->X_op != O_register) -- as_bad (_("invalid register in & expression")); -- else -- expressionP->X_op = O_constant; -- } -- else if (input_line_pointer[0] == '$' -- && ISDIGIT ((unsigned char) input_line_pointer[1])) -- { -- long lab; -- char *name; -- symbolS *sym; -- -- /* This is a local label. */ -- ++input_line_pointer; -- lab = (long) get_absolute_expression (); -- -- if (dollar_label_defined (lab)) -- { -- name = dollar_label_name (lab, 0); -- sym = symbol_find (name); -- } -- else -- { -- name = dollar_label_name (lab, 1); -- sym = symbol_find_or_make (name); -- } -- -- expressionP->X_op = O_symbol; -- expressionP->X_add_symbol = sym; -- expressionP->X_add_number = 0; -- } -- else if (input_line_pointer[0] == '$') -- { -- char *s; -- char type; -- int fieldnum, fieldlimit; -- LITTLENUM_TYPE floatbuf[8]; -- -- /* $float(), $doubleN(), or $extendN() convert floating values -- to integers. */ -- s = input_line_pointer; -- -- ++s; -- -- fieldnum = 0; -- if (strncmp (s, "double", sizeof "double" - 1) == 0) -- { -- s += sizeof "double" - 1; -- type = 'd'; -- fieldlimit = 2; -- } -- else if (strncmp (s, "float", sizeof "float" - 1) == 0) -- { -- s += sizeof "float" - 1; -- type = 'f'; -- fieldlimit = 1; -- } -- else if (strncmp (s, "extend", sizeof "extend" - 1) == 0) -- { -- s += sizeof "extend" - 1; -- type = 'x'; -- fieldlimit = 4; -- } -- else -- return; -- -- if (ISDIGIT (*s)) -- { -- fieldnum = *s - '0'; -- ++s; -- } -- if (fieldnum >= fieldlimit) -- return; -- -- SKIP_WHITESPACE (); -- if (*s != '(') -- return; -- ++s; -- SKIP_WHITESPACE (); -- -- s = atof_ieee (s, type, floatbuf); -- if (s == NULL) -- return; -- s = s; -- -- SKIP_WHITESPACE (); -- if (*s != ')') -- return; -- ++s; -- SKIP_WHITESPACE (); -- -- input_line_pointer = s; -- expressionP->X_op = O_constant; -- expressionP->X_unsigned = 1; -- expressionP->X_add_number = ((floatbuf[fieldnum * 2] -- << LITTLENUM_NUMBER_OF_BITS) -- + floatbuf[fieldnum * 2 + 1]); -- } --} -- --/* Round up a section size to the appropriate boundary. */ -- --valueT --md_section_align (segT segment ATTRIBUTE_UNUSED, valueT size ATTRIBUTE_UNUSED) --{ -- return size; /* Byte alignment is fine. */ --} -- --/* Exactly what point is a PC-relative offset relative TO? -- On the 29000, they're relative to the address of the instruction, -- which we have set up as the address of the fixup too. */ -- --long --md_pcrel_from (fixS *fixP) --{ -- return fixP->fx_where + fixP->fx_frag->fr_address; --} -- --/* Generate a reloc for a fixup. */ -- --arelent * --tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp) --{ -- arelent *reloc; -- -- reloc = xmalloc (sizeof (arelent)); -- reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *)); -- *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); -- reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; -- /* reloc->address = fixp->fx_frag->fr_address + fixp->fx_where + fixp->fx_addnumber;*/ -- reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); -- -- if (reloc->howto == (reloc_howto_type *) NULL) -- { -- as_bad_where (fixp->fx_file, fixp->fx_line, -- _("reloc %d not supported by object file format"), -- (int) fixp->fx_r_type); -- return NULL; -- } -- -- if (fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) -- reloc->address = fixp->fx_offset; -- -- reloc->addend = fixp->fx_addnumber; -- return reloc; --} -diff -rNU3 dist.orig/gas/config/tc-or32.h dist/gas/config/tc-or32.h ---- dist.orig/gas/config/tc-or32.h 2007-07-03 13:01:04.000000000 +0200 -+++ dist/gas/config/tc-or32.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,56 +0,0 @@ --/* tc-or32.h -- Assemble for the OpenRISC 1000. -- Copyright (C) 2002, 2003. 2005, 2007 Free Software Foundation, Inc. -- Contributed by Damjan Lampret . -- Based upon a29k port. -- -- This file is part of GAS, the GNU Assembler. -- -- GAS is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- GAS is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with GAS; see the file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street - Fifth Floor, -- Boston, MA 02110-1301, USA. */ -- --#define TC_OR32 -- --#define TARGET_BYTES_BIG_ENDIAN 1 -- --#define LEX_DOLLAR 1 -- --#ifdef OBJ_ELF --#define TARGET_FORMAT "elf32-or32" --#define TARGET_ARCH bfd_arch_or32 --#endif -- --#ifdef OBJ_COFF --#define TARGET_FORMAT "coff-or32-big" --#define reloc_type int --#endif -- --#define tc_unrecognized_line(c) or32_unrecognized_line (c) -- --extern int or32_unrecognized_line (int); -- --#define tc_coff_symbol_emit_hook(a) ; /* Not used. */ -- --#define COFF_MAGIC SIPFBOMAGIC -- --/* No shared lib support, so we don't need to ensure externally -- visible symbols can be overridden. */ --#define EXTERN_FORCE_RELOC 0 -- --#ifdef OBJ_ELF --/* Values passed to md_apply_fix don't include the symbol value. */ --#define MD_APPLY_SYM_VALUE(FIX) 0 --#endif -- --#define ZERO_BASED_SEGMENTS -diff -rNU3 dist.orig/gas/config/tc-riscv.c dist/gas/config/tc-riscv.c ---- dist.orig/gas/config/tc-riscv.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/tc-riscv.c 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,2225 @@ -+/* tc-riscv.c -- RISC-V assembler -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on MIPS target. -+ -+ This file is part of GAS. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ GAS is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GAS; see the file COPYING. If not, write to the Free -+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -+ 02110-1301, USA. */ -+ -+#include "as.h" -+#include "config.h" -+#include "subsegs.h" -+#include "safe-ctype.h" -+ -+#include "itbl-ops.h" -+#include "dwarf2dbg.h" -+#include "dw2gencfi.h" -+ -+#include "elf/riscv.h" -+#include "opcode/riscv.h" -+ -+#include -+#include -+ -+/* Information about an instruction, including its format, operands -+ and fixups. */ -+struct riscv_cl_insn -+{ -+ /* The opcode's entry in riscv_opcodes. */ -+ const struct riscv_opcode *insn_mo; -+ -+ /* The encoded instruction bits. */ -+ insn_t insn_opcode; -+ -+ /* The frag that contains the instruction. */ -+ struct frag *frag; -+ -+ /* The offset into FRAG of the first instruction byte. */ -+ long where; -+ -+ /* The relocs associated with the instruction, if any. */ -+ fixS *fixp; -+}; -+ -+bfd_boolean rv64 = TRUE; /* RV64 (true) or RV32 (false) */ -+#define LOAD_ADDRESS_INSN (rv64 ? "ld" : "lw") -+#define ADD32_INSN (rv64 ? "addiw" : "addi") -+ -+struct riscv_subset -+{ -+ const char* name; -+ int version_major; -+ int version_minor; -+ -+ struct riscv_subset* next; -+}; -+ -+static struct riscv_subset* riscv_subsets; -+ -+static int -+riscv_subset_supports(const char* feature) -+{ -+ struct riscv_subset* s; -+ bfd_boolean rv64_insn; -+ -+ if ((rv64_insn = !strncmp(feature, "64", 2)) || !strncmp(feature, "32", 2)) -+ { -+ if (rv64 != rv64_insn) -+ return 0; -+ feature += 2; -+ } -+ -+ for (s = riscv_subsets; s != NULL; s = s->next) -+ if (strcmp(s->name, feature) == 0) -+ /* FIXME: once we support version numbers: -+ return major == s->version_major && minor <= s->version_minor; */ -+ return 1; -+ -+ return 0; -+} -+ -+static void -+riscv_add_subset(const char* subset) -+{ -+ struct riscv_subset* s = xmalloc(sizeof(struct riscv_subset)); -+ s->name = xstrdup(subset); -+ s->version_major = 1; -+ s->version_minor = 0; -+ s->next = riscv_subsets; -+ riscv_subsets = s; -+} -+ -+static void -+riscv_set_arch(const char* arg) -+{ -+ /* Formally, ISA subset names begin with RV, RV32, or RV64, but we allow the -+ prefix to be omitted. We also allow all-lowercase names if version -+ numbers and eXtensions are omitted (i.e. only some combination of imafd -+ is supported in this case). -+ -+ FIXME: Version numbers are not supported yet. */ -+ const char* subsets = "IMAFD"; -+ const char* p; -+ -+ for (p = arg; *p; p++) -+ if (!ISLOWER(*p) || strchr(subsets, TOUPPER(*p)) == NULL) -+ break; -+ -+ if (!*p) -+ { -+ /* Legal all-lowercase name. */ -+ for (p = arg; *p; p++) -+ { -+ char subset[2] = {TOUPPER(*p), 0}; -+ riscv_add_subset(subset); -+ } -+ return; -+ } -+ -+ if (strncmp(arg, "RV32", 4) == 0) -+ { -+ rv64 = FALSE; -+ arg += 4; -+ } -+ else if (strncmp(arg, "RV64", 4) == 0) -+ { -+ rv64 = TRUE; -+ arg += 4; -+ } -+ else if (strncmp(arg, "RV", 2) == 0) -+ arg += 2; -+ -+ if (*arg && *arg != 'I') -+ as_fatal("`I' must be the first ISA subset name specified (got %c)", *arg); -+ -+ for (p = arg; *p; p++) -+ { -+ if (*p == 'X') -+ { -+ const char* q = p+1; -+ while (ISLOWER(*q)) -+ q++; -+ -+ char subset[q-p+1]; -+ memcpy(subset, p, q-p); -+ subset[q-p] = 0; -+ -+ riscv_add_subset(subset); -+ p = q-1; -+ } -+ else if (strchr(subsets, *p) != NULL) -+ { -+ char subset[2] = {*p, 0}; -+ riscv_add_subset(subset); -+ } -+ else -+ as_fatal("unsupported ISA subset %c", *p); -+ } -+} -+ -+/* This is the set of options which may be modified by the .set -+ pseudo-op. We use a struct so that .set push and .set pop are more -+ reliable. */ -+ -+struct riscv_set_options -+{ -+ /* Generate position-independent code. */ -+ int pic; -+ /* Generate RVC code. */ -+ int rvc; -+}; -+ -+static struct riscv_set_options riscv_opts = -+{ -+ 0, /* pic */ -+ 0, /* rvc */ -+}; -+ -+/* handle of the OPCODE hash table */ -+static struct hash_control *op_hash = NULL; -+ -+/* This array holds the chars that always start a comment. If the -+ pre-processor is disabled, these aren't very useful */ -+const char comment_chars[] = "#"; -+ -+/* This array holds the chars that only start a comment at the beginning of -+ a line. If the line seems to have the form '# 123 filename' -+ .line and .file directives will appear in the pre-processed output */ -+/* Note that input_file.c hand checks for '#' at the beginning of the -+ first line of the input file. This is because the compiler outputs -+ #NO_APP at the beginning of its output. */ -+/* Also note that C style comments are always supported. */ -+const char line_comment_chars[] = "#"; -+ -+/* This array holds machine specific line separator characters. */ -+const char line_separator_chars[] = ";"; -+ -+/* Chars that can be used to separate mant from exp in floating point nums */ -+const char EXP_CHARS[] = "eE"; -+ -+/* Chars that mean this number is a floating point constant */ -+/* As in 0f12.456 */ -+/* or 0d1.2345e12 */ -+const char FLT_CHARS[] = "rRsSfFdDxXpP"; -+ -+/* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be -+ changed in read.c . Ideally it shouldn't have to know about it at all, -+ but nothing is ideal around here. -+ */ -+ -+static char *insn_error; -+ -+#define RELAX_BRANCH_ENCODE(uncond, toofar) \ -+ ((relax_substateT) \ -+ (0xc0000000 \ -+ | ((toofar) ? 1 : 0) \ -+ | ((uncond) ? 2 : 0))) -+#define RELAX_BRANCH_P(i) (((i) & 0xf0000000) == 0xc0000000) -+#define RELAX_BRANCH_TOOFAR(i) (((i) & 1) != 0) -+#define RELAX_BRANCH_UNCOND(i) (((i) & 2) != 0) -+ -+/* Is the given value a sign-extended 32-bit value? */ -+#define IS_SEXT_32BIT_NUM(x) \ -+ (((x) &~ (offsetT) 0x7fffffff) == 0 \ -+ || (((x) &~ (offsetT) 0x7fffffff) == ~ (offsetT) 0x7fffffff)) -+ -+#define IS_SEXT_NBIT_NUM(x,n) \ -+ ({ int64_t __tmp = (x); \ -+ __tmp = (__tmp << (64-(n))) >> (64-(n)); \ -+ __tmp == (x); }) -+ -+/* Is the given value a zero-extended 32-bit value? Or a negated one? */ -+#define IS_ZEXT_32BIT_NUM(x) \ -+ (((x) &~ (offsetT) 0xffffffff) == 0 \ -+ || (((x) &~ (offsetT) 0xffffffff) == ~ (offsetT) 0xffffffff)) -+ -+/* Replace bits MASK << SHIFT of STRUCT with the equivalent bits in -+ VALUE << SHIFT. VALUE is evaluated exactly once. */ -+#define INSERT_BITS(STRUCT, VALUE, MASK, SHIFT) \ -+ (STRUCT) = (((STRUCT) & ~((insn_t)(MASK) << (SHIFT))) \ -+ | ((insn_t)((VALUE) & (MASK)) << (SHIFT))) -+ -+/* Extract bits MASK << SHIFT from STRUCT and shift them right -+ SHIFT places. */ -+#define EXTRACT_BITS(STRUCT, MASK, SHIFT) \ -+ (((STRUCT) >> (SHIFT)) & (MASK)) -+ -+/* Change INSN's opcode so that the operand given by FIELD has value VALUE. -+ INSN is a riscv_cl_insn structure and VALUE is evaluated exactly once. */ -+#define INSERT_OPERAND(FIELD, INSN, VALUE) \ -+ INSERT_BITS ((INSN).insn_opcode, VALUE, OP_MASK_##FIELD, OP_SH_##FIELD) -+ -+/* Extract the operand given by FIELD from riscv_cl_insn INSN. */ -+#define EXTRACT_OPERAND(FIELD, INSN) \ -+ EXTRACT_BITS ((INSN).insn_opcode, OP_MASK_##FIELD, OP_SH_##FIELD) -+ -+/* Determine if an instruction matches an opcode. */ -+#define OPCODE_MATCHES(OPCODE, OP) \ -+ (((OPCODE) & MASK_##OP) == MATCH_##OP) -+ -+#define INSN_MATCHES(INSN, OP) \ -+ (((INSN).insn_opcode & MASK_##OP) == MATCH_##OP) -+ -+/* Prototypes for static functions. */ -+ -+#define internalError() \ -+ as_fatal (_("internal Error, line %d, %s"), __LINE__, __FILE__) -+ -+static char *expr_end; -+ -+/* Expressions which appear in instructions. These are set by -+ riscv_ip. */ -+ -+static expressionS imm_expr; -+static expressionS offset_expr; -+ -+/* Relocs associated with imm_expr and offset_expr. */ -+ -+static bfd_reloc_code_real_type imm_reloc = BFD_RELOC_UNUSED; -+static bfd_reloc_code_real_type offset_reloc = BFD_RELOC_UNUSED; -+ -+/* The default target format to use. */ -+ -+const char * -+riscv_target_format (void) -+{ -+ return rv64 ? "elf64-littleriscv" : "elf32-littleriscv"; -+} -+ -+/* Return the length of instruction INSN. */ -+ -+static inline unsigned int -+insn_length (const struct riscv_cl_insn *insn) -+{ -+ return riscv_insn_length (insn->insn_opcode); -+} -+ -+/* Initialise INSN from opcode entry MO. Leave its position unspecified. */ -+ -+static void -+create_insn (struct riscv_cl_insn *insn, const struct riscv_opcode *mo) -+{ -+ insn->insn_mo = mo; -+ insn->insn_opcode = mo->match; -+ insn->frag = NULL; -+ insn->where = 0; -+ insn->fixp = NULL; -+} -+ -+/* Install INSN at the location specified by its "frag" and "where" fields. */ -+ -+static void -+install_insn (const struct riscv_cl_insn *insn) -+{ -+ char *f = insn->frag->fr_literal + insn->where; -+ md_number_to_chars (f, insn->insn_opcode, insn_length(insn)); -+} -+ -+/* Move INSN to offset WHERE in FRAG. Adjust the fixups accordingly -+ and install the opcode in the new location. */ -+ -+static void -+move_insn (struct riscv_cl_insn *insn, fragS *frag, long where) -+{ -+ insn->frag = frag; -+ insn->where = where; -+ if (insn->fixp != NULL) -+ { -+ insn->fixp->fx_frag = frag; -+ insn->fixp->fx_where = where; -+ } -+ install_insn (insn); -+} -+ -+/* Add INSN to the end of the output. */ -+ -+static void -+add_fixed_insn (struct riscv_cl_insn *insn) -+{ -+ char *f = frag_more (insn_length (insn)); -+ move_insn (insn, frag_now, f - frag_now->fr_literal); -+} -+ -+static void -+add_relaxed_insn (struct riscv_cl_insn *insn, int max_chars, int var, -+ relax_substateT subtype, symbolS *symbol, offsetT offset) -+{ -+ frag_grow (max_chars); -+ move_insn (insn, frag_now, frag_more (0) - frag_now->fr_literal); -+ frag_var (rs_machine_dependent, max_chars, var, -+ subtype, symbol, offset, NULL); -+} -+ -+/* Compute the length of a branch sequence, and adjust the -+ RELAX_BRANCH_TOOFAR bit accordingly. If FRAGP is NULL, the -+ worst-case length is computed. */ -+static int -+relaxed_branch_length (fragS *fragp, asection *sec, int update) -+{ -+ bfd_boolean toofar = TRUE; -+ -+ if (fragp) -+ { -+ bfd_boolean uncond = RELAX_BRANCH_UNCOND (fragp->fr_subtype); -+ -+ if (S_IS_DEFINED (fragp->fr_symbol) -+ && sec == S_GET_SEGMENT (fragp->fr_symbol)) -+ { -+ offsetT val = S_GET_VALUE (fragp->fr_symbol) + fragp->fr_offset; -+ bfd_vma range; -+ val -= fragp->fr_address + fragp->fr_fix; -+ -+ if (uncond) -+ range = RISCV_JUMP_REACH; -+ else -+ range = RISCV_BRANCH_REACH; -+ toofar = (bfd_vma)(val + range/2) >= range; -+ } -+ -+ if (update && toofar != RELAX_BRANCH_TOOFAR (fragp->fr_subtype)) -+ fragp->fr_subtype = RELAX_BRANCH_ENCODE (uncond, toofar); -+ } -+ -+ return toofar ? 8 : 4; -+} -+ -+struct regname { -+ const char *name; -+ unsigned int num; -+}; -+ -+enum reg_class { -+ RCLASS_GPR, -+ RCLASS_FPR, -+ RCLASS_CSR, -+ RCLASS_VEC_GPR, -+ RCLASS_VEC_FPR, -+ RCLASS_MAX -+}; -+ -+static struct hash_control *reg_names_hash = NULL; -+ -+#define ENCODE_REG_HASH(cls, n) (void*)(uintptr_t)((n)*RCLASS_MAX + (cls) + 1) -+#define DECODE_REG_CLASS(hash) (((uintptr_t)(hash) - 1) % RCLASS_MAX) -+#define DECODE_REG_NUM(hash) (((uintptr_t)(hash) - 1) / RCLASS_MAX) -+ -+static void -+hash_reg_name (enum reg_class class, const char *name, unsigned n) -+{ -+ void *hash = ENCODE_REG_HASH (class, n); -+ const char *retval = hash_insert (reg_names_hash, name, hash); -+ if (retval != NULL) -+ as_fatal (_("internal error: can't hash `%s': %s"), name, retval); -+} -+ -+static void -+hash_reg_names (enum reg_class class, const char * const names[], unsigned n) -+{ -+ unsigned i; -+ for (i = 0; i < n; i++) -+ hash_reg_name (class, names[i], i); -+} -+ -+static unsigned int -+reg_lookup_internal (const char *s, enum reg_class class) -+{ -+ struct regname *r = (struct regname *) hash_find (reg_names_hash, s); -+ if (r == NULL || DECODE_REG_CLASS (r) != class) -+ return -1; -+ return DECODE_REG_NUM (r); -+} -+ -+static int -+reg_lookup (char **s, enum reg_class class, unsigned int *regnop) -+{ -+ char *e; -+ char save_c; -+ int reg = -1; -+ -+ /* Find end of name. */ -+ e = *s; -+ if (is_name_beginner (*e)) -+ ++e; -+ while (is_part_of_name (*e)) -+ ++e; -+ -+ /* Terminate name. */ -+ save_c = *e; -+ *e = '\0'; -+ -+ /* Look for the register. Advance to next token if one was recognized. */ -+ if ((reg = reg_lookup_internal (*s, class)) >= 0) -+ *s = e; -+ -+ *e = save_c; -+ if (regnop) -+ *regnop = reg; -+ return reg >= 0; -+} -+ -+static int -+arg_lookup(char **s, const char* const* array, size_t size, unsigned *regnop) -+{ -+ const char *p = strchr(*s, ','); -+ size_t i, len = p ? (size_t)(p - *s) : strlen(*s); -+ -+ for (i = 0; i < size; i++) -+ if (array[i] != NULL && strncmp(array[i], *s, len) == 0) -+ { -+ *regnop = i; -+ *s += len; -+ return 1; -+ } -+ -+ return 0; -+} -+ -+/* For consistency checking, verify that all bits are specified either -+ by the match/mask part of the instruction definition, or by the -+ operand list. */ -+static int -+validate_riscv_insn (const struct riscv_opcode *opc) -+{ -+ const char *p = opc->args; -+ char c; -+ insn_t required_bits, used_bits = opc->mask; -+ -+ if ((used_bits & opc->match) != opc->match) -+ { -+ as_bad (_("internal: bad RISC-V opcode (mask error): %s %s"), -+ opc->name, opc->args); -+ return 0; -+ } -+ required_bits = ((insn_t)1 << (8 * riscv_insn_length (opc->match))) - 1; -+ /* Work around for undefined behavior of uint64_t << 64 */ -+ if(riscv_insn_length (opc->match) == 8) -+ required_bits = 0xffffffffffffffff; -+ -+#define USE_BITS(mask,shift) (used_bits |= ((insn_t)(mask) << (shift))) -+ while (*p) -+ switch (c = *p++) -+ { -+ /* Xcustom */ -+ case '^': -+ switch (c = *p++) -+ { -+ case 'd': USE_BITS (OP_MASK_RD, OP_SH_RD); break; -+ case 's': USE_BITS (OP_MASK_RS1, OP_SH_RS1); break; -+ case 't': USE_BITS (OP_MASK_RS2, OP_SH_RS2); break; -+ case 'j': USE_BITS (OP_MASK_CUSTOM_IMM, OP_SH_CUSTOM_IMM); break; -+ } -+ break; -+ /* Xhwacha */ -+ case '#': -+ switch (c = *p++) -+ { -+ case 'g': USE_BITS (OP_MASK_IMMNGPR, OP_SH_IMMNGPR); break; -+ case 'f': USE_BITS (OP_MASK_IMMNFPR, OP_SH_IMMNFPR); break; -+ case 'n': USE_BITS (OP_MASK_IMMSEGNELM, OP_SH_IMMSEGNELM); break; -+ case 'd': USE_BITS (OP_MASK_VRD, OP_SH_VRD); break; -+ case 's': USE_BITS (OP_MASK_VRS, OP_SH_VRS); break; -+ case 't': USE_BITS (OP_MASK_VRT, OP_SH_VRT); break; -+ case 'r': USE_BITS (OP_MASK_VRR, OP_SH_VRR); break; -+ case 'D': USE_BITS (OP_MASK_VFD, OP_SH_VFD); break; -+ case 'S': USE_BITS (OP_MASK_VFS, OP_SH_VFS); break; -+ case 'T': USE_BITS (OP_MASK_VFT, OP_SH_VFT); break; -+ case 'R': USE_BITS (OP_MASK_VFR, OP_SH_VFR); break; -+ -+ default: -+ as_bad (_("internal: bad RISC-V opcode (unknown extension operand type `#%c'): %s %s"), -+ c, opc->name, opc->args); -+ return 0; -+ } -+ break; -+ case ',': break; -+ case '(': break; -+ case ')': break; -+ case '<': USE_BITS (OP_MASK_SHAMTW, OP_SH_SHAMTW); break; -+ case '>': USE_BITS (OP_MASK_SHAMT, OP_SH_SHAMT); break; -+ case 'A': break; -+ case 'D': USE_BITS (OP_MASK_RD, OP_SH_RD); break; -+ case 'Z': USE_BITS (OP_MASK_RS1, OP_SH_RS1); break; -+ case 'E': USE_BITS (OP_MASK_CSR, OP_SH_CSR); break; -+ case 'I': break; -+ case 'R': USE_BITS (OP_MASK_RS3, OP_SH_RS3); break; -+ case 'S': USE_BITS (OP_MASK_RS1, OP_SH_RS1); break; -+ case 'U': USE_BITS (OP_MASK_RS1, OP_SH_RS1); /* fallthru */ -+ case 'T': USE_BITS (OP_MASK_RS2, OP_SH_RS2); break; -+ case 'd': USE_BITS (OP_MASK_RD, OP_SH_RD); break; -+ case 'm': USE_BITS (OP_MASK_RM, OP_SH_RM); break; -+ case 's': USE_BITS (OP_MASK_RS1, OP_SH_RS1); break; -+ case 't': USE_BITS (OP_MASK_RS2, OP_SH_RS2); break; -+ case 'P': USE_BITS (OP_MASK_PRED, OP_SH_PRED); break; -+ case 'Q': USE_BITS (OP_MASK_SUCC, OP_SH_SUCC); break; -+ case 'o': -+ case 'j': used_bits |= ENCODE_ITYPE_IMM(-1U); break; -+ case 'a': used_bits |= ENCODE_UJTYPE_IMM(-1U); break; -+ case 'p': used_bits |= ENCODE_SBTYPE_IMM(-1U); break; -+ case 'q': used_bits |= ENCODE_STYPE_IMM(-1U); break; -+ case 'u': used_bits |= ENCODE_UTYPE_IMM(-1U); break; -+ case '[': break; -+ case ']': break; -+ case '0': break; -+ default: -+ as_bad (_("internal: bad RISC-V opcode (unknown operand type `%c'): %s %s"), -+ c, opc->name, opc->args); -+ return 0; -+ } -+#undef USE_BITS -+ if (used_bits != required_bits) -+ { -+ as_bad (_("internal: bad RISC-V opcode (bits 0x%lx undefined): %s %s"), -+ ~(long)(used_bits & required_bits), opc->name, opc->args); -+ return 0; -+ } -+ return 1; -+} -+ -+struct percent_op_match -+{ -+ const char *str; -+ bfd_reloc_code_real_type reloc; -+}; -+ -+/* This function is called once, at assembler startup time. It should set up -+ all the tables, etc. that the MD part of the assembler will need. */ -+ -+void -+md_begin (void) -+{ -+ const char *retval = NULL; -+ int i = 0; -+ -+ if (! bfd_set_arch_mach (stdoutput, bfd_arch_riscv, 0)) -+ as_warn (_("Could not set architecture and machine")); -+ -+ op_hash = hash_new (); -+ -+ for (i = 0; i < NUMOPCODES;) -+ { -+ const char *name = riscv_opcodes[i].name; -+ -+ if (riscv_subset_supports(riscv_opcodes[i].subset)) -+ retval = hash_insert (op_hash, name, (void *) &riscv_opcodes[i]); -+ -+ if (retval != NULL) -+ { -+ fprintf (stderr, _("internal error: can't hash `%s': %s\n"), -+ riscv_opcodes[i].name, retval); -+ /* Probably a memory allocation problem? Give up now. */ -+ as_fatal (_("Broken assembler. No assembly attempted.")); -+ } -+ do -+ { -+ if (riscv_opcodes[i].pinfo != INSN_MACRO) -+ { -+ if (!validate_riscv_insn (&riscv_opcodes[i])) -+ as_fatal (_("Broken assembler. No assembly attempted.")); -+ } -+ ++i; -+ } -+ while ((i < NUMOPCODES) && !strcmp (riscv_opcodes[i].name, name)); -+ } -+ -+ reg_names_hash = hash_new (); -+ hash_reg_names (RCLASS_GPR, riscv_gpr_names_numeric, NGPR); -+ hash_reg_names (RCLASS_GPR, riscv_gpr_names_abi, NGPR); -+ hash_reg_names (RCLASS_FPR, riscv_fpr_names_numeric, NFPR); -+ hash_reg_names (RCLASS_FPR, riscv_fpr_names_abi, NFPR); -+ hash_reg_names (RCLASS_VEC_GPR, riscv_vec_gpr_names, NVGPR); -+ hash_reg_names (RCLASS_VEC_FPR, riscv_vec_fpr_names, NVFPR); -+ -+#define DECLARE_CSR(name, num) hash_reg_name (RCLASS_CSR, #name, num); -+#include "opcode/riscv-opc.h" -+#undef DECLARE_CSR -+ -+ /* set the default alignment for the text section (2**2) */ -+ record_alignment (text_section, 2); -+} -+ -+/* Output an instruction. IP is the instruction information. -+ ADDRESS_EXPR is an operand of the instruction to be used with -+ RELOC_TYPE. */ -+ -+static void -+append_insn (struct riscv_cl_insn *ip, expressionS *address_expr, -+ bfd_reloc_code_real_type reloc_type) -+{ -+#ifdef OBJ_ELF -+ dwarf2_emit_insn (0); -+#endif -+ -+ gas_assert(reloc_type <= BFD_RELOC_UNUSED); -+ -+ if (address_expr != NULL) -+ { -+ if (address_expr->X_op == O_constant) -+ { -+ switch (reloc_type) -+ { -+ case BFD_RELOC_32: -+ ip->insn_opcode |= address_expr->X_add_number; -+ break; -+ -+ case BFD_RELOC_RISCV_HI20: -+ ip->insn_opcode |= ENCODE_UTYPE_IMM ( -+ RISCV_CONST_HIGH_PART (address_expr->X_add_number)); -+ break; -+ -+ case BFD_RELOC_RISCV_LO12_S: -+ ip->insn_opcode |= ENCODE_STYPE_IMM (address_expr->X_add_number); -+ break; -+ -+ case BFD_RELOC_UNUSED: -+ case BFD_RELOC_RISCV_LO12_I: -+ ip->insn_opcode |= ENCODE_ITYPE_IMM (address_expr->X_add_number); -+ break; -+ -+ default: -+ internalError (); -+ } -+ reloc_type = BFD_RELOC_UNUSED; -+ } -+ else if (reloc_type == BFD_RELOC_12_PCREL) -+ { -+ add_relaxed_insn (ip, relaxed_branch_length (NULL, NULL, 0), 4, -+ RELAX_BRANCH_ENCODE (0, 0), -+ address_expr->X_add_symbol, -+ address_expr->X_add_number); -+ return; -+ } -+ else if (reloc_type < BFD_RELOC_UNUSED) -+ { -+ reloc_howto_type *howto; -+ -+ howto = bfd_reloc_type_lookup (stdoutput, reloc_type); -+ if (howto == NULL) -+ as_bad (_("Unsupported RISC-V relocation number %d"), reloc_type); -+ -+ ip->fixp = fix_new_exp (ip->frag, ip->where, -+ bfd_get_reloc_size (howto), -+ address_expr, -+ reloc_type == BFD_RELOC_12_PCREL || -+ reloc_type == BFD_RELOC_RISCV_CALL || -+ reloc_type == BFD_RELOC_RISCV_JMP, -+ reloc_type); -+ -+ /* These relocations can have an addend that won't fit in -+ 4 octets for 64bit assembly. */ -+ if (rv64 -+ && ! howto->partial_inplace -+ && (reloc_type == BFD_RELOC_32 -+ || reloc_type == BFD_RELOC_64 -+ || reloc_type == BFD_RELOC_CTOR -+ || reloc_type == BFD_RELOC_RISCV_HI20 -+ || reloc_type == BFD_RELOC_RISCV_LO12_I -+ || reloc_type == BFD_RELOC_RISCV_LO12_S)) -+ ip->fixp->fx_no_overflow = 1; -+ } -+ } -+ -+ add_fixed_insn (ip); -+ -+ install_insn (ip); -+} -+ -+/* Build an instruction created by a macro expansion. This is passed -+ a pointer to the count of instructions created so far, an -+ expression, the name of the instruction to build, an operand format -+ string, and corresponding arguments. */ -+ -+static void -+macro_build (expressionS *ep, const char *name, const char *fmt, ...) -+{ -+ const struct riscv_opcode *mo; -+ struct riscv_cl_insn insn; -+ bfd_reloc_code_real_type r; -+ va_list args; -+ -+ va_start (args, fmt); -+ -+ r = BFD_RELOC_UNUSED; -+ mo = (struct riscv_opcode *) hash_find (op_hash, name); -+ gas_assert (mo); -+ gas_assert (strcmp (name, mo->name) == 0); -+ -+ create_insn (&insn, mo); -+ for (;;) -+ { -+ switch (*fmt++) -+ { -+ case 'd': -+ INSERT_OPERAND (RD, insn, va_arg (args, int)); -+ continue; -+ -+ case 's': -+ INSERT_OPERAND (RS1, insn, va_arg (args, int)); -+ continue; -+ -+ case 't': -+ INSERT_OPERAND (RS2, insn, va_arg (args, int)); -+ continue; -+ -+ case '>': -+ INSERT_OPERAND (SHAMT, insn, va_arg (args, int)); -+ continue; -+ -+ case 'j': -+ case 'u': -+ case 'q': -+ gas_assert (ep != NULL); -+ r = va_arg (args, int); -+ continue; -+ -+ case '\0': -+ break; -+ case ',': -+ continue; -+ default: -+ internalError (); -+ } -+ break; -+ } -+ va_end (args); -+ gas_assert (r == BFD_RELOC_UNUSED ? ep == NULL : ep != NULL); -+ -+ append_insn (&insn, ep, r); -+} -+ -+/* -+ * Sign-extend 32-bit mode constants that have bit 31 set and all -+ * higher bits unset. -+ */ -+static void -+normalize_constant_expr (expressionS *ex) -+{ -+ if (rv64) -+ return; -+ if ((ex->X_op == O_constant || ex->X_op == O_symbol) -+ && IS_ZEXT_32BIT_NUM (ex->X_add_number)) -+ ex->X_add_number = (((ex->X_add_number & 0xffffffff) ^ 0x80000000) -+ - 0x80000000); -+} -+ -+static symbolS * -+make_internal_label (void) -+{ -+ return (symbolS *) local_symbol_make (FAKE_LABEL_NAME, now_seg, -+ (valueT) frag_now_fix(), frag_now); -+} -+ -+/* Load an entry from the GOT. */ -+static void -+pcrel_access (int destreg, int tempreg, expressionS *ep, -+ const char* lo_insn, const char* lo_pattern, -+ bfd_reloc_code_real_type hi_reloc, -+ bfd_reloc_code_real_type lo_reloc) -+{ -+ expressionS ep2; -+ ep2.X_op = O_symbol; -+ ep2.X_add_symbol = make_internal_label (); -+ ep2.X_add_number = 0; -+ -+ macro_build (ep, "auipc", "d,u", tempreg, hi_reloc); -+ macro_build (&ep2, lo_insn, lo_pattern, destreg, tempreg, lo_reloc); -+} -+ -+static void -+pcrel_load (int destreg, int tempreg, expressionS *ep, const char* lo_insn, -+ bfd_reloc_code_real_type hi_reloc, -+ bfd_reloc_code_real_type lo_reloc) -+{ -+ pcrel_access (destreg, tempreg, ep, lo_insn, "d,s,j", hi_reloc, lo_reloc); -+} -+ -+static void -+pcrel_store (int srcreg, int tempreg, expressionS *ep, const char* lo_insn, -+ bfd_reloc_code_real_type hi_reloc, -+ bfd_reloc_code_real_type lo_reloc) -+{ -+ pcrel_access (srcreg, tempreg, ep, lo_insn, "t,s,q", hi_reloc, lo_reloc); -+} -+ -+/* PC-relative function call using AUIPC/JALR, relaxed to JAL. */ -+static void -+riscv_call (int destreg, int tempreg, expressionS *ep, -+ bfd_reloc_code_real_type reloc) -+{ -+ macro_build (ep, "auipc", "d,u", tempreg, reloc); -+ macro_build (NULL, "jalr", "d,s", destreg, tempreg); -+} -+ -+/* Warn if an expression is not a constant. */ -+ -+static void -+check_absolute_expr (struct riscv_cl_insn *ip, expressionS *ex) -+{ -+ if (ex->X_op == O_big) -+ as_bad (_("unsupported large constant")); -+ else if (ex->X_op != O_constant) -+ as_bad (_("Instruction %s requires absolute expression"), -+ ip->insn_mo->name); -+ normalize_constant_expr (ex); -+} -+ -+/* Load an integer constant into a register. */ -+ -+static void -+load_const (int reg, expressionS *ep) -+{ -+ int shift = RISCV_IMM_BITS; -+ expressionS upper = *ep, lower = *ep; -+ lower.X_add_number = (int32_t) ep->X_add_number << (32-shift) >> (32-shift); -+ upper.X_add_number -= lower.X_add_number; -+ -+ gas_assert (ep->X_op == O_constant); -+ -+ if (rv64 && !IS_SEXT_32BIT_NUM(ep->X_add_number)) -+ { -+ /* Reduce to a signed 32-bit constant using SLLI and ADDI, which -+ is not optimal but also not so bad. */ -+ while (((upper.X_add_number >> shift) & 1) == 0) -+ shift++; -+ -+ upper.X_add_number = (int64_t) upper.X_add_number >> shift; -+ load_const(reg, &upper); -+ -+ macro_build (NULL, "slli", "d,s,>", reg, reg, shift); -+ if (lower.X_add_number != 0) -+ macro_build (&lower, "addi", "d,s,j", reg, reg, BFD_RELOC_RISCV_LO12_I); -+ } -+ else -+ { -+ int hi_reg = 0; -+ -+ if (upper.X_add_number != 0) -+ { -+ macro_build (ep, "lui", "d,u", reg, BFD_RELOC_RISCV_HI20); -+ hi_reg = reg; -+ } -+ -+ if (lower.X_add_number != 0 || hi_reg == 0) -+ macro_build (ep, ADD32_INSN, "d,s,j", reg, hi_reg, -+ BFD_RELOC_RISCV_LO12_I); -+ } -+} -+ -+/* Expand RISC-V assembly macros into one or more instructions. */ -+static void -+macro (struct riscv_cl_insn *ip) -+{ -+ int rd = (ip->insn_opcode >> OP_SH_RD) & OP_MASK_RD; -+ int rs1 = (ip->insn_opcode >> OP_SH_RS1) & OP_MASK_RS1; -+ int rs2 = (ip->insn_opcode >> OP_SH_RS2) & OP_MASK_RS2; -+ int mask = ip->insn_mo->mask; -+ -+ switch (mask) -+ { -+ case M_LI: -+ load_const (rd, &imm_expr); -+ break; -+ -+ case M_LA: -+ case M_LLA: -+ /* Load the address of a symbol into a register. */ -+ if (!IS_SEXT_32BIT_NUM (offset_expr.X_add_number)) -+ as_bad(_("offset too large")); -+ -+ if (offset_expr.X_op == O_constant) -+ load_const (rd, &offset_expr); -+ else if (riscv_opts.pic && mask == M_LA) /* Global PIC symbol */ -+ pcrel_load (rd, rd, &offset_expr, LOAD_ADDRESS_INSN, -+ BFD_RELOC_RISCV_GOT_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ else /* Local PIC symbol, or any non-PIC symbol */ -+ pcrel_load (rd, rd, &offset_expr, "addi", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LA_TLS_GD: -+ pcrel_load (rd, rd, &offset_expr, "addi", -+ BFD_RELOC_RISCV_TLS_GD_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LA_TLS_IE: -+ pcrel_load (rd, rd, &offset_expr, LOAD_ADDRESS_INSN, -+ BFD_RELOC_RISCV_TLS_GOT_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LB: -+ pcrel_load (rd, rd, &offset_expr, "lb", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LBU: -+ pcrel_load (rd, rd, &offset_expr, "lbu", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LH: -+ pcrel_load (rd, rd, &offset_expr, "lh", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LHU: -+ pcrel_load (rd, rd, &offset_expr, "lhu", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LW: -+ pcrel_load (rd, rd, &offset_expr, "lw", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LWU: -+ pcrel_load (rd, rd, &offset_expr, "lwu", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_LD: -+ pcrel_load (rd, rd, &offset_expr, "ld", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_FLW: -+ pcrel_load (rd, rs1, &offset_expr, "flw", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_FLD: -+ pcrel_load (rd, rs1, &offset_expr, "fld", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_I); -+ break; -+ -+ case M_SB: -+ pcrel_store (rs2, rs1, &offset_expr, "sb", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_SH: -+ pcrel_store (rs2, rs1, &offset_expr, "sh", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_SW: -+ pcrel_store (rs2, rs1, &offset_expr, "sw", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_SD: -+ pcrel_store (rs2, rs1, &offset_expr, "sd", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_FSW: -+ pcrel_store (rs2, rs1, &offset_expr, "fsw", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_FSD: -+ pcrel_store (rs2, rs1, &offset_expr, "fsd", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_VF: -+ pcrel_access (0, rs1, &offset_expr, "vf", "s,s,q", -+ BFD_RELOC_RISCV_PCREL_HI20, BFD_RELOC_RISCV_PCREL_LO12_S); -+ break; -+ -+ case M_CALL: -+ riscv_call (rd, rs1, &offset_expr, offset_reloc); -+ break; -+ -+ default: -+ as_bad (_("Macro %s not implemented"), ip->insn_mo->name); -+ break; -+ } -+} -+ -+static const struct percent_op_match percent_op_utype[] = -+{ -+ {"%tprel_hi", BFD_RELOC_RISCV_TPREL_HI20}, -+ {"%pcrel_hi", BFD_RELOC_RISCV_PCREL_HI20}, -+ {"%tls_ie_pcrel_hi", BFD_RELOC_RISCV_TLS_GOT_HI20}, -+ {"%tls_gd_pcrel_hi", BFD_RELOC_RISCV_TLS_GD_HI20}, -+ {"%hi", BFD_RELOC_RISCV_HI20}, -+ {0, 0} -+}; -+ -+static const struct percent_op_match percent_op_itype[] = -+{ -+ {"%lo", BFD_RELOC_RISCV_LO12_I}, -+ {"%tprel_lo", BFD_RELOC_RISCV_TPREL_LO12_I}, -+ {"%pcrel_lo", BFD_RELOC_RISCV_PCREL_LO12_I}, -+ {0, 0} -+}; -+ -+static const struct percent_op_match percent_op_stype[] = -+{ -+ {"%lo", BFD_RELOC_RISCV_LO12_S}, -+ {"%tprel_lo", BFD_RELOC_RISCV_TPREL_LO12_S}, -+ {"%pcrel_lo", BFD_RELOC_RISCV_PCREL_LO12_S}, -+ {0, 0} -+}; -+ -+static const struct percent_op_match percent_op_rtype[] = -+{ -+ {"%tprel_add", BFD_RELOC_RISCV_TPREL_ADD}, -+ {0, 0} -+}; -+ -+/* Return true if *STR points to a relocation operator. When returning true, -+ move *STR over the operator and store its relocation code in *RELOC. -+ Leave both *STR and *RELOC alone when returning false. */ -+ -+static bfd_boolean -+parse_relocation (char **str, bfd_reloc_code_real_type *reloc, -+ const struct percent_op_match *percent_op) -+{ -+ for ( ; percent_op->str; percent_op++) -+ if (strncasecmp (*str, percent_op->str, strlen (percent_op->str)) == 0) -+ { -+ int len = strlen (percent_op->str); -+ -+ if (!ISSPACE ((*str)[len]) && (*str)[len] != '(') -+ continue; -+ -+ *str += strlen (percent_op->str); -+ *reloc = percent_op->reloc; -+ -+ /* Check whether the output BFD supports this relocation. -+ If not, issue an error and fall back on something safe. */ -+ if (!bfd_reloc_type_lookup (stdoutput, percent_op->reloc)) -+ { -+ as_bad ("relocation %s isn't supported by the current ABI", -+ percent_op->str); -+ *reloc = BFD_RELOC_UNUSED; -+ } -+ return TRUE; -+ } -+ return FALSE; -+} -+ -+static void -+my_getExpression (expressionS *ep, char *str) -+{ -+ char *save_in; -+ -+ save_in = input_line_pointer; -+ input_line_pointer = str; -+ expression (ep); -+ expr_end = input_line_pointer; -+ input_line_pointer = save_in; -+} -+ -+/* Parse string STR as a 16-bit relocatable operand. Store the -+ expression in *EP and the relocation, if any, in RELOC. -+ Return the number of relocation operators used (0 or 1). -+ -+ On exit, EXPR_END points to the first character after the expression. */ -+ -+static size_t -+my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, -+ char *str, const struct percent_op_match *percent_op) -+{ -+ size_t reloc_index; -+ int crux_depth, str_depth; -+ char *crux; -+ -+ /* Search for the start of the main expression. -+ End the loop with CRUX pointing to the start -+ of the main expression and with CRUX_DEPTH containing the number -+ of open brackets at that point. */ -+ reloc_index = -1; -+ str_depth = 0; -+ do -+ { -+ reloc_index++; -+ crux = str; -+ crux_depth = str_depth; -+ -+ /* Skip over whitespace and brackets, keeping count of the number -+ of brackets. */ -+ while (*str == ' ' || *str == '\t' || *str == '(') -+ if (*str++ == '(') -+ str_depth++; -+ } -+ while (*str == '%' -+ && reloc_index < 1 -+ && parse_relocation (&str, reloc, percent_op)); -+ -+ my_getExpression (ep, crux); -+ str = expr_end; -+ -+ /* Match every open bracket. */ -+ while (crux_depth > 0 && (*str == ')' || *str == ' ' || *str == '\t')) -+ if (*str++ == ')') -+ crux_depth--; -+ -+ if (crux_depth > 0) -+ as_bad ("unclosed '('"); -+ -+ expr_end = str; -+ -+ return reloc_index; -+} -+ -+/* This routine assembles an instruction into its binary format. As a -+ side effect, it sets one of the global variables imm_reloc or -+ offset_reloc to the type of relocation to do if one of the operands -+ is an address expression. */ -+ -+static void -+riscv_ip (char *str, struct riscv_cl_insn *ip) -+{ -+ char *s; -+ const char *args; -+ char c = 0; -+ struct riscv_opcode *insn; -+ char *argsStart; -+ unsigned int regno; -+ char save_c = 0; -+ int argnum; -+ const struct percent_op_match *p; -+ -+ insn_error = NULL; -+ -+ /* If the instruction contains a '.', we first try to match an instruction -+ including the '.'. Then we try again without the '.'. */ -+ insn = NULL; -+ for (s = str; *s != '\0' && !ISSPACE (*s); ++s) -+ continue; -+ -+ /* If we stopped on whitespace, then replace the whitespace with null for -+ the call to hash_find. Save the character we replaced just in case we -+ have to re-parse the instruction. */ -+ if (ISSPACE (*s)) -+ { -+ save_c = *s; -+ *s++ = '\0'; -+ } -+ -+ insn = (struct riscv_opcode *) hash_find (op_hash, str); -+ -+ /* If we didn't find the instruction in the opcode table, try again, but -+ this time with just the instruction up to, but not including the -+ first '.'. */ -+ if (insn == NULL) -+ { -+ /* Restore the character we overwrite above (if any). */ -+ if (save_c) -+ *(--s) = save_c; -+ -+ /* Scan up to the first '.' or whitespace. */ -+ for (s = str; -+ *s != '\0' && *s != '.' && !ISSPACE (*s); -+ ++s) -+ continue; -+ -+ /* If we did not find a '.', then we can quit now. */ -+ if (*s != '.') -+ { -+ insn_error = "unrecognized opcode"; -+ return; -+ } -+ -+ /* Lookup the instruction in the hash table. */ -+ *s++ = '\0'; -+ if ((insn = (struct riscv_opcode *) hash_find (op_hash, str)) == NULL) -+ { -+ insn_error = "unrecognized opcode"; -+ return; -+ } -+ } -+ -+ argsStart = s; -+ for (;;) -+ { -+ bfd_boolean ok = TRUE; -+ gas_assert (strcmp (insn->name, str) == 0); -+ -+ create_insn (ip, insn); -+ insn_error = NULL; -+ argnum = 1; -+ for (args = insn->args;; ++args) -+ { -+ s += strspn (s, " \t"); -+ switch (*args) -+ { -+ case '\0': /* end of args */ -+ if (*s == '\0') -+ return; -+ break; -+ /* Xcustom */ -+ case '^': -+ { -+ unsigned long max = OP_MASK_RD; -+ my_getExpression (&imm_expr, s); -+ check_absolute_expr (ip, &imm_expr); -+ switch (*++args) -+ { -+ case 'j': -+ max = OP_MASK_CUSTOM_IMM; -+ INSERT_OPERAND (CUSTOM_IMM, *ip, imm_expr.X_add_number); -+ break; -+ case 'd': -+ INSERT_OPERAND (RD, *ip, imm_expr.X_add_number); -+ break; -+ case 's': -+ INSERT_OPERAND (RS1, *ip, imm_expr.X_add_number); -+ break; -+ case 't': -+ INSERT_OPERAND (RS2, *ip, imm_expr.X_add_number); -+ break; -+ } -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ if ((unsigned long) imm_expr.X_add_number > max) -+ as_warn ("Bad custom immediate (%lu), must be at most %lu", -+ (unsigned long)imm_expr.X_add_number, max); -+ continue; -+ } -+ -+ /* Xhwacha */ -+ case '#': -+ switch ( *++args ) -+ { -+ case 'g': -+ my_getExpression( &imm_expr, s ); -+ /* check_absolute_expr( ip, &imm_expr ); */ -+ if ((unsigned long) imm_expr.X_add_number > 32 ) -+ as_warn( _( "Improper ngpr amount (%lu)" ), -+ (unsigned long) imm_expr.X_add_number ); -+ INSERT_OPERAND( IMMNGPR, *ip, imm_expr.X_add_number ); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ continue; -+ case 'f': -+ my_getExpression( &imm_expr, s ); -+ /* check_absolute_expr( ip, &imm_expr ); */ -+ if ((unsigned long) imm_expr.X_add_number > 32 ) -+ as_warn( _( "Improper nfpr amount (%lu)" ), -+ (unsigned long) imm_expr.X_add_number ); -+ INSERT_OPERAND( IMMNFPR, *ip, imm_expr.X_add_number ); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ continue; -+ case 'n': -+ my_getExpression( &imm_expr, s ); -+ /* check_absolute_expr( ip, &imm_expr ); */ -+ if ((unsigned long) imm_expr.X_add_number > 8 ) -+ as_warn( _( "Improper nelm amount (%lu)" ), -+ (unsigned long) imm_expr.X_add_number ); -+ INSERT_OPERAND( IMMSEGNELM, *ip, imm_expr.X_add_number - 1 ); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ continue; -+ case 'd': -+ ok = reg_lookup( &s, RCLASS_VEC_GPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VRD, *ip, regno ); -+ continue; -+ case 's': -+ ok = reg_lookup( &s, RCLASS_VEC_GPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VRS, *ip, regno ); -+ continue; -+ case 't': -+ ok = reg_lookup( &s, RCLASS_VEC_GPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VRT, *ip, regno ); -+ continue; -+ case 'r': -+ ok = reg_lookup( &s, RCLASS_VEC_GPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VRR, *ip, regno ); -+ continue; -+ case 'D': -+ ok = reg_lookup( &s, RCLASS_VEC_FPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VFD, *ip, regno ); -+ continue; -+ case 'S': -+ ok = reg_lookup( &s, RCLASS_VEC_FPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VFS, *ip, regno ); -+ continue; -+ case 'T': -+ ok = reg_lookup( &s, RCLASS_VEC_FPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VFT, *ip, regno ); -+ continue; -+ case 'R': -+ ok = reg_lookup( &s, RCLASS_VEC_FPR, ®no ); -+ if ( !ok ) -+ as_bad( _( "Invalid vector register" ) ); -+ INSERT_OPERAND( VFR, *ip, regno ); -+ continue; -+ } -+ break; -+ -+ case ',': -+ ++argnum; -+ if (*s++ == *args) -+ continue; -+ s--; -+ break; -+ -+ case '(': -+ case ')': -+ case '[': -+ case ']': -+ if (*s++ == *args) -+ continue; -+ break; -+ -+ case '<': /* shift amount, 0 - 31 */ -+ my_getExpression (&imm_expr, s); -+ check_absolute_expr (ip, &imm_expr); -+ if ((unsigned long) imm_expr.X_add_number > 31) -+ as_warn (_("Improper shift amount (%lu)"), -+ (unsigned long) imm_expr.X_add_number); -+ INSERT_OPERAND (SHAMTW, *ip, imm_expr.X_add_number); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ continue; -+ -+ case '>': /* shift amount, 0 - (XLEN-1) */ -+ my_getExpression (&imm_expr, s); -+ check_absolute_expr (ip, &imm_expr); -+ if ((unsigned long) imm_expr.X_add_number > (rv64 ? 63 : 31)) -+ as_warn (_("Improper shift amount (%lu)"), -+ (unsigned long) imm_expr.X_add_number); -+ INSERT_OPERAND (SHAMT, *ip, imm_expr.X_add_number); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ continue; -+ -+ case 'Z': /* CSRRxI immediate */ -+ my_getExpression (&imm_expr, s); -+ check_absolute_expr (ip, &imm_expr); -+ if ((unsigned long) imm_expr.X_add_number > 31) -+ as_warn (_("Improper CSRxI immediate (%lu)"), -+ (unsigned long) imm_expr.X_add_number); -+ INSERT_OPERAND (RS1, *ip, imm_expr.X_add_number); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ continue; -+ -+ case 'E': /* Control register. */ -+ ok = reg_lookup (&s, RCLASS_CSR, ®no); -+ if (ok) -+ INSERT_OPERAND (CSR, *ip, regno); -+ else -+ { -+ my_getExpression (&imm_expr, s); -+ check_absolute_expr (ip, &imm_expr); -+ if ((unsigned long) imm_expr.X_add_number > 0xfff) -+ as_warn(_("Improper CSR address (%lu)"), -+ (unsigned long) imm_expr.X_add_number); -+ INSERT_OPERAND (CSR, *ip, imm_expr.X_add_number); -+ imm_expr.X_op = O_absent; -+ s = expr_end; -+ } -+ continue; -+ -+ case 'm': /* rounding mode */ -+ if (arg_lookup (&s, riscv_rm, ARRAY_SIZE(riscv_rm), ®no)) -+ { -+ INSERT_OPERAND (RM, *ip, regno); -+ continue; -+ } -+ break; -+ -+ case 'P': -+ case 'Q': /* fence predecessor/successor */ -+ if (arg_lookup (&s, riscv_pred_succ, ARRAY_SIZE(riscv_pred_succ), ®no)) -+ { -+ if (*args == 'P') -+ INSERT_OPERAND(PRED, *ip, regno); -+ else -+ INSERT_OPERAND(SUCC, *ip, regno); -+ continue; -+ } -+ break; -+ -+ case 'd': /* destination register */ -+ case 's': /* source register */ -+ case 't': /* target register */ -+ ok = reg_lookup (&s, RCLASS_GPR, ®no); -+ if (ok) -+ { -+ c = *args; -+ if (*s == ' ') -+ ++s; -+ -+ /* Now that we have assembled one operand, we use the args string -+ * to figure out where it goes in the instruction. */ -+ switch (c) -+ { -+ case 's': -+ INSERT_OPERAND (RS1, *ip, regno); -+ break; -+ case 'd': -+ INSERT_OPERAND (RD, *ip, regno); -+ break; -+ case 't': -+ INSERT_OPERAND (RS2, *ip, regno); -+ break; -+ } -+ continue; -+ } -+ break; -+ -+ case 'D': /* floating point rd */ -+ case 'S': /* floating point rs1 */ -+ case 'T': /* floating point rs2 */ -+ case 'U': /* floating point rs1 and rs2 */ -+ case 'R': /* floating point rs3 */ -+ if (reg_lookup (&s, RCLASS_FPR, ®no)) -+ { -+ c = *args; -+ if (*s == ' ') -+ ++s; -+ switch (c) -+ { -+ case 'D': -+ INSERT_OPERAND (RD, *ip, regno); -+ break; -+ case 'S': -+ INSERT_OPERAND (RS1, *ip, regno); -+ break; -+ case 'U': -+ INSERT_OPERAND (RS1, *ip, regno); -+ /* fallthru */ -+ case 'T': -+ INSERT_OPERAND (RS2, *ip, regno); -+ break; -+ case 'R': -+ INSERT_OPERAND (RS3, *ip, regno); -+ break; -+ } -+ continue; -+ } -+ -+ break; -+ -+ case 'I': -+ my_getExpression (&imm_expr, s); -+ if (imm_expr.X_op != O_big -+ && imm_expr.X_op != O_constant) -+ insn_error = _("absolute expression required"); -+ normalize_constant_expr (&imm_expr); -+ s = expr_end; -+ continue; -+ -+ case 'A': -+ my_getExpression (&offset_expr, s); -+ normalize_constant_expr (&offset_expr); -+ imm_reloc = BFD_RELOC_32; -+ s = expr_end; -+ continue; -+ -+ case 'j': /* sign-extended immediate */ -+ imm_reloc = BFD_RELOC_RISCV_LO12_I; -+ p = percent_op_itype; -+ goto alu_op; -+ case 'q': /* store displacement */ -+ p = percent_op_stype; -+ offset_reloc = BFD_RELOC_RISCV_LO12_S; -+ goto load_store; -+ case 'o': /* load displacement */ -+ p = percent_op_itype; -+ offset_reloc = BFD_RELOC_RISCV_LO12_I; -+ goto load_store; -+ case '0': /* AMO "displacement," which must be zero */ -+ p = percent_op_rtype; -+ offset_reloc = BFD_RELOC_UNUSED; -+load_store: -+ /* Check whether there is only a single bracketed expression -+ left. If so, it must be the base register and the -+ constant must be zero. */ -+ offset_expr.X_op = O_constant; -+ offset_expr.X_add_number = 0; -+ if (*s == '(' && strchr (s + 1, '(') == 0) -+ continue; -+alu_op: -+ /* If this value won't fit into a 16 bit offset, then go -+ find a macro that will generate the 32 bit offset -+ code pattern. */ -+ if (!my_getSmallExpression (&offset_expr, &offset_reloc, s, p)) -+ { -+ normalize_constant_expr (&offset_expr); -+ if (offset_expr.X_op != O_constant -+ || (*args == '0' && offset_expr.X_add_number != 0) -+ || offset_expr.X_add_number >= (signed)RISCV_IMM_REACH/2 -+ || offset_expr.X_add_number < -(signed)RISCV_IMM_REACH/2) -+ break; -+ } -+ -+ s = expr_end; -+ continue; -+ -+ case 'p': /* pc relative offset */ -+ offset_reloc = BFD_RELOC_12_PCREL; -+ my_getExpression (&offset_expr, s); -+ s = expr_end; -+ continue; -+ -+ case 'u': /* upper 20 bits */ -+ p = percent_op_utype; -+ if (!my_getSmallExpression (&imm_expr, &imm_reloc, s, p) -+ && imm_expr.X_op == O_constant) -+ { -+ if (imm_expr.X_add_number < 0 -+ || imm_expr.X_add_number >= (signed)RISCV_BIGIMM_REACH) -+ as_bad (_("lui expression not in range 0..1048575")); -+ -+ imm_reloc = BFD_RELOC_RISCV_HI20; -+ imm_expr.X_add_number <<= RISCV_IMM_BITS; -+ } -+ s = expr_end; -+ continue; -+ -+ case 'a': /* 26 bit address */ -+ my_getExpression (&offset_expr, s); -+ s = expr_end; -+ offset_reloc = BFD_RELOC_RISCV_JMP; -+ continue; -+ -+ case 'c': -+ my_getExpression (&offset_expr, s); -+ s = expr_end; -+ offset_reloc = BFD_RELOC_RISCV_CALL; -+ if (*s == '@') -+ offset_reloc = BFD_RELOC_RISCV_CALL_PLT, s++; -+ continue; -+ -+ default: -+ as_bad (_("bad char = '%c'\n"), *args); -+ internalError (); -+ } -+ break; -+ } -+ /* Args don't match. */ -+ if (insn + 1 < &riscv_opcodes[NUMOPCODES] && -+ !strcmp (insn->name, insn[1].name)) -+ { -+ ++insn; -+ s = argsStart; -+ insn_error = _("illegal operands"); -+ continue; -+ } -+ if (save_c) -+ *(--argsStart) = save_c; -+ insn_error = _("illegal operands"); -+ return; -+ } -+} -+ -+void -+md_assemble (char *str) -+{ -+ struct riscv_cl_insn insn; -+ -+ imm_expr.X_op = O_absent; -+ offset_expr.X_op = O_absent; -+ imm_reloc = BFD_RELOC_UNUSED; -+ offset_reloc = BFD_RELOC_UNUSED; -+ -+ riscv_ip (str, &insn); -+ -+ if (insn_error) -+ { -+ as_bad ("%s `%s'", insn_error, str); -+ return; -+ } -+ -+ if (insn.insn_mo->pinfo == INSN_MACRO) -+ macro (&insn); -+ else -+ { -+ if (imm_expr.X_op != O_absent) -+ append_insn (&insn, &imm_expr, imm_reloc); -+ else if (offset_expr.X_op != O_absent) -+ append_insn (&insn, &offset_expr, offset_reloc); -+ else -+ append_insn (&insn, NULL, BFD_RELOC_UNUSED); -+ } -+} -+ -+char * -+md_atof (int type, char *litP, int *sizeP) -+{ -+ return ieee_md_atof (type, litP, sizeP, TARGET_BYTES_BIG_ENDIAN); -+} -+ -+void -+md_number_to_chars (char *buf, valueT val, int n) -+{ -+ number_to_chars_littleendian (buf, val, n); -+} -+ -+const char *md_shortopts = "O::g::G:"; -+ -+enum options -+ { -+ OPTION_M32 = OPTION_MD_BASE, -+ OPTION_M64, -+ OPTION_MARCH, -+ OPTION_PIC, -+ OPTION_NO_PIC, -+ OPTION_MRVC, -+ OPTION_MNO_RVC, -+ OPTION_END_OF_ENUM -+ }; -+ -+struct option md_longopts[] = -+{ -+ {"m32", no_argument, NULL, OPTION_M32}, -+ {"m64", no_argument, NULL, OPTION_M64}, -+ {"march", required_argument, NULL, OPTION_MARCH}, -+ {"fPIC", no_argument, NULL, OPTION_PIC}, -+ {"fpic", no_argument, NULL, OPTION_PIC}, -+ {"fno-pic", no_argument, NULL, OPTION_NO_PIC}, -+ {"mrvc", no_argument, NULL, OPTION_MRVC}, -+ {"mno-rvc", no_argument, NULL, OPTION_MNO_RVC}, -+ -+ {NULL, no_argument, NULL, 0} -+}; -+size_t md_longopts_size = sizeof (md_longopts); -+ -+int -+md_parse_option (int c, char *arg) -+{ -+ switch (c) -+ { -+ case OPTION_MRVC: -+ riscv_opts.rvc = 1; -+ break; -+ -+ case OPTION_MNO_RVC: -+ riscv_opts.rvc = 0; -+ break; -+ -+ case OPTION_M32: -+ rv64 = FALSE; -+ break; -+ -+ case OPTION_M64: -+ rv64 = TRUE; -+ break; -+ -+ case OPTION_MARCH: -+ riscv_set_arch(arg); -+ -+ case OPTION_NO_PIC: -+ riscv_opts.pic = FALSE; -+ break; -+ -+ case OPTION_PIC: -+ riscv_opts.pic = TRUE; -+ break; -+ -+ default: -+ return 0; -+ } -+ -+ return 1; -+} -+ -+void -+riscv_after_parse_args (void) -+{ -+ if (riscv_subsets == NULL) -+ riscv_set_arch("RVIMAFDXcustom"); -+} -+ -+void -+riscv_init_after_args (void) -+{ -+ /* initialize opcodes */ -+ bfd_riscv_num_opcodes = bfd_riscv_num_builtin_opcodes; -+ riscv_opcodes = (struct riscv_opcode *) riscv_builtin_opcodes; -+} -+ -+long -+md_pcrel_from (fixS *fixP) -+{ -+ return fixP->fx_where + fixP->fx_frag->fr_address; -+} -+ -+/* Apply a fixup to the object file. */ -+ -+void -+md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) -+{ -+ bfd_byte *buf = (bfd_byte *) (fixP->fx_frag->fr_literal + fixP->fx_where); -+ -+ /* Remember value for tc_gen_reloc. */ -+ fixP->fx_addnumber = *valP; -+ -+ switch (fixP->fx_r_type) -+ { -+ case BFD_RELOC_RISCV_TLS_GOT_HI20: -+ case BFD_RELOC_RISCV_TLS_GD_HI20: -+ case BFD_RELOC_RISCV_TLS_DTPREL32: -+ case BFD_RELOC_RISCV_TLS_DTPREL64: -+ case BFD_RELOC_RISCV_TPREL_HI20: -+ case BFD_RELOC_RISCV_TPREL_LO12_I: -+ case BFD_RELOC_RISCV_TPREL_LO12_S: -+ case BFD_RELOC_RISCV_TPREL_ADD: -+ S_SET_THREAD_LOCAL (fixP->fx_addsy); -+ /* fall through */ -+ -+ case BFD_RELOC_RISCV_GOT_HI20: -+ case BFD_RELOC_RISCV_PCREL_HI20: -+ case BFD_RELOC_RISCV_HI20: -+ case BFD_RELOC_RISCV_LO12_I: -+ case BFD_RELOC_RISCV_LO12_S: -+ case BFD_RELOC_RISCV_ADD8: -+ case BFD_RELOC_RISCV_ADD16: -+ case BFD_RELOC_RISCV_ADD32: -+ case BFD_RELOC_RISCV_ADD64: -+ case BFD_RELOC_RISCV_SUB8: -+ case BFD_RELOC_RISCV_SUB16: -+ case BFD_RELOC_RISCV_SUB32: -+ case BFD_RELOC_RISCV_SUB64: -+ gas_assert (fixP->fx_addsy != NULL); -+ /* Nothing needed to do. The value comes from the reloc entry. */ -+ break; -+ -+ case BFD_RELOC_64: -+ case BFD_RELOC_32: -+ case BFD_RELOC_16: -+ case BFD_RELOC_8: -+ if (fixP->fx_addsy && fixP->fx_subsy) -+ { -+ fixP->fx_next = xmemdup (fixP, sizeof (*fixP), sizeof (*fixP)); -+ fixP->fx_next->fx_addsy = fixP->fx_subsy; -+ fixP->fx_next->fx_subsy = NULL; -+ fixP->fx_next->fx_offset = 0; -+ fixP->fx_subsy = NULL; -+ -+ if (fixP->fx_r_type == BFD_RELOC_64) -+ fixP->fx_r_type = BFD_RELOC_RISCV_ADD64, -+ fixP->fx_next->fx_r_type = BFD_RELOC_RISCV_SUB64; -+ else if (fixP->fx_r_type == BFD_RELOC_32) -+ fixP->fx_r_type = BFD_RELOC_RISCV_ADD32, -+ fixP->fx_next->fx_r_type = BFD_RELOC_RISCV_SUB32; -+ else if (fixP->fx_r_type == BFD_RELOC_16) -+ fixP->fx_r_type = BFD_RELOC_RISCV_ADD16, -+ fixP->fx_next->fx_r_type = BFD_RELOC_RISCV_SUB16; -+ else -+ fixP->fx_r_type = BFD_RELOC_RISCV_ADD8, -+ fixP->fx_next->fx_r_type = BFD_RELOC_RISCV_SUB8; -+ } -+ /* fall through */ -+ -+ case BFD_RELOC_RVA: -+ /* If we are deleting this reloc entry, we must fill in the -+ value now. This can happen if we have a .word which is not -+ resolved when it appears but is later defined. */ -+ if (fixP->fx_addsy == NULL) -+ { -+ gas_assert (fixP->fx_size <= sizeof (valueT)); -+ md_number_to_chars ((char *) buf, *valP, fixP->fx_size); -+ fixP->fx_done = 1; -+ } -+ break; -+ -+ case BFD_RELOC_RISCV_JMP: -+ if (fixP->fx_addsy) -+ { -+ /* Fill in a tentative value to improve objdump readability. */ -+ bfd_vma delta = ENCODE_UJTYPE_IMM (S_GET_VALUE (fixP->fx_addsy) + *valP); -+ bfd_putl32 (bfd_getl32 (buf) | delta, buf); -+ } -+ break; -+ -+ case BFD_RELOC_12_PCREL: -+ if (fixP->fx_addsy) -+ { -+ /* Fill in a tentative value to improve objdump readability. */ -+ bfd_vma delta = ENCODE_SBTYPE_IMM (S_GET_VALUE (fixP->fx_addsy) + *valP); -+ bfd_putl32 (bfd_getl32 (buf) | delta, buf); -+ } -+ break; -+ -+ case BFD_RELOC_RISCV_PCREL_LO12_S: -+ case BFD_RELOC_RISCV_PCREL_LO12_I: -+ case BFD_RELOC_RISCV_CALL: -+ case BFD_RELOC_RISCV_CALL_PLT: -+ case BFD_RELOC_RISCV_ALIGN: -+ break; -+ -+ default: -+ /* We ignore generic BFD relocations we don't know about. */ -+ if (bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type) != NULL) -+ internalError (); -+ } -+} -+ -+/* This structure is used to hold a stack of .set values. */ -+ -+struct riscv_option_stack -+{ -+ struct riscv_option_stack *next; -+ struct riscv_set_options options; -+}; -+ -+static struct riscv_option_stack *riscv_opts_stack; -+ -+/* Handle the .set pseudo-op. */ -+ -+static void -+s_riscv_option (int x ATTRIBUTE_UNUSED) -+{ -+ char *name = input_line_pointer, ch; -+ -+ while (!is_end_of_line[(unsigned char) *input_line_pointer]) -+ ++input_line_pointer; -+ ch = *input_line_pointer; -+ *input_line_pointer = '\0'; -+ -+ if (strcmp (name, "rvc") == 0) -+ riscv_opts.rvc = 1; -+ else if (strcmp (name, "norvc") == 0) -+ riscv_opts.rvc = 0; -+ else if (strcmp (name, "push") == 0) -+ { -+ struct riscv_option_stack *s; -+ -+ s = (struct riscv_option_stack *) xmalloc (sizeof *s); -+ s->next = riscv_opts_stack; -+ s->options = riscv_opts; -+ riscv_opts_stack = s; -+ } -+ else if (strcmp (name, "pop") == 0) -+ { -+ struct riscv_option_stack *s; -+ -+ s = riscv_opts_stack; -+ if (s == NULL) -+ as_bad (_(".option pop with no .option push")); -+ else -+ { -+ riscv_opts = s->options; -+ riscv_opts_stack = s->next; -+ free (s); -+ } -+ } -+ else -+ { -+ as_warn (_("Unrecognized .option directive: %s\n"), name); -+ } -+ *input_line_pointer = ch; -+ demand_empty_rest_of_line (); -+} -+ -+/* Handle the .dtprelword and .dtpreldword pseudo-ops. They generate -+ a 32-bit or 64-bit DTP-relative relocation (BYTES says which) for -+ use in DWARF debug information. */ -+ -+static void -+s_dtprel (int bytes) -+{ -+ expressionS ex; -+ char *p; -+ -+ expression (&ex); -+ -+ if (ex.X_op != O_symbol) -+ { -+ as_bad (_("Unsupported use of %s"), (bytes == 8 -+ ? ".dtpreldword" -+ : ".dtprelword")); -+ ignore_rest_of_line (); -+ } -+ -+ p = frag_more (bytes); -+ md_number_to_chars (p, 0, bytes); -+ fix_new_exp (frag_now, p - frag_now->fr_literal, bytes, &ex, FALSE, -+ (bytes == 8 -+ ? BFD_RELOC_RISCV_TLS_DTPREL64 -+ : BFD_RELOC_RISCV_TLS_DTPREL32)); -+ -+ demand_empty_rest_of_line (); -+} -+ -+/* Handle the .bss pseudo-op. */ -+ -+static void -+s_bss (int ignore ATTRIBUTE_UNUSED) -+{ -+ subseg_set (bss_section, 0); -+ demand_empty_rest_of_line (); -+} -+ -+/* Align to a given power of two. */ -+ -+static void -+s_align (int x ATTRIBUTE_UNUSED) -+{ -+ int alignment, fill_value = 0, fill_value_specified = 0; -+ -+ alignment = get_absolute_expression (); -+ if (alignment < 0 || alignment > 31) -+ as_bad (_("unsatisfiable alignment: %d"), alignment); -+ -+ if (*input_line_pointer == ',') -+ { -+ ++input_line_pointer; -+ fill_value = get_absolute_expression (); -+ fill_value_specified = 1; -+ } -+ -+ if (!fill_value_specified && subseg_text_p (now_seg) && alignment > 2) -+ { -+ /* Emit the worst-case NOP string. The linker will delete any -+ unnecessary NOPs. This allows us to support code alignment -+ in spite of linker relaxations. */ -+ bfd_vma i, worst_case_nop_bytes = (1L << alignment) - 4; -+ char *nops = frag_more (worst_case_nop_bytes); -+ for (i = 0; i < worst_case_nop_bytes; i += 4) -+ md_number_to_chars (nops + i, RISCV_NOP, 4); -+ -+ expressionS ex; -+ ex.X_op = O_constant; -+ ex.X_add_number = worst_case_nop_bytes; -+ -+ fix_new_exp (frag_now, nops - frag_now->fr_literal, 0, -+ &ex, TRUE, BFD_RELOC_RISCV_ALIGN); -+ } -+ else if (alignment) -+ frag_align (alignment, fill_value, 0); -+ -+ record_alignment (now_seg, alignment); -+ -+ demand_empty_rest_of_line (); -+} -+ -+int -+md_estimate_size_before_relax (fragS *fragp, asection *segtype) -+{ -+ return (fragp->fr_var = relaxed_branch_length (fragp, segtype, FALSE)); -+} -+ -+/* Translate internal representation of relocation info to BFD target -+ format. */ -+ -+arelent * -+tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) -+{ -+ arelent *reloc = (arelent *) xmalloc (sizeof (arelent)); -+ -+ reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); -+ *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); -+ reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; -+ -+ if (fixp->fx_pcrel) -+ /* At this point, fx_addnumber is "symbol offset - pcrel address". -+ Relocations want only the symbol offset. */ -+ reloc->addend = fixp->fx_addnumber + reloc->address; -+ else -+ reloc->addend = fixp->fx_addnumber; -+ -+ reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); -+ if (reloc->howto == NULL) -+ { -+ if ((fixp->fx_r_type == BFD_RELOC_16 || fixp->fx_r_type == BFD_RELOC_8) -+ && fixp->fx_addsy != NULL && fixp->fx_subsy != NULL) -+ { -+ /* We don't have R_RISCV_8/16, but for this special case, -+ we can use R_RISCV_ADD8/16 with R_RISCV_SUB8/16. */ -+ return reloc; -+ } -+ -+ as_bad_where (fixp->fx_file, fixp->fx_line, -+ _("cannot represent %s relocation in object file"), -+ bfd_get_reloc_code_name (fixp->fx_r_type)); -+ return NULL; -+ } -+ -+ return reloc; -+} -+ -+int -+riscv_relax_frag (asection *sec, fragS *fragp, long stretch ATTRIBUTE_UNUSED) -+{ -+ if (RELAX_BRANCH_P (fragp->fr_subtype)) -+ { -+ offsetT old_var = fragp->fr_var; -+ fragp->fr_var = relaxed_branch_length (fragp, sec, TRUE); -+ return fragp->fr_var - old_var; -+ } -+ -+ return 0; -+} -+ -+/* Convert a machine dependent frag. */ -+ -+static void -+md_convert_frag_branch (fragS *fragp) -+{ -+ bfd_byte *buf; -+ insn_t insn; -+ expressionS exp; -+ fixS *fixp; -+ -+ buf = (bfd_byte *)fragp->fr_literal + fragp->fr_fix; -+ -+ exp.X_op = O_symbol; -+ exp.X_add_symbol = fragp->fr_symbol; -+ exp.X_add_number = fragp->fr_offset; -+ -+ if (RELAX_BRANCH_TOOFAR (fragp->fr_subtype)) -+ { -+ gas_assert (fragp->fr_var == 8); -+ /* We could relax JAL to AUIPC/JALR, but we don't do this yet. */ -+ gas_assert (!RELAX_BRANCH_UNCOND (fragp->fr_subtype)); -+ -+ /* Invert the branch condition. Branch over the jump. */ -+ insn = bfd_getl32 (buf); -+ insn ^= MATCH_BEQ ^ MATCH_BNE; -+ insn |= ENCODE_SBTYPE_IMM (8); -+ md_number_to_chars ((char *) buf, insn, 4); -+ buf += 4; -+ -+ /* Jump to the target. */ -+ fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, -+ 4, &exp, FALSE, BFD_RELOC_RISCV_JMP); -+ md_number_to_chars ((char *) buf, MATCH_JAL, 4); -+ buf += 4; -+ } -+ else -+ { -+ fixp = fix_new_exp (fragp, buf - (bfd_byte *)fragp->fr_literal, -+ 4, &exp, FALSE, BFD_RELOC_12_PCREL); -+ buf += 4; -+ } -+ -+ fixp->fx_file = fragp->fr_file; -+ fixp->fx_line = fragp->fr_line; -+ fixp->fx_pcrel = 1; -+ -+ gas_assert (buf == (bfd_byte *)fragp->fr_literal -+ + fragp->fr_fix + fragp->fr_var); -+ -+ fragp->fr_fix += fragp->fr_var; -+} -+ -+/* Relax a machine dependent frag. This returns the amount by which -+ the current size of the frag should change. */ -+ -+void -+md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT asec ATTRIBUTE_UNUSED, -+ fragS *fragp) -+{ -+ gas_assert (RELAX_BRANCH_P (fragp->fr_subtype)); -+ md_convert_frag_branch (fragp); -+} -+ -+void -+md_show_usage (FILE *stream) -+{ -+ fprintf (stream, _("\ -+RISC-V options:\n\ -+ -m32 assemble RV32 code\n\ -+ -m64 assemble RV64 code (default)\n\ -+ -fpic generate position-independent code\n\ -+ -fno-pic don't generate position-independent code (default)\n\ -+")); -+} -+ -+/* Standard calling conventions leave the CFA at SP on entry. */ -+void -+riscv_cfi_frame_initial_instructions (void) -+{ -+ cfi_add_CFA_def_cfa_register (X_SP); -+} -+ -+int -+tc_riscv_regname_to_dw2regnum (char *regname) -+{ -+ int reg; -+ -+ if ((reg = reg_lookup_internal (regname, RCLASS_GPR)) >= 0) -+ return reg; -+ -+ if ((reg = reg_lookup_internal (regname, RCLASS_FPR)) >= 0) -+ return reg + 32; -+ -+ as_bad (_("unknown register `%s'"), regname); -+ return -1; -+} -+ -+void -+riscv_elf_final_processing (void) -+{ -+ struct riscv_subset* s; -+ -+ unsigned int Xlen = 0; -+ for (s = riscv_subsets; s != NULL; s = s->next) -+ if (s->name[0] == 'X') -+ Xlen += strlen(s->name); -+ -+ char extension[Xlen]; -+ extension[0] = 0; -+ for (s = riscv_subsets; s != NULL; s = s->next) -+ if (s->name[0] == 'X') -+ strcat(extension, s->name); -+ -+ EF_SET_RISCV_EXT(elf_elfheader (stdoutput)->e_flags, -+ riscv_elf_name_to_flag (extension)); -+} -+ -+/* Pseudo-op table. */ -+ -+static const pseudo_typeS riscv_pseudo_table[] = -+{ -+ /* RISC-V-specific pseudo-ops. */ -+ {"option", s_riscv_option, 0}, -+ {"half", cons, 2}, -+ {"word", cons, 4}, -+ {"dword", cons, 8}, -+ {"dtprelword", s_dtprel, 4}, -+ {"dtpreldword", s_dtprel, 8}, -+ {"bss", s_bss, 0}, -+ {"align", s_align, 0}, -+ -+ /* leb128 doesn't work with relaxation; disallow it */ -+ {"uleb128", s_err, 0}, -+ {"sleb128", s_err, 0}, -+ -+ { NULL, NULL, 0 }, -+}; -+ -+void -+riscv_pop_insert (void) -+{ -+ extern void pop_insert (const pseudo_typeS *); -+ -+ pop_insert (riscv_pseudo_table); -+} -diff -rNU3 dist.orig/gas/config/tc-riscv.h dist/gas/config/tc-riscv.h ---- dist.orig/gas/config/tc-riscv.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/tc-riscv.h 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,102 @@ -+/* tc-riscv.h -- header file for tc-riscv.c. -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on MIPS target. -+ -+ This file is part of GAS. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ GAS is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GAS; see the file COPYING. If not, write to the Free -+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -+ 02110-1301, USA. */ -+ -+#ifndef TC_RISCV -+#define TC_RISCV -+ -+#include "opcode/riscv.h" -+ -+struct frag; -+struct expressionS; -+ -+#define TARGET_BYTES_BIG_ENDIAN 0 -+ -+#define TARGET_ARCH bfd_arch_riscv -+ -+#define WORKING_DOT_WORD 1 -+#define OLD_FLOAT_READS -+#define REPEAT_CONS_EXPRESSIONS -+#define LOCAL_LABELS_FB 1 -+#define FAKE_LABEL_NAME ".L0 " -+ -+#define md_relax_frag(segment, fragp, stretch) \ -+ riscv_relax_frag(segment, fragp, stretch) -+extern int riscv_relax_frag (asection *, struct frag *, long); -+ -+#define md_section_align(seg,size) (size) -+#define md_undefined_symbol(name) (0) -+#define md_operand(x) -+ -+#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2) -+ -+#define TC_SYMFIELD_TYPE int -+ -+/* The ISA of the target may change based on command-line arguments. */ -+#define TARGET_FORMAT riscv_target_format() -+extern const char *riscv_target_format (void); -+ -+#define md_after_parse_args() riscv_after_parse_args() -+extern void riscv_after_parse_args (void); -+ -+#define tc_init_after_args() riscv_init_after_args() -+extern void riscv_init_after_args (void); -+ -+#define md_parse_long_option(arg) riscv_parse_long_option (arg) -+extern int riscv_parse_long_option (const char *); -+ -+/* Let the linker resolve all the relocs due to relaxation. */ -+#define tc_fix_adjustable(fixp) 0 -+#define md_allow_local_subtract(l,r,s) 0 -+ -+/* Values passed to md_apply_fix don't include symbol values. */ -+#define MD_APPLY_SYM_VALUE(FIX) 0 -+ -+/* Global syms must not be resolved, to support ELF shared libraries. */ -+#define EXTERN_FORCE_RELOC \ -+ (OUTPUT_FLAVOR == bfd_target_elf_flavour) -+ -+#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) ((SEG)->flags & SEC_CODE) -+#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1 -+#define TC_VALIDATE_FIX_SUB(FIX, SEG) 1 -+#define TC_FORCE_RELOCATION_LOCAL(FIX) 1 -+#define DIFF_EXPR_OK 1 -+ -+extern void riscv_pop_insert (void); -+#define md_pop_insert() riscv_pop_insert() -+ -+#define TARGET_USE_CFIPOP 1 -+ -+#define tc_cfi_frame_initial_instructions riscv_cfi_frame_initial_instructions -+extern void riscv_cfi_frame_initial_instructions (void); -+ -+#define tc_regname_to_dw2regnum tc_riscv_regname_to_dw2regnum -+extern int tc_riscv_regname_to_dw2regnum (char *regname); -+ -+extern bfd_boolean rv64; -+#define DWARF2_DEFAULT_RETURN_COLUMN X_RA -+#define DWARF2_CIE_DATA_ALIGNMENT (rv64 ? 8 : 4) -+ -+#define elf_tc_final_processing riscv_elf_final_processing -+extern void riscv_elf_final_processing (void); -+ -+#endif /* TC_RISCV */ -diff -rNU3 dist.orig/gas/config/tc-vax.c dist/gas/config/tc-vax.c ---- dist.orig/gas/config/tc-vax.c 2010-06-28 16:06:57.000000000 +0200 -+++ dist/gas/config/tc-vax.c 2015-10-18 13:11:13.000000000 +0200 -@@ -24,6 +24,7 @@ - - #include "vax-inst.h" - #include "obstack.h" /* For FRAG_APPEND_1_CHAR macro in "frags.h" */ -+#include "dw2gencfi.h" - #include "subsegs.h" - #include "safe-ctype.h" - -@@ -392,6 +393,9 @@ - && (PLT_symbol == NULL || fragP->fr_symbol != PLT_symbol) - && fragP->fr_symbol != NULL - && flag_want_pic -+#ifdef OBJ_ELF -+ && ELF_ST_VISIBILITY (S_GET_OTHER (fragP->fr_symbol)) != STV_HIDDEN -+#endif - && (!S_IS_DEFINED (fragP->fr_symbol) - || S_IS_WEAK (fragP->fr_symbol) - || S_IS_EXTERNAL (fragP->fr_symbol))) -@@ -1073,6 +1077,154 @@ - return retval; - } - -+#ifdef OBJ_AOUT -+#ifndef BFD_ASSEMBLER -+void -+tc_aout_fix_to_chars (where, fixP, segment_address_in_file) -+ char *where; -+ fixS *fixP; -+ relax_addressT segment_address_in_file; -+{ -+ /* -+ * In: length of relocation (or of address) in chars: 1, 2 or 4. -+ * Out: GNU LD relocation length code: 0, 1, or 2. -+ */ -+ -+ static const unsigned char nbytes_r_length[] = {42, 0, 1, 42, 2}; -+ int r_symbolnum; -+ int r_flags; -+ -+ know (fixP->fx_addsy != NULL); -+ -+ md_number_to_chars (where, -+ fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, -+ 4); -+ -+ r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) -+ ? S_GET_TYPE (fixP->fx_addsy) -+ : fixP->fx_addsy->sy_number); -+ r_flags = (fixP->fx_pcrel ? 1 : 0) -+ | (!S_IS_DEFINED (fixP->fx_addsy) ? 8 : 0) /* extern */ -+ | ((nbytes_r_length[fixP->fx_size] & 3) << 1); -+ -+#if 0 -+ r_flags |= ((!S_IS_DEFINED(fixP->fx_addsy) -+ && fixP->fx_pcrel -+ && fixP->fx_addsy != GOT_symbol -+ && fixP->fx_addsy != PLT_symbol -+ && flags_want_pic) ? 0x10 : 0); -+#endif -+ -+ switch (fixP->fx_r_type) { -+ case NO_RELOC: -+ break; -+ case NO_RELOC2: -+ if (r_flags & 8) -+ r_flags |= 0x80; /* setting the copy bit */ -+ /* says we can convert */ -+ /* to gotslot if needed */ -+ break; -+ case RELOC_32: -+ if (flag_want_pic && S_IS_EXTERNAL(fixP->fx_addsy)) { -+ r_symbolnum = fixP->fx_addsy->sy_number; -+ r_flags |= 8; /* set extern bit */ -+ } -+ break; -+ case RELOC_JMP_SLOT: -+ if (flag_want_pic) { -+ r_flags |= 0x20; /* set jmptable */ -+ r_flags &= ~0x08; /* clear extern bit */ -+ } -+ break; -+ case RELOC_JMP_TBL: -+ if (flag_want_pic) { -+ r_flags |= 0x20; /* set jmptable */ -+ r_flags |= 0x08; /* set extern bit */ -+ } -+ break; -+ case RELOC_GLOB_DAT: -+ if (flag_want_pic) { -+ r_flags |= 0x10; /* set baserel bit */ -+ r_symbolnum = fixP->fx_addsy->sy_number; -+ if (S_IS_EXTERNAL(fixP->fx_addsy)) -+ r_flags |= 8; /* set extern bit */ -+ } -+ break; -+ } -+ -+ where[4] = (r_symbolnum >> 0) & 0xff; -+ where[5] = (r_symbolnum >> 8) & 0xff; -+ where[6] = (r_symbolnum >> 16) & 0xff; -+ where[7] = r_flags; -+} -+#endif /* !BFD_ASSEMBLER */ -+#endif /* OBJ_AOUT */ -+ -+/* -+ * BUGS, GRIPES, APOLOGIA, etc. -+ * -+ * The opcode table 'votstrs' needs to be sorted on opcode frequency. -+ * That is, AFTER we hash it with hash_...(), we want most-used opcodes -+ * to come out of the hash table faster. -+ * -+ * I am sorry to inflict yet another VAX assembler on the world, but -+ * RMS says we must do everything from scratch, to prevent pin-heads -+ * restricting this software. -+ */ -+ -+/* -+ * This is a vaguely modular set of routines in C to parse VAX -+ * assembly code using DEC mnemonics. It is NOT un*x specific. -+ * -+ * The idea here is that the assembler has taken care of all: -+ * labels -+ * macros -+ * listing -+ * pseudo-ops -+ * line continuation -+ * comments -+ * condensing any whitespace down to exactly one space -+ * and all we have to do is parse 1 line into a vax instruction -+ * partially formed. We will accept a line, and deliver: -+ * an error message (hopefully empty) -+ * a skeleton VAX instruction (tree structure) -+ * textual pointers to all the operand expressions -+ * a warning message that notes a silly operand (hopefully empty) -+ */ -+ -+/* -+ * E D I T H I S T O R Y -+ * -+ * 17may86 Dean Elsner. Bug if line ends immediately after opcode. -+ * 30apr86 Dean Elsner. New vip_op() uses arg block so change call. -+ * 6jan86 Dean Elsner. Crock vip_begin() to call vip_op_defaults(). -+ * 2jan86 Dean Elsner. Invent synthetic opcodes. -+ * Widen vax_opcodeT to 32 bits. Use a bit for VIT_OPCODE_SYNTHETIC, -+ * which means this is not a real opcode, it is like a macro; it will -+ * be relax()ed into 1 or more instructions. -+ * Use another bit for VIT_OPCODE_SPECIAL if the op-code is not optimised -+ * like a regular branch instruction. Option added to vip_begin(): -+ * exclude synthetic opcodes. Invent synthetic_votstrs[]. -+ * 31dec85 Dean Elsner. Invent vit_opcode_nbytes. -+ * Also make vit_opcode into a char[]. We now have n-byte vax opcodes, -+ * so caller's don't have to know the difference between a 1-byte & a -+ * 2-byte op-code. Still need vax_opcodeT concept, so we know how -+ * big an object must be to hold an op.code. -+ * 30dec85 Dean Elsner. Widen typedef vax_opcodeT in "vax-inst.h" -+ * because vax opcodes may be 16 bits. Our crufty C compiler was -+ * happily initialising 8-bit vot_codes with 16-bit numbers! -+ * (Wouldn't the 'phone company like to compress data so easily!) -+ * 29dec85 Dean Elsner. New static table vax_operand_width_size[]. -+ * Invented so we know hw many bytes a "I^#42" needs in its immediate -+ * operand. Revised struct vop in "vax-inst.h": explicitly include -+ * byte length of each operand, and it's letter-code datum type. -+ * 17nov85 Dean Elsner. Name Change. -+ * Due to ar(1) truncating names, we learned the hard way that -+ * "vax-inst-parse.c" -> "vax-inst-parse." dropping the "o" off -+ * the archived object name. SO... we shortened the name of this -+ * source file, and changed the makefile. -+ */ -+ - /* Parse a vax operand in DEC assembler notation. - For speed, expect a string of whitespace to be reduced to a single ' '. - This is the case for GNU AS, and is easy for other DEC-compatible -@@ -3150,7 +3302,7 @@ - if (flag_want_pic && operandP->vop_mode == 8 - && this_add_symbol != NULL) - { -- as_warn (_("Symbol %s used as immediate operand in PIC mode."), -+ as_warn (_("Symbol '%s' used as immediate operand in PIC mode."), - S_GET_NAME (this_add_symbol)); - } - #endif -@@ -3226,7 +3378,15 @@ - length = 4; - } - } -+#ifdef OBJ_ELF -+ if (flag_want_pic && this_add_symbol != NULL) -+ { -+ as_warn (_("Symbol '%s' used as displacement in PIC mode."), -+ S_GET_NAME (this_add_symbol)); -+ } -+#endif - p = frag_more (1 + length); -+ know (operandP->vop_reg != 0xf); - know (operandP->vop_reg >= 0); - p[0] = operandP->vop_reg - | ((at | "?\12\14?\16"[length]) << 4); -@@ -3411,3 +3571,38 @@ - { - return vax_md_atof (type, litP, sizeP); - } -+ -+void -+vax_cfi_frame_initial_instructions (void) -+{ -+ cfi_add_CFA_def_cfa (14, 0); -+} -+ -+int -+tc_vax_regname_to_dw2regnum (char *regname) -+{ -+ unsigned int i; -+ static const struct { char *name; int dw2regnum; } regnames[] = -+ { -+ { "r0", 0 }, { "r1", 1 }, { "r2", 2 }, { "r3", 3 }, -+ { "r4", 4 }, { "r5", 5 }, { "r6", 6 }, { "r7", 7 }, -+ { "r8", 8 }, { "r9", 9 }, { "r10", 10 }, { "r11", 11 }, -+ { "ap", 12 }, { "fp", 13 }, { "sp", 14 }, { "pc", 15 }, -+ { "psw", 16 }, -+ }; -+ -+ for (i = 0; i < ARRAY_SIZE (regnames); ++i) -+ if (strcmp (regnames[i].name, regname) == 0) -+ return regnames[i].dw2regnum; -+ -+ return -1; -+} -+ -+void -+vax_cfi_emit_pcrel_expr (expressionS *expP, unsigned int nbytes) -+{ -+ vax_cons_special_reloc = "pcrel"; -+ expP->X_add_number += nbytes; -+ emit_expr (expP, nbytes); -+ vax_cons_special_reloc = NULL; -+} -diff -rNU3 dist.orig/gas/config/tc-vax.h dist/gas/config/tc-vax.h ---- dist.orig/gas/config/tc-vax.h 2007-07-03 13:01:05.000000000 +0200 -+++ dist/gas/config/tc-vax.h 2015-10-18 13:11:13.000000000 +0200 -@@ -71,9 +71,17 @@ - == S_GET_SEGMENT ((FIX)->fx_addsy))) \ - || S_IS_LOCAL ((FIX)->fx_addsy))) - --/* -- * Local Variables: -- * comment-column: 0 -- * fill-column: 131 -- * End: -- */ -+#define TARGET_USE_CFIPOP 1 -+ -+#define tc_cfi_frame_initial_instructions vax_cfi_frame_initial_instructions -+extern void vax_cfi_frame_initial_instructions (void); -+ -+#define tc_regname_to_dw2regnum tc_vax_regname_to_dw2regnum -+extern int tc_vax_regname_to_dw2regnum (char *); -+ -+#define tc_cfi_emit_pcrel_expr vax_cfi_emit_pcrel_expr -+extern void vax_cfi_emit_pcrel_expr (expressionS *, unsigned int); -+ -+#define DWARF2_LINE_MIN_INSN_LENGTH 1 -+#define DWARF2_DEFAULT_RETURN_COLUMN 15 -+#define DWARF2_CIE_DATA_ALIGNMENT -4 -diff -rNU3 dist.orig/gas/config/te-armnbsd.h dist/gas/config/te-armnbsd.h ---- dist.orig/gas/config/te-armnbsd.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/te-armnbsd.h 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,22 @@ -+/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -+ -+ This file is part of GAS, the GNU Assembler. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as -+ published by the Free Software Foundation; either version 3, -+ or (at your option) any later version. -+ -+ GAS is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -+ the GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GAS; see the file COPYING. If not, write to the Free -+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -+ 02110-1301, USA. */ -+ -+#include "te-nbsd.h" -+ -+#define CPU_DEFAULT ARM_ARCH_V4 -diff -rNU3 dist.orig/gas/config/te-armnbsdeabi.h dist/gas/config/te-armnbsdeabi.h ---- dist.orig/gas/config/te-armnbsdeabi.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/te-armnbsdeabi.h 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,25 @@ -+/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -+ -+ This file is part of GAS, the GNU Assembler. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as -+ published by the Free Software Foundation; either version 3, -+ or (at your option) any later version. -+ -+ GAS is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -+ the GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GAS; see the file COPYING. If not, write to the Free -+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -+ 02110-1301, USA. */ -+ -+#include "te-nbsd.h" -+ -+/* The EABI requires the use of VFP. */ -+#define CPU_DEFAULT ARM_ARCH_V5TEJ -+#define FPU_DEFAULT FPU_ARCH_VFP -+#define EABI_DEFAULT EF_ARM_EABI_VER5 -diff -rNU3 dist.orig/gas/config/te-armnbsdeabihf.h dist/gas/config/te-armnbsdeabihf.h ---- dist.orig/gas/config/te-armnbsdeabihf.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/te-armnbsdeabihf.h 2015-10-18 13:11:13.000000000 +0200 -@@ -0,0 +1,25 @@ -+/* Copyright 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -+ -+ This file is part of GAS, the GNU Assembler. -+ -+ GAS is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as -+ published by the Free Software Foundation; either version 3, -+ or (at your option) any later version. -+ -+ GAS is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -+ the GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with GAS; see the file COPYING. If not, write to the Free -+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA -+ 02110-1301, USA. */ -+ -+#include "te-nbsd.h" -+ -+/* The EABI requires the use of VFP. */ -+#define CPU_DEFAULT ARM_ARCH_V5TEJ -+#define FPU_DEFAULT FPU_ARCH_VFP_V2 -+#define EABI_DEFAULT EF_ARM_EABI_VER5 -diff -rNU3 dist.orig/gas/config/vax-inst.h dist/gas/config/vax-inst.h ---- dist.orig/gas/config/vax-inst.h 2009-09-02 09:24:21.000000000 +0200 -+++ dist/gas/config/vax-inst.h 2015-10-18 13:11:13.000000000 +0200 -@@ -66,6 +66,8 @@ - #define VAX_WIDEN_WORD (0x20) /* Add this to byte branch to get word br. */ - #define VAX_WIDEN_LONG (0x6) /* Add this to byte branch to get long jmp.*/ - /* Needs VAX_PC_RELATIVE_MODE byte after it*/ -+#define VAX_CALLS (0xFB) /* Call with arg list on stack */ -+#define VAX_CALLG (0xFA) /* Call with arg list in memory */ - - struct vit /* vax instruction tree */ - { -diff -rNU3 dist.orig/gas/configure dist/gas/configure ---- dist.orig/gas/configure 2012-06-18 06:43:06.000000000 +0200 -+++ dist/gas/configure 2015-10-18 13:11:13.000000000 +0200 -@@ -12146,7 +12146,7 @@ - fi - ;; - -- epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | openrisc) -+ epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | or1k | or1knd) - using_cgen=yes - ;; - -@@ -12340,6 +12340,8 @@ - cgen_cpu_prefix="" - if test $using_cgen = yes ; then - case ${target_cpu} in -+ or1knd) -+ cgen_cpu_prefix=or1k ;; - *) cgen_cpu_prefix=${target_cpu} ;; - esac - -diff -rNU3 dist.orig/gas/configure.in dist/gas/configure.in ---- dist.orig/gas/configure.in 2012-11-05 17:27:44.000000000 +0100 -+++ dist/gas/configure.in 2015-10-18 13:11:13.000000000 +0200 -@@ -314,7 +314,7 @@ - fi - ;; - -- epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | openrisc) -+ epiphany | fr30 | ip2k | iq2000 | lm32 | m32r | or1k | or1knd) - using_cgen=yes - ;; - -@@ -504,6 +504,8 @@ - cgen_cpu_prefix="" - if test $using_cgen = yes ; then - case ${target_cpu} in -+ or1knd) -+ cgen_cpu_prefix=or1k ;; - *) cgen_cpu_prefix=${target_cpu} ;; - esac - AC_SUBST(cgen_cpu_prefix) -diff -rNU3 dist.orig/gas/configure.tgt dist/gas/configure.tgt ---- dist.orig/gas/configure.tgt 2012-09-04 14:53:45.000000000 +0200 -+++ dist/gas/configure.tgt 2015-10-18 13:11:13.000000000 +0200 -@@ -51,7 +51,7 @@ - m32c) cpu_type=m32c endian=little ;; - m32r) cpu_type=m32r endian=big ;; - m32rle) cpu_type=m32r endian=little ;; -- m5200) cpu_type=m68k ;; -+ m5200|m5407) cpu_type=m68k ;; - m68008) cpu_type=m68k ;; - m680[012346]0) cpu_type=m68k ;; - m6811|m6812|m68hc12) cpu_type=m68hc11 ;; -@@ -61,11 +61,13 @@ - mips*el) cpu_type=mips endian=little ;; - mips*) cpu_type=mips endian=big ;; - mt) cpu_type=mt endian=big ;; -- or32*) cpu_type=or32 endian=big ;; -+ or1k*) cpu_type=or1k endian=big ;; - pjl*) cpu_type=pj endian=little ;; - pj*) cpu_type=pj endian=big ;; - powerpc*le*) cpu_type=ppc endian=little ;; - powerpc*) cpu_type=ppc endian=big ;; -+ riscv*eb) cpu_type=riscv endian=big ;; -+ riscv*) cpu_type=riscv endian=little ;; - rs6000*) cpu_type=ppc ;; - rl78*) cpu_type=rl78 ;; - rx) cpu_type=rx ;; -@@ -100,6 +102,7 @@ - case ${generic_target} in - aarch64*-*-elf) fmt=elf;; - aarch64*-*-linux*) fmt=elf em=linux ;; -+ aarch64*-*-netbsd*) fmt=elf em=nbsd ;; - - alpha-*-*vms*) fmt=evax ;; - alpha-*-osf*) fmt=ecoff ;; -@@ -111,9 +114,11 @@ - arc-*-elf*) fmt=elf ;; - - arm-*-aout) fmt=aout ;; -- arm-*-coff) fmt=coff ;; -- arm-*-rtems*) fmt=elf ;; -- arm-*-elf) fmt=elf ;; -+ arm-*-coff | thumb-*-coff) fmt=coff ;; -+ arm-*-rtems* | thumb-*-rtems*) fmt=elf ;; -+ arm-*-elf | thumb-*-elf) fmt=elf ;; -+ arm-*-netbsdelf*-*eabihf*) fmt=elf em=armnbsdeabihf ;; -+ arm-*-netbsdelf*-*eabi*) fmt=elf em=armnbsdeabi ;; - arm-*-eabi*) fmt=elf em=armeabi ;; - arm-*-symbianelf*) fmt=elf em=symbian ;; - arm-*-kaos*) fmt=elf ;; -@@ -124,8 +129,8 @@ - arm-*-uclinux*eabi*) fmt=elf em=armlinuxeabi ;; - arm-*-uclinux*) fmt=elf em=linux ;; - arm-*-nacl*) fmt=elf em=nacl ;; -- arm-*-netbsdelf*) fmt=elf em=nbsd ;; -- arm-*-*n*bsd*) fmt=aout em=nbsd ;; -+ arm-*-netbsdelf*) fmt=elf em=armnbsd ;; -+ arm-*-*n*bsd*) fmt=aout em=armnbsd ;; - arm-*-nto*) fmt=elf ;; - arm-epoc-pe) fmt=coff em=epoc-pe ;; - arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*) -@@ -334,10 +339,9 @@ - ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; - ns32k-*-*n*bsd*) fmt=aout em=nbsd532 ;; - -- openrisc-*-*) fmt=elf ;; -- -- or32-*-rtems*) fmt=elf ;; -- or32-*-elf) fmt=elf ;; -+ or1k-*-elf) fmt=elf ;; -+ or1k-*-linux*) fmt=elf em=linux ;; -+ or1k-*-netbsd*) fmt=elf em=nbsd ;; - - pj*) fmt=elf ;; - -@@ -357,6 +361,11 @@ - ppc-*-kaos*) fmt=elf ;; - ppc-*-lynxos*) fmt=elf em=lynx ;; - -+ riscv*eb-*-linux*) fmt=elf endian=big em=linux ;; -+ riscv*eb-*-netbsd*) fmt=elf endian=big em=nbsd ;; -+ riscv*-*-linux*) fmt=elf endian=little em=linux ;; -+ riscv*-*-netbsd*) fmt=elf endian=little em=nbsd ;; -+ - s390-*-linux-*) fmt=elf em=linux ;; - s390-*-tpf*) fmt=elf ;; - -@@ -451,7 +460,7 @@ - esac - - case ${cpu_type} in -- aarch64 | alpha | arm | i386 | ia64 | microblaze | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k) -+ aarch64 | alpha | arm | i386 | ia64 | microblaze | mips | ns32k | or1k | or1knd | pdp11 | ppc | riscv | sparc | z80 | z8k) - bfd_gas=yes - ;; - esac -diff -rNU3 dist.orig/gas/doc/Makefile.am dist/gas/doc/Makefile.am ---- dist.orig/gas/doc/Makefile.am 2012-09-04 14:53:45.000000000 +0200 -+++ dist/gas/doc/Makefile.am 2015-10-18 13:11:13.000000000 +0200 -@@ -24,6 +24,8 @@ - -I "$(top_srcdir)/../bfd/doc" -I ../../bfd/doc - - asconfig.texi: $(CONFIG).texi -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_asconfig.text: - rm -f asconfig.texi - cp $(srcdir)/$(CONFIG).texi ./asconfig.texi - chmod u+w ./asconfig.texi -@@ -103,6 +105,8 @@ - # The sed command removes the no-adjust Nroff command so that - # the man output looks standard. - as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_as.1: - touch $@ - -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod - -($(POD2MAN) as.pod | \ -diff -rNU3 dist.orig/gas/doc/Makefile.in dist/gas/doc/Makefile.in ---- dist.orig/gas/doc/Makefile.in 2012-09-04 14:53:45.000000000 +0200 -+++ dist/gas/doc/Makefile.in 2015-10-18 13:11:13.000000000 +0200 -@@ -374,6 +374,8 @@ - -rm -rf .libs _libs - - as.info: as.texinfo $(as_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_as.info: as.texinfo $(as_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ -@@ -756,6 +758,8 @@ - - - asconfig.texi: $(CONFIG).texi -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_asconfig.texi: - rm -f asconfig.texi - cp $(srcdir)/$(CONFIG).texi ./asconfig.texi - chmod u+w ./asconfig.texi -@@ -773,6 +777,8 @@ - # The sed command removes the no-adjust Nroff command so that - # the man output looks standard. - as.1: $(srcdir)/as.texinfo asconfig.texi $(CPU_DOCS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_as.1: - touch $@ - -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod - -($(POD2MAN) as.pod | \ -diff -rNU3 dist.orig/gas/doc/as.info dist/gas/doc/as.info ---- dist.orig/gas/doc/as.info 2013-03-25 10:10:23.000000000 +0100 -+++ dist/gas/doc/as.info 2015-10-18 13:11:13.000000000 +0200 -@@ -22275,8 +22275,8 @@ - * -g command line option, Alpha: Alpha Options. (line 47) - * -G command line option, Alpha: Alpha Options. (line 53) - * -G option (MIPS): MIPS Opts. (line 8) --* -H option, VAX/VMS: VAX-Opts. (line 81) - * -h option, VAX/VMS: VAX-Opts. (line 45) -+* -H option, VAX/VMS: VAX-Opts. (line 81) - * -I PATH: I. (line 6) - * -ignore-parallel-conflicts option, M32RX: M32R-Opts. (line 87) - * -Ip option, M32RX: M32R-Opts. (line 97) -@@ -22876,8 +22876,8 @@ - * BSD syntax: PDP-11-Syntax. (line 6) - * bss directive, i960: Directives-i960. (line 6) - * bss directive, TIC54X: TIC54X-Directives. (line 29) --* bss section <1>: bss. (line 6) --* bss section: Ld Sections. (line 20) -+* bss section <1>: Ld Sections. (line 20) -+* bss section: bss. (line 6) - * bug criteria: Bug Criteria. (line 6) - * bug reports: Bug Reporting. (line 6) - * bugs in assembler: Reporting Bugs. (line 6) -diff -rNU3 dist.orig/gas/doc/c-mips.texi dist/gas/doc/c-mips.texi ---- dist.orig/gas/doc/c-mips.texi 2012-09-04 16:16:07.000000000 +0200 -+++ dist/gas/doc/c-mips.texi 2015-10-18 13:11:13.000000000 +0200 -@@ -210,6 +210,14 @@ - @itemx -mno-fix-vr4130 - Insert nops to work around the VR4130 @samp{mflo}/@samp{mfhi} errata. - -+@item -mfix-loongson2f-btb -+@itemx -mno-fix-loongson2f-btb -+Clear the Branch Target Buffer before any jump through a register. This -+option is intended to be used on kernel code for the Loongson 2F processor -+only; userland code compiled with this option will fault, and kernel code -+compiled with this option run on another processor than Loongson 2F will -+yield unpredictable results. -+ - @item -mfix-24k - @itemx -mno-fix-24k - Insert nops to work around the 24K @samp{eret}/@samp{deret} errata. -diff -rNU3 dist.orig/gas/remap.c dist/gas/remap.c ---- dist.orig/gas/remap.c 2011-03-11 15:18:24.000000000 +0100 -+++ dist/gas/remap.c 2015-10-18 13:11:13.000000000 +0200 -@@ -84,8 +84,8 @@ - return xstrdup (filename); - name = filename + map->old_len; - name_len = strlen (name) + 1; -- s = (char *) alloca (name_len + map->new_len); -+ s = (char *) xmalloc (name_len + map->new_len); - memcpy (s, map->new_prefix, map->new_len); - memcpy (s + map->new_len, name, name_len); -- return xstrdup (s); -+ return s; - } -diff -rNU3 dist.orig/gprof/corefile.c dist/gprof/corefile.c ---- dist.orig/gprof/corefile.c 2012-03-06 14:54:59.000000000 +0100 -+++ dist/gprof/corefile.c 2015-10-18 13:11:17.000000000 +0200 -@@ -30,6 +30,8 @@ - #include "corefile.h" - #include "safe-ctype.h" - -+#include -+ - bfd *core_bfd; - static int core_num_syms; - static asymbol **core_syms; -diff -rNU3 dist.orig/gprof/gprof.c dist/gprof/gprof.c ---- dist.orig/gprof/gprof.c 2009-06-12 17:33:30.000000000 +0200 -+++ dist/gprof/gprof.c 2015-10-18 13:11:17.000000000 +0200 -@@ -47,6 +47,8 @@ - - static void usage (FILE *, int) ATTRIBUTE_NORETURN; - -+#include -+ - const char * whoami; - const char * function_mapping_file; - static const char * external_symbol_table; -diff -rNU3 dist.orig/gprof/gprof.info dist/gprof/gprof.info ---- dist.orig/gprof/gprof.info 2012-11-13 15:19:35.000000000 +0100 -+++ dist/gprof/gprof.info 2015-10-18 13:11:17.000000000 +0200 -@@ -2441,34 +2441,34 @@ -  - Tag Table: - Node: Top777 --Node: Introduction2102 --Node: Compiling4594 --Node: Executing8650 --Node: Invoking11438 --Node: Output Options12853 --Node: Analysis Options19942 --Node: Miscellaneous Options23640 --Node: Deprecated Options24895 --Node: Symspecs26964 --Node: Output28790 --Node: Flat Profile29830 --Node: Call Graph34783 --Node: Primary38015 --Node: Callers40603 --Node: Subroutines42720 --Node: Cycles44561 --Node: Line-by-line51338 --Node: Annotated Source55411 --Node: Inaccuracy58410 --Node: Sampling Error58668 --Node: Assumptions61572 --Node: How do I?63042 --Node: Incompatibilities64596 --Node: Details66090 --Node: Implementation66483 --Node: File Format72380 --Node: Internals76670 --Node: Debugging85165 --Node: GNU Free Documentation License86766 -+Node: Introduction2103 -+Node: Compiling4595 -+Node: Executing8651 -+Node: Invoking11439 -+Node: Output Options12854 -+Node: Analysis Options19943 -+Node: Miscellaneous Options23641 -+Node: Deprecated Options24896 -+Node: Symspecs26965 -+Node: Output28791 -+Node: Flat Profile29831 -+Node: Call Graph34784 -+Node: Primary38016 -+Node: Callers40604 -+Node: Subroutines42721 -+Node: Cycles44562 -+Node: Line-by-line51339 -+Node: Annotated Source55412 -+Node: Inaccuracy58411 -+Node: Sampling Error58669 -+Node: Assumptions61573 -+Node: How do I?63043 -+Node: Incompatibilities64597 -+Node: Details66091 -+Node: Implementation66484 -+Node: File Format72381 -+Node: Internals76671 -+Node: Debugging85166 -+Node: GNU Free Documentation License86767 -  - End Tag Table -diff -rNU3 dist.orig/include/bfdlink.h dist/include/bfdlink.h ---- dist.orig/include/bfdlink.h 2012-04-09 18:27:18.000000000 +0200 -+++ dist/include/bfdlink.h 2015-10-18 13:11:17.000000000 +0200 -@@ -435,6 +435,10 @@ - option). If this is NULL, no symbols are being wrapped. */ - struct bfd_hash_table *wrap_hash; - -+ /* Hash table of symbols which may be left unresolved during -+ a link. If this is NULL, no symbols can be left unresolved. */ -+ struct bfd_hash_table *ignore_hash; -+ - /* The output BFD. */ - bfd *output_bfd; - -diff -rNU3 dist.orig/include/dis-asm.h dist/include/dis-asm.h ---- dist.orig/include/dis-asm.h 2012-09-04 14:53:46.000000000 +0200 -+++ dist/include/dis-asm.h 2015-10-18 13:11:17.000000000 +0200 -@@ -226,7 +226,6 @@ - extern int print_insn_bfin (bfd_vma, disassemble_info *); - extern int print_insn_big_arm (bfd_vma, disassemble_info *); - extern int print_insn_big_mips (bfd_vma, disassemble_info *); --extern int print_insn_big_or32 (bfd_vma, disassemble_info *); - extern int print_insn_big_powerpc (bfd_vma, disassemble_info *); - extern int print_insn_big_score (bfd_vma, disassemble_info *); - extern int print_insn_cr16 (bfd_vma, disassemble_info *); -@@ -253,7 +252,6 @@ - extern int print_insn_iq2000 (bfd_vma, disassemble_info *); - extern int print_insn_little_arm (bfd_vma, disassemble_info *); - extern int print_insn_little_mips (bfd_vma, disassemble_info *); --extern int print_insn_little_or32 (bfd_vma, disassemble_info *); - extern int print_insn_little_powerpc (bfd_vma, disassemble_info *); - extern int print_insn_little_score (bfd_vma, disassemble_info *); - extern int print_insn_lm32 (bfd_vma, disassemble_info *); -@@ -275,9 +273,10 @@ - extern int print_insn_msp430 (bfd_vma, disassemble_info *); - extern int print_insn_mt (bfd_vma, disassemble_info *); - extern int print_insn_ns32k (bfd_vma, disassemble_info *); --extern int print_insn_openrisc (bfd_vma, disassemble_info *); -+extern int print_insn_or1k (bfd_vma, disassemble_info *); - extern int print_insn_pdp11 (bfd_vma, disassemble_info *); - extern int print_insn_pj (bfd_vma, disassemble_info *); -+extern int print_insn_riscv (bfd_vma, disassemble_info *); - extern int print_insn_rs6000 (bfd_vma, disassemble_info *); - extern int print_insn_s390 (bfd_vma, disassemble_info *); - extern int print_insn_sh (bfd_vma, disassemble_info *); -diff -rNU3 dist.orig/include/elf/common.h dist/include/elf/common.h ---- dist.orig/include/elf/common.h 2012-09-04 14:53:47.000000000 +0200 -+++ dist/include/elf/common.h 2015-10-18 13:11:17.000000000 +0200 -@@ -194,7 +194,7 @@ - #define EM_MN10300 89 /* Matsushita MN10300 */ - #define EM_MN10200 90 /* Matsushita MN10200 */ - #define EM_PJ 91 /* picoJava */ --#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ -+#define EM_OR1K 92 /* OpenRISC 1000 32-bit embedded processor */ - #define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ - #define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ - #define EM_VIDEOCORE 95 /* Alphamosaic VideoCore processor */ -@@ -298,6 +298,7 @@ - #define EM_TILEGX 191 /* Tilera TILE-Gx multicore architecture family */ - #define EM_RL78 197 /* Renesas RL78 family. */ - #define EM_78K0R 199 /* Renesas 78K0R. */ -+#define EM_RISCV 243 /* RISC-V */ - - /* If it is necessary to assign new unofficial EM_* values, please pick large - random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision -@@ -357,9 +358,6 @@ - /* Ubicom IP2xxx; Written in the absense of an ABI. */ - #define EM_IP2K_OLD 0x8217 - --/* (Deprecated) Temporary number for the OpenRISC processor. */ --#define EM_OR32 0x8472 -- - /* Cygnus PowerPC ELF backend. Written in the absence of an ABI. */ - #define EM_CYGNUS_POWERPC 0x9025 - -@@ -607,6 +605,16 @@ - /* Values for NetBSD .note.netbsd.ident notes. Note name is "NetBSD". */ - - #define NT_NETBSD_IDENT 1 -+#define NT_NETBSD_MARCH 5 -+ -+/* Values for NetBSD .note.netbsd.ident notes. Note name is "PaX". */ -+#define NT_NETBSD_PAX 3 -+#define NT_NETBSD_PAX_MPROTECT 0x01 /* Force enable Mprotect */ -+#define NT_NETBSD_PAX_NOMPROTECT 0x02 /* Force disable Mprotect */ -+#define NT_NETBSD_PAX_GUARD 0x04 /* Force enable Segvguard */ -+#define NT_NETBSD_PAX_NOGUARD 0x08 /* Force disable Servguard */ -+#define NT_NETBSD_PAX_ASLR 0x10 /* Force enable ASLR */ -+#define NT_NETBSD_PAX_NOASLR 0x20 /* Force disable ASLR */ - - /* Values for OpenBSD .note.openbsd.ident notes. Note name is "OpenBSD". */ - -diff -rNU3 dist.orig/include/elf/openrisc.h dist/include/elf/openrisc.h ---- dist.orig/include/elf/openrisc.h 2010-04-15 12:26:08.000000000 +0200 -+++ dist/include/elf/openrisc.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,39 +0,0 @@ --/* OpenRISC ELF support for BFD. -- Copyright 2001, 2010 Free Software Foundation, Inc. -- -- This file is part of BFD, the Binary File Descriptor library. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software Foundation, -- Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -- --#ifndef _ELF_OPENRISC_H --#define _ELF_OPENRISC_H -- --#include "elf/reloc-macros.h" -- --/* Relocations. */ --START_RELOC_NUMBERS (elf_openrisc_reloc_type) -- RELOC_NUMBER (R_OPENRISC_NONE, 0) -- RELOC_NUMBER (R_OPENRISC_INSN_REL_26, 1) -- RELOC_NUMBER (R_OPENRISC_INSN_ABS_26, 2) -- RELOC_NUMBER (R_OPENRISC_LO_16_IN_INSN, 3) -- RELOC_NUMBER (R_OPENRISC_HI_16_IN_INSN, 4) -- RELOC_NUMBER (R_OPENRISC_8, 5) -- RELOC_NUMBER (R_OPENRISC_16, 6) -- RELOC_NUMBER (R_OPENRISC_32, 7) -- RELOC_NUMBER (R_OPENRISC_GNU_VTINHERIT, 8) -- RELOC_NUMBER (R_OPENRISC_GNU_VTENTRY, 9) --END_RELOC_NUMBERS (R_OPENRISC_max) -- --#endif /* _ELF_OPENRISC_H */ -diff -rNU3 dist.orig/include/elf/or1k.h dist/include/elf/or1k.h ---- dist.orig/include/elf/or1k.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/include/elf/or1k.h 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,65 @@ -+/* Or1k ELF support for BFD. -+ Copyright 2001-2014 Free Software Foundation, Inc. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, see */ -+ -+#ifndef _ELF_OR1K_H -+#define _ELF_OR1K_H -+ -+#include "elf/reloc-macros.h" -+ -+/* Relocations. */ -+START_RELOC_NUMBERS (elf_or1k_reloc_type) -+ RELOC_NUMBER (R_OR1K_NONE, 0) -+ RELOC_NUMBER (R_OR1K_32, 1) -+ RELOC_NUMBER (R_OR1K_16, 2) -+ RELOC_NUMBER (R_OR1K_8, 3) -+ RELOC_NUMBER (R_OR1K_LO_16_IN_INSN, 4) -+ RELOC_NUMBER (R_OR1K_HI_16_IN_INSN, 5) -+ RELOC_NUMBER (R_OR1K_INSN_REL_26, 6) -+ RELOC_NUMBER (R_OR1K_GNU_VTENTRY, 7) -+ RELOC_NUMBER (R_OR1K_GNU_VTINHERIT, 8) -+ RELOC_NUMBER (R_OR1K_32_PCREL, 9) -+ RELOC_NUMBER (R_OR1K_16_PCREL, 10) -+ RELOC_NUMBER (R_OR1K_8_PCREL, 11) -+ RELOC_NUMBER (R_OR1K_GOTPC_HI16, 12) -+ RELOC_NUMBER (R_OR1K_GOTPC_LO16, 13) -+ RELOC_NUMBER (R_OR1K_GOT16, 14) -+ RELOC_NUMBER (R_OR1K_PLT26, 15) -+ RELOC_NUMBER (R_OR1K_GOTOFF_HI16, 16) -+ RELOC_NUMBER (R_OR1K_GOTOFF_LO16, 17) -+ RELOC_NUMBER (R_OR1K_COPY, 18) -+ RELOC_NUMBER (R_OR1K_GLOB_DAT, 19) -+ RELOC_NUMBER (R_OR1K_JMP_SLOT, 20) -+ RELOC_NUMBER (R_OR1K_RELATIVE, 21) -+ RELOC_NUMBER (R_OR1K_TLS_GD_HI16, 22) -+ RELOC_NUMBER (R_OR1K_TLS_GD_LO16, 23) -+ RELOC_NUMBER (R_OR1K_TLS_LDM_HI16, 24) -+ RELOC_NUMBER (R_OR1K_TLS_LDM_LO16, 25) -+ RELOC_NUMBER (R_OR1K_TLS_LDO_HI16, 26) -+ RELOC_NUMBER (R_OR1K_TLS_LDO_LO16, 27) -+ RELOC_NUMBER (R_OR1K_TLS_IE_HI16, 28) -+ RELOC_NUMBER (R_OR1K_TLS_IE_LO16, 29) -+ RELOC_NUMBER (R_OR1K_TLS_LE_HI16, 30) -+ RELOC_NUMBER (R_OR1K_TLS_LE_LO16, 31) -+ RELOC_NUMBER (R_OR1K_TLS_TPOFF, 32) -+ RELOC_NUMBER (R_OR1K_TLS_DTPOFF, 33) -+ RELOC_NUMBER (R_OR1K_TLS_DTPMOD, 34) -+END_RELOC_NUMBERS (R_OR1K_max) -+ -+#define EF_OR1K_NODELAY (1UL << 0) -+ -+#endif /* _ELF_OR1K_H */ -diff -rNU3 dist.orig/include/elf/or32.h dist/include/elf/or32.h ---- dist.orig/include/elf/or32.h 2010-05-18 05:31:06.000000000 +0200 -+++ dist/include/elf/or32.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,56 +0,0 @@ --/* OR1K ELF support for BFD. Derived from ppc.h. -- Copyright (C) 2002, 2010 Free Software Foundation, Inc. -- Contributed by Ivan Guzvinec -- -- This file is part of BFD, the Binary File Descriptor library. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#ifndef _ELF_OR1K_H --#define _ELF_OR1K_H -- --#include "elf/reloc-macros.h" -- --/* Relocations. */ --START_RELOC_NUMBERS (elf_or32_reloc_type) -- RELOC_NUMBER (R_OR32_NONE, 0) -- RELOC_NUMBER (R_OR32_32, 1) -- RELOC_NUMBER (R_OR32_16, 2) -- RELOC_NUMBER (R_OR32_8, 3) -- RELOC_NUMBER (R_OR32_CONST, 4) -- RELOC_NUMBER (R_OR32_CONSTH, 5) -- RELOC_NUMBER (R_OR32_JUMPTARG, 6) -- RELOC_NUMBER (R_OR32_GNU_VTENTRY, 7) -- RELOC_NUMBER (R_OR32_GNU_VTINHERIT, 8) --END_RELOC_NUMBERS (R_OR32_max) -- --/* Four bit OR32 machine type field. */ --#define EF_OR32_MACH 0x0000000f -- --/* Various CPU types. */ --#define E_OR32_MACH_BASE 0x00000000 --#define E_OR32_MACH_UNUSED1 0x00000001 --#define E_OR32_MACH_UNUSED2 0x00000002 --#define E_OR32_MACH_UNUSED4 0x00000003 -- --/* Processor specific section headers, sh_type field */ --#define SHT_ORDERED SHT_HIPROC /* Link editor is to sort the \ -- entries in this section \ -- based on the address \ -- specified in the associated \ -- symbol table entry. */ -- --#endif /* _ELF_OR1K_H */ -diff -rNU3 dist.orig/include/elf/riscv.h dist/include/elf/riscv.h ---- dist.orig/include/elf/riscv.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/include/elf/riscv.h 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,138 @@ -+/* RISC-V ELF support for BFD. -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrw Waterman at UC Berkeley. -+ Based on MIPS ELF support for BFD, by Ian Lance Taylor. -+ -+ This file is part of BFD, the Binary File Descriptor library. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+/* This file holds definitions specific to the RISCV ELF ABI. Note -+ that most of this is not actually implemented by BFD. */ -+ -+#ifndef _ELF_RISCV_H -+#define _ELF_RISCV_H -+ -+#include "elf/reloc-macros.h" -+ -+/* Relocation types. */ -+START_RELOC_NUMBERS (elf_riscv_reloc_type) -+ /* Relocation types used by the dynamic linker. */ -+ RELOC_NUMBER (R_RISCV_NONE, 0) -+ RELOC_NUMBER (R_RISCV_32, 1) -+ RELOC_NUMBER (R_RISCV_64, 2) -+ RELOC_NUMBER (R_RISCV_RELATIVE, 3) -+ RELOC_NUMBER (R_RISCV_COPY, 4) -+ RELOC_NUMBER (R_RISCV_JUMP_SLOT, 5) -+ RELOC_NUMBER (R_RISCV_TLS_DTPMOD32, 6) -+ RELOC_NUMBER (R_RISCV_TLS_DTPMOD64, 7) -+ RELOC_NUMBER (R_RISCV_TLS_DTPREL32, 8) -+ RELOC_NUMBER (R_RISCV_TLS_DTPREL64, 9) -+ RELOC_NUMBER (R_RISCV_TLS_TPREL32, 10) -+ RELOC_NUMBER (R_RISCV_TLS_TPREL64, 11) -+ -+ /* Relocation types not used by the dynamic linker. */ -+ RELOC_NUMBER (R_RISCV_BRANCH, 16) -+ RELOC_NUMBER (R_RISCV_JAL, 17) -+ RELOC_NUMBER (R_RISCV_CALL, 18) -+ RELOC_NUMBER (R_RISCV_CALL_PLT, 19) -+ RELOC_NUMBER (R_RISCV_GOT_HI20, 20) -+ RELOC_NUMBER (R_RISCV_TLS_GOT_HI20, 21) -+ RELOC_NUMBER (R_RISCV_TLS_GD_HI20, 22) -+ RELOC_NUMBER (R_RISCV_PCREL_HI20, 23) -+ RELOC_NUMBER (R_RISCV_PCREL_LO12_I, 24) -+ RELOC_NUMBER (R_RISCV_PCREL_LO12_S, 25) -+ RELOC_NUMBER (R_RISCV_HI20, 26) -+ RELOC_NUMBER (R_RISCV_LO12_I, 27) -+ RELOC_NUMBER (R_RISCV_LO12_S, 28) -+ RELOC_NUMBER (R_RISCV_TPREL_HI20, 29) -+ RELOC_NUMBER (R_RISCV_TPREL_LO12_I, 30) -+ RELOC_NUMBER (R_RISCV_TPREL_LO12_S, 31) -+ RELOC_NUMBER (R_RISCV_TPREL_ADD, 32) -+ RELOC_NUMBER (R_RISCV_ADD8, 33) -+ RELOC_NUMBER (R_RISCV_ADD16, 34) -+ RELOC_NUMBER (R_RISCV_ADD32, 35) -+ RELOC_NUMBER (R_RISCV_ADD64, 36) -+ RELOC_NUMBER (R_RISCV_SUB8, 37) -+ RELOC_NUMBER (R_RISCV_SUB16, 38) -+ RELOC_NUMBER (R_RISCV_SUB32, 39) -+ RELOC_NUMBER (R_RISCV_SUB64, 40) -+ RELOC_NUMBER (R_RISCV_GNU_VTINHERIT, 41) -+ RELOC_NUMBER (R_RISCV_GNU_VTENTRY, 42) -+ RELOC_NUMBER (R_RISCV_ALIGN, 43) -+END_RELOC_NUMBERS (R_RISCV_max) -+ -+/* Processor specific flags for the ELF header e_flags field. */ -+ -+/* Custom flag definitions. */ -+ -+#define EF_RISCV_EXT_MASK 0xffff -+#define EF_RISCV_EXT_SH 16 -+#define E_RISCV_EXT_Xcustom 0x0000 -+#define E_RISCV_EXT_Xhwacha 0x0001 -+#define E_RISCV_EXT_RESERVED 0xffff -+ -+#define EF_GET_RISCV_EXT(x) \ -+ ((x >> EF_RISCV_EXT_SH) & EF_RISCV_EXT_MASK) -+ -+#define EF_SET_RISCV_EXT(x, ext) \ -+ do { x |= ((ext & EF_RISCV_EXT_MASK) << EF_RISCV_EXT_SH); } while (0) -+ -+#define EF_IS_RISCV_EXT_Xcustom(x) \ -+ (EF_GET_RISCV_EXT(x) == E_RISCV_EXT_Xcustom) -+ -+/* A mapping from extension names to elf flags */ -+ -+struct riscv_extension_entry -+{ -+ const char* name; -+ unsigned int flag; -+}; -+ -+static const struct riscv_extension_entry riscv_extension_map[] = -+{ -+ {"Xcustom", E_RISCV_EXT_Xcustom}, -+ {"Xhwacha", E_RISCV_EXT_Xhwacha}, -+}; -+ -+/* Given an extension name, return an elf flag. */ -+ -+static inline const char* riscv_elf_flag_to_name(unsigned int flag) -+{ -+ unsigned int i; -+ -+ for (i=0; icurrent_space \ -+ (__len != 0 && __len <= __o->current_space \ - ? (__o->current_ptr += __len, \ - __o->current_space -= __len, \ - (void *) (__o->current_ptr - __len)) \ -diff -rNU3 dist.orig/include/opcode/mips.h dist/include/opcode/mips.h ---- dist.orig/include/opcode/mips.h 2012-09-04 16:21:05.000000000 +0200 -+++ dist/include/opcode/mips.h 2015-10-18 13:11:17.000000000 +0200 -@@ -1035,7 +1035,11 @@ - M_DSUB_I, - M_DSUBU_I, - M_DSUBU_I_2, -+ M_JR_S, -+ M_J_S, - M_J_A, -+ M_JALR_S, -+ M_JALR_DS, - M_JAL_1, - M_JAL_2, - M_JAL_A, -diff -rNU3 dist.orig/include/opcode/riscv-opc.h dist/include/opcode/riscv-opc.h ---- dist.orig/include/opcode/riscv-opc.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/include/opcode/riscv-opc.h 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,1234 @@ -+/* Automatically generated by parse-opcodes */ -+#ifndef RISCV_ENCODING_H -+#define RISCV_ENCODING_H -+#define MATCH_CUSTOM3_RD_RS1_RS2 0x707b -+#define MASK_CUSTOM3_RD_RS1_RS2 0x707f -+#define MATCH_VLSEGSTWU 0xc00305b -+#define MASK_VLSEGSTWU 0x1e00707f -+#define MATCH_C_LW0 0x12 -+#define MASK_C_LW0 0x801f -+#define MATCH_FMV_D_X 0xf2000053 -+#define MASK_FMV_D_X 0xfff0707f -+#define MATCH_VLH 0x200205b -+#define MASK_VLH 0xfff0707f -+#define MATCH_C_LI 0x0 -+#define MASK_C_LI 0x1f -+#define MATCH_FADD_D 0x2000053 -+#define MASK_FADD_D 0xfe00007f -+#define MATCH_C_LD 0x9 -+#define MASK_C_LD 0x1f -+#define MATCH_VLD 0x600205b -+#define MASK_VLD 0xfff0707f -+#define MATCH_FADD_S 0x53 -+#define MASK_FADD_S 0xfe00007f -+#define MATCH_C_LW 0xa -+#define MASK_C_LW 0x1f -+#define MATCH_VLW 0x400205b -+#define MASK_VLW 0xfff0707f -+#define MATCH_VSSEGSTW 0x400307b -+#define MASK_VSSEGSTW 0x1e00707f -+#define MATCH_UTIDX 0x6077 -+#define MASK_UTIDX 0xfffff07f -+#define MATCH_C_FLW 0x14 -+#define MASK_C_FLW 0x1f -+#define MATCH_FSUB_D 0xa000053 -+#define MASK_FSUB_D 0xfe00007f -+#define MATCH_VSSEGSTD 0x600307b -+#define MASK_VSSEGSTD 0x1e00707f -+#define MATCH_VSSEGSTB 0x307b -+#define MASK_VSSEGSTB 0x1e00707f -+#define MATCH_DIV 0x2004033 -+#define MASK_DIV 0xfe00707f -+#define MATCH_FMV_H_X 0xf4000053 -+#define MASK_FMV_H_X 0xfff0707f -+#define MATCH_C_FLD 0x15 -+#define MASK_C_FLD 0x1f -+#define MATCH_FRRM 0x202073 -+#define MASK_FRRM 0xfffff07f -+#define MATCH_VFMSV_S 0x1000202b -+#define MASK_VFMSV_S 0xfff0707f -+#define MATCH_C_LWSP 0x5 -+#define MASK_C_LWSP 0x1f -+#define MATCH_FENCE 0xf -+#define MASK_FENCE 0x707f -+#define MATCH_FNMSUB_S 0x4b -+#define MASK_FNMSUB_S 0x600007f -+#define MATCH_FLE_S 0xa0000053 -+#define MASK_FLE_S 0xfe00707f -+#define MATCH_FNMSUB_H 0x400004b -+#define MASK_FNMSUB_H 0x600007f -+#define MATCH_FLE_H 0xbc000053 -+#define MASK_FLE_H 0xfe00707f -+#define MATCH_FLW 0x2007 -+#define MASK_FLW 0x707f -+#define MATCH_VSETVL 0x600b -+#define MASK_VSETVL 0xfff0707f -+#define MATCH_VFMSV_D 0x1200202b -+#define MASK_VFMSV_D 0xfff0707f -+#define MATCH_FLE_D 0xa2000053 -+#define MASK_FLE_D 0xfe00707f -+#define MATCH_FENCE_I 0x100f -+#define MASK_FENCE_I 0x707f -+#define MATCH_FNMSUB_D 0x200004b -+#define MASK_FNMSUB_D 0x600007f -+#define MATCH_ADDW 0x3b -+#define MASK_ADDW 0xfe00707f -+#define MATCH_XOR 0x4033 -+#define MASK_XOR 0xfe00707f -+#define MATCH_SUB 0x40000033 -+#define MASK_SUB 0xfe00707f -+#define MATCH_VSSTW 0x400307b -+#define MASK_VSSTW 0xfe00707f -+#define MATCH_VSSTH 0x200307b -+#define MASK_VSSTH 0xfe00707f -+#define MATCH_SC_W 0x1800202f -+#define MASK_SC_W 0xf800707f -+#define MATCH_VSSTB 0x307b -+#define MASK_VSSTB 0xfe00707f -+#define MATCH_VSSTD 0x600307b -+#define MASK_VSSTD 0xfe00707f -+#define MATCH_ADDI 0x13 -+#define MASK_ADDI 0x707f -+#define MATCH_RDTIMEH 0xc8102073 -+#define MASK_RDTIMEH 0xfffff07f -+#define MATCH_MULH 0x2001033 -+#define MASK_MULH 0xfe00707f -+#define MATCH_CSRRSI 0x6073 -+#define MASK_CSRRSI 0x707f -+#define MATCH_FCVT_D_WU 0xd2100053 -+#define MASK_FCVT_D_WU 0xfff0007f -+#define MATCH_MULW 0x200003b -+#define MASK_MULW 0xfe00707f -+#define MATCH_CUSTOM1_RD_RS1_RS2 0x702b -+#define MASK_CUSTOM1_RD_RS1_RS2 0x707f -+#define MATCH_VENQIMM1 0xc00302b -+#define MASK_VENQIMM1 0xfe007fff -+#define MATCH_VENQIMM2 0xe00302b -+#define MASK_VENQIMM2 0xfe007fff -+#define MATCH_RDINSTRET 0xc0202073 -+#define MASK_RDINSTRET 0xfffff07f -+#define MATCH_C_SWSP 0x8 -+#define MASK_C_SWSP 0x1f -+#define MATCH_VLSTW 0x400305b -+#define MASK_VLSTW 0xfe00707f -+#define MATCH_VLSTH 0x200305b -+#define MASK_VLSTH 0xfe00707f -+#define MATCH_VLSTB 0x305b -+#define MASK_VLSTB 0xfe00707f -+#define MATCH_VLSTD 0x600305b -+#define MASK_VLSTD 0xfe00707f -+#define MATCH_ANDI 0x7013 -+#define MASK_ANDI 0x707f -+#define MATCH_FMV_X_S 0xe0000053 -+#define MASK_FMV_X_S 0xfff0707f -+#define MATCH_CUSTOM0_RD_RS1_RS2 0x700b -+#define MASK_CUSTOM0_RD_RS1_RS2 0x707f -+#define MATCH_FNMADD_S 0x4f -+#define MASK_FNMADD_S 0x600007f -+#define MATCH_LWU 0x6003 -+#define MASK_LWU 0x707f -+#define MATCH_CUSTOM0_RS1 0x200b -+#define MASK_CUSTOM0_RS1 0x707f -+#define MATCH_VLSEGSTBU 0x800305b -+#define MASK_VLSEGSTBU 0x1e00707f -+#define MATCH_FNMADD_D 0x200004f -+#define MASK_FNMADD_D 0x600007f -+#define MATCH_FCVT_W_S 0xc0000053 -+#define MASK_FCVT_W_S 0xfff0007f -+#define MATCH_C_SRAI 0x1019 -+#define MASK_C_SRAI 0x1c1f -+#define MATCH_MULHSU 0x2002033 -+#define MASK_MULHSU 0xfe00707f -+#define MATCH_FCVT_D_LU 0xd2300053 -+#define MASK_FCVT_D_LU 0xfff0007f -+#define MATCH_FCVT_W_D 0xc2000053 -+#define MASK_FCVT_W_D 0xfff0007f -+#define MATCH_FSUB_H 0xc000053 -+#define MASK_FSUB_H 0xfe00007f -+#define MATCH_DIVUW 0x200503b -+#define MASK_DIVUW 0xfe00707f -+#define MATCH_SLTI 0x2013 -+#define MASK_SLTI 0x707f -+#define MATCH_VLSTBU 0x800305b -+#define MASK_VLSTBU 0xfe00707f -+#define MATCH_SLTU 0x3033 -+#define MASK_SLTU 0xfe00707f -+#define MATCH_FLH 0x1007 -+#define MASK_FLH 0x707f -+#define MATCH_CUSTOM2_RD_RS1_RS2 0x705b -+#define MASK_CUSTOM2_RD_RS1_RS2 0x707f -+#define MATCH_FLD 0x3007 -+#define MASK_FLD 0x707f -+#define MATCH_FSUB_S 0x8000053 -+#define MASK_FSUB_S 0xfe00007f -+#define MATCH_FCVT_H_LU 0x6c000053 -+#define MASK_FCVT_H_LU 0xfff0007f -+#define MATCH_CUSTOM0 0xb -+#define MASK_CUSTOM0 0x707f -+#define MATCH_CUSTOM1 0x2b -+#define MASK_CUSTOM1 0x707f -+#define MATCH_CUSTOM2 0x5b -+#define MASK_CUSTOM2 0x707f -+#define MATCH_CUSTOM3 0x7b -+#define MASK_CUSTOM3 0x707f -+#define MATCH_VXCPTSAVE 0x302b -+#define MASK_VXCPTSAVE 0xfff07fff -+#define MATCH_VMSV 0x200202b -+#define MASK_VMSV 0xfff0707f -+#define MATCH_FCVT_LU_S 0xc0300053 -+#define MASK_FCVT_LU_S 0xfff0007f -+#define MATCH_AUIPC 0x17 -+#define MASK_AUIPC 0x7f -+#define MATCH_FRFLAGS 0x102073 -+#define MASK_FRFLAGS 0xfffff07f -+#define MATCH_FCVT_LU_D 0xc2300053 -+#define MASK_FCVT_LU_D 0xfff0007f -+#define MATCH_CSRRWI 0x5073 -+#define MASK_CSRRWI 0x707f -+#define MATCH_FADD_H 0x4000053 -+#define MASK_FADD_H 0xfe00007f -+#define MATCH_FSQRT_S 0x58000053 -+#define MASK_FSQRT_S 0xfff0007f -+#define MATCH_VXCPTKILL 0x400302b -+#define MASK_VXCPTKILL 0xffffffff -+#define MATCH_STOP 0x5077 -+#define MASK_STOP 0xffffffff -+#define MATCH_FSGNJN_S 0x20001053 -+#define MASK_FSGNJN_S 0xfe00707f -+#define MATCH_FSGNJN_H 0x34000053 -+#define MASK_FSGNJN_H 0xfe00707f -+#define MATCH_FSQRT_D 0x5a000053 -+#define MASK_FSQRT_D 0xfff0007f -+#define MATCH_XORI 0x4013 -+#define MASK_XORI 0x707f -+#define MATCH_DIVU 0x2005033 -+#define MASK_DIVU 0xfe00707f -+#define MATCH_FSGNJN_D 0x22001053 -+#define MASK_FSGNJN_D 0xfe00707f -+#define MATCH_FSQRT_H 0x24000053 -+#define MASK_FSQRT_H 0xfff0007f -+#define MATCH_VSSEGSTH 0x200307b -+#define MASK_VSSEGSTH 0x1e00707f -+#define MATCH_SW 0x2023 -+#define MASK_SW 0x707f -+#define MATCH_VLSTWU 0xc00305b -+#define MASK_VLSTWU 0xfe00707f -+#define MATCH_VFSSEGW 0x1400207b -+#define MASK_VFSSEGW 0x1ff0707f -+#define MATCH_LHU 0x5003 -+#define MASK_LHU 0x707f -+#define MATCH_SH 0x1023 -+#define MASK_SH 0x707f -+#define MATCH_FMSUB_H 0x4000047 -+#define MASK_FMSUB_H 0x600007f -+#define MATCH_VXCPTAUX 0x200402b -+#define MASK_VXCPTAUX 0xfffff07f -+#define MATCH_FMSUB_D 0x2000047 -+#define MASK_FMSUB_D 0x600007f -+#define MATCH_VFSSEGD 0x1600207b -+#define MASK_VFSSEGD 0x1ff0707f -+#define MATCH_VLSEGHU 0xa00205b -+#define MASK_VLSEGHU 0x1ff0707f -+#define MATCH_MOVN 0x2007077 -+#define MASK_MOVN 0xfe00707f -+#define MATCH_CUSTOM1_RS1 0x202b -+#define MASK_CUSTOM1_RS1 0x707f -+#define MATCH_VLSTHU 0xa00305b -+#define MASK_VLSTHU 0xfe00707f -+#define MATCH_MOVZ 0x7077 -+#define MASK_MOVZ 0xfe00707f -+#define MATCH_CSRRW 0x1073 -+#define MASK_CSRRW 0x707f -+#define MATCH_LD 0x3003 -+#define MASK_LD 0x707f -+#define MATCH_LB 0x3 -+#define MASK_LB 0x707f -+#define MATCH_VLWU 0xc00205b -+#define MASK_VLWU 0xfff0707f -+#define MATCH_LH 0x1003 -+#define MASK_LH 0x707f -+#define MATCH_LW 0x2003 -+#define MASK_LW 0x707f -+#define MATCH_CSRRC 0x3073 -+#define MASK_CSRRC 0x707f -+#define MATCH_FCVT_LU_H 0x4c000053 -+#define MASK_FCVT_LU_H 0xfff0007f -+#define MATCH_FCVT_S_D 0x40100053 -+#define MASK_FCVT_S_D 0xfff0007f -+#define MATCH_BGEU 0x7063 -+#define MASK_BGEU 0x707f -+#define MATCH_VFLSTD 0x1600305b -+#define MASK_VFLSTD 0xfe00707f -+#define MATCH_FCVT_S_L 0xd0200053 -+#define MASK_FCVT_S_L 0xfff0007f -+#define MATCH_FCVT_S_H 0x84000053 -+#define MASK_FCVT_S_H 0xfff0007f -+#define MATCH_FSCSR 0x301073 -+#define MASK_FSCSR 0xfff0707f -+#define MATCH_FCVT_S_W 0xd0000053 -+#define MASK_FCVT_S_W 0xfff0007f -+#define MATCH_VFLSTW 0x1400305b -+#define MASK_VFLSTW 0xfe00707f -+#define MATCH_VXCPTEVAC 0x600302b -+#define MASK_VXCPTEVAC 0xfff07fff -+#define MATCH_AMOMINU_D 0xc000302f -+#define MASK_AMOMINU_D 0xf800707f -+#define MATCH_FSFLAGS 0x101073 -+#define MASK_FSFLAGS 0xfff0707f -+#define MATCH_SRLI 0x5013 -+#define MASK_SRLI 0xfc00707f -+#define MATCH_C_SRLI 0x819 -+#define MASK_C_SRLI 0x1c1f -+#define MATCH_AMOMINU_W 0xc000202f -+#define MASK_AMOMINU_W 0xf800707f -+#define MATCH_SRLW 0x503b -+#define MASK_SRLW 0xfe00707f -+#define MATCH_VFLSEGW 0x1400205b -+#define MASK_VFLSEGW 0x1ff0707f -+#define MATCH_C_LD0 0x8012 -+#define MASK_C_LD0 0x801f -+#define MATCH_VLSEGBU 0x800205b -+#define MASK_VLSEGBU 0x1ff0707f -+#define MATCH_JALR 0x67 -+#define MASK_JALR 0x707f -+#define MATCH_BLT 0x4063 -+#define MASK_BLT 0x707f -+#define MATCH_CUSTOM2_RD_RS1 0x605b -+#define MASK_CUSTOM2_RD_RS1 0x707f -+#define MATCH_FCLASS_S 0xe0001053 -+#define MASK_FCLASS_S 0xfff0707f -+#define MATCH_SFENCE_VM 0x10100073 -+#define MASK_SFENCE_VM 0xfff07fff -+#define MATCH_REM 0x2006033 -+#define MASK_REM 0xfe00707f -+#define MATCH_FCLASS_D 0xe2001053 -+#define MASK_FCLASS_D 0xfff0707f -+#define MATCH_FMUL_S 0x10000053 -+#define MASK_FMUL_S 0xfe00007f -+#define MATCH_RDCYCLEH 0xc8002073 -+#define MASK_RDCYCLEH 0xfffff07f -+#define MATCH_VLSEGSTHU 0xa00305b -+#define MASK_VLSEGSTHU 0x1e00707f -+#define MATCH_FMUL_D 0x12000053 -+#define MASK_FMUL_D 0xfe00007f -+#define MATCH_ORI 0x6013 -+#define MASK_ORI 0x707f -+#define MATCH_FMUL_H 0x14000053 -+#define MASK_FMUL_H 0xfe00007f -+#define MATCH_VFLSEGD 0x1600205b -+#define MASK_VFLSEGD 0x1ff0707f -+#define MATCH_FEQ_S 0xa0002053 -+#define MASK_FEQ_S 0xfe00707f -+#define MATCH_FSGNJX_D 0x22002053 -+#define MASK_FSGNJX_D 0xfe00707f -+#define MATCH_SRAIW 0x4000501b -+#define MASK_SRAIW 0xfe00707f -+#define MATCH_FSGNJX_H 0x3c000053 -+#define MASK_FSGNJX_H 0xfe00707f -+#define MATCH_FSGNJX_S 0x20002053 -+#define MASK_FSGNJX_S 0xfe00707f -+#define MATCH_FEQ_D 0xa2002053 -+#define MASK_FEQ_D 0xfe00707f -+#define MATCH_CUSTOM1_RD_RS1 0x602b -+#define MASK_CUSTOM1_RD_RS1 0x707f -+#define MATCH_FEQ_H 0xac000053 -+#define MASK_FEQ_H 0xfe00707f -+#define MATCH_AMOMAXU_D 0xe000302f -+#define MASK_AMOMAXU_D 0xf800707f -+#define MATCH_DIVW 0x200403b -+#define MASK_DIVW 0xfe00707f -+#define MATCH_AMOMAXU_W 0xe000202f -+#define MASK_AMOMAXU_W 0xf800707f -+#define MATCH_SRAI_RV32 0x40005013 -+#define MASK_SRAI_RV32 0xfe00707f -+#define MATCH_C_SRLI32 0xc19 -+#define MASK_C_SRLI32 0x1c1f -+#define MATCH_VFSSTW 0x1400307b -+#define MASK_VFSSTW 0xfe00707f -+#define MATCH_CUSTOM0_RD 0x400b -+#define MASK_CUSTOM0_RD 0x707f -+#define MATCH_C_BEQ 0x10 -+#define MASK_C_BEQ 0x1f -+#define MATCH_VFSSTD 0x1600307b -+#define MASK_VFSSTD 0xfe00707f -+#define MATCH_CUSTOM3_RD_RS1 0x607b -+#define MASK_CUSTOM3_RD_RS1 0x707f -+#define MATCH_LR_D 0x1000302f -+#define MASK_LR_D 0xf9f0707f -+#define MATCH_LR_W 0x1000202f -+#define MASK_LR_W 0xf9f0707f -+#define MATCH_FCVT_H_WU 0x7c000053 -+#define MASK_FCVT_H_WU 0xfff0007f -+#define MATCH_VMVV 0x200002b -+#define MASK_VMVV 0xfff0707f -+#define MATCH_SLLW 0x103b -+#define MASK_SLLW 0xfe00707f -+#define MATCH_SLLI 0x1013 -+#define MASK_SLLI 0xfc00707f -+#define MATCH_BEQ 0x63 -+#define MASK_BEQ 0x707f -+#define MATCH_AND 0x7033 -+#define MASK_AND 0xfe00707f -+#define MATCH_LBU 0x4003 -+#define MASK_LBU 0x707f -+#define MATCH_FSGNJ_S 0x20000053 -+#define MASK_FSGNJ_S 0xfe00707f -+#define MATCH_FMSUB_S 0x47 -+#define MASK_FMSUB_S 0x600007f -+#define MATCH_C_SUB3 0x11c -+#define MASK_C_SUB3 0x31f -+#define MATCH_FSGNJ_H 0x2c000053 -+#define MASK_FSGNJ_H 0xfe00707f -+#define MATCH_VLB 0x205b -+#define MASK_VLB 0xfff0707f -+#define MATCH_C_ADDIW 0x1d -+#define MASK_C_ADDIW 0x1f -+#define MATCH_CUSTOM3_RS1_RS2 0x307b -+#define MASK_CUSTOM3_RS1_RS2 0x707f -+#define MATCH_FSGNJ_D 0x22000053 -+#define MASK_FSGNJ_D 0xfe00707f -+#define MATCH_VLSEGWU 0xc00205b -+#define MASK_VLSEGWU 0x1ff0707f -+#define MATCH_FCVT_S_WU 0xd0100053 -+#define MASK_FCVT_S_WU 0xfff0007f -+#define MATCH_CUSTOM3_RS1 0x207b -+#define MASK_CUSTOM3_RS1 0x707f -+#define MATCH_SC_D 0x1800302f -+#define MASK_SC_D 0xf800707f -+#define MATCH_VFSW 0x1400207b -+#define MASK_VFSW 0xfff0707f -+#define MATCH_AMOSWAP_D 0x800302f -+#define MASK_AMOSWAP_D 0xf800707f -+#define MATCH_SB 0x23 -+#define MASK_SB 0x707f -+#define MATCH_AMOSWAP_W 0x800202f -+#define MASK_AMOSWAP_W 0xf800707f -+#define MATCH_VFSD 0x1600207b -+#define MASK_VFSD 0xfff0707f -+#define MATCH_CUSTOM2_RS1 0x205b -+#define MASK_CUSTOM2_RS1 0x707f -+#define MATCH_SD 0x3023 -+#define MASK_SD 0x707f -+#define MATCH_FMV_S_X 0xf0000053 -+#define MASK_FMV_S_X 0xfff0707f -+#define MATCH_REMUW 0x200703b -+#define MASK_REMUW 0xfe00707f -+#define MATCH_JAL 0x6f -+#define MASK_JAL 0x7f -+#define MATCH_C_FSD 0x18 -+#define MASK_C_FSD 0x1f -+#define MATCH_RDCYCLE 0xc0002073 -+#define MASK_RDCYCLE 0xfffff07f -+#define MATCH_C_BNE 0x11 -+#define MASK_C_BNE 0x1f -+#define MATCH_C_ADD 0x1a -+#define MASK_C_ADD 0x801f -+#define MATCH_VXCPTCAUSE 0x402b -+#define MASK_VXCPTCAUSE 0xfffff07f -+#define MATCH_VGETCFG 0x400b -+#define MASK_VGETCFG 0xfffff07f -+#define MATCH_LUI 0x37 -+#define MASK_LUI 0x7f -+#define MATCH_VSETCFG 0x200b -+#define MASK_VSETCFG 0x7fff -+#define MATCH_C_SDSP 0x6 -+#define MASK_C_SDSP 0x1f -+#define MATCH_C_LDSP 0x4 -+#define MASK_C_LDSP 0x1f -+#define MATCH_FNMADD_H 0x400004f -+#define MASK_FNMADD_H 0x600007f -+#define MATCH_CUSTOM0_RS1_RS2 0x300b -+#define MASK_CUSTOM0_RS1_RS2 0x707f -+#define MATCH_SLLI_RV32 0x1013 -+#define MASK_SLLI_RV32 0xfe00707f -+#define MATCH_MUL 0x2000033 -+#define MASK_MUL 0xfe00707f -+#define MATCH_CSRRCI 0x7073 -+#define MASK_CSRRCI 0x707f -+#define MATCH_C_SRAI32 0x1419 -+#define MASK_C_SRAI32 0x1c1f -+#define MATCH_FLT_H 0xb4000053 -+#define MASK_FLT_H 0xfe00707f -+#define MATCH_SRAI 0x40005013 -+#define MASK_SRAI 0xfc00707f -+#define MATCH_AMOAND_D 0x6000302f -+#define MASK_AMOAND_D 0xf800707f -+#define MATCH_FLT_D 0xa2001053 -+#define MASK_FLT_D 0xfe00707f -+#define MATCH_SRAW 0x4000503b -+#define MASK_SRAW 0xfe00707f -+#define MATCH_CSRRS 0x2073 -+#define MASK_CSRRS 0x707f -+#define MATCH_FLT_S 0xa0001053 -+#define MASK_FLT_S 0xfe00707f -+#define MATCH_ADDIW 0x1b -+#define MASK_ADDIW 0x707f -+#define MATCH_AMOAND_W 0x6000202f -+#define MASK_AMOAND_W 0xf800707f -+#define MATCH_CUSTOM2_RD 0x405b -+#define MASK_CUSTOM2_RD 0x707f -+#define MATCH_MRTS 0x30500073 -+#define MASK_MRTS 0xffffffff -+#define MATCH_FCVT_WU_D 0xc2100053 -+#define MASK_FCVT_WU_D 0xfff0007f -+#define MATCH_AMOXOR_W 0x2000202f -+#define MASK_AMOXOR_W 0xf800707f -+#define MATCH_FCVT_D_L 0xd2200053 -+#define MASK_FCVT_D_L 0xfff0007f -+#define MATCH_FCVT_WU_H 0x5c000053 -+#define MASK_FCVT_WU_H 0xfff0007f -+#define MATCH_C_SLLI 0x19 -+#define MASK_C_SLLI 0x1c1f -+#define MATCH_AMOXOR_D 0x2000302f -+#define MASK_AMOXOR_D 0xf800707f -+#define MATCH_FCVT_WU_S 0xc0100053 -+#define MASK_FCVT_WU_S 0xfff0007f -+#define MATCH_CUSTOM3_RD 0x407b -+#define MASK_CUSTOM3_RD 0x707f -+#define MATCH_FMAX_H 0xcc000053 -+#define MASK_FMAX_H 0xfe00707f -+#define MATCH_VENQCNT 0x1000302b -+#define MASK_VENQCNT 0xfe007fff -+#define MATCH_VLBU 0x800205b -+#define MASK_VLBU 0xfff0707f -+#define MATCH_VLHU 0xa00205b -+#define MASK_VLHU 0xfff0707f -+#define MATCH_C_SW 0xd -+#define MASK_C_SW 0x1f -+#define MATCH_C_SD 0xc -+#define MASK_C_SD 0x1f -+#define MATCH_C_OR3 0x21c -+#define MASK_C_OR3 0x31f -+#define MATCH_C_AND3 0x31c -+#define MASK_C_AND3 0x31f -+#define MATCH_VFSSEGSTW 0x1400307b -+#define MASK_VFSSEGSTW 0x1e00707f -+#define MATCH_SLT 0x2033 -+#define MASK_SLT 0xfe00707f -+#define MATCH_AMOOR_D 0x4000302f -+#define MASK_AMOOR_D 0xf800707f -+#define MATCH_REMU 0x2007033 -+#define MASK_REMU 0xfe00707f -+#define MATCH_REMW 0x200603b -+#define MASK_REMW 0xfe00707f -+#define MATCH_SLL 0x1033 -+#define MASK_SLL 0xfe00707f -+#define MATCH_VFSSEGSTD 0x1600307b -+#define MASK_VFSSEGSTD 0x1e00707f -+#define MATCH_AMOOR_W 0x4000202f -+#define MASK_AMOOR_W 0xf800707f -+#define MATCH_CUSTOM2_RS1_RS2 0x305b -+#define MASK_CUSTOM2_RS1_RS2 0x707f -+#define MATCH_VF 0x10202b -+#define MASK_VF 0x1f0707f -+#define MATCH_VFMVV 0x1000002b -+#define MASK_VFMVV 0xfff0707f -+#define MATCH_VFLSEGSTW 0x1400305b -+#define MASK_VFLSEGSTW 0x1e00707f -+#define MATCH_VXCPTRESTORE 0x200302b -+#define MASK_VXCPTRESTORE 0xfff07fff -+#define MATCH_VXCPTHOLD 0x800302b -+#define MASK_VXCPTHOLD 0xfff07fff -+#define MATCH_SLTIU 0x3013 -+#define MASK_SLTIU 0x707f -+#define MATCH_VFLSEGSTD 0x1600305b -+#define MASK_VFLSEGSTD 0x1e00707f -+#define MATCH_VFLD 0x1600205b -+#define MASK_VFLD 0xfff0707f -+#define MATCH_FMADD_S 0x43 -+#define MASK_FMADD_S 0x600007f -+#define MATCH_VFLW 0x1400205b -+#define MASK_VFLW 0xfff0707f -+#define MATCH_FMADD_D 0x2000043 -+#define MASK_FMADD_D 0x600007f -+#define MATCH_FMADD_H 0x4000043 -+#define MASK_FMADD_H 0x600007f -+#define MATCH_SRET 0x10000073 -+#define MASK_SRET 0xffffffff -+#define MATCH_VSSEGW 0x400207b -+#define MASK_VSSEGW 0x1ff0707f -+#define MATCH_CUSTOM0_RD_RS1 0x600b -+#define MASK_CUSTOM0_RD_RS1 0x707f -+#define MATCH_VSSEGH 0x200207b -+#define MASK_VSSEGH 0x1ff0707f -+#define MATCH_FRCSR 0x302073 -+#define MASK_FRCSR 0xfffff07f -+#define MATCH_VSSEGD 0x600207b -+#define MASK_VSSEGD 0x1ff0707f -+#define MATCH_VSSEGB 0x207b -+#define MASK_VSSEGB 0x1ff0707f -+#define MATCH_FMIN_H 0xc4000053 -+#define MASK_FMIN_H 0xfe00707f -+#define MATCH_FMIN_D 0x2a000053 -+#define MASK_FMIN_D 0xfe00707f -+#define MATCH_BLTU 0x6063 -+#define MASK_BLTU 0x707f -+#define MATCH_FMIN_S 0x28000053 -+#define MASK_FMIN_S 0xfe00707f -+#define MATCH_SRLI_RV32 0x5013 -+#define MASK_SRLI_RV32 0xfe00707f -+#define MATCH_SLLIW 0x101b -+#define MASK_SLLIW 0xfe00707f -+#define MATCH_FMAX_S 0x28001053 -+#define MASK_FMAX_S 0xfe00707f -+#define MATCH_FCVT_D_H 0x8c000053 -+#define MASK_FCVT_D_H 0xfff0007f -+#define MATCH_FCVT_D_W 0xd2000053 -+#define MASK_FCVT_D_W 0xfff0007f -+#define MATCH_ADD 0x33 -+#define MASK_ADD 0xfe00707f -+#define MATCH_FCVT_D_S 0x42000053 -+#define MASK_FCVT_D_S 0xfff0007f -+#define MATCH_FMAX_D 0x2a001053 -+#define MASK_FMAX_D 0xfe00707f -+#define MATCH_BNE 0x1063 -+#define MASK_BNE 0x707f -+#define MATCH_CUSTOM1_RD 0x402b -+#define MASK_CUSTOM1_RD 0x707f -+#define MATCH_FSRM 0x201073 -+#define MASK_FSRM 0xfff0707f -+#define MATCH_FDIV_D 0x1a000053 -+#define MASK_FDIV_D 0xfe00007f -+#define MATCH_VSW 0x400207b -+#define MASK_VSW 0xfff0707f -+#define MATCH_FCVT_L_S 0xc0200053 -+#define MASK_FCVT_L_S 0xfff0007f -+#define MATCH_FDIV_H 0x1c000053 -+#define MASK_FDIV_H 0xfe00007f -+#define MATCH_VSB 0x207b -+#define MASK_VSB 0xfff0707f -+#define MATCH_FDIV_S 0x18000053 -+#define MASK_FDIV_S 0xfe00007f -+#define MATCH_FSRMI 0x205073 -+#define MASK_FSRMI 0xfff0707f -+#define MATCH_FCVT_L_H 0x44000053 -+#define MASK_FCVT_L_H 0xfff0007f -+#define MATCH_VSH 0x200207b -+#define MASK_VSH 0xfff0707f -+#define MATCH_FCVT_L_D 0xc2200053 -+#define MASK_FCVT_L_D 0xfff0007f -+#define MATCH_FCVT_H_S 0x90000053 -+#define MASK_FCVT_H_S 0xfff0007f -+#define MATCH_SCALL 0x73 -+#define MASK_SCALL 0xffffffff -+#define MATCH_FSFLAGSI 0x105073 -+#define MASK_FSFLAGSI 0xfff0707f -+#define MATCH_FCVT_H_W 0x74000053 -+#define MASK_FCVT_H_W 0xfff0007f -+#define MATCH_FCVT_H_L 0x64000053 -+#define MASK_FCVT_H_L 0xfff0007f -+#define MATCH_SRLIW 0x501b -+#define MASK_SRLIW 0xfe00707f -+#define MATCH_FCVT_S_LU 0xd0300053 -+#define MASK_FCVT_S_LU 0xfff0007f -+#define MATCH_FCVT_H_D 0x92000053 -+#define MASK_FCVT_H_D 0xfff0007f -+#define MATCH_SBREAK 0x100073 -+#define MASK_SBREAK 0xffffffff -+#define MATCH_RDINSTRETH 0xc8202073 -+#define MASK_RDINSTRETH 0xfffff07f -+#define MATCH_SRA 0x40005033 -+#define MASK_SRA 0xfe00707f -+#define MATCH_BGE 0x5063 -+#define MASK_BGE 0x707f -+#define MATCH_SRL 0x5033 -+#define MASK_SRL 0xfe00707f -+#define MATCH_VENQCMD 0xa00302b -+#define MASK_VENQCMD 0xfe007fff -+#define MATCH_OR 0x6033 -+#define MASK_OR 0xfe00707f -+#define MATCH_SUBW 0x4000003b -+#define MASK_SUBW 0xfe00707f -+#define MATCH_FMV_X_D 0xe2000053 -+#define MASK_FMV_X_D 0xfff0707f -+#define MATCH_RDTIME 0xc0102073 -+#define MASK_RDTIME 0xfffff07f -+#define MATCH_AMOADD_D 0x302f -+#define MASK_AMOADD_D 0xf800707f -+#define MATCH_AMOMAX_W 0xa000202f -+#define MASK_AMOMAX_W 0xf800707f -+#define MATCH_C_MOVE 0x2 -+#define MASK_C_MOVE 0x801f -+#define MATCH_FMOVN 0x6007077 -+#define MASK_FMOVN 0xfe00707f -+#define MATCH_C_FSW 0x16 -+#define MASK_C_FSW 0x1f -+#define MATCH_AMOADD_W 0x202f -+#define MASK_AMOADD_W 0xf800707f -+#define MATCH_AMOMAX_D 0xa000302f -+#define MASK_AMOMAX_D 0xf800707f -+#define MATCH_FMOVZ 0x4007077 -+#define MASK_FMOVZ 0xfe00707f -+#define MATCH_CUSTOM1_RS1_RS2 0x302b -+#define MASK_CUSTOM1_RS1_RS2 0x707f -+#define MATCH_FMV_X_H 0xe4000053 -+#define MASK_FMV_X_H 0xfff0707f -+#define MATCH_VSD 0x600207b -+#define MASK_VSD 0xfff0707f -+#define MATCH_VLSEGSTW 0x400305b -+#define MASK_VLSEGSTW 0x1e00707f -+#define MATCH_C_ADDI 0x1 -+#define MASK_C_ADDI 0x1f -+#define MATCH_C_SLLIW 0x1819 -+#define MASK_C_SLLIW 0x1c1f -+#define MATCH_VLSEGSTB 0x305b -+#define MASK_VLSEGSTB 0x1e00707f -+#define MATCH_VLSEGSTD 0x600305b -+#define MASK_VLSEGSTD 0x1e00707f -+#define MATCH_VLSEGSTH 0x200305b -+#define MASK_VLSEGSTH 0x1e00707f -+#define MATCH_MULHU 0x2003033 -+#define MASK_MULHU 0xfe00707f -+#define MATCH_AMOMIN_W 0x8000202f -+#define MASK_AMOMIN_W 0xf800707f -+#define MATCH_C_SLLI32 0x419 -+#define MASK_C_SLLI32 0x1c1f -+#define MATCH_C_ADD3 0x1c -+#define MASK_C_ADD3 0x31f -+#define MATCH_VGETVL 0x200400b -+#define MASK_VGETVL 0xfffff07f -+#define MATCH_AMOMIN_D 0x8000302f -+#define MASK_AMOMIN_D 0xf800707f -+#define MATCH_FCVT_W_H 0x54000053 -+#define MASK_FCVT_W_H 0xfff0007f -+#define MATCH_VLSEGB 0x205b -+#define MASK_VLSEGB 0x1ff0707f -+#define MATCH_FSD 0x3027 -+#define MASK_FSD 0x707f -+#define MATCH_VLSEGD 0x600205b -+#define MASK_VLSEGD 0x1ff0707f -+#define MATCH_FSH 0x1027 -+#define MASK_FSH 0x707f -+#define MATCH_VLSEGH 0x200205b -+#define MASK_VLSEGH 0x1ff0707f -+#define MATCH_C_SUB 0x801a -+#define MASK_C_SUB 0x801f -+#define MATCH_VLSEGW 0x400205b -+#define MASK_VLSEGW 0x1ff0707f -+#define MATCH_FSW 0x2027 -+#define MASK_FSW 0x707f -+#define MATCH_C_J 0x8002 -+#define MASK_C_J 0x801f -+#define CSR_FFLAGS 0x1 -+#define CSR_FRM 0x2 -+#define CSR_FCSR 0x3 -+#define CSR_CYCLE 0xc00 -+#define CSR_TIME 0xc01 -+#define CSR_INSTRET 0xc02 -+#define CSR_STATS 0xc0 -+#define CSR_UARCH0 0xcc0 -+#define CSR_UARCH1 0xcc1 -+#define CSR_UARCH2 0xcc2 -+#define CSR_UARCH3 0xcc3 -+#define CSR_UARCH4 0xcc4 -+#define CSR_UARCH5 0xcc5 -+#define CSR_UARCH6 0xcc6 -+#define CSR_UARCH7 0xcc7 -+#define CSR_UARCH8 0xcc8 -+#define CSR_UARCH9 0xcc9 -+#define CSR_UARCH10 0xcca -+#define CSR_UARCH11 0xccb -+#define CSR_UARCH12 0xccc -+#define CSR_UARCH13 0xccd -+#define CSR_UARCH14 0xcce -+#define CSR_UARCH15 0xccf -+#define CSR_SSTATUS 0x100 -+#define CSR_STVEC 0x101 -+#define CSR_STIMECMP 0x121 -+#define CSR_SSCRATCH 0x140 -+#define CSR_SEPC 0x141 -+#define CSR_SPTBR 0x188 -+#define CSR_SASID 0x189 -+#define CSR_SCYCLE 0x900 -+#define CSR_STIME 0x901 -+#define CSR_SINSTRET 0x902 -+#define CSR_SCAUSE 0xd40 -+#define CSR_SBADADDR 0xd41 -+#define CSR_MSTATUS 0x300 -+#define CSR_MSCRATCH 0x340 -+#define CSR_MEPC 0x341 -+#define CSR_MCAUSE 0x342 -+#define CSR_MBADADDR 0x343 -+#define CSR_RESET 0x780 -+#define CSR_TOHOST 0x781 -+#define CSR_FROMHOST 0x782 -+#define CSR_SEND_IPI 0x783 -+#define CSR_HARTID 0xfc0 -+#define CSR_CYCLEH 0xc80 -+#define CSR_TIMEH 0xc81 -+#define CSR_INSTRETH 0xc82 -+#define CSR_SCYCLEH 0x980 -+#define CSR_STIMEH 0x981 -+#define CSR_SINSTRETH 0x982 -+#define CAUSE_MISALIGNED_FETCH 0x0 -+#define CAUSE_FAULT_FETCH 0x1 -+#define CAUSE_ILLEGAL_INSTRUCTION 0x2 -+#define CAUSE_MISALIGNED_LOAD 0x4 -+#define CAUSE_FAULT_LOAD 0x5 -+#define CAUSE_MISALIGNED_STORE 0x6 -+#define CAUSE_FAULT_STORE 0x7 -+#define CAUSE_ECALL 0x8 -+#define CAUSE_BREAKPOINT 0x9 -+#endif -+#ifdef DECLARE_INSN -+DECLARE_INSN(custom3_rd_rs1_rs2, MATCH_CUSTOM3_RD_RS1_RS2, MASK_CUSTOM3_RD_RS1_RS2) -+DECLARE_INSN(vlsegstwu, MATCH_VLSEGSTWU, MASK_VLSEGSTWU) -+DECLARE_INSN(c_lw0, MATCH_C_LW0, MASK_C_LW0) -+DECLARE_INSN(fmv_d_x, MATCH_FMV_D_X, MASK_FMV_D_X) -+DECLARE_INSN(vlh, MATCH_VLH, MASK_VLH) -+DECLARE_INSN(c_li, MATCH_C_LI, MASK_C_LI) -+DECLARE_INSN(fadd_d, MATCH_FADD_D, MASK_FADD_D) -+DECLARE_INSN(c_ld, MATCH_C_LD, MASK_C_LD) -+DECLARE_INSN(vld, MATCH_VLD, MASK_VLD) -+DECLARE_INSN(fadd_s, MATCH_FADD_S, MASK_FADD_S) -+DECLARE_INSN(c_lw, MATCH_C_LW, MASK_C_LW) -+DECLARE_INSN(vlw, MATCH_VLW, MASK_VLW) -+DECLARE_INSN(vssegstw, MATCH_VSSEGSTW, MASK_VSSEGSTW) -+DECLARE_INSN(utidx, MATCH_UTIDX, MASK_UTIDX) -+DECLARE_INSN(c_flw, MATCH_C_FLW, MASK_C_FLW) -+DECLARE_INSN(fsub_d, MATCH_FSUB_D, MASK_FSUB_D) -+DECLARE_INSN(vssegstd, MATCH_VSSEGSTD, MASK_VSSEGSTD) -+DECLARE_INSN(vssegstb, MATCH_VSSEGSTB, MASK_VSSEGSTB) -+DECLARE_INSN(div, MATCH_DIV, MASK_DIV) -+DECLARE_INSN(fmv_h_x, MATCH_FMV_H_X, MASK_FMV_H_X) -+DECLARE_INSN(c_fld, MATCH_C_FLD, MASK_C_FLD) -+DECLARE_INSN(frrm, MATCH_FRRM, MASK_FRRM) -+DECLARE_INSN(vfmsv_s, MATCH_VFMSV_S, MASK_VFMSV_S) -+DECLARE_INSN(c_lwsp, MATCH_C_LWSP, MASK_C_LWSP) -+DECLARE_INSN(fence, MATCH_FENCE, MASK_FENCE) -+DECLARE_INSN(fnmsub_s, MATCH_FNMSUB_S, MASK_FNMSUB_S) -+DECLARE_INSN(fle_s, MATCH_FLE_S, MASK_FLE_S) -+DECLARE_INSN(fnmsub_h, MATCH_FNMSUB_H, MASK_FNMSUB_H) -+DECLARE_INSN(fle_h, MATCH_FLE_H, MASK_FLE_H) -+DECLARE_INSN(flw, MATCH_FLW, MASK_FLW) -+DECLARE_INSN(vsetvl, MATCH_VSETVL, MASK_VSETVL) -+DECLARE_INSN(vfmsv_d, MATCH_VFMSV_D, MASK_VFMSV_D) -+DECLARE_INSN(fle_d, MATCH_FLE_D, MASK_FLE_D) -+DECLARE_INSN(fence_i, MATCH_FENCE_I, MASK_FENCE_I) -+DECLARE_INSN(fnmsub_d, MATCH_FNMSUB_D, MASK_FNMSUB_D) -+DECLARE_INSN(addw, MATCH_ADDW, MASK_ADDW) -+DECLARE_INSN(xor, MATCH_XOR, MASK_XOR) -+DECLARE_INSN(sub, MATCH_SUB, MASK_SUB) -+DECLARE_INSN(vsstw, MATCH_VSSTW, MASK_VSSTW) -+DECLARE_INSN(vssth, MATCH_VSSTH, MASK_VSSTH) -+DECLARE_INSN(sc_w, MATCH_SC_W, MASK_SC_W) -+DECLARE_INSN(vsstb, MATCH_VSSTB, MASK_VSSTB) -+DECLARE_INSN(vsstd, MATCH_VSSTD, MASK_VSSTD) -+DECLARE_INSN(addi, MATCH_ADDI, MASK_ADDI) -+DECLARE_INSN(rdtimeh, MATCH_RDTIMEH, MASK_RDTIMEH) -+DECLARE_INSN(mulh, MATCH_MULH, MASK_MULH) -+DECLARE_INSN(csrrsi, MATCH_CSRRSI, MASK_CSRRSI) -+DECLARE_INSN(fcvt_d_wu, MATCH_FCVT_D_WU, MASK_FCVT_D_WU) -+DECLARE_INSN(mulw, MATCH_MULW, MASK_MULW) -+DECLARE_INSN(custom1_rd_rs1_rs2, MATCH_CUSTOM1_RD_RS1_RS2, MASK_CUSTOM1_RD_RS1_RS2) -+DECLARE_INSN(venqimm1, MATCH_VENQIMM1, MASK_VENQIMM1) -+DECLARE_INSN(venqimm2, MATCH_VENQIMM2, MASK_VENQIMM2) -+DECLARE_INSN(rdinstret, MATCH_RDINSTRET, MASK_RDINSTRET) -+DECLARE_INSN(c_swsp, MATCH_C_SWSP, MASK_C_SWSP) -+DECLARE_INSN(vlstw, MATCH_VLSTW, MASK_VLSTW) -+DECLARE_INSN(vlsth, MATCH_VLSTH, MASK_VLSTH) -+DECLARE_INSN(vlstb, MATCH_VLSTB, MASK_VLSTB) -+DECLARE_INSN(vlstd, MATCH_VLSTD, MASK_VLSTD) -+DECLARE_INSN(andi, MATCH_ANDI, MASK_ANDI) -+DECLARE_INSN(fmv_x_s, MATCH_FMV_X_S, MASK_FMV_X_S) -+DECLARE_INSN(custom0_rd_rs1_rs2, MATCH_CUSTOM0_RD_RS1_RS2, MASK_CUSTOM0_RD_RS1_RS2) -+DECLARE_INSN(fnmadd_s, MATCH_FNMADD_S, MASK_FNMADD_S) -+DECLARE_INSN(lwu, MATCH_LWU, MASK_LWU) -+DECLARE_INSN(custom0_rs1, MATCH_CUSTOM0_RS1, MASK_CUSTOM0_RS1) -+DECLARE_INSN(vlsegstbu, MATCH_VLSEGSTBU, MASK_VLSEGSTBU) -+DECLARE_INSN(fnmadd_d, MATCH_FNMADD_D, MASK_FNMADD_D) -+DECLARE_INSN(fcvt_w_s, MATCH_FCVT_W_S, MASK_FCVT_W_S) -+DECLARE_INSN(c_srai, MATCH_C_SRAI, MASK_C_SRAI) -+DECLARE_INSN(mulhsu, MATCH_MULHSU, MASK_MULHSU) -+DECLARE_INSN(fcvt_d_lu, MATCH_FCVT_D_LU, MASK_FCVT_D_LU) -+DECLARE_INSN(fcvt_w_d, MATCH_FCVT_W_D, MASK_FCVT_W_D) -+DECLARE_INSN(fsub_h, MATCH_FSUB_H, MASK_FSUB_H) -+DECLARE_INSN(divuw, MATCH_DIVUW, MASK_DIVUW) -+DECLARE_INSN(slti, MATCH_SLTI, MASK_SLTI) -+DECLARE_INSN(vlstbu, MATCH_VLSTBU, MASK_VLSTBU) -+DECLARE_INSN(sltu, MATCH_SLTU, MASK_SLTU) -+DECLARE_INSN(flh, MATCH_FLH, MASK_FLH) -+DECLARE_INSN(custom2_rd_rs1_rs2, MATCH_CUSTOM2_RD_RS1_RS2, MASK_CUSTOM2_RD_RS1_RS2) -+DECLARE_INSN(fld, MATCH_FLD, MASK_FLD) -+DECLARE_INSN(fsub_s, MATCH_FSUB_S, MASK_FSUB_S) -+DECLARE_INSN(fcvt_h_lu, MATCH_FCVT_H_LU, MASK_FCVT_H_LU) -+DECLARE_INSN(custom0, MATCH_CUSTOM0, MASK_CUSTOM0) -+DECLARE_INSN(custom1, MATCH_CUSTOM1, MASK_CUSTOM1) -+DECLARE_INSN(custom2, MATCH_CUSTOM2, MASK_CUSTOM2) -+DECLARE_INSN(custom3, MATCH_CUSTOM3, MASK_CUSTOM3) -+DECLARE_INSN(vxcptsave, MATCH_VXCPTSAVE, MASK_VXCPTSAVE) -+DECLARE_INSN(vmsv, MATCH_VMSV, MASK_VMSV) -+DECLARE_INSN(fcvt_lu_s, MATCH_FCVT_LU_S, MASK_FCVT_LU_S) -+DECLARE_INSN(auipc, MATCH_AUIPC, MASK_AUIPC) -+DECLARE_INSN(frflags, MATCH_FRFLAGS, MASK_FRFLAGS) -+DECLARE_INSN(fcvt_lu_d, MATCH_FCVT_LU_D, MASK_FCVT_LU_D) -+DECLARE_INSN(csrrwi, MATCH_CSRRWI, MASK_CSRRWI) -+DECLARE_INSN(fadd_h, MATCH_FADD_H, MASK_FADD_H) -+DECLARE_INSN(fsqrt_s, MATCH_FSQRT_S, MASK_FSQRT_S) -+DECLARE_INSN(vxcptkill, MATCH_VXCPTKILL, MASK_VXCPTKILL) -+DECLARE_INSN(stop, MATCH_STOP, MASK_STOP) -+DECLARE_INSN(fsgnjn_s, MATCH_FSGNJN_S, MASK_FSGNJN_S) -+DECLARE_INSN(fsgnjn_h, MATCH_FSGNJN_H, MASK_FSGNJN_H) -+DECLARE_INSN(fsqrt_d, MATCH_FSQRT_D, MASK_FSQRT_D) -+DECLARE_INSN(xori, MATCH_XORI, MASK_XORI) -+DECLARE_INSN(divu, MATCH_DIVU, MASK_DIVU) -+DECLARE_INSN(fsgnjn_d, MATCH_FSGNJN_D, MASK_FSGNJN_D) -+DECLARE_INSN(fsqrt_h, MATCH_FSQRT_H, MASK_FSQRT_H) -+DECLARE_INSN(vssegsth, MATCH_VSSEGSTH, MASK_VSSEGSTH) -+DECLARE_INSN(sw, MATCH_SW, MASK_SW) -+DECLARE_INSN(vlstwu, MATCH_VLSTWU, MASK_VLSTWU) -+DECLARE_INSN(vfssegw, MATCH_VFSSEGW, MASK_VFSSEGW) -+DECLARE_INSN(lhu, MATCH_LHU, MASK_LHU) -+DECLARE_INSN(sh, MATCH_SH, MASK_SH) -+DECLARE_INSN(fmsub_h, MATCH_FMSUB_H, MASK_FMSUB_H) -+DECLARE_INSN(vxcptaux, MATCH_VXCPTAUX, MASK_VXCPTAUX) -+DECLARE_INSN(fmsub_d, MATCH_FMSUB_D, MASK_FMSUB_D) -+DECLARE_INSN(vfssegd, MATCH_VFSSEGD, MASK_VFSSEGD) -+DECLARE_INSN(vlseghu, MATCH_VLSEGHU, MASK_VLSEGHU) -+DECLARE_INSN(movn, MATCH_MOVN, MASK_MOVN) -+DECLARE_INSN(custom1_rs1, MATCH_CUSTOM1_RS1, MASK_CUSTOM1_RS1) -+DECLARE_INSN(vlsthu, MATCH_VLSTHU, MASK_VLSTHU) -+DECLARE_INSN(movz, MATCH_MOVZ, MASK_MOVZ) -+DECLARE_INSN(csrrw, MATCH_CSRRW, MASK_CSRRW) -+DECLARE_INSN(ld, MATCH_LD, MASK_LD) -+DECLARE_INSN(lb, MATCH_LB, MASK_LB) -+DECLARE_INSN(vlwu, MATCH_VLWU, MASK_VLWU) -+DECLARE_INSN(lh, MATCH_LH, MASK_LH) -+DECLARE_INSN(lw, MATCH_LW, MASK_LW) -+DECLARE_INSN(csrrc, MATCH_CSRRC, MASK_CSRRC) -+DECLARE_INSN(fcvt_lu_h, MATCH_FCVT_LU_H, MASK_FCVT_LU_H) -+DECLARE_INSN(fcvt_s_d, MATCH_FCVT_S_D, MASK_FCVT_S_D) -+DECLARE_INSN(bgeu, MATCH_BGEU, MASK_BGEU) -+DECLARE_INSN(vflstd, MATCH_VFLSTD, MASK_VFLSTD) -+DECLARE_INSN(fcvt_s_l, MATCH_FCVT_S_L, MASK_FCVT_S_L) -+DECLARE_INSN(fcvt_s_h, MATCH_FCVT_S_H, MASK_FCVT_S_H) -+DECLARE_INSN(fscsr, MATCH_FSCSR, MASK_FSCSR) -+DECLARE_INSN(fcvt_s_w, MATCH_FCVT_S_W, MASK_FCVT_S_W) -+DECLARE_INSN(vflstw, MATCH_VFLSTW, MASK_VFLSTW) -+DECLARE_INSN(vxcptevac, MATCH_VXCPTEVAC, MASK_VXCPTEVAC) -+DECLARE_INSN(amominu_d, MATCH_AMOMINU_D, MASK_AMOMINU_D) -+DECLARE_INSN(fsflags, MATCH_FSFLAGS, MASK_FSFLAGS) -+DECLARE_INSN(srli, MATCH_SRLI, MASK_SRLI) -+DECLARE_INSN(c_srli, MATCH_C_SRLI, MASK_C_SRLI) -+DECLARE_INSN(amominu_w, MATCH_AMOMINU_W, MASK_AMOMINU_W) -+DECLARE_INSN(srlw, MATCH_SRLW, MASK_SRLW) -+DECLARE_INSN(vflsegw, MATCH_VFLSEGW, MASK_VFLSEGW) -+DECLARE_INSN(c_ld0, MATCH_C_LD0, MASK_C_LD0) -+DECLARE_INSN(vlsegbu, MATCH_VLSEGBU, MASK_VLSEGBU) -+DECLARE_INSN(jalr, MATCH_JALR, MASK_JALR) -+DECLARE_INSN(blt, MATCH_BLT, MASK_BLT) -+DECLARE_INSN(custom2_rd_rs1, MATCH_CUSTOM2_RD_RS1, MASK_CUSTOM2_RD_RS1) -+DECLARE_INSN(fclass_s, MATCH_FCLASS_S, MASK_FCLASS_S) -+DECLARE_INSN(sfence_vm, MATCH_SFENCE_VM, MASK_SFENCE_VM) -+DECLARE_INSN(rem, MATCH_REM, MASK_REM) -+DECLARE_INSN(fclass_d, MATCH_FCLASS_D, MASK_FCLASS_D) -+DECLARE_INSN(fmul_s, MATCH_FMUL_S, MASK_FMUL_S) -+DECLARE_INSN(rdcycleh, MATCH_RDCYCLEH, MASK_RDCYCLEH) -+DECLARE_INSN(vlsegsthu, MATCH_VLSEGSTHU, MASK_VLSEGSTHU) -+DECLARE_INSN(fmul_d, MATCH_FMUL_D, MASK_FMUL_D) -+DECLARE_INSN(ori, MATCH_ORI, MASK_ORI) -+DECLARE_INSN(fmul_h, MATCH_FMUL_H, MASK_FMUL_H) -+DECLARE_INSN(vflsegd, MATCH_VFLSEGD, MASK_VFLSEGD) -+DECLARE_INSN(feq_s, MATCH_FEQ_S, MASK_FEQ_S) -+DECLARE_INSN(fsgnjx_d, MATCH_FSGNJX_D, MASK_FSGNJX_D) -+DECLARE_INSN(sraiw, MATCH_SRAIW, MASK_SRAIW) -+DECLARE_INSN(fsgnjx_h, MATCH_FSGNJX_H, MASK_FSGNJX_H) -+DECLARE_INSN(fsgnjx_s, MATCH_FSGNJX_S, MASK_FSGNJX_S) -+DECLARE_INSN(feq_d, MATCH_FEQ_D, MASK_FEQ_D) -+DECLARE_INSN(custom1_rd_rs1, MATCH_CUSTOM1_RD_RS1, MASK_CUSTOM1_RD_RS1) -+DECLARE_INSN(feq_h, MATCH_FEQ_H, MASK_FEQ_H) -+DECLARE_INSN(amomaxu_d, MATCH_AMOMAXU_D, MASK_AMOMAXU_D) -+DECLARE_INSN(divw, MATCH_DIVW, MASK_DIVW) -+DECLARE_INSN(amomaxu_w, MATCH_AMOMAXU_W, MASK_AMOMAXU_W) -+DECLARE_INSN(srai_rv32, MATCH_SRAI_RV32, MASK_SRAI_RV32) -+DECLARE_INSN(c_srli32, MATCH_C_SRLI32, MASK_C_SRLI32) -+DECLARE_INSN(vfsstw, MATCH_VFSSTW, MASK_VFSSTW) -+DECLARE_INSN(custom0_rd, MATCH_CUSTOM0_RD, MASK_CUSTOM0_RD) -+DECLARE_INSN(c_beq, MATCH_C_BEQ, MASK_C_BEQ) -+DECLARE_INSN(vfsstd, MATCH_VFSSTD, MASK_VFSSTD) -+DECLARE_INSN(custom3_rd_rs1, MATCH_CUSTOM3_RD_RS1, MASK_CUSTOM3_RD_RS1) -+DECLARE_INSN(lr_d, MATCH_LR_D, MASK_LR_D) -+DECLARE_INSN(lr_w, MATCH_LR_W, MASK_LR_W) -+DECLARE_INSN(fcvt_h_wu, MATCH_FCVT_H_WU, MASK_FCVT_H_WU) -+DECLARE_INSN(vmvv, MATCH_VMVV, MASK_VMVV) -+DECLARE_INSN(sllw, MATCH_SLLW, MASK_SLLW) -+DECLARE_INSN(slli, MATCH_SLLI, MASK_SLLI) -+DECLARE_INSN(beq, MATCH_BEQ, MASK_BEQ) -+DECLARE_INSN(and, MATCH_AND, MASK_AND) -+DECLARE_INSN(lbu, MATCH_LBU, MASK_LBU) -+DECLARE_INSN(fsgnj_s, MATCH_FSGNJ_S, MASK_FSGNJ_S) -+DECLARE_INSN(fmsub_s, MATCH_FMSUB_S, MASK_FMSUB_S) -+DECLARE_INSN(c_sub3, MATCH_C_SUB3, MASK_C_SUB3) -+DECLARE_INSN(fsgnj_h, MATCH_FSGNJ_H, MASK_FSGNJ_H) -+DECLARE_INSN(vlb, MATCH_VLB, MASK_VLB) -+DECLARE_INSN(c_addiw, MATCH_C_ADDIW, MASK_C_ADDIW) -+DECLARE_INSN(custom3_rs1_rs2, MATCH_CUSTOM3_RS1_RS2, MASK_CUSTOM3_RS1_RS2) -+DECLARE_INSN(fsgnj_d, MATCH_FSGNJ_D, MASK_FSGNJ_D) -+DECLARE_INSN(vlsegwu, MATCH_VLSEGWU, MASK_VLSEGWU) -+DECLARE_INSN(fcvt_s_wu, MATCH_FCVT_S_WU, MASK_FCVT_S_WU) -+DECLARE_INSN(custom3_rs1, MATCH_CUSTOM3_RS1, MASK_CUSTOM3_RS1) -+DECLARE_INSN(sc_d, MATCH_SC_D, MASK_SC_D) -+DECLARE_INSN(vfsw, MATCH_VFSW, MASK_VFSW) -+DECLARE_INSN(amoswap_d, MATCH_AMOSWAP_D, MASK_AMOSWAP_D) -+DECLARE_INSN(sb, MATCH_SB, MASK_SB) -+DECLARE_INSN(amoswap_w, MATCH_AMOSWAP_W, MASK_AMOSWAP_W) -+DECLARE_INSN(vfsd, MATCH_VFSD, MASK_VFSD) -+DECLARE_INSN(custom2_rs1, MATCH_CUSTOM2_RS1, MASK_CUSTOM2_RS1) -+DECLARE_INSN(sd, MATCH_SD, MASK_SD) -+DECLARE_INSN(fmv_s_x, MATCH_FMV_S_X, MASK_FMV_S_X) -+DECLARE_INSN(remuw, MATCH_REMUW, MASK_REMUW) -+DECLARE_INSN(jal, MATCH_JAL, MASK_JAL) -+DECLARE_INSN(c_fsd, MATCH_C_FSD, MASK_C_FSD) -+DECLARE_INSN(rdcycle, MATCH_RDCYCLE, MASK_RDCYCLE) -+DECLARE_INSN(c_bne, MATCH_C_BNE, MASK_C_BNE) -+DECLARE_INSN(c_add, MATCH_C_ADD, MASK_C_ADD) -+DECLARE_INSN(vxcptcause, MATCH_VXCPTCAUSE, MASK_VXCPTCAUSE) -+DECLARE_INSN(vgetcfg, MATCH_VGETCFG, MASK_VGETCFG) -+DECLARE_INSN(lui, MATCH_LUI, MASK_LUI) -+DECLARE_INSN(vsetcfg, MATCH_VSETCFG, MASK_VSETCFG) -+DECLARE_INSN(c_sdsp, MATCH_C_SDSP, MASK_C_SDSP) -+DECLARE_INSN(c_ldsp, MATCH_C_LDSP, MASK_C_LDSP) -+DECLARE_INSN(fnmadd_h, MATCH_FNMADD_H, MASK_FNMADD_H) -+DECLARE_INSN(custom0_rs1_rs2, MATCH_CUSTOM0_RS1_RS2, MASK_CUSTOM0_RS1_RS2) -+DECLARE_INSN(slli_rv32, MATCH_SLLI_RV32, MASK_SLLI_RV32) -+DECLARE_INSN(mul, MATCH_MUL, MASK_MUL) -+DECLARE_INSN(csrrci, MATCH_CSRRCI, MASK_CSRRCI) -+DECLARE_INSN(c_srai32, MATCH_C_SRAI32, MASK_C_SRAI32) -+DECLARE_INSN(flt_h, MATCH_FLT_H, MASK_FLT_H) -+DECLARE_INSN(srai, MATCH_SRAI, MASK_SRAI) -+DECLARE_INSN(amoand_d, MATCH_AMOAND_D, MASK_AMOAND_D) -+DECLARE_INSN(flt_d, MATCH_FLT_D, MASK_FLT_D) -+DECLARE_INSN(sraw, MATCH_SRAW, MASK_SRAW) -+DECLARE_INSN(csrrs, MATCH_CSRRS, MASK_CSRRS) -+DECLARE_INSN(flt_s, MATCH_FLT_S, MASK_FLT_S) -+DECLARE_INSN(addiw, MATCH_ADDIW, MASK_ADDIW) -+DECLARE_INSN(amoand_w, MATCH_AMOAND_W, MASK_AMOAND_W) -+DECLARE_INSN(custom2_rd, MATCH_CUSTOM2_RD, MASK_CUSTOM2_RD) -+DECLARE_INSN(mrts, MATCH_MRTS, MASK_MRTS) -+DECLARE_INSN(fcvt_wu_d, MATCH_FCVT_WU_D, MASK_FCVT_WU_D) -+DECLARE_INSN(amoxor_w, MATCH_AMOXOR_W, MASK_AMOXOR_W) -+DECLARE_INSN(fcvt_d_l, MATCH_FCVT_D_L, MASK_FCVT_D_L) -+DECLARE_INSN(fcvt_wu_h, MATCH_FCVT_WU_H, MASK_FCVT_WU_H) -+DECLARE_INSN(c_slli, MATCH_C_SLLI, MASK_C_SLLI) -+DECLARE_INSN(amoxor_d, MATCH_AMOXOR_D, MASK_AMOXOR_D) -+DECLARE_INSN(fcvt_wu_s, MATCH_FCVT_WU_S, MASK_FCVT_WU_S) -+DECLARE_INSN(custom3_rd, MATCH_CUSTOM3_RD, MASK_CUSTOM3_RD) -+DECLARE_INSN(fmax_h, MATCH_FMAX_H, MASK_FMAX_H) -+DECLARE_INSN(venqcnt, MATCH_VENQCNT, MASK_VENQCNT) -+DECLARE_INSN(vlbu, MATCH_VLBU, MASK_VLBU) -+DECLARE_INSN(vlhu, MATCH_VLHU, MASK_VLHU) -+DECLARE_INSN(c_sw, MATCH_C_SW, MASK_C_SW) -+DECLARE_INSN(c_sd, MATCH_C_SD, MASK_C_SD) -+DECLARE_INSN(c_or3, MATCH_C_OR3, MASK_C_OR3) -+DECLARE_INSN(c_and3, MATCH_C_AND3, MASK_C_AND3) -+DECLARE_INSN(vfssegstw, MATCH_VFSSEGSTW, MASK_VFSSEGSTW) -+DECLARE_INSN(slt, MATCH_SLT, MASK_SLT) -+DECLARE_INSN(amoor_d, MATCH_AMOOR_D, MASK_AMOOR_D) -+DECLARE_INSN(remu, MATCH_REMU, MASK_REMU) -+DECLARE_INSN(remw, MATCH_REMW, MASK_REMW) -+DECLARE_INSN(sll, MATCH_SLL, MASK_SLL) -+DECLARE_INSN(vfssegstd, MATCH_VFSSEGSTD, MASK_VFSSEGSTD) -+DECLARE_INSN(amoor_w, MATCH_AMOOR_W, MASK_AMOOR_W) -+DECLARE_INSN(custom2_rs1_rs2, MATCH_CUSTOM2_RS1_RS2, MASK_CUSTOM2_RS1_RS2) -+DECLARE_INSN(vf, MATCH_VF, MASK_VF) -+DECLARE_INSN(vfmvv, MATCH_VFMVV, MASK_VFMVV) -+DECLARE_INSN(vflsegstw, MATCH_VFLSEGSTW, MASK_VFLSEGSTW) -+DECLARE_INSN(vxcptrestore, MATCH_VXCPTRESTORE, MASK_VXCPTRESTORE) -+DECLARE_INSN(vxcpthold, MATCH_VXCPTHOLD, MASK_VXCPTHOLD) -+DECLARE_INSN(sltiu, MATCH_SLTIU, MASK_SLTIU) -+DECLARE_INSN(vflsegstd, MATCH_VFLSEGSTD, MASK_VFLSEGSTD) -+DECLARE_INSN(vfld, MATCH_VFLD, MASK_VFLD) -+DECLARE_INSN(fmadd_s, MATCH_FMADD_S, MASK_FMADD_S) -+DECLARE_INSN(vflw, MATCH_VFLW, MASK_VFLW) -+DECLARE_INSN(fmadd_d, MATCH_FMADD_D, MASK_FMADD_D) -+DECLARE_INSN(fmadd_h, MATCH_FMADD_H, MASK_FMADD_H) -+DECLARE_INSN(sret, MATCH_SRET, MASK_SRET) -+DECLARE_INSN(vssegw, MATCH_VSSEGW, MASK_VSSEGW) -+DECLARE_INSN(custom0_rd_rs1, MATCH_CUSTOM0_RD_RS1, MASK_CUSTOM0_RD_RS1) -+DECLARE_INSN(vssegh, MATCH_VSSEGH, MASK_VSSEGH) -+DECLARE_INSN(frcsr, MATCH_FRCSR, MASK_FRCSR) -+DECLARE_INSN(vssegd, MATCH_VSSEGD, MASK_VSSEGD) -+DECLARE_INSN(vssegb, MATCH_VSSEGB, MASK_VSSEGB) -+DECLARE_INSN(fmin_h, MATCH_FMIN_H, MASK_FMIN_H) -+DECLARE_INSN(fmin_d, MATCH_FMIN_D, MASK_FMIN_D) -+DECLARE_INSN(bltu, MATCH_BLTU, MASK_BLTU) -+DECLARE_INSN(fmin_s, MATCH_FMIN_S, MASK_FMIN_S) -+DECLARE_INSN(srli_rv32, MATCH_SRLI_RV32, MASK_SRLI_RV32) -+DECLARE_INSN(slliw, MATCH_SLLIW, MASK_SLLIW) -+DECLARE_INSN(fmax_s, MATCH_FMAX_S, MASK_FMAX_S) -+DECLARE_INSN(fcvt_d_h, MATCH_FCVT_D_H, MASK_FCVT_D_H) -+DECLARE_INSN(fcvt_d_w, MATCH_FCVT_D_W, MASK_FCVT_D_W) -+DECLARE_INSN(add, MATCH_ADD, MASK_ADD) -+DECLARE_INSN(fcvt_d_s, MATCH_FCVT_D_S, MASK_FCVT_D_S) -+DECLARE_INSN(fmax_d, MATCH_FMAX_D, MASK_FMAX_D) -+DECLARE_INSN(bne, MATCH_BNE, MASK_BNE) -+DECLARE_INSN(custom1_rd, MATCH_CUSTOM1_RD, MASK_CUSTOM1_RD) -+DECLARE_INSN(fsrm, MATCH_FSRM, MASK_FSRM) -+DECLARE_INSN(fdiv_d, MATCH_FDIV_D, MASK_FDIV_D) -+DECLARE_INSN(vsw, MATCH_VSW, MASK_VSW) -+DECLARE_INSN(fcvt_l_s, MATCH_FCVT_L_S, MASK_FCVT_L_S) -+DECLARE_INSN(fdiv_h, MATCH_FDIV_H, MASK_FDIV_H) -+DECLARE_INSN(vsb, MATCH_VSB, MASK_VSB) -+DECLARE_INSN(fdiv_s, MATCH_FDIV_S, MASK_FDIV_S) -+DECLARE_INSN(fsrmi, MATCH_FSRMI, MASK_FSRMI) -+DECLARE_INSN(fcvt_l_h, MATCH_FCVT_L_H, MASK_FCVT_L_H) -+DECLARE_INSN(vsh, MATCH_VSH, MASK_VSH) -+DECLARE_INSN(fcvt_l_d, MATCH_FCVT_L_D, MASK_FCVT_L_D) -+DECLARE_INSN(fcvt_h_s, MATCH_FCVT_H_S, MASK_FCVT_H_S) -+DECLARE_INSN(scall, MATCH_SCALL, MASK_SCALL) -+DECLARE_INSN(fsflagsi, MATCH_FSFLAGSI, MASK_FSFLAGSI) -+DECLARE_INSN(fcvt_h_w, MATCH_FCVT_H_W, MASK_FCVT_H_W) -+DECLARE_INSN(fcvt_h_l, MATCH_FCVT_H_L, MASK_FCVT_H_L) -+DECLARE_INSN(srliw, MATCH_SRLIW, MASK_SRLIW) -+DECLARE_INSN(fcvt_s_lu, MATCH_FCVT_S_LU, MASK_FCVT_S_LU) -+DECLARE_INSN(fcvt_h_d, MATCH_FCVT_H_D, MASK_FCVT_H_D) -+DECLARE_INSN(sbreak, MATCH_SBREAK, MASK_SBREAK) -+DECLARE_INSN(rdinstreth, MATCH_RDINSTRETH, MASK_RDINSTRETH) -+DECLARE_INSN(sra, MATCH_SRA, MASK_SRA) -+DECLARE_INSN(bge, MATCH_BGE, MASK_BGE) -+DECLARE_INSN(srl, MATCH_SRL, MASK_SRL) -+DECLARE_INSN(venqcmd, MATCH_VENQCMD, MASK_VENQCMD) -+DECLARE_INSN(or, MATCH_OR, MASK_OR) -+DECLARE_INSN(subw, MATCH_SUBW, MASK_SUBW) -+DECLARE_INSN(fmv_x_d, MATCH_FMV_X_D, MASK_FMV_X_D) -+DECLARE_INSN(rdtime, MATCH_RDTIME, MASK_RDTIME) -+DECLARE_INSN(amoadd_d, MATCH_AMOADD_D, MASK_AMOADD_D) -+DECLARE_INSN(amomax_w, MATCH_AMOMAX_W, MASK_AMOMAX_W) -+DECLARE_INSN(c_move, MATCH_C_MOVE, MASK_C_MOVE) -+DECLARE_INSN(fmovn, MATCH_FMOVN, MASK_FMOVN) -+DECLARE_INSN(c_fsw, MATCH_C_FSW, MASK_C_FSW) -+DECLARE_INSN(amoadd_w, MATCH_AMOADD_W, MASK_AMOADD_W) -+DECLARE_INSN(amomax_d, MATCH_AMOMAX_D, MASK_AMOMAX_D) -+DECLARE_INSN(fmovz, MATCH_FMOVZ, MASK_FMOVZ) -+DECLARE_INSN(custom1_rs1_rs2, MATCH_CUSTOM1_RS1_RS2, MASK_CUSTOM1_RS1_RS2) -+DECLARE_INSN(fmv_x_h, MATCH_FMV_X_H, MASK_FMV_X_H) -+DECLARE_INSN(vsd, MATCH_VSD, MASK_VSD) -+DECLARE_INSN(vlsegstw, MATCH_VLSEGSTW, MASK_VLSEGSTW) -+DECLARE_INSN(c_addi, MATCH_C_ADDI, MASK_C_ADDI) -+DECLARE_INSN(c_slliw, MATCH_C_SLLIW, MASK_C_SLLIW) -+DECLARE_INSN(vlsegstb, MATCH_VLSEGSTB, MASK_VLSEGSTB) -+DECLARE_INSN(vlsegstd, MATCH_VLSEGSTD, MASK_VLSEGSTD) -+DECLARE_INSN(vlsegsth, MATCH_VLSEGSTH, MASK_VLSEGSTH) -+DECLARE_INSN(mulhu, MATCH_MULHU, MASK_MULHU) -+DECLARE_INSN(amomin_w, MATCH_AMOMIN_W, MASK_AMOMIN_W) -+DECLARE_INSN(c_slli32, MATCH_C_SLLI32, MASK_C_SLLI32) -+DECLARE_INSN(c_add3, MATCH_C_ADD3, MASK_C_ADD3) -+DECLARE_INSN(vgetvl, MATCH_VGETVL, MASK_VGETVL) -+DECLARE_INSN(amomin_d, MATCH_AMOMIN_D, MASK_AMOMIN_D) -+DECLARE_INSN(fcvt_w_h, MATCH_FCVT_W_H, MASK_FCVT_W_H) -+DECLARE_INSN(vlsegb, MATCH_VLSEGB, MASK_VLSEGB) -+DECLARE_INSN(fsd, MATCH_FSD, MASK_FSD) -+DECLARE_INSN(vlsegd, MATCH_VLSEGD, MASK_VLSEGD) -+DECLARE_INSN(fsh, MATCH_FSH, MASK_FSH) -+DECLARE_INSN(vlsegh, MATCH_VLSEGH, MASK_VLSEGH) -+DECLARE_INSN(c_sub, MATCH_C_SUB, MASK_C_SUB) -+DECLARE_INSN(vlsegw, MATCH_VLSEGW, MASK_VLSEGW) -+DECLARE_INSN(fsw, MATCH_FSW, MASK_FSW) -+DECLARE_INSN(c_j, MATCH_C_J, MASK_C_J) -+#endif -+#ifdef DECLARE_CSR -+DECLARE_CSR(fflags, CSR_FFLAGS) -+DECLARE_CSR(frm, CSR_FRM) -+DECLARE_CSR(fcsr, CSR_FCSR) -+DECLARE_CSR(cycle, CSR_CYCLE) -+DECLARE_CSR(time, CSR_TIME) -+DECLARE_CSR(instret, CSR_INSTRET) -+DECLARE_CSR(stats, CSR_STATS) -+DECLARE_CSR(uarch0, CSR_UARCH0) -+DECLARE_CSR(uarch1, CSR_UARCH1) -+DECLARE_CSR(uarch2, CSR_UARCH2) -+DECLARE_CSR(uarch3, CSR_UARCH3) -+DECLARE_CSR(uarch4, CSR_UARCH4) -+DECLARE_CSR(uarch5, CSR_UARCH5) -+DECLARE_CSR(uarch6, CSR_UARCH6) -+DECLARE_CSR(uarch7, CSR_UARCH7) -+DECLARE_CSR(uarch8, CSR_UARCH8) -+DECLARE_CSR(uarch9, CSR_UARCH9) -+DECLARE_CSR(uarch10, CSR_UARCH10) -+DECLARE_CSR(uarch11, CSR_UARCH11) -+DECLARE_CSR(uarch12, CSR_UARCH12) -+DECLARE_CSR(uarch13, CSR_UARCH13) -+DECLARE_CSR(uarch14, CSR_UARCH14) -+DECLARE_CSR(uarch15, CSR_UARCH15) -+DECLARE_CSR(sstatus, CSR_SSTATUS) -+DECLARE_CSR(stvec, CSR_STVEC) -+DECLARE_CSR(stimecmp, CSR_STIMECMP) -+DECLARE_CSR(sscratch, CSR_SSCRATCH) -+DECLARE_CSR(sepc, CSR_SEPC) -+DECLARE_CSR(sptbr, CSR_SPTBR) -+DECLARE_CSR(sasid, CSR_SASID) -+DECLARE_CSR(scycle, CSR_SCYCLE) -+DECLARE_CSR(stime, CSR_STIME) -+DECLARE_CSR(sinstret, CSR_SINSTRET) -+DECLARE_CSR(scause, CSR_SCAUSE) -+DECLARE_CSR(sbadaddr, CSR_SBADADDR) -+DECLARE_CSR(mstatus, CSR_MSTATUS) -+DECLARE_CSR(mscratch, CSR_MSCRATCH) -+DECLARE_CSR(mepc, CSR_MEPC) -+DECLARE_CSR(mcause, CSR_MCAUSE) -+DECLARE_CSR(mbadaddr, CSR_MBADADDR) -+DECLARE_CSR(reset, CSR_RESET) -+DECLARE_CSR(tohost, CSR_TOHOST) -+DECLARE_CSR(fromhost, CSR_FROMHOST) -+DECLARE_CSR(send_ipi, CSR_SEND_IPI) -+DECLARE_CSR(hartid, CSR_HARTID) -+DECLARE_CSR(cycleh, CSR_CYCLEH) -+DECLARE_CSR(timeh, CSR_TIMEH) -+DECLARE_CSR(instreth, CSR_INSTRETH) -+DECLARE_CSR(scycleh, CSR_SCYCLEH) -+DECLARE_CSR(stimeh, CSR_STIMEH) -+DECLARE_CSR(sinstreth, CSR_SINSTRETH) -+#endif -+#ifdef DECLARE_CAUSE -+DECLARE_CAUSE("fflags", CAUSE_FFLAGS) -+DECLARE_CAUSE("frm", CAUSE_FRM) -+DECLARE_CAUSE("fcsr", CAUSE_FCSR) -+DECLARE_CAUSE("cycle", CAUSE_CYCLE) -+DECLARE_CAUSE("time", CAUSE_TIME) -+DECLARE_CAUSE("instret", CAUSE_INSTRET) -+DECLARE_CAUSE("stats", CAUSE_STATS) -+DECLARE_CAUSE("uarch0", CAUSE_UARCH0) -+DECLARE_CAUSE("uarch1", CAUSE_UARCH1) -+DECLARE_CAUSE("uarch2", CAUSE_UARCH2) -+DECLARE_CAUSE("uarch3", CAUSE_UARCH3) -+DECLARE_CAUSE("uarch4", CAUSE_UARCH4) -+DECLARE_CAUSE("uarch5", CAUSE_UARCH5) -+DECLARE_CAUSE("uarch6", CAUSE_UARCH6) -+DECLARE_CAUSE("uarch7", CAUSE_UARCH7) -+DECLARE_CAUSE("uarch8", CAUSE_UARCH8) -+DECLARE_CAUSE("uarch9", CAUSE_UARCH9) -+DECLARE_CAUSE("uarch10", CAUSE_UARCH10) -+DECLARE_CAUSE("uarch11", CAUSE_UARCH11) -+DECLARE_CAUSE("uarch12", CAUSE_UARCH12) -+DECLARE_CAUSE("uarch13", CAUSE_UARCH13) -+DECLARE_CAUSE("uarch14", CAUSE_UARCH14) -+DECLARE_CAUSE("uarch15", CAUSE_UARCH15) -+DECLARE_CAUSE("sstatus", CAUSE_SSTATUS) -+DECLARE_CAUSE("stvec", CAUSE_STVEC) -+DECLARE_CAUSE("stimecmp", CAUSE_STIMECMP) -+DECLARE_CAUSE("sscratch", CAUSE_SSCRATCH) -+DECLARE_CAUSE("sepc", CAUSE_SEPC) -+DECLARE_CAUSE("sptbr", CAUSE_SPTBR) -+DECLARE_CAUSE("sasid", CAUSE_SASID) -+DECLARE_CAUSE("scycle", CAUSE_SCYCLE) -+DECLARE_CAUSE("stime", CAUSE_STIME) -+DECLARE_CAUSE("sinstret", CAUSE_SINSTRET) -+DECLARE_CAUSE("scause", CAUSE_SCAUSE) -+DECLARE_CAUSE("sbadaddr", CAUSE_SBADADDR) -+DECLARE_CAUSE("mstatus", CAUSE_MSTATUS) -+DECLARE_CAUSE("mscratch", CAUSE_MSCRATCH) -+DECLARE_CAUSE("mepc", CAUSE_MEPC) -+DECLARE_CAUSE("mcause", CAUSE_MCAUSE) -+DECLARE_CAUSE("mbadaddr", CAUSE_MBADADDR) -+DECLARE_CAUSE("reset", CAUSE_RESET) -+DECLARE_CAUSE("tohost", CAUSE_TOHOST) -+DECLARE_CAUSE("fromhost", CAUSE_FROMHOST) -+DECLARE_CAUSE("send_ipi", CAUSE_SEND_IPI) -+DECLARE_CAUSE("hartid", CAUSE_HARTID) -+DECLARE_CAUSE("cycleh", CAUSE_CYCLEH) -+DECLARE_CAUSE("timeh", CAUSE_TIMEH) -+DECLARE_CAUSE("instreth", CAUSE_INSTRETH) -+DECLARE_CAUSE("scycleh", CAUSE_SCYCLEH) -+DECLARE_CAUSE("stimeh", CAUSE_STIMEH) -+DECLARE_CAUSE("sinstreth", CAUSE_SINSTRETH) -+#endif -diff -rNU3 dist.orig/include/opcode/riscv.h dist/include/opcode/riscv.h ---- dist.orig/include/opcode/riscv.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/include/opcode/riscv.h 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,320 @@ -+/* riscv.h. RISC-V opcode list for GDB, the GNU debugger. -+ Copyright 2011 -+ Free Software Foundation, Inc. -+ Contributed by Andrew Waterman -+ -+This file is part of GDB, GAS, and the GNU binutils. -+ -+GDB, GAS, and the GNU binutils are free software; you can redistribute -+them and/or modify them under the terms of the GNU General Public -+License as published by the Free Software Foundation; either version -+1, or (at your option) any later version. -+ -+GDB, GAS, and the GNU binutils are distributed in the hope that they -+will be useful, but WITHOUT ANY WARRANTY; without even the implied -+warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -+the GNU General Public License for more details. -+ -+You should have received a copy of the GNU General Public License -+along with this file; see the file COPYING. If not, write to the Free -+Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -+ -+#ifndef _RISCV_H_ -+#define _RISCV_H_ -+ -+#include "riscv-opc.h" -+#include -+#include -+ -+/* RVC fields */ -+ -+#define OP_MASK_CRD 0x1f -+#define OP_SH_CRD 5 -+#define OP_MASK_CRS2 0x1f -+#define OP_SH_CRS2 5 -+#define OP_MASK_CRS1 0x1f -+#define OP_SH_CRS1 10 -+#define OP_MASK_CRDS 0x7 -+#define OP_SH_CRDS 13 -+#define OP_MASK_CRS2S 0x7 -+#define OP_SH_CRS2S 13 -+#define OP_MASK_CRS2BS 0x7 -+#define OP_SH_CRS2BS 5 -+#define OP_MASK_CRS1S 0x7 -+#define OP_SH_CRS1S 10 -+#define OP_MASK_CIMM6 0x3f -+#define OP_SH_CIMM6 10 -+#define OP_MASK_CIMM5 0x1f -+#define OP_SH_CIMM5 5 -+#define OP_MASK_CIMM10 0x3ff -+#define OP_SH_CIMM10 5 -+ -+static const char rvc_rs1_regmap[8] = { 20, 21, 2, 3, 4, 5, 6, 7 }; -+#define rvc_rd_regmap rvc_rs1_regmap -+#define rvc_rs2b_regmap rvc_rs1_regmap -+static const char rvc_rs2_regmap[8] = { 20, 21, 2, 3, 4, 5, 6, 0 }; -+ -+typedef uint64_t insn_t; -+ -+static inline unsigned int riscv_insn_length (insn_t insn) -+{ -+ if ((insn & 0x3) != 3) /* RVC */ -+ return 2; -+ if ((insn & 0x1f) != 0x1f) /* base ISA and extensions in 32-bit space */ -+ return 4; -+ if ((insn & 0x3f) == 0x1f) /* 48-bit extensions */ -+ return 6; -+ if ((insn & 0x7f) == 0x3f) /* 64-bit extensions */ -+ return 8; -+ /* longer instructions not supported at the moment */ -+ return 2; -+} -+ -+static const char * const riscv_rm[8] = { -+ "rne", "rtz", "rdn", "rup", "rmm", 0, 0, "dyn" -+}; -+static const char* const riscv_pred_succ[16] = { -+ 0, "w", "r", "rw", "o", "ow", "or", "orw", -+ "i", "iw", "ir", "irw", "io", "iow", "ior", "iorw", -+}; -+ -+#define RVC_JUMP_BITS 10 -+#define RVC_JUMP_ALIGN_BITS 1 -+#define RVC_JUMP_ALIGN (1 << RVC_JUMP_ALIGN_BITS) -+#define RVC_JUMP_REACH ((1ULL<> (s)) & ((1<<(n))-1)) -+#define RV_IMM_SIGN(x) (-(((x) >> 31) & 1)) -+ -+#define EXTRACT_ITYPE_IMM(x) \ -+ (RV_X(x, 20, 12) | (RV_IMM_SIGN(x) << 12)) -+#define EXTRACT_STYPE_IMM(x) \ -+ (RV_X(x, 7, 5) | (RV_X(x, 25, 7) << 5) | (RV_IMM_SIGN(x) << 12)) -+#define EXTRACT_SBTYPE_IMM(x) \ -+ ((RV_X(x, 8, 4) << 1) | (RV_X(x, 25, 6) << 5) | (RV_X(x, 7, 1) << 11) | (RV_IMM_SIGN(x) << 12)) -+#define EXTRACT_UTYPE_IMM(x) \ -+ ((RV_X(x, 12, 20) << 12) | (RV_IMM_SIGN(x) << 32)) -+#define EXTRACT_UJTYPE_IMM(x) \ -+ ((RV_X(x, 21, 10) << 1) | (RV_X(x, 20, 1) << 11) | (RV_X(x, 12, 8) << 12) | (RV_IMM_SIGN(x) << 20)) -+ -+#define ENCODE_ITYPE_IMM(x) \ -+ (RV_X(x, 0, 12) << 20) -+#define ENCODE_STYPE_IMM(x) \ -+ ((RV_X(x, 0, 5) << 7) | (RV_X(x, 5, 7) << 25)) -+#define ENCODE_SBTYPE_IMM(x) \ -+ ((RV_X(x, 1, 4) << 8) | (RV_X(x, 5, 6) << 25) | (RV_X(x, 11, 1) << 7) | (RV_X(x, 12, 1) << 31)) -+#define ENCODE_UTYPE_IMM(x) \ -+ (RV_X(x, 12, 20) << 12) -+#define ENCODE_UJTYPE_IMM(x) \ -+ ((RV_X(x, 1, 10) << 21) | (RV_X(x, 11, 1) << 20) | (RV_X(x, 12, 8) << 12) | (RV_X(x, 20, 1) << 31)) -+ -+#define VALID_ITYPE_IMM(x) (EXTRACT_ITYPE_IMM(ENCODE_ITYPE_IMM(x)) == (x)) -+#define VALID_STYPE_IMM(x) (EXTRACT_STYPE_IMM(ENCODE_STYPE_IMM(x)) == (x)) -+#define VALID_SBTYPE_IMM(x) (EXTRACT_SBTYPE_IMM(ENCODE_SBTYPE_IMM(x)) == (x)) -+#define VALID_UTYPE_IMM(x) (EXTRACT_UTYPE_IMM(ENCODE_UTYPE_IMM(x)) == (x)) -+#define VALID_UJTYPE_IMM(x) (EXTRACT_UJTYPE_IMM(ENCODE_UJTYPE_IMM(x)) == (x)) -+ -+#define RISCV_RTYPE(insn, rd, rs1, rs2) \ -+ ((MATCH_ ## insn) | ((rd) << OP_SH_RD) | ((rs1) << OP_SH_RS1) | ((rs2) << OP_SH_RS2)) -+#define RISCV_ITYPE(insn, rd, rs1, imm) \ -+ ((MATCH_ ## insn) | ((rd) << OP_SH_RD) | ((rs1) << OP_SH_RS1) | ENCODE_ITYPE_IMM(imm)) -+#define RISCV_STYPE(insn, rs1, rs2, imm) \ -+ ((MATCH_ ## insn) | ((rs1) << OP_SH_RS1) | ((rs2) << OP_SH_RS2) | ENCODE_STYPE_IMM(imm)) -+#define RISCV_SBTYPE(insn, rs1, rs2, target) \ -+ ((MATCH_ ## insn) | ((rs1) << OP_SH_RS1) | ((rs2) << OP_SH_RS2) | ENCODE_SBTYPE_IMM(target)) -+#define RISCV_UTYPE(insn, rd, bigimm) \ -+ ((MATCH_ ## insn) | ((rd) << OP_SH_RD) | ENCODE_UTYPE_IMM(bigimm)) -+#define RISCV_UJTYPE(insn, rd, target) \ -+ ((MATCH_ ## insn) | ((rd) << OP_SH_RD) | ENCODE_UJTYPE_IMM(target)) -+ -+#define RISCV_NOP RISCV_ITYPE(ADDI, 0, 0, 0) -+ -+#define RISCV_CONST_HIGH_PART(VALUE) \ -+ (((VALUE) + (RISCV_IMM_REACH/2)) & ~(RISCV_IMM_REACH-1)) -+#define RISCV_CONST_LOW_PART(VALUE) ((VALUE) - RISCV_CONST_HIGH_PART (VALUE)) -+#define RISCV_PCREL_HIGH_PART(VALUE, PC) RISCV_CONST_HIGH_PART((VALUE) - (PC)) -+#define RISCV_PCREL_LOW_PART(VALUE, PC) RISCV_CONST_LOW_PART((VALUE) - (PC)) -+ -+/* RV fields */ -+ -+#define OP_MASK_OP 0x7f -+#define OP_SH_OP 0 -+#define OP_MASK_RS2 0x1f -+#define OP_SH_RS2 20 -+#define OP_MASK_RS1 0x1f -+#define OP_SH_RS1 15 -+#define OP_MASK_RS3 0x1f -+#define OP_SH_RS3 27 -+#define OP_MASK_RD 0x1f -+#define OP_SH_RD 7 -+#define OP_MASK_SHAMT 0x3f -+#define OP_SH_SHAMT 20 -+#define OP_MASK_SHAMTW 0x1f -+#define OP_SH_SHAMTW 20 -+#define OP_MASK_RM 0x7 -+#define OP_SH_RM 12 -+#define OP_MASK_PRED 0xf -+#define OP_SH_PRED 24 -+#define OP_MASK_SUCC 0xf -+#define OP_SH_SUCC 20 -+#define OP_MASK_AQ 0x1 -+#define OP_SH_AQ 26 -+#define OP_MASK_RL 0x1 -+#define OP_SH_RL 25 -+ -+#define OP_MASK_VRD 0x1f -+#define OP_SH_VRD 7 -+#define OP_MASK_VRS 0x1f -+#define OP_SH_VRS 15 -+#define OP_MASK_VRT 0x1f -+#define OP_SH_VRT 20 -+#define OP_MASK_VRR 0x1f -+#define OP_SH_VRR 27 -+ -+#define OP_MASK_VFD 0x1f -+#define OP_SH_VFD 7 -+#define OP_MASK_VFS 0x1f -+#define OP_SH_VFS 15 -+#define OP_MASK_VFT 0x1f -+#define OP_SH_VFT 20 -+#define OP_MASK_VFR 0x1f -+#define OP_SH_VFR 27 -+ -+#define OP_MASK_IMMNGPR 0x3f -+#define OP_SH_IMMNGPR 20 -+#define OP_MASK_IMMNFPR 0x3f -+#define OP_SH_IMMNFPR 26 -+#define OP_MASK_IMMSEGNELM 0x7 -+#define OP_SH_IMMSEGNELM 29 -+#define OP_MASK_CUSTOM_IMM 0x7f -+#define OP_SH_CUSTOM_IMM 25 -+#define OP_MASK_CSR 0xfff -+#define OP_SH_CSR 20 -+ -+#define X_RA 1 -+#define X_SP 2 -+#define X_GP 3 -+#define X_TP 4 -+#define X_T0 5 -+#define X_T1 6 -+#define X_T2 7 -+#define X_T3 28 -+ -+#define NGPR 32 -+#define NFPR 32 -+#define NVGPR 32 -+#define NVFPR 32 -+ -+#define RISCV_JUMP_BITS RISCV_BIGIMM_BITS -+#define RISCV_JUMP_ALIGN_BITS 1 -+#define RISCV_JUMP_ALIGN (1 << RISCV_JUMP_ALIGN_BITS) -+#define RISCV_JUMP_REACH ((1ULL< ld.pod - -($(POD2MAN) ld.pod | \ -diff -rNU3 dist.orig/ld/Makefile.in dist/ld/Makefile.in ---- dist.orig/ld/Makefile.in 2013-03-25 09:06:23.000000000 +0100 -+++ dist/ld/Makefile.in 2015-10-18 13:11:17.000000000 +0200 -@@ -452,12 +452,16 @@ - earmelf_linux_eabi.c \ - earmelf_nacl.c \ - earmelf_nbsd.c \ -+ earmelf_nbsd_eabi.c \ -+ earmelf_nbsd_eabihf.c \ - earmelf_vxworks.c \ - earmelfb.c \ - earmelfb_linux.c \ - earmelfb_linux_eabi.c \ - earmelfb_nacl.c \ - earmelfb_nbsd.c \ -+ earmelfb_nbsd_eabi.c \ -+ earmelfb_nbsd_eabihf.c \ - earmnbsd.c \ - earmnto.c \ - earmpe.c \ -@@ -535,6 +539,7 @@ - eelf32lppc.c \ - eelf32lppcnto.c \ - eelf32lppcsim.c \ -+ eelf32lriscv.c \ - eelf32lsmip.c \ - eelf32ltsmip.c \ - eelf32ltsmip_fbsd.c \ -@@ -548,9 +553,12 @@ - eelf32mipswindiss.c \ - eelf32moxie.c \ - eelf32mt.c \ -- eelf32openrisc.c \ -+ eelf32or1k.c \ -+ eelf32or1k_linux.c \ -+ eelf32or1k_nbsd.c \ - eelf32ppc.c \ - eelf32ppc_fbsd.c \ -+ eelf32ppc_nbsd.c \ - eelf32ppclinux.c \ - eelf32ppcnto.c \ - eelf32ppcsim.c \ -@@ -709,8 +717,6 @@ - emsp430xW427.c \ - enews.c \ - ens32knbsd.c \ -- eor32.c \ -- eor32elf.c \ - epc532macha.c \ - epdp11.c \ - epjelf.c \ -@@ -775,6 +781,8 @@ - eaarch64elfb.c \ - eaarch64linux.c \ - eaarch64linuxb.c \ -+ eaarch64nbsd.c \ -+ eaarch64nbsdb.c \ - eelf32_x86_64.c \ - eelf32_x86_64_nacl.c \ - eelf64_aix.c \ -@@ -793,6 +801,7 @@ - eelf64btsmip_fbsd.c \ - eelf64hppa.c \ - eelf64lppc.c \ -+ eelf64lriscv.c \ - eelf64ltsmip.c \ - eelf64ltsmip_fbsd.c \ - eelf64mmix.c \ -@@ -1060,6 +1069,8 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64elfb.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linux.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64linuxb.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64nbsd.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaarch64nbsdb.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaix5ppc.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaix5rs6.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eaixppc.Po@am__quote@ -@@ -1078,12 +1089,16 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_eabi.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nacl.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd_eabi.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd_eabihf.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_vxworks.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux_eabi.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nacl.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd_eabi.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nbsd_eabihf.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmnbsd.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmnto.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmpe.Po@am__quote@ -@@ -1156,6 +1171,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppc.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppcnto.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lppcsim.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lriscv.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32lsmip.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmip.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ltsmip_fbsd.Po@am__quote@ -@@ -1169,9 +1185,12 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mipswindiss.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32moxie.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32mt.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32openrisc.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_linux.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32or1k_nbsd.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc_fbsd.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppc_nbsd.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppclinux.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcnto.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf32ppcsim.Po@am__quote@ -@@ -1204,6 +1223,7 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64btsmip_fbsd.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64hppa.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lppc.Po@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64lriscv.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ltsmip.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ltsmip_fbsd.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64mmix.Po@am__quote@ -@@ -1363,8 +1383,6 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emsp430xW427.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enews.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ens32knbsd.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eor32.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eor32elf.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epc532macha.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epdp11.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epjelf.Po@am__quote@ -@@ -1490,6 +1508,8 @@ - -rm -f libtool config.lt - - ld.info: ld.texinfo $(ld_TEXINFOS) -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_ld.info: ld.texinfo $(ld_TEXINFOS) - restore=: && backupdir="$(am__leading_dot)am$$$$" && \ - rm -rf $$backupdir && mkdir $$backupdir && \ - if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ -@@ -2201,6 +2221,18 @@ - $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} armelf_nbsd "$(tdir_armelf_nbsd)" -+earmelf_nbsd_eabi.c: $(srcdir)/emulparams/armelf_nbsd_eabi.sh \ -+ $(srcdir)/emulparams/armelf_nbsd.sh \ -+ $(srcdir)/emulparams/armelf.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} armelf_nbsd_eabi "$(tdir_armelf_nbsd_eabi)" -+earmelf_nbsd_eabihf.c: $(srcdir)/emulparams/armelf_nbsd_eabihf.sh \ -+ $(srcdir)/emulparams/armelf_nbsd.sh \ -+ $(srcdir)/emulparams/armelf.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} armelf_nbsd_eabihf "$(tdir_armelf_nbsd_eabihf)" - earmelf_vxworks.c: $(srcdir)/emulparams/armelf_vxworks.sh \ - $(srcdir)/emulparams/vxworks.sh $(srcdir)/emulparams/armelf.sh \ - $(ELF_DEPS) $(srcdir)/emultempl/vxworks.em \ -@@ -2236,6 +2268,20 @@ - $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} armelfb_nbsd "$(tdir_armelfb_nbsd)" -+earmelfb_nbsd_eabi.c: $(srcdir)/emulparams/armelfb_nbsd_eabi.sh \ -+ $(srcdir)/emulparams/armelf_nbsd_eabi.sh \ -+ $(srcdir)/emulparams/armelf_nbsd.sh \ -+ $(srcdir)/emulparams/armelf.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} armelfb_nbsd_eabi "$(tdir_armelfb_nbsd_eabi)" -+earmelfb_nbsd_eabihf.c: $(srcdir)/emulparams/armelfb_nbsd_eabihf.sh \ -+ $(srcdir)/emulparams/armelf_nbsd_eabihf.sh \ -+ $(srcdir)/emulparams/armelf_nbsd.sh \ -+ $(srcdir)/emulparams/armelf.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} armelfb_nbsd_eabihf "$(tdir_armelfb_nbsd_eabihf)" - earmnbsd.c: $(srcdir)/emulparams/armnbsd.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} - ${GENSCRIPTS} armnbsd "$(tdir_armnbsd)" -@@ -2550,6 +2596,10 @@ - ldemul-list.h \ - $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} elf32lppcsim "$(tdir_elf32lppcsim)" -+eelf32lriscv.c: $(srcdir)/emulparams/elf32lriscv.sh \ -+ $(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \ -+ $(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} elf32lriscv "$(tdir_elf32lriscv)" - eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \ - $(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \ - $(ELF_DEPS) $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc \ -@@ -2600,9 +2650,17 @@ - eelf32mt.c: $(srcdir)/emulparams/elf32mt.sh \ - $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} elf32mt "$(tdir_mt)" --eelf32openrisc.c: $(srcdir)/emulparams/elf32openrisc.sh \ -+eelf32or1k.c: $(srcdir)/emulparams/elf32or1k.sh \ -+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} elf32or1k "$(tdir_or1k)" -+eelf32or1k_linux.c: $(srcdir)/emulparams/elf32or1k_linux.sh \ -+ $(srcdir)/emulparams/elf32or1k.sh \ -+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} elf32or1k_linux "$(tdir_or1k_linux)" -+eelf32or1k_nbsd.c: $(srcdir)/emulparams/elf32or1k_nbsd.sh \ -+ $(srcdir)/emulparams/elf32or1k.sh \ - $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -- ${GENSCRIPTS} elf32openrisc "$(tdir_openrisc)" -+ ${GENSCRIPTS} elf32or1k_nbsd "$(tdir_or1k_nbsd)" - eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \ - $(srcdir)/emulparams/elf32ppccommon.sh $(srcdir)/emultempl/ppc32elf.em \ - ldemul-list.h \ -@@ -2614,6 +2672,12 @@ - ldemul-list.h \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} elf32ppc_fbsd "$(tdir_elf32ppc_fbsd)" -+eelf32ppc_nbsd.c: $(srcdir)/emulparams/elf32ppc_nbsd.sh \ -+ $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \ -+ $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \ -+ ldemul-list.h \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} elf32ppc_nbsd "$(tdir_elf32ppc_nbsd)" - eelf32ppclinux.c: $(srcdir)/emulparams/elf32ppclinux.sh \ - $(srcdir)/emulparams/elf32ppc.sh $(srcdir)/emulparams/elf32ppccommon.sh \ - $(srcdir)/emultempl/ppc32elf.em $(ELF_DEPS) \ -@@ -3211,12 +3275,14 @@ - $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} aarch64linuxb "$(tdir_aarch64linuxb)" --eor32.c: $(srcdir)/emulparams/or32.sh \ -- $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/or32.sc ${GEN_DEPENDS} -- ${GENSCRIPTS} or32 "$(tdir_or32)" --eor32elf.c: $(srcdir)/emulparams/or32elf.sh \ -- $(ELF_GEN_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -- ${GENSCRIPTS} or32elf "$(tdir_or32elf)" -+eaarch64nbsd.c: $(srcdir)/emulparams/aarch64nbsd.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} aarch64nbsd "$(tdir_aarch64nbsd)" -+eaarch64nbsdb.c: $(srcdir)/emulparams/aarch64nbsdb.sh $(srcdir)/emulparams/aarch64nbsd.sh \ -+ $(ELF_DEPS) $(srcdir)/emultempl/aarch64elf.em \ -+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} aarch64nbsdb "$(tdir_aarch64nbsdb)" - epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \ - $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} - ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)" -@@ -3499,6 +3565,11 @@ - ldemul-list.h \ - $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} elf64lppc "$(tdir_elf64lppc)" -+eelf64lriscv.c: $(srcdir)/emulparams/elf64lriscv.sh \ -+ $(srcdir)/emulparams/elf64lriscv-defs.sh \ -+ $(srcdir)/emulparams/elf32lriscv-defs.sh $(ELF_DEPS) \ -+ $(srcdir)/emultempl/riscvelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} elf64lriscv "$(tdir_elf64lriscv)" - eelf64ltsmip.c: $(srcdir)/emulparams/elf64ltsmip.sh \ - $(srcdir)/emulparams/elf64btsmip.sh $(srcdir)/emulparams/elf64bmip-defs.sh \ - $(srcdir)/emulparams/elf32bmipn32-defs.sh $(ELF_DEPS) \ -@@ -3632,6 +3703,8 @@ - # because almost all configs use "gen" version of manual. - # Set DOCVER above to change. - configdoc.texi: ${DOCVER}-doc.texi -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_configdoc.texi: - cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi - chmod u+w ./configdoc.texi - -@@ -3639,6 +3712,8 @@ - # The sed command removes the no-adjust Nroff command so that - # the man output looks standard. - ld.1: $(srcdir)/ld.texinfo configdoc.texi -+ @echo "NOT REBUILDING $@" -+NetBSD_DISABLED_ld.1: - touch $@ - -$(TEXI2POD) $(MANCONF) < $(srcdir)/ld.texinfo > ld.pod - -($(POD2MAN) ld.pod | \ -diff -rNU3 dist.orig/ld/configdoc.texi dist/ld/configdoc.texi ---- dist.orig/ld/configdoc.texi 2012-11-13 15:19:33.000000000 +0100 -+++ dist/ld/configdoc.texi 1970-01-01 01:00:00.000000000 +0100 -@@ -1,27 +0,0 @@ --@c ------------------------------ CONFIGURATION VARS: --@c 1. Inclusiveness of this manual --@set GENERIC -- --@c 2. Specific target machines --@set ARM --@set C6X --@set H8300 --@set HPPA --@set I960 --@set M68HC11 --@set M68K --@set MMIX --@set MSP430 --@set POWERPC --@set POWERPC64 --@set Renesas --@set SPU --@set TICOFF --@set WIN32 --@set XTENSA -- --@c 3. Properties of this configuration --@clear SingleFormat --@set UsesEnvVars --@c ------------------------------ end CONFIGURATION VARS -- -diff -rNU3 dist.orig/ld/configure.tgt dist/ld/configure.tgt ---- dist.orig/ld/configure.tgt 2012-09-04 14:53:47.000000000 +0200 -+++ dist/ld/configure.tgt 2015-10-18 13:11:17.000000000 +0200 -@@ -35,6 +35,10 @@ - targ_extra_emuls="aarch64linux aarch64elfb aarch64elf armelfb_linux_eabi armelf_linux_eabi armelfb armelf" ;; - aarch64-*-linux*) targ_emul=aarch64linux - targ_extra_emuls="aarch64linuxb aarch64elf aarch64elfb armelf_linux_eabi armelfb_linux_eabi armelf armelfb" ;; -+aarch64_be-*-netbsd*) targ_emul=aarch64nbsdb -+ targ_extra_emuls="aarch64nbsd aarch64elfb aarch64elf armelfb_nbsd_eabihf armelf_nbsd_eabihf armelfb_nbsd_eabi armelf_nbsd_eabi armelfb_nbsd armelf_nbsd armelf armelfb" ;; -+aarch64-*-netbsd*) targ_emul=aarch64nbsd -+ targ_extra_emuls="aarch64nbsdb aarch64elf aarch64elfb armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armelfb" ;; - alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) - targ_emul=elf64alpha_fbsd - targ_extra_emuls="elf64alpha alpha" -@@ -64,7 +68,19 @@ - arm-*-freebsd* | arm-*-kfreebsd*-gnu) - targ_emul=armelf_fbsd - targ_extra_emuls="armelf" ;; --armeb-*-netbsdelf*) targ_emul=armelfb_nbsd; -+arm*eb-*-netbsdelf*-*eabihf*) -+ targ_emul=armelfb_nbsd_eabihf; -+ targ_extra_emuls="armelf_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armnbsd" ;; -+arm*eb-*-netbsdelf*-*eabi*) -+ targ_emul=armelfb_nbsd_eabi; -+ targ_extra_emuls="armelf_nbsd_eabi armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd armelfb_nbsd armelf armnbsd" ;; -+arm*-*-netbsdelf*-*eabihf*) -+ targ_emul=armelf_nbsd_eabihf; -+ targ_extra_emuls="armelfb_nbsd_eabihf armelf_nbsd_eabi armelfb_nbsd_eabi armelf_nbsd armelfb_nbsd armelf armnbsd" ;; -+arm*-*-netbsdelf*-*eabi*) -+ targ_emul=armelf_nbsd_eabi; -+ targ_extra_emuls="armelfb_nbsd_eabi armelf_nbsd_eabihf armelfb_nbsd_eabihf armelf_nbsd armelfb_nbsd armelf armnbsd" ;; -+arm*eb-*-netbsdelf*) targ_emul=armelfb_nbsd; - targ_extra_emuls="armelf_nbsd armelf armnbsd" ;; - arm-*-netbsdelf*) targ_emul=armelf_nbsd; - targ_extra_emuls="armelfb_nbsd armelf armnbsd" ;; -@@ -379,7 +395,8 @@ - m68*-*-gnu*) targ_emul=m68kelf ;; - m68*-*-netbsd*4k*) targ_emul=m68k4knbsd - targ_extra_emuls="m68knbsd m68kelfnbsd" ;; --m68*-*-netbsdelf*) targ_emul=m68kelfnbsd -+m68*-*-netbsdelf* | m5407*-*-netbsdelf*) -+ targ_emul=m68kelfnbsd - targ_extra_emuls="m68knbsd m68k4knbsd" ;; - m68*-*-netbsdaout* | m68*-*-netbsd*) - targ_emul=m68knbsd -@@ -409,12 +426,18 @@ - mips*-sgi-irix*) targ_emul=mipsbig ;; - mips*el-*-ecoff*) targ_emul=mipsidtl ;; - mips*-*-ecoff*) targ_emul=mipsidt ;; -+mips64*el-*-netbsd*) targ_emul=elf32ltsmipn32 -+ targ_extra_emuls="elf64btsmip elf64ltsmip elf32ltsmip elf32btsmipn32 elf32btsmip" -+ ;; -+mips64*-*-netbsd*) targ_emul=elf32btsmipn32 -+ targ_extra_emuls="elf64ltsmip elf64btsmip elf32btsmip elf32ltsmipn32 elf32ltsmip" -+ ;; - mips*el-*-netbsd*) targ_emul=elf32ltsmip - targ_extra_emuls="elf32btsmip elf64ltsmip elf64btsmip" - ;; - mips*-*-netbsd*) targ_emul=elf32btsmip - targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" -- ;; -+ ;; - mips*-*-bsd*) targ_emul=mipsbig ;; - mips*vr4300el-*-elf*) targ_emul=elf32l4300 ;; - mips*vr4300-*-elf*) targ_emul=elf32b4300 ;; -@@ -481,11 +504,11 @@ - ns32k-pc532-mach* | ns32k-pc532-ux*) targ_emul=pc532macha ;; - ns32k-*-netbsd* | ns32k-pc532-lites*) targ_emul=ns32knbsd - ;; --openrisc-*-*) targ_emul=elf32openrisc ;; --or32-*-coff) targ_emul=or32 ;; --or32-*-elf) targ_emul=or32elf ;; --or32-*-rtems*) targ_emul=or32elf -- ;; -+or1k-*-elf | or1knd-*-elf) targ_emul=elf32or1k ;; -+or1k-*-linux* | or1knd-*-linux*) targ_emul=elf32or1k_linux ;; -+or1k-*-netbsd* | or1knd-*-netbsd*) targ_emul=elf32or1k_nbsd ;; -+or1k-*-rtems* | or1knd-*-rtems*) targ_emul=elf32or1k ;; -+ - pdp11-*-*) targ_emul=pdp11 - ;; - pjl*-*-*) targ_emul=pjlelf ; targ_extra_emuls="elf_i386" ;; -@@ -529,8 +552,18 @@ - *) targ_emul=elf32lppc - targ_extra_emuls="elf32ppcsim" ;; - esac ;; -+powerpc64*-*-netbsd*) -+ targ_emul=elf64ppc -+ targ_extra_emuls="elf32ppc elf32ppc_nbsd elf32ppcsim" -+ tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'` -+ tdir_elf32ppc_nbsd=$tdir_elf32ppc -+ tdir_elf32ppcsim=$tdir_elf32ppc -+ ;; -+powerpc*-*-netbsd*) -+ targ_emul=elf32ppc_nbsd -+ targ_extra_emuls="elf32ppc elf32ppcsim" ;; - powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \ -- | powerpc*-*-netbsd* | powerpc-*-openbsd* | powerpc*-*-kaos*) -+ | powerpc-*-openbsd* | powerpc*-*-kaos*) - case "${targ}" in - *64*) targ_emul=elf64ppc - targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim" -@@ -557,6 +590,12 @@ - powerpc-*-beos*) targ_emul=aixppc ;; - powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;; - powerpc-*-lynxos*) targ_emul=ppclynx ;; -+riscv32-*-*) targ_emul=elf32lriscv -+ targ_extra_emuls="elf64lriscv" -+ targ_extra_libpath=$targ_extra_emuls ;; -+riscv*-*-*) targ_emul=elf64lriscv -+ targ_extra_emuls="elf32lriscv" -+ targ_extra_libpath=$targ_extra_emuls ;; - rs6000-*-aix[5-9]*) targ_emul=aix5rs6 ;; - rs6000-*-aix*) targ_emul=aixrs6 - ;; -@@ -654,10 +693,15 @@ - tdir_sparclinux=${targ_alias}aout - tdir_elf64_sparc=`echo ${targ_alias} | sed -e 's/32//'` - tdir_sun4=sparc-sun-sunos4 ;; --sparc64-*-netbsd* | sparc64-*-openbsd*) -- targ_emul=elf64_sparc -- targ_extra_emuls="elf32_sparc" ;; --sparc*-*-netbsd*elf*) targ_emul=elf32_sparc ;; -+sparc64-*-netbsd*) targ_emul=elf64_sparc -+ targ_extra_emuls="elf32_sparc sparcnbsd" -+ ;; -+sparc64-*-openbsd*) targ_emul=elf64_sparc -+ targ_extra_emuls="elf32_sparc" -+ ;; -+sparc*-*-netbsd*elf*) targ_emul=elf32_sparc -+ targ_extra_emuls=sparcnbsd -+ ;; - sparc*-*-netbsd*) targ_emul=sparcnbsd ;; - sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) - targ_emul=elf32_sparc_sol2 -diff -rNU3 dist.orig/ld/emulparams/aarch64nbsd.sh dist/ld/emulparams/aarch64nbsd.sh ---- dist.orig/ld/emulparams/aarch64nbsd.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/aarch64nbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,36 @@ -+ARCH=aarch64 -+MACHINE= -+NOP=0 -+ -+SCRIPT_NAME=elf -+OUTPUT_FORMAT="elf64-littleaarch64" -+BIG_OUTPUT_FORMAT="elf64-bigaarch64" -+LITTLE_OUTPUT_FORMAT="elf64-littleaarch64" -+NO_REL_RELOCS=yes -+ -+TEMPLATE_NAME=elf32 -+EXTRA_EM_FILE=aarch64elf -+ -+GENERATE_SHLIB_SCRIPT=yes -+GENERATE_PIE_SCRIPT=yes -+ -+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -+SEPARATE_GOTPLT=24 -+IREL_IN_PLT= -+ -+TEXT_START_ADDR=0x200100000 -+ -+DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; -+ -+# AArch64 does not support .s* sections. -+NO_SMALL_DATA=yes -+ -+OTHER_BSS_SYMBOLS='__bss_start__ = .;' -+OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;' -+OTHER_END_SYMBOLS='__end__ = . ;' -+ -+OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }' -+ATTRS_SECTIONS='.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) KEEP (*(.gnu.attributes)) }' -+# Ensure each PLT entry is aligned to a cache line. -+PLT=".plt ${RELOCATING-0} : ALIGN(16) { *(.plt)${IREL_IN_PLT+ *(.iplt)} }" -diff -rNU3 dist.orig/ld/emulparams/aarch64nbsdb.sh dist/ld/emulparams/aarch64nbsdb.sh ---- dist.orig/ld/emulparams/aarch64nbsdb.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/aarch64nbsdb.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,2 @@ -+. ${srcdir}/emulparams/aarch64nbsd.sh -+OUTPUT_FORMAT="elf64-bigaarch64" -diff -rNU3 dist.orig/ld/emulparams/armelf_nbsd.sh dist/ld/emulparams/armelf_nbsd.sh ---- dist.orig/ld/emulparams/armelf_nbsd.sh 2006-05-30 18:45:32.000000000 +0200 -+++ dist/ld/emulparams/armelf_nbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -1,7 +1,14 @@ - . ${srcdir}/emulparams/armelf.sh - MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" --TEXT_START_ADDR=0x00008000 -+TEXT_START_ADDR=0x00010000 - TARGET2_TYPE=got-rel - -+unset DATA_START_SYMBOLS - unset STACK_ADDR - unset EMBEDDED -+ -+case "$target" in -+ aarch64*-*-netbsd* | arm*-*-netbsdelf*-*eabi*) -+ LIB_PATH='=/usr/lib/oabi' -+ ;; -+esac -diff -rNU3 dist.orig/ld/emulparams/armelf_nbsd_eabi.sh dist/ld/emulparams/armelf_nbsd_eabi.sh ---- dist.orig/ld/emulparams/armelf_nbsd_eabi.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/armelf_nbsd_eabi.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,20 @@ -+. ${srcdir}/emulparams/armelf_nbsd.sh -+ -+# Use the ARM ABI-compliant exception-handling sections. -+OTHER_READONLY_SECTIONS=" -+ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } -+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } -+ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } -+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" -+ -+case "$target" in -+ arm*-*-netbsdelf*-*eabihf*) -+ LIB_PATH='=/usr/lib/eabi' -+ ;; -+ arm*-*-netbsdelf*-*eabi*) -+ LIB_PATH='=/usr/lib' -+ ;; -+ aarch64*-*-netbsd* | arm*-*-netbsdelf*) -+ LIB_PATH='=/usr/lib/eabi' -+ ;; -+esac -diff -rNU3 dist.orig/ld/emulparams/armelf_nbsd_eabihf.sh dist/ld/emulparams/armelf_nbsd_eabihf.sh ---- dist.orig/ld/emulparams/armelf_nbsd_eabihf.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/armelf_nbsd_eabihf.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,17 @@ -+. ${srcdir}/emulparams/armelf_nbsd.sh -+ -+# Use the ARM ABI-compliant exception-handling sections. -+OTHER_READONLY_SECTIONS=" -+ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } -+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } -+ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } -+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" -+ -+case "$target" in -+ arm*-*-netbsdelf*-*eabihf*) -+ LIB_PATH='=/usr/lib' -+ ;; -+ aarch64*-*-netbsd* | arm*-*-netbsdelf*) -+ LIB_PATH='=/usr/lib/eabihf' -+ ;; -+esac -diff -rNU3 dist.orig/ld/emulparams/armelfb_nbsd_eabi.sh dist/ld/emulparams/armelfb_nbsd_eabi.sh ---- dist.orig/ld/emulparams/armelfb_nbsd_eabi.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/armelfb_nbsd_eabi.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,2 @@ -+. ${srcdir}/emulparams/armelf_nbsd_eabi.sh -+OUTPUT_FORMAT="elf32-bigarm" -diff -rNU3 dist.orig/ld/emulparams/armelfb_nbsd_eabihf.sh dist/ld/emulparams/armelfb_nbsd_eabihf.sh ---- dist.orig/ld/emulparams/armelfb_nbsd_eabihf.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/armelfb_nbsd_eabihf.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,2 @@ -+. ${srcdir}/emulparams/armelf_nbsd_eabihf.sh -+OUTPUT_FORMAT="elf32-bigarm" -diff -rNU3 dist.orig/ld/emulparams/elf32_sparc.sh dist/ld/emulparams/elf32_sparc.sh ---- dist.orig/ld/emulparams/elf32_sparc.sh 2010-09-20 20:41:15.000000000 +0200 -+++ dist/ld/emulparams/elf32_sparc.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -13,6 +13,13 @@ - TEMPLATE_NAME=elf32 - DATA_PLT= - GENERATE_SHLIB_SCRIPT=yes -+#ELFSIZE=32 - GENERATE_PIE_SCRIPT=yes - NOP=0x01000000 - NO_SMALL_DATA=yes -+ -+case "$target" in -+ sparc64-*-netbsd*) -+ LIB_PATH='=/usr/lib/sparc' -+ ;; -+esac -diff -rNU3 dist.orig/ld/emulparams/elf32bmipn32-defs.sh dist/ld/emulparams/elf32bmipn32-defs.sh ---- dist.orig/ld/emulparams/elf32bmipn32-defs.sh 2012-09-04 16:14:28.000000000 +0200 -+++ dist/ld/emulparams/elf32bmipn32-defs.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -6,6 +6,7 @@ - - # Handle both big- and little-ended 32-bit MIPS objects. - ARCH=mips -+MACHINE= - OUTPUT_FORMAT="elf32-bigmips" - BIG_OUTPUT_FORMAT="elf32-bigmips" - LITTLE_OUTPUT_FORMAT="elf32-littlemips" -diff -rNU3 dist.orig/ld/emulparams/elf32lriscv-defs.sh dist/ld/emulparams/elf32lriscv-defs.sh ---- dist.orig/ld/emulparams/elf32lriscv-defs.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf32lriscv-defs.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,39 @@ -+# This is an ELF platform. -+SCRIPT_NAME=elf -+ARCH=riscv -+OUTPUT_FORMAT="elf32-littleriscv" -+NO_REL_RELOCS=yes -+ -+TEMPLATE_NAME=elf32 -+EXTRA_EM_FILE=riscvelf -+ -+case "$EMULATION_NAME" in -+elf32*) ELFSIZE=32; LIBPATH_SUFFIX=32 ;; -+elf64*) ELFSIZE=64; LIBPATH_SUFFIX= ;; -+*) echo $0: unhandled emulation $EMULATION_NAME >&2; exit 1 ;; -+esac -+ -+if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then -+ case " $EMULATION_LIBPATH " in -+ *" ${EMULATION_NAME} "*) -+ NATIVE=yes -+ ;; -+ esac -+fi -+ -+GENERATE_SHLIB_SCRIPT=yes -+GENERATE_PIE_SCRIPT=yes -+ -+TEXT_START_ADDR=0x800000 -+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -+ -+INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" -+SDATA_START_SYMBOLS="_gp = . + 0x800; -+ *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata*)" -+if test -n "${CREATE_SHLIB}"; then -+ INITIAL_READONLY_SECTIONS= -+ SDATA_START_SYMBOLS= -+ OTHER_READONLY_SECTIONS=".srodata ${RELOCATING-0} : { *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata*) }" -+ unset GOT -+fi -diff -rNU3 dist.orig/ld/emulparams/elf32lriscv.sh dist/ld/emulparams/elf32lriscv.sh ---- dist.orig/ld/emulparams/elf32lriscv.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf32lriscv.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,2 @@ -+. ${srcdir}/emulparams/elf32lriscv-defs.sh -+OUTPUT_FORMAT="elf32-littleriscv" -diff -rNU3 dist.orig/ld/emulparams/elf32openrisc.sh dist/ld/emulparams/elf32openrisc.sh ---- dist.orig/ld/emulparams/elf32openrisc.sh 2008-10-22 07:20:44.000000000 +0200 -+++ dist/ld/emulparams/elf32openrisc.sh 1970-01-01 01:00:00.000000000 +0100 -@@ -1,11 +0,0 @@ --MACHINE= --SCRIPT_NAME=elf --OUTPUT_FORMAT="elf32-openrisc" --NO_RELA_RELOCS=yes --TEXT_START_ADDR=0x10000 --ARCH=openrisc --MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" --ENTRY=_start --EMBEDDED=yes --NOP=0x15000000 -- -diff -rNU3 dist.orig/ld/emulparams/elf32or1k.sh dist/ld/emulparams/elf32or1k.sh ---- dist.orig/ld/emulparams/elf32or1k.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf32or1k.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,14 @@ -+SCRIPT_NAME=elf -+MACHINE= -+TEMPLATE_NAME=elf32 -+OUTPUT_FORMAT="elf32-or1k" -+NOP=0x15000000 -+TEXT_START_ADDR=0x0000 -+TARGET_PAGE_SIZE=0x2000 -+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -+EMBEDDED=yes -+ARCH=or1k -+ELFSIZE=32 -+INITIAL_READONLY_SECTIONS=".vectors ${RELOCATING-0} : { KEEP (*(.vectors)) }" -+NO_REL_RELOCS=yes -+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -diff -rNU3 dist.orig/ld/emulparams/elf32or1k_linux.sh dist/ld/emulparams/elf32or1k_linux.sh ---- dist.orig/ld/emulparams/elf32or1k_linux.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf32or1k_linux.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,6 @@ -+. ${srcdir}/emulparams/elf32or1k.sh -+unset EMBEDDED -+GENERATE_SHLIB_SCRIPT=yes -+GENERATE_PIE_SCRIPT=yes -+GENERATE_COMBRELOC_SCRIPT=yes -+TEXT_START_ADDR=0x00002000 -diff -rNU3 dist.orig/ld/emulparams/elf32or1k_nbsd.sh dist/ld/emulparams/elf32or1k_nbsd.sh ---- dist.orig/ld/emulparams/elf32or1k_nbsd.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf32or1k_nbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,6 @@ -+. ${srcdir}/emulparams/elf32or1k.sh -+unset EMBEDDED -+GENERATE_SHLIB_SCRIPT=yes -+GENERATE_PIE_SCRIPT=yes -+GENERATE_COMBRELOC_SCRIPT=yes -+TEXT_START_ADDR=0x00002000 -diff -rNU3 dist.orig/ld/emulparams/elf32ppc_nbsd.sh dist/ld/emulparams/elf32ppc_nbsd.sh ---- dist.orig/ld/emulparams/elf32ppc_nbsd.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf32ppc_nbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,7 @@ -+. ${srcdir}/emulparams/elf32ppc.sh -+ -+case "$target" in -+ powerpc64*-*-netbsd*) -+ LIB_PATH='=/usr/lib/powerpc' -+ ;; -+esac -diff -rNU3 dist.orig/ld/emulparams/elf64alpha_nbsd.sh dist/ld/emulparams/elf64alpha_nbsd.sh ---- dist.orig/ld/emulparams/elf64alpha_nbsd.sh 2001-12-18 00:54:58.000000000 +0100 -+++ dist/ld/emulparams/elf64alpha_nbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -1,2 +1,8 @@ - . ${srcdir}/emulparams/elf64alpha.sh - ENTRY=__start -+ -+NOP=0x47ff041f -+# XXX binutils 2.13 -+# Note that the number is always big-endian, thus we have to -+# reverse the digit string. -+#NOP=0x0000fe2f1f04ff47 # unop; nop -diff -rNU3 dist.orig/ld/emulparams/elf64lriscv-defs.sh dist/ld/emulparams/elf64lriscv-defs.sh ---- dist.orig/ld/emulparams/elf64lriscv-defs.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf64lriscv-defs.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1 @@ -+. ${srcdir}/emulparams/elf32lriscv-defs.sh -diff -rNU3 dist.orig/ld/emulparams/elf64lriscv.sh dist/ld/emulparams/elf64lriscv.sh ---- dist.orig/ld/emulparams/elf64lriscv.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf64lriscv.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -0,0 +1,2 @@ -+. ${srcdir}/emulparams/elf64lriscv-defs.sh -+OUTPUT_FORMAT="elf64-littleriscv" -diff -rNU3 dist.orig/ld/emulparams/elf_i386.sh dist/ld/emulparams/elf_i386.sh ---- dist.orig/ld/emulparams/elf_i386.sh 2012-06-11 15:23:50.000000000 +0200 -+++ dist/ld/emulparams/elf_i386.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -9,7 +9,14 @@ - MACHINE= - TEMPLATE_NAME=elf32 - GENERATE_SHLIB_SCRIPT=yes -+#ELFSIZE=32 - GENERATE_PIE_SCRIPT=yes - NO_SMALL_DATA=yes - SEPARATE_GOTPLT="SIZEOF (.got.plt) >= 12 ? 12 : 0" - IREL_IN_PLT= -+ -+case "$target" in -+ x86_64-*-netbsd*) -+ LIB_PATH='=/usr/lib/i386' -+ ;; -+esac -diff -rNU3 dist.orig/ld/emulparams/hppalinux.sh dist/ld/emulparams/hppalinux.sh ---- dist.orig/ld/emulparams/hppalinux.sh 2011-02-18 19:20:29.000000000 +0100 -+++ dist/ld/emulparams/hppalinux.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -1,5 +1,5 @@ - # If you change this file, please also look at files which source this one: --# hppanbsd.sh -+# hppanbsd.sh hppaobsd.sh - - SCRIPT_NAME=elf - ELFSIZE=32 -diff -rNU3 dist.orig/ld/emulparams/hppaobsd.sh dist/ld/emulparams/hppaobsd.sh ---- dist.orig/ld/emulparams/hppaobsd.sh 2006-05-30 18:45:32.000000000 +0200 -+++ dist/ld/emulparams/hppaobsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -1,4 +1,4 @@ --. ${srcdir}/emulparams/hppanbsd.sh -+. ${srcdir}/emulparams/hppalinux.sh - - OUTPUT_FORMAT="elf32-hppa" - TEXT_START_ADDR=0x1000 -diff -rNU3 dist.orig/ld/emulparams/m68kelf.sh dist/ld/emulparams/m68kelf.sh ---- dist.orig/ld/emulparams/m68kelf.sh 2009-09-29 18:28:52.000000000 +0200 -+++ dist/ld/emulparams/m68kelf.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -10,5 +10,6 @@ - TEMPLATE_NAME=elf32 - EXTRA_EM_FILE=m68kelf - GENERATE_SHLIB_SCRIPT=yes -+ELFSIZE=32 - GENERATE_PIE_SCRIPT=yes - NO_SMALL_DATA=yes -diff -rNU3 dist.orig/ld/emulparams/m68kelfnbsd.sh dist/ld/emulparams/m68kelfnbsd.sh ---- dist.orig/ld/emulparams/m68kelfnbsd.sh 2001-12-18 14:26:26.000000000 +0100 -+++ dist/ld/emulparams/m68kelfnbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -1,4 +1,4 @@ - . ${srcdir}/emulparams/m68kelf.sh - TEXT_START_ADDR=0x2000 - TARGET_PAGE_SIZE=0x2000 --MACHINE= -+NONPAGED_TEXT_START_ADDR=${TEXT_START_ADDR} -diff -rNU3 dist.orig/ld/emulparams/or32.sh dist/ld/emulparams/or32.sh ---- dist.orig/ld/emulparams/or32.sh 2006-06-20 04:22:14.000000000 +0200 -+++ dist/ld/emulparams/or32.sh 1970-01-01 01:00:00.000000000 +0100 -@@ -1,5 +0,0 @@ --SCRIPT_NAME=or32 --OUTPUT_FORMAT="coff-or32-big" --TEXT_START_ADDR=0x1000000 --TARGET_PAGE_SIZE=0x1000000 --ARCH=or32 -diff -rNU3 dist.orig/ld/emulparams/or32elf.sh dist/ld/emulparams/or32elf.sh ---- dist.orig/ld/emulparams/or32elf.sh 2008-10-22 07:20:44.000000000 +0200 -+++ dist/ld/emulparams/or32elf.sh 1970-01-01 01:00:00.000000000 +0100 -@@ -1,9 +0,0 @@ --SCRIPT_NAME=elf --TEMPLATE_NAME=generic --EXTRA_EM_FILE=genelf --OUTPUT_FORMAT="elf32-or32" --NO_RELA_RELOCS=yes --TEXT_START_ADDR=0x1000000 --TARGET_PAGE_SIZE=0x1000000 --MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" --ARCH=or32 -diff -rNU3 dist.orig/ld/emulparams/sh.sh dist/ld/emulparams/sh.sh ---- dist.orig/ld/emulparams/sh.sh 2001-11-22 10:08:04.000000000 +0100 -+++ dist/ld/emulparams/sh.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -3,6 +3,6 @@ - - SCRIPT_NAME=sh - OUTPUT_FORMAT="coff-sh" --TEXT_START_ADDR=0x8000 --TARGET_PAGE_SIZE=128 -+TEXT_START_ADDR=0x1000 -+TARGET_PAGE_SIZE=0x1000 - ARCH=sh -diff -rNU3 dist.orig/ld/emulparams/shelf_nbsd.sh dist/ld/emulparams/shelf_nbsd.sh ---- dist.orig/ld/emulparams/shelf_nbsd.sh 2008-01-16 00:05:46.000000000 +0100 -+++ dist/ld/emulparams/shelf_nbsd.sh 2015-10-18 13:11:17.000000000 +0200 -@@ -9,7 +9,11 @@ - - DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; - --ENTRY=_start -+ENTRY=__start - - unset EMBEDDED - unset OTHER_SECTIONS -+ -+OTHER_READWRITE_SECTIONS=' -+ .note.ABI-tag : { *(.note.ABI-tag) } -+' -diff -rNU3 dist.orig/ld/emultempl/aarch64elf.em dist/ld/emultempl/aarch64elf.em ---- dist.orig/ld/emultempl/aarch64elf.em 2013-03-25 09:06:23.000000000 +0100 -+++ dist/ld/emultempl/aarch64elf.em 2015-10-18 13:11:17.000000000 +0200 -@@ -38,6 +38,7 @@ - ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); - #endif /* not TARGET_ */ - input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; -+ input_flags.add_DT_NEEDED_for_dynamic = TRUE; - config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; - config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; - } -diff -rNU3 dist.orig/ld/emultempl/armelf.em dist/ld/emultempl/armelf.em ---- dist.orig/ld/emultempl/armelf.em 2013-03-25 09:06:23.000000000 +0100 -+++ dist/ld/emultempl/armelf.em 2015-10-18 13:11:17.000000000 +0200 -@@ -51,6 +51,7 @@ - ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown); - #endif /* not TARGET_ */ - input_flags.dynamic = ${DYNAMIC_LINK-TRUE}; -+ input_flags.add_DT_NEEDED_for_dynamic = TRUE; - config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`; - config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`; - } -diff -rNU3 dist.orig/ld/emultempl/elf32.em dist/ld/emultempl/elf32.em ---- dist.orig/ld/emultempl/elf32.em 2013-03-25 09:06:23.000000000 +0100 -+++ dist/ld/emultempl/elf32.em 2015-10-18 13:11:17.000000000 +0200 -@@ -72,6 +72,9 @@ - - if [ "x${USE_LIBPATH}" = xyes ] ; then - case ${target} in -+ *-*-netbsd*) -+ ;; -+ - *-*-linux-* | *-*-k*bsd*-* | *-*-gnu*) - fragment <name; - size_t len; - struct dt_needed needed; - -- if (name[0] == '/') -+ if (name[0] == '/') { -+ if (prepend_sysroot && ld_sysroot) { -+ bfd_boolean rv; -+ needed.by = n->by; -+ char *filename= concat(ld_sysroot, n->name, (const char *)NULL); -+ needed.name = filename; -+ rv = gld${EMULATION_NAME}_try_needed (&needed, force); -+ free(filename); -+ return rv; -+ } - return gld${EMULATION_NAME}_try_needed (n, force); -+ } - - if (path == NULL || *path == '\0') - return FALSE; -@@ -501,6 +518,13 @@ - } - strcpy (sset, name); - -+ if (prepend_sysroot && filename[0] == '=') -+ abort(); -+ if (filename[0] == '/' && prepend_sysroot && ld_sysroot) { -+ char *filename2 = concat(ld_sysroot, filename, (const char *)NULL); -+ free(filename); -+ filename = filename2; -+ } - needed.name = filename; - if (gld${EMULATION_NAME}_try_needed (&needed, force)) - return TRUE; -@@ -621,6 +645,9 @@ - # FreeBSD - ;; - -+ *-*-netbsd*) -+ ;; -+ - *-*-linux-* | *-*-k*bsd*-* | *-*-gnu*) - fragment <next) - { -- char *tmpname = gld${EMULATION_NAME}_add_sysroot (rp->name); - found = (rp->by == l->by -- && gld${EMULATION_NAME}_search_needed (tmpname, -+ && gld${EMULATION_NAME}_search_needed (rp->name, - &n, -- force)); -- free (tmpname); -+ force, 1)); - } - if (found) - break; -@@ -1315,6 +1340,9 @@ - # FreeBSD - ;; - -+ *-*-netbsd*) -+ ;; -+ - *-*-linux-* | *-*-k*bsd*-* | *-*-gnu*) - # Linux - fragment <ignore_hash != NULL -+ && bfd_hash_lookup (info->ignore_hash, name, FALSE, FALSE) != NULL) -+ return TRUE; -+ - if (config.warn_once) - { -- static struct bfd_hash_table *hash; -- - /* Only warn once about a particular undefined symbol. */ -- if (hash == NULL) -+ if (info->ignore_hash == NULL) - { -- hash = (struct bfd_hash_table *) -- xmalloc (sizeof (struct bfd_hash_table)); -- if (!bfd_hash_table_init (hash, bfd_hash_newfunc, -+ info->ignore_hash = xmalloc (sizeof (struct bfd_hash_table)); -+ if (!bfd_hash_table_init (info->ignore_hash, bfd_hash_newfunc, - sizeof (struct bfd_hash_entry))) - einfo (_("%F%P: bfd_hash_table_init failed: %E\n")); - } - -- if (bfd_hash_lookup (hash, name, FALSE, FALSE) != NULL) -+ if (bfd_hash_lookup (info->ignore_hash, name, FALSE, FALSE) != NULL) - return TRUE; - -- if (bfd_hash_lookup (hash, name, TRUE, TRUE) == NULL) -+ if (bfd_hash_lookup (info->ignore_hash, name, TRUE, TRUE) == NULL) - einfo (_("%F%P: bfd_hash_lookup failed: %E\n")); - } - -diff -rNU3 dist.orig/ld/ldmain.h dist/ld/ldmain.h ---- dist.orig/ld/ldmain.h 2012-07-13 15:20:26.000000000 +0200 -+++ dist/ld/ldmain.h 2015-10-18 13:11:17.000000000 +0200 -@@ -41,6 +41,7 @@ - - extern void add_ysym (const char *); - extern void add_wrap (const char *); -+extern void add_ignoresym (const char *); - extern void add_keepsyms_file (const char *); - - #endif -diff -rNU3 dist.orig/ld/lexsup.c dist/ld/lexsup.c ---- dist.orig/ld/lexsup.c 2013-03-25 09:06:23.000000000 +0100 -+++ dist/ld/lexsup.c 2015-10-18 13:11:17.000000000 +0200 -@@ -398,7 +398,7 @@ - ONE_DASH }, - { {"shared", no_argument, NULL, OPTION_SHARED}, - '\0', NULL, N_("Create a shared library"), ONE_DASH }, -- { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD. */ -+ { {"Bshareable", no_argument, NULL, OPTION_SHARED }, /* FreeBSD, NetBSD. */ - '\0', NULL, NULL, ONE_DASH }, - { {"pie", no_argument, NULL, OPTION_PIE}, - '\0', NULL, N_("Create a position independent executable"), ONE_DASH }, -@@ -496,8 +496,14 @@ - { {"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE}, - '\0', NULL, N_("Include all objects from following archives"), - TWO_DASHES }, -+ { {"Bforcearchive", no_argument, NULL, OPTION_WHOLE_ARCHIVE}, -+ '\0', NULL, NULL, TWO_DASHES }, /* NetBSD. */ - { {"wrap", required_argument, NULL, OPTION_WRAP}, - '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES }, -+ { {"ignore-unresolved-symbol", required_argument, NULL, -+ OPTION_IGNORE_UNRESOLVED_SYMBOL}, -+ '\0', N_("SYMBOL"), -+ N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES }, - }; - - #define OPTION_COUNT ARRAY_SIZE (ld_options) -@@ -1344,6 +1350,9 @@ - case OPTION_WRAP: - add_wrap (optarg); - break; -+ case OPTION_IGNORE_UNRESOLVED_SYMBOL: -+ add_ignoresym (optarg); -+ break; - case OPTION_DISCARD_NONE: - link_info.discard = discard_none; - break; -diff -rNU3 dist.orig/ld/scripttempl/elf.sc dist/ld/scripttempl/elf.sc ---- dist.orig/ld/scripttempl/elf.sc 2013-03-25 09:06:23.000000000 +0100 -+++ dist/ld/scripttempl/elf.sc 2015-10-18 13:11:17.000000000 +0200 -@@ -94,6 +94,8 @@ - # - # Each of these can also have corresponding .rel.* and .rela.* sections. - -+test -z "$TEXT_START_SYMBOLS" && TEXT_START_SYMBOLS="PROVIDE_HIDDEN (__eprol = .);" -+test -z "$ENTRY" && ENTRY=_start - if test -n "$NOP"; then - FILL="=$NOP" - else -@@ -471,11 +473,12 @@ - .text ${RELOCATING-0} : - { - ${RELOCATING+${TEXT_START_SYMBOLS}} -+ *(.text) - ${RELOCATING+*(.text.unlikely .text.*_unlikely)} - ${RELOCATING+*(.text.exit .text.exit.*)} - ${RELOCATING+*(.text.startup .text.startup.*)} - ${RELOCATING+*(.text.hot .text.hot.*)} -- *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) -+ *(.stub${RELOCATING+ .text.* .gnu.linkonce.t.*}) - /* .gnu.warning sections are handled specially by elf32.em. */ - *(.gnu.warning) - ${RELOCATING+${OTHER_TEXT_SECTIONS}} -diff -rNU3 dist.orig/ld/scripttempl/sh.sc dist/ld/scripttempl/sh.sc ---- dist.orig/ld/scripttempl/sh.sc 2002-09-25 19:06:09.000000000 +0200 -+++ dist/ld/scripttempl/sh.sc 2015-10-18 13:11:17.000000000 +0200 -@@ -6,16 +6,13 @@ - ___dtors = . ; - *(.dtors) - ___dtors_end = . ; -- } > ram" -+ }" -+ - - cat < ram} -+ } - ${CONSTRUCTING+${TORS}} -- .data : -+ .data ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} : - { - *(.data) - ${RELOCATING+*(.gcc_exc*)} -@@ -35,19 +32,19 @@ - ${RELOCATING+___EH_FRAME_END__ = . ;} - ${RELOCATING+LONG(0);} - ${RELOCATING+ _edata = . ; } -- } ${RELOCATING+ > ram} -- .bss : -+ } -+ .bss ${RELOCATING+ ALIGN(${TARGET_PAGE_SIZE})} : - { - ${RELOCATING+ _bss_start = . ; } - *(.bss) - *(COMMON) - ${RELOCATING+ _end = . ; } -- } ${RELOCATING+ > ram} -- .stack ${RELOCATING+ 0x30000 } : -+ } -+ .stack : - { - ${RELOCATING+ _stack = . ; } - *(.stack) -- } ${RELOCATING+ > ram} -+ } - .stab 0 ${RELOCATING+(NOLOAD)} : - { - *(.stab) -diff -rNU3 dist.orig/libiberty/floatformat.c dist/libiberty/floatformat.c ---- dist.orig/libiberty/floatformat.c 2011-01-03 22:05:58.000000000 +0100 -+++ dist/libiberty/floatformat.c 2015-10-18 13:11:19.000000000 +0200 -@@ -489,7 +489,11 @@ - if (nan) - dto = NAN; - else -+#ifdef __vax__ -+ dto = HUGE_VAL; -+#else - dto = INFINITY; -+#endif - - if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1)) - dto = -dto; -diff -rNU3 dist.orig/libiberty/make-temp-file.c dist/libiberty/make-temp-file.c ---- dist.orig/libiberty/make-temp-file.c 2011-01-03 22:05:58.000000000 +0100 -+++ dist/libiberty/make-temp-file.c 2015-10-18 13:11:19.000000000 +0200 -@@ -130,10 +130,10 @@ - base = try_dir (P_tmpdir, base); - #endif - -- /* Try /var/tmp, /usr/tmp, then /tmp. */ -+ /* Try /tmp, /var/tmp, then /usr/tmp. */ -+ base = try_dir (tmp, base); - base = try_dir (vartmp, base); - base = try_dir (usrtmp, base); -- base = try_dir (tmp, base); - - /* If all else fails, use the current directory! */ - if (base == 0) -diff -rNU3 dist.orig/libiberty/objalloc.c dist/libiberty/objalloc.c ---- dist.orig/libiberty/objalloc.c 2005-07-22 05:26:05.000000000 +0200 -+++ dist/libiberty/objalloc.c 2015-10-18 13:11:19.000000000 +0200 -@@ -1,5 +1,5 @@ - /* objalloc.c -- routines to allocate memory for objects -- Copyright 1997 Free Software Foundation, Inc. -+ Copyright 1997-2012 Free Software Foundation, Inc. - Written by Ian Lance Taylor, Cygnus Solutions. - - This program is free software; you can redistribute it and/or modify it -@@ -112,8 +112,10 @@ - /* Allocate space from an objalloc structure. */ - - PTR --_objalloc_alloc (struct objalloc *o, unsigned long len) -+_objalloc_alloc (struct objalloc *o, unsigned long original_len) - { -+ unsigned long len = original_len; -+ - /* We avoid confusion from zero sized objects by always allocating - at least 1 byte. */ - if (len == 0) -@@ -121,6 +123,11 @@ - - len = (len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); - -+ /* Check for overflow in the alignment operation above and the -+ malloc argument below. */ -+ if (len + CHUNK_HEADER_SIZE < original_len) -+ return NULL; -+ - if (len <= o->current_space) - { - o->current_ptr += len; -diff -rNU3 dist.orig/libiberty/strerror.c dist/libiberty/strerror.c ---- dist.orig/libiberty/strerror.c 2005-03-28 04:09:01.000000000 +0200 -+++ dist/libiberty/strerror.c 2015-10-18 13:11:19.000000000 +0200 -@@ -347,7 +347,7 @@ - ENTRY(EPROTOTYPE, "EPROTOTYPE", "Protocol wrong type for socket"), - #endif - #if defined (ENOPROTOOPT) -- ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol not available"), -+ ENTRY(ENOPROTOOPT, "ENOPROTOOPT", "Protocol option not available"), - #endif - #if defined (EPROTONOSUPPORT) - ENTRY(EPROTONOSUPPORT, "EPROTONOSUPPORT", "Protocol not supported"), -diff -rNU3 dist.orig/opcodes/Makefile.am dist/opcodes/Makefile.am ---- dist.orig/opcodes/Makefile.am 2012-09-04 16:21:06.000000000 +0200 -+++ dist/opcodes/Makefile.am 2015-10-18 13:11:20.000000000 +0200 -@@ -62,7 +62,7 @@ - mep-desc.h mep-opc.h \ - microblaze-opc.h \ - mt-desc.h mt-opc.h \ -- openrisc-desc.h openrisc-opc.h \ -+ or1k-desc.h or1k-opc.h \ - score-opc.h \ - sh-opc.h \ - sh64-opc.h \ -@@ -188,13 +188,11 @@ - mt-ibld.c \ - mt-opc.c \ - ns32k-dis.c \ -- openrisc-asm.c \ -- openrisc-desc.c \ -- openrisc-dis.c \ -- openrisc-ibld.c \ -- openrisc-opc.c \ -- or32-dis.c \ -- or32-opc.c \ -+ or1k-asm.c \ -+ or1k-desc.c \ -+ or1k-dis.c \ -+ or1k-ibld.c \ -+ or1k-opc.c \ - pdp11-dis.c \ - pdp11-opc.c \ - pj-dis.c \ -@@ -332,7 +330,7 @@ - CLEANFILES = \ - stamp-epiphany stamp-fr30 stamp-frv stamp-ip2k stamp-iq2000 stamp-lm32 \ - stamp-m32c stamp-m32r stamp-mep stamp-mt \ -- stamp-openrisc stamp-xc16x stamp-xstormy16 \ -+ stamp-or1k stamp-xc16x stamp-xstormy16 \ - libopcodes.a stamp-lib - - -@@ -348,7 +346,7 @@ - $(CGENDIR)/opc-opinst.scm \ - cgen-asm.in cgen-dis.in cgen-ibld.in - --CGEN_CPUS = epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt openrisc xc16x xstormy16 -+CGEN_CPUS = epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt or1k xc16x xstormy16 - - if CGEN_MAINT - EPIPHANY_DEPS = stamp-epiphany -@@ -361,7 +359,7 @@ - M32R_DEPS = stamp-m32r - MEP_DEPS = stamp-mep - MT_DEPS = stamp-mt --OPENRISC_DEPS = stamp-openrisc -+OR1K_DEPS = stamp-or1k - XC16X_DEPS = stamp-xc16x - XSTORMY16_DEPS = stamp-xstormy16 - else -@@ -375,7 +373,7 @@ - M32R_DEPS = - MEP_DEPS = - MT_DEPS = --OPENRISC_DEPS = -+OR1K_DEPS = - XC16X_DEPS = - XSTORMY16_DEPS = - endif -@@ -469,11 +467,11 @@ - archfile=$(CPUDIR)/mt.cpu \ - opcfile=$(CPUDIR)/mt.opc extrafiles= - --$(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS) -+$(srcdir)/or1k-desc.h $(srcdir)/or1k-desc.c $(srcdir)/or1k-opc.h $(srcdir)/or1k-opc.c $(srcdir)/or1k-ibld.c $(srcdir)/or1k-opinst.c $(srcdir)/or1k-asm.c $(srcdir)/or1k-dis.c: $(OR1K_DEPS) - @true --stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc -- $(MAKE) run-cgen arch=openrisc prefix=openrisc options= \ -- archfile=$(CPUDIR)/openrisc.cpu opcfile=$(CPUDIR)/openrisc.opc extrafiles= -+stamp-or1k: $(CGENDEPS) $(CPUDIR)/or1k.cpu $(CPUDIR)/or1k.opc $(CPUDIR)/or1kcommon.cpu $(CPUDIR)/or1korbis.cpu $(CPUDIR)/or1korfpx.cpu -+ $(MAKE) run-cgen arch=or1k prefix=or1k options=opinst \ -+ archfile=$(CPUDIR)/or1k.cpu opcfile=$(CPUDIR)/or1k.opc extrafiles=opinst - - $(srcdir)/xc16x-desc.h $(srcdir)/xc16x-desc.c $(srcdir)/xc16x-opc.h $(srcdir)/xc16x-opc.c $(srcdir)/xc16x-ibld.c $(srcdir)/xc16x-asm.c $(srcdir)/xc16x-dis.c: $(XC16X_DEPS) - @true -diff -rNU3 dist.orig/opcodes/Makefile.in dist/opcodes/Makefile.in ---- dist.orig/opcodes/Makefile.in 2012-09-04 16:21:06.000000000 +0200 -+++ dist/opcodes/Makefile.in 2015-10-18 13:11:20.000000000 +0200 -@@ -459,13 +459,11 @@ - mt-ibld.c \ - mt-opc.c \ - ns32k-dis.c \ -- openrisc-asm.c \ -- openrisc-desc.c \ -- openrisc-dis.c \ -- openrisc-ibld.c \ -- openrisc-opc.c \ -- or32-dis.c \ -- or32-opc.c \ -+ or1k-asm.c \ -+ or1k-desc.c \ -+ or1k-dis.c \ -+ or1k-ibld.c \ -+ or1k-opc.c \ - pdp11-dis.c \ - pdp11-opc.c \ - pj-dis.c \ -@@ -572,7 +570,7 @@ - CLEANFILES = \ - stamp-epiphany stamp-fr30 stamp-frv stamp-ip2k stamp-iq2000 stamp-lm32 \ - stamp-m32c stamp-m32r stamp-mep stamp-mt \ -- stamp-openrisc stamp-xc16x stamp-xstormy16 \ -+ stamp-or1k stamp-xc16x stamp-xstormy16 \ - libopcodes.a stamp-lib - - CGENDIR = @cgendir@ -@@ -586,7 +584,7 @@ - $(CGENDIR)/opc-opinst.scm \ - cgen-asm.in cgen-dis.in cgen-ibld.in - --CGEN_CPUS = epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt openrisc xc16x xstormy16 -+CGEN_CPUS = epiphany fr30 frv ip2k iq2000 lm32 m32c m32r mep mt or1k xc16x xstormy16 - @CGEN_MAINT_FALSE@EPIPHANY_DEPS = - @CGEN_MAINT_TRUE@EPIPHANY_DEPS = stamp-epiphany - @CGEN_MAINT_FALSE@FR30_DEPS = -@@ -607,8 +605,8 @@ - @CGEN_MAINT_TRUE@MEP_DEPS = stamp-mep - @CGEN_MAINT_FALSE@MT_DEPS = - @CGEN_MAINT_TRUE@MT_DEPS = stamp-mt --@CGEN_MAINT_FALSE@OPENRISC_DEPS = --@CGEN_MAINT_TRUE@OPENRISC_DEPS = stamp-openrisc -+@CGEN_MAINT_FALSE@OR1K_DEPS = -+@CGEN_MAINT_TRUE@OR1K_DEPS = stamp-or1k - @CGEN_MAINT_FALSE@XC16X_DEPS = - @CGEN_MAINT_TRUE@XC16X_DEPS = stamp-xc16x - @CGEN_MAINT_FALSE@XSTORMY16_DEPS = -@@ -855,13 +853,12 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt-ibld.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mt-opc.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ns32k-dis.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openrisc-asm.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openrisc-desc.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openrisc-dis.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openrisc-ibld.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openrisc-opc.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or32-dis.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or32-opc.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-asm.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-desc.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-dis.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-ibld.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-opc.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/or1k-opinst.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdp11-dis.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pdp11-opc.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pj-dis.Plo@am__quote@ -@@ -1340,11 +1337,11 @@ - archfile=$(CPUDIR)/mt.cpu \ - opcfile=$(CPUDIR)/mt.opc extrafiles= - --$(srcdir)/openrisc-desc.h $(srcdir)/openrisc-desc.c $(srcdir)/openrisc-opc.h $(srcdir)/openrisc-opc.c $(srcdir)/openrisc-ibld.c $(srcdir)/openrisc-asm.c $(srcdir)/openrisc-dis.c: $(OPENRISC_DEPS) -+$(srcdir)/or1k-desc.h $(srcdir)/or1k-desc.c $(srcdir)/or1k-opc.h $(srcdir)/or1k-opc.c $(srcdir)/or1k-ibld.c $(srcdir)/or1k-opinst.c $(srcdir)/or1k-asm.c $(srcdir)/or1k-dis.c: $(OR1K_DEPS) - @true --stamp-openrisc: $(CGENDEPS) $(CPUDIR)/openrisc.cpu $(CPUDIR)/openrisc.opc -- $(MAKE) run-cgen arch=openrisc prefix=openrisc options= \ -- archfile=$(CPUDIR)/openrisc.cpu opcfile=$(CPUDIR)/openrisc.opc extrafiles= -+stamp-or1k: $(CGENDEPS) $(CPUDIR)/or1k.cpu $(CPUDIR)/or1k.opc $(CPUDIR)/or1kcommon.cpu $(CPUDIR)/or1korbis.cpu $(CPUDIR)/or1korfpx.cpu -+ $(MAKE) run-cgen arch=or1k prefix=or1k options=opinst \ -+ archfile=$(CPUDIR)/or1k.cpu opcfile=$(CPUDIR)/or1k.opc extrafiles=opinst - - $(srcdir)/xc16x-desc.h $(srcdir)/xc16x-desc.c $(srcdir)/xc16x-opc.h $(srcdir)/xc16x-opc.c $(srcdir)/xc16x-ibld.c $(srcdir)/xc16x-asm.c $(srcdir)/xc16x-dis.c: $(XC16X_DEPS) - @true -diff -rNU3 dist.orig/opcodes/cgen.sh dist/opcodes/cgen.sh ---- dist.orig/opcodes/cgen.sh 2009-06-14 18:36:56.000000000 +0200 -+++ dist/opcodes/cgen.sh 2015-10-18 13:11:19.000000000 +0200 -@@ -61,6 +61,7 @@ - shift ; extrafiles=$9 - - rootdir=${srcdir}/.. -+move_if_change="${CONFIG_SHELL:-/bin/sh} ${rootdir}/move-if-change" - - # $arch is $6, as passed on the command line. - # $ARCH is the same argument but in all uppercase. -diff -rNU3 dist.orig/opcodes/configure dist/opcodes/configure ---- dist.orig/opcodes/configure 2012-09-04 16:21:07.000000000 +0200 -+++ dist/opcodes/configure 2015-10-18 13:11:19.000000000 +0200 -@@ -12532,13 +12532,13 @@ - bfd_mt_arch) ta="$ta mt-asm.lo mt-desc.lo mt-dis.lo mt-ibld.lo mt-opc.lo" using_cgen=yes ;; - bfd_msp430_arch) ta="$ta msp430-dis.lo" ;; - bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; -- bfd_openrisc_arch) ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;; -- bfd_or32_arch) ta="$ta or32-dis.lo or32-opc.lo" using_cgen=yes ;; -+ bfd_or1k_arch) ta="$ta or1k-asm.lo or1k-desc.lo or1k-dis.lo or1k-ibld.lo or1k-opc.lo" using_cgen=yes ;; - bfd_pdp11_arch) ta="$ta pdp11-dis.lo pdp11-opc.lo" ;; - bfd_pj_arch) ta="$ta pj-dis.lo pj-opc.lo" ;; - bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; - bfd_powerpc_64_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; - bfd_pyramid_arch) ;; -+ bfd_riscv_arch) ta="$ta riscv-dis.lo riscv-opc.lo" ;; - bfd_romp_arch) ;; - bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; - bfd_rl78_arch) ta="$ta rl78-dis.lo rl78-decode.lo";; -@@ -12551,6 +12551,14 @@ - # specified, as in sh3-elf, sh3b-linux-gnu, etc. - # Include it just for ELF targets, since the SH5 bfd:s are ELF only. - for t in $target $canon_targets; do -+ # For NetBSD we do NOT want SH5 support unless sh5 or sh64 -+ # is specified -+ case $t in -+ sh5*-* | sh64*-*) # let the case below handle it -+ ;; -+ sh*-*-netbsd* | sh*l*-*-netbsd*) -+ continue ;; -+ esac - case $t in - all | sh5*-* | sh64*-* | sh-*-*elf* | shl*-*-*elf* | \ - sh-*-linux* | shl-*-linux*) -diff -rNU3 dist.orig/opcodes/configure.in dist/opcodes/configure.in ---- dist.orig/opcodes/configure.in 2012-11-05 17:29:08.000000000 +0100 -+++ dist/opcodes/configure.in 2015-10-18 13:11:19.000000000 +0200 -@@ -277,13 +277,13 @@ - bfd_mt_arch) ta="$ta mt-asm.lo mt-desc.lo mt-dis.lo mt-ibld.lo mt-opc.lo" using_cgen=yes ;; - bfd_msp430_arch) ta="$ta msp430-dis.lo" ;; - bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; -- bfd_openrisc_arch) ta="$ta openrisc-asm.lo openrisc-desc.lo openrisc-dis.lo openrisc-ibld.lo openrisc-opc.lo" using_cgen=yes ;; -- bfd_or32_arch) ta="$ta or32-dis.lo or32-opc.lo" using_cgen=yes ;; -+ bfd_or1k_arch) ta="$ta or1k-asm.lo or1k-desc.lo or1k-dis.lo or1k-ibld.lo or1k-opc.lo" using_cgen=yes ;; - bfd_pdp11_arch) ta="$ta pdp11-dis.lo pdp11-opc.lo" ;; - bfd_pj_arch) ta="$ta pj-dis.lo pj-opc.lo" ;; - bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; - bfd_powerpc_64_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; - bfd_pyramid_arch) ;; -+ bfd_riscv_arch) ta="$ta riscv-dis.lo riscv-opc.lo" ;; - bfd_romp_arch) ;; - bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; - bfd_rl78_arch) ta="$ta rl78-dis.lo rl78-decode.lo";; -@@ -296,6 +296,14 @@ - # specified, as in sh3-elf, sh3b-linux-gnu, etc. - # Include it just for ELF targets, since the SH5 bfd:s are ELF only. - for t in $target $canon_targets; do -+ # For NetBSD we do NOT want SH5 support unless sh5 or sh64 -+ # is specified -+ case $t in -+ sh5*-* | sh64*-*) # let the case below handle it -+ ;; -+ sh*-*-netbsd* | sh*l*-*-netbsd*) -+ continue ;; -+ esac - case $t in - all | sh5*-* | sh64*-* | sh-*-*elf* | shl*-*-*elf* | \ - sh-*-linux* | shl-*-linux*) -diff -rNU3 dist.orig/opcodes/disassemble.c dist/opcodes/disassemble.c ---- dist.orig/opcodes/disassemble.c 2012-09-04 14:53:50.000000000 +0200 -+++ dist/opcodes/disassemble.c 2015-10-18 13:11:19.000000000 +0200 -@@ -67,11 +67,11 @@ - #define ARCH_mt - #define ARCH_msp430 - #define ARCH_ns32k --#define ARCH_openrisc --#define ARCH_or32 -+#define ARCH_or1k - #define ARCH_pdp11 - #define ARCH_pj - #define ARCH_powerpc -+#define ARCH_riscv - #define ARCH_rs6000 - #define ARCH_rl78 - #define ARCH_rx -@@ -332,17 +332,9 @@ - disassemble = print_insn_mn10300; - break; - #endif --#ifdef ARCH_openrisc -- case bfd_arch_openrisc: -- disassemble = print_insn_openrisc; -- break; --#endif --#ifdef ARCH_or32 -- case bfd_arch_or32: -- if (bfd_big_endian (abfd)) -- disassemble = print_insn_big_or32; -- else -- disassemble = print_insn_little_or32; -+#ifdef ARCH_or1k -+ case bfd_arch_or1k: -+ disassemble = print_insn_or1k; - break; - #endif - #ifdef ARCH_pdp11 -@@ -363,6 +355,11 @@ - disassemble = print_insn_little_powerpc; - break; - #endif -+#ifdef ARCH_riscv -+ case bfd_arch_riscv: -+ disassemble = print_insn_riscv; -+ break; -+#endif - #ifdef ARCH_rs6000 - case bfd_arch_rs6000: - if (bfd_get_mach (abfd) == bfd_mach_ppc_620) -diff -rNU3 dist.orig/opcodes/mips-opc.c dist/opcodes/mips-opc.c ---- dist.orig/opcodes/mips-opc.c 2012-09-04 16:21:10.000000000 +0200 -+++ dist/opcodes/mips-opc.c 2015-10-18 13:11:20.000000000 +0200 -@@ -791,10 +791,12 @@ - {"hibernate","", 0x42000023, 0xffffffff, 0, 0, V1 }, - {"ins", "t,r,+A,+B", 0x7c000004, 0xfc00003f, WR_t|RD_s, 0, I33 }, - {"iret", "", 0x42000038, 0xffffffff, NODS, 0, MC }, -+{"jr", "s", 0, (int) M_JR_S, INSN_MACRO, 0, I1 }, - {"jr", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, - /* jr.hb is officially MIPS{32,64}R2, but it works on R1 as jr with - the same hazard barrier effect. */ - {"jr.hb", "s", 0x00000408, 0xfc1fffff, UBD|RD_s, 0, I32 }, -+{"j", "s", 0, (int) M_J_S, INSN_MACRO, 0, I1 }, - {"j", "s", 0x00000008, 0xfc1fffff, UBD|RD_s, 0, I1 }, /* jr */ - /* SVR4 PIC code requires special handling for j, so it must be a - macro. */ -@@ -803,7 +805,9 @@ - assembler, but will never match user input (because the line above - will match first). */ - {"j", "a", 0x08000000, 0xfc000000, UBD, 0, I1 }, -+{"jalr", "s", 0, (int) M_JALR_S, INSN_MACRO, 0, I1 }, - {"jalr", "s", 0x0000f809, 0xfc1fffff, UBD|RD_s|WR_d, 0, I1 }, -+{"jalr", "d,s", 0, (int) M_JALR_DS, INSN_MACRO, 0, I1 }, - {"jalr", "d,s", 0x00000009, 0xfc1f07ff, UBD|RD_s|WR_d, 0, I1 }, - /* jalr.hb is officially MIPS{32,64}R2, but it works on R1 as jalr - with the same hazard barrier effect. */ -diff -rNU3 dist.orig/opcodes/openrisc-asm.c dist/opcodes/openrisc-asm.c ---- dist.orig/opcodes/openrisc-asm.c 2010-06-27 06:07:55.000000000 +0200 -+++ dist/opcodes/openrisc-asm.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,649 +0,0 @@ --/* Assembler interface for targets using CGEN. -*- C -*- -- CGEN: Cpu tools GENerator -- -- THIS FILE IS MACHINE GENERATED WITH CGEN. -- - the resultant file is machine generated, cgen-asm.in isn't -- -- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2007, 2008, 2010 -- Free Software Foundation, Inc. -- -- This file is part of libopcodes. -- -- This library is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -- -- --/* ??? Eventually more and more of this stuff can go to cpu-independent files. -- Keep that in mind. */ -- --#include "sysdep.h" --#include --#include "ansidecl.h" --#include "bfd.h" --#include "symcat.h" --#include "openrisc-desc.h" --#include "openrisc-opc.h" --#include "opintl.h" --#include "xregex.h" --#include "libiberty.h" --#include "safe-ctype.h" -- --#undef min --#define min(a,b) ((a) < (b) ? (a) : (b)) --#undef max --#define max(a,b) ((a) > (b) ? (a) : (b)) -- --static const char * parse_insn_normal -- (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *); -- --/* -- assembler routines inserted here. */ -- --/* -- asm.c */ -- --static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'"); -- --#define CGEN_VERBOSE_ASSEMBLER_ERRORS -- --long --openrisc_sign_extend_16bit (long value) --{ -- return ((value & 0xffff) ^ 0x8000) - 0x8000; --} -- --/* Handle hi(). */ -- --static const char * --parse_hi16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep) --{ -- const char *errmsg; -- enum cgen_parse_operand_result result_type; -- unsigned long ret; -- -- if (**strp == '#') -- ++*strp; -- -- if (strncasecmp (*strp, "hi(", 3) == 0) -- { -- bfd_vma value; -- -- *strp += 3; -- errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16, -- & result_type, & value); -- if (**strp != ')') -- return MISSING_CLOSING_PARENTHESIS; -- -- ++*strp; -- if (errmsg == NULL -- && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -- value >>= 16; -- ret = value; -- } -- else -- { -- if (**strp == '-') -- { -- long value; -- -- errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); -- ret = value; -- } -- else -- { -- unsigned long value; -- -- errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value); -- ret = value; -- } -- } -- -- *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000; -- return errmsg; --} -- --/* Handle lo(). */ -- --static const char * --parse_lo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep) --{ -- const char *errmsg; -- enum cgen_parse_operand_result result_type; -- unsigned long ret; -- -- if (**strp == '#') -- ++*strp; -- -- if (strncasecmp (*strp, "lo(", 3) == 0) -- { -- bfd_vma value; -- -- *strp += 3; -- errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16, -- & result_type, & value); -- if (**strp != ')') -- return MISSING_CLOSING_PARENTHESIS; -- -- ++*strp; -- ret = value; -- } -- else -- { -- if (**strp == '-') -- { -- long value; -- -- errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); -- ret = value; -- } -- else -- { -- unsigned long value; -- -- errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value); -- ret = value; -- } -- } -- -- *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000; -- return errmsg; --} -- --/* -- */ -- --const char * openrisc_cgen_parse_operand -- (CGEN_CPU_DESC, int, const char **, CGEN_FIELDS *); -- --/* Main entry point for operand parsing. -- -- This function is basically just a big switch statement. Earlier versions -- used tables to look up the function to use, but -- - if the table contains both assembler and disassembler functions then -- the disassembler contains much of the assembler and vice-versa, -- - there's a lot of inlining possibilities as things grow, -- - using a switch statement avoids the function call overhead. -- -- This function could be moved into `parse_insn_normal', but keeping it -- separate makes clear the interface between `parse_insn_normal' and each of -- the handlers. */ -- --const char * --openrisc_cgen_parse_operand (CGEN_CPU_DESC cd, -- int opindex, -- const char ** strp, -- CGEN_FIELDS * fields) --{ -- const char * errmsg = NULL; -- /* Used by scalar operands that still need to be parsed. */ -- long junk ATTRIBUTE_UNUSED; -- -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- { -- bfd_vma value = 0; -- errmsg = cgen_parse_address (cd, strp, OPENRISC_OPERAND_ABS_26, 0, NULL, & value); -- fields->f_abs26 = value; -- } -- break; -- case OPENRISC_OPERAND_DISP_26 : -- { -- bfd_vma value = 0; -- errmsg = cgen_parse_address (cd, strp, OPENRISC_OPERAND_DISP_26, 0, NULL, & value); -- fields->f_disp26 = value; -- } -- break; -- case OPENRISC_OPERAND_HI16 : -- errmsg = parse_hi16 (cd, strp, OPENRISC_OPERAND_HI16, (long *) (& fields->f_simm16)); -- break; -- case OPENRISC_OPERAND_LO16 : -- errmsg = parse_lo16 (cd, strp, OPENRISC_OPERAND_LO16, (long *) (& fields->f_lo16)); -- break; -- case OPENRISC_OPERAND_OP_F_23 : -- errmsg = cgen_parse_unsigned_integer (cd, strp, OPENRISC_OPERAND_OP_F_23, (unsigned long *) (& fields->f_op4)); -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- errmsg = cgen_parse_unsigned_integer (cd, strp, OPENRISC_OPERAND_OP_F_3, (unsigned long *) (& fields->f_op5)); -- break; -- case OPENRISC_OPERAND_RA : -- errmsg = cgen_parse_keyword (cd, strp, & openrisc_cgen_opval_h_gr, & fields->f_r2); -- break; -- case OPENRISC_OPERAND_RB : -- errmsg = cgen_parse_keyword (cd, strp, & openrisc_cgen_opval_h_gr, & fields->f_r3); -- break; -- case OPENRISC_OPERAND_RD : -- errmsg = cgen_parse_keyword (cd, strp, & openrisc_cgen_opval_h_gr, & fields->f_r1); -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- errmsg = cgen_parse_signed_integer (cd, strp, OPENRISC_OPERAND_SIMM_16, (long *) (& fields->f_simm16)); -- break; -- case OPENRISC_OPERAND_UI16NC : -- errmsg = parse_lo16 (cd, strp, OPENRISC_OPERAND_UI16NC, (long *) (& fields->f_i16nc)); -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- errmsg = cgen_parse_unsigned_integer (cd, strp, OPENRISC_OPERAND_UIMM_16, (unsigned long *) (& fields->f_uimm16)); -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- errmsg = cgen_parse_unsigned_integer (cd, strp, OPENRISC_OPERAND_UIMM_5, (unsigned long *) (& fields->f_uimm5)); -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while parsing.\n"), opindex); -- abort (); -- } -- -- return errmsg; --} -- --cgen_parse_fn * const openrisc_cgen_parse_handlers[] = --{ -- parse_insn_normal, --}; -- --void --openrisc_cgen_init_asm (CGEN_CPU_DESC cd) --{ -- openrisc_cgen_init_opcode_table (cd); -- openrisc_cgen_init_ibld_table (cd); -- cd->parse_handlers = & openrisc_cgen_parse_handlers[0]; -- cd->parse_operand = openrisc_cgen_parse_operand; --#ifdef CGEN_ASM_INIT_HOOK --CGEN_ASM_INIT_HOOK --#endif --} -- -- -- --/* Regex construction routine. -- -- This translates an opcode syntax string into a regex string, -- by replacing any non-character syntax element (such as an -- opcode) with the pattern '.*' -- -- It then compiles the regex and stores it in the opcode, for -- later use by openrisc_cgen_assemble_insn -- -- Returns NULL for success, an error message for failure. */ -- --char * --openrisc_cgen_build_insn_regex (CGEN_INSN *insn) --{ -- CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn); -- const char *mnem = CGEN_INSN_MNEMONIC (insn); -- char rxbuf[CGEN_MAX_RX_ELEMENTS]; -- char *rx = rxbuf; -- const CGEN_SYNTAX_CHAR_TYPE *syn; -- int reg_err; -- -- syn = CGEN_SYNTAX_STRING (CGEN_OPCODE_SYNTAX (opc)); -- -- /* Mnemonics come first in the syntax string. */ -- if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) -- return _("missing mnemonic in syntax string"); -- ++syn; -- -- /* Generate a case sensitive regular expression that emulates case -- insensitive matching in the "C" locale. We cannot generate a case -- insensitive regular expression because in Turkish locales, 'i' and 'I' -- are not equal modulo case conversion. */ -- -- /* Copy the literal mnemonic out of the insn. */ -- for (; *mnem; mnem++) -- { -- char c = *mnem; -- -- if (ISALPHA (c)) -- { -- *rx++ = '['; -- *rx++ = TOLOWER (c); -- *rx++ = TOUPPER (c); -- *rx++ = ']'; -- } -- else -- *rx++ = c; -- } -- -- /* Copy any remaining literals from the syntax string into the rx. */ -- for(; * syn != 0 && rx <= rxbuf + (CGEN_MAX_RX_ELEMENTS - 7 - 4); ++syn) -- { -- if (CGEN_SYNTAX_CHAR_P (* syn)) -- { -- char c = CGEN_SYNTAX_CHAR (* syn); -- -- switch (c) -- { -- /* Escape any regex metacharacters in the syntax. */ -- case '.': case '[': case '\\': -- case '*': case '^': case '$': -- --#ifdef CGEN_ESCAPE_EXTENDED_REGEX -- case '?': case '{': case '}': -- case '(': case ')': case '*': -- case '|': case '+': case ']': --#endif -- *rx++ = '\\'; -- *rx++ = c; -- break; -- -- default: -- if (ISALPHA (c)) -- { -- *rx++ = '['; -- *rx++ = TOLOWER (c); -- *rx++ = TOUPPER (c); -- *rx++ = ']'; -- } -- else -- *rx++ = c; -- break; -- } -- } -- else -- { -- /* Replace non-syntax fields with globs. */ -- *rx++ = '.'; -- *rx++ = '*'; -- } -- } -- -- /* Trailing whitespace ok. */ -- * rx++ = '['; -- * rx++ = ' '; -- * rx++ = '\t'; -- * rx++ = ']'; -- * rx++ = '*'; -- -- /* But anchor it after that. */ -- * rx++ = '$'; -- * rx = '\0'; -- -- CGEN_INSN_RX (insn) = xmalloc (sizeof (regex_t)); -- reg_err = regcomp ((regex_t *) CGEN_INSN_RX (insn), rxbuf, REG_NOSUB); -- -- if (reg_err == 0) -- return NULL; -- else -- { -- static char msg[80]; -- -- regerror (reg_err, (regex_t *) CGEN_INSN_RX (insn), msg, 80); -- regfree ((regex_t *) CGEN_INSN_RX (insn)); -- free (CGEN_INSN_RX (insn)); -- (CGEN_INSN_RX (insn)) = NULL; -- return msg; -- } --} -- -- --/* Default insn parser. -- -- The syntax string is scanned and operands are parsed and stored in FIELDS. -- Relocs are queued as we go via other callbacks. -- -- ??? Note that this is currently an all-or-nothing parser. If we fail to -- parse the instruction, we return 0 and the caller will start over from -- the beginning. Backtracking will be necessary in parsing subexpressions, -- but that can be handled there. Not handling backtracking here may get -- expensive in the case of the m68k. Deal with later. -- -- Returns NULL for success, an error message for failure. */ -- --static const char * --parse_insn_normal (CGEN_CPU_DESC cd, -- const CGEN_INSN *insn, -- const char **strp, -- CGEN_FIELDS *fields) --{ -- /* ??? Runtime added insns not handled yet. */ -- const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -- const char *str = *strp; -- const char *errmsg; -- const char *p; -- const CGEN_SYNTAX_CHAR_TYPE * syn; --#ifdef CGEN_MNEMONIC_OPERANDS -- /* FIXME: wip */ -- int past_opcode_p; --#endif -- -- /* For now we assume the mnemonic is first (there are no leading operands). -- We can parse it without needing to set up operand parsing. -- GAS's input scrubber will ensure mnemonics are lowercase, but we may -- not be called from GAS. */ -- p = CGEN_INSN_MNEMONIC (insn); -- while (*p && TOLOWER (*p) == TOLOWER (*str)) -- ++p, ++str; -- -- if (* p) -- return _("unrecognized instruction"); -- --#ifndef CGEN_MNEMONIC_OPERANDS -- if (* str && ! ISSPACE (* str)) -- return _("unrecognized instruction"); --#endif -- -- CGEN_INIT_PARSE (cd); -- cgen_init_parse_operand (cd); --#ifdef CGEN_MNEMONIC_OPERANDS -- past_opcode_p = 0; --#endif -- -- /* We don't check for (*str != '\0') here because we want to parse -- any trailing fake arguments in the syntax string. */ -- syn = CGEN_SYNTAX_STRING (syntax); -- -- /* Mnemonics come first for now, ensure valid string. */ -- if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) -- abort (); -- -- ++syn; -- -- while (* syn != 0) -- { -- /* Non operand chars must match exactly. */ -- if (CGEN_SYNTAX_CHAR_P (* syn)) -- { -- /* FIXME: While we allow for non-GAS callers above, we assume the -- first char after the mnemonic part is a space. */ -- /* FIXME: We also take inappropriate advantage of the fact that -- GAS's input scrubber will remove extraneous blanks. */ -- if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn))) -- { --#ifdef CGEN_MNEMONIC_OPERANDS -- if (CGEN_SYNTAX_CHAR(* syn) == ' ') -- past_opcode_p = 1; --#endif -- ++ syn; -- ++ str; -- } -- else if (*str) -- { -- /* Syntax char didn't match. Can't be this insn. */ -- static char msg [80]; -- -- /* xgettext:c-format */ -- sprintf (msg, _("syntax error (expected char `%c', found `%c')"), -- CGEN_SYNTAX_CHAR(*syn), *str); -- return msg; -- } -- else -- { -- /* Ran out of input. */ -- static char msg [80]; -- -- /* xgettext:c-format */ -- sprintf (msg, _("syntax error (expected char `%c', found end of instruction)"), -- CGEN_SYNTAX_CHAR(*syn)); -- return msg; -- } -- continue; -- } -- --#ifdef CGEN_MNEMONIC_OPERANDS -- (void) past_opcode_p; --#endif -- /* We have an operand of some sort. */ -- errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); -- if (errmsg) -- return errmsg; -- -- /* Done with this operand, continue with next one. */ -- ++ syn; -- } -- -- /* If we're at the end of the syntax string, we're done. */ -- if (* syn == 0) -- { -- /* FIXME: For the moment we assume a valid `str' can only contain -- blanks now. IE: We needn't try again with a longer version of -- the insn and it is assumed that longer versions of insns appear -- before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */ -- while (ISSPACE (* str)) -- ++ str; -- -- if (* str != '\0') -- return _("junk at end of line"); /* FIXME: would like to include `str' */ -- -- return NULL; -- } -- -- /* We couldn't parse it. */ -- return _("unrecognized instruction"); --} -- --/* Main entry point. -- This routine is called for each instruction to be assembled. -- STR points to the insn to be assembled. -- We assume all necessary tables have been initialized. -- The assembled instruction, less any fixups, is stored in BUF. -- Remember that if CGEN_INT_INSN_P then BUF is an int and thus the value -- still needs to be converted to target byte order, otherwise BUF is an array -- of bytes in target byte order. -- The result is a pointer to the insn's entry in the opcode table, -- or NULL if an error occured (an error message will have already been -- printed). -- -- Note that when processing (non-alias) macro-insns, -- this function recurses. -- -- ??? It's possible to make this cpu-independent. -- One would have to deal with a few minor things. -- At this point in time doing so would be more of a curiosity than useful -- [for example this file isn't _that_ big], but keeping the possibility in -- mind helps keep the design clean. */ -- --const CGEN_INSN * --openrisc_cgen_assemble_insn (CGEN_CPU_DESC cd, -- const char *str, -- CGEN_FIELDS *fields, -- CGEN_INSN_BYTES_PTR buf, -- char **errmsg) --{ -- const char *start; -- CGEN_INSN_LIST *ilist; -- const char *parse_errmsg = NULL; -- const char *insert_errmsg = NULL; -- int recognized_mnemonic = 0; -- -- /* Skip leading white space. */ -- while (ISSPACE (* str)) -- ++ str; -- -- /* The instructions are stored in hashed lists. -- Get the first in the list. */ -- ilist = CGEN_ASM_LOOKUP_INSN (cd, str); -- -- /* Keep looking until we find a match. */ -- start = str; -- for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) -- { -- const CGEN_INSN *insn = ilist->insn; -- recognized_mnemonic = 1; -- --#ifdef CGEN_VALIDATE_INSN_SUPPORTED -- /* Not usually needed as unsupported opcodes -- shouldn't be in the hash lists. */ -- /* Is this insn supported by the selected cpu? */ -- if (! openrisc_cgen_insn_supported (cd, insn)) -- continue; --#endif -- /* If the RELAXED attribute is set, this is an insn that shouldn't be -- chosen immediately. Instead, it is used during assembler/linker -- relaxation if possible. */ -- if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED) != 0) -- continue; -- -- str = start; -- -- /* Skip this insn if str doesn't look right lexically. */ -- if (CGEN_INSN_RX (insn) != NULL && -- regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) -- continue; -- -- /* Allow parse/insert handlers to obtain length of insn. */ -- CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); -- -- parse_errmsg = CGEN_PARSE_FN (cd, insn) (cd, insn, & str, fields); -- if (parse_errmsg != NULL) -- continue; -- -- /* ??? 0 is passed for `pc'. */ -- insert_errmsg = CGEN_INSERT_FN (cd, insn) (cd, insn, fields, buf, -- (bfd_vma) 0); -- if (insert_errmsg != NULL) -- continue; -- -- /* It is up to the caller to actually output the insn and any -- queued relocs. */ -- return insn; -- } -- -- { -- static char errbuf[150]; -- const char *tmp_errmsg; --#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS --#define be_verbose 1 --#else --#define be_verbose 0 --#endif -- -- if (be_verbose) -- { -- /* If requesting verbose error messages, use insert_errmsg. -- Failing that, use parse_errmsg. */ -- tmp_errmsg = (insert_errmsg ? insert_errmsg : -- parse_errmsg ? parse_errmsg : -- recognized_mnemonic ? -- _("unrecognized form of instruction") : -- _("unrecognized instruction")); -- -- if (strlen (start) > 50) -- /* xgettext:c-format */ -- sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); -- else -- /* xgettext:c-format */ -- sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); -- } -- else -- { -- if (strlen (start) > 50) -- /* xgettext:c-format */ -- sprintf (errbuf, _("bad instruction `%.50s...'"), start); -- else -- /* xgettext:c-format */ -- sprintf (errbuf, _("bad instruction `%.50s'"), start); -- } -- -- *errmsg = errbuf; -- return NULL; -- } --} -diff -rNU3 dist.orig/opcodes/openrisc-desc.c dist/opcodes/openrisc-desc.c ---- dist.orig/opcodes/openrisc-desc.c 2010-02-12 04:25:49.000000000 +0100 -+++ dist/opcodes/openrisc-desc.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,1018 +0,0 @@ --/* CPU data for openrisc. -- --THIS FILE IS MACHINE GENERATED WITH CGEN. -- --Copyright 1996-2010 Free Software Foundation, Inc. -- --This file is part of the GNU Binutils and/or GDB, the GNU debugger. -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License along -- with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -- --*/ -- --#include "sysdep.h" --#include --#include --#include "ansidecl.h" --#include "bfd.h" --#include "symcat.h" --#include "openrisc-desc.h" --#include "openrisc-opc.h" --#include "opintl.h" --#include "libiberty.h" --#include "xregex.h" -- --/* Attributes. */ -- --static const CGEN_ATTR_ENTRY bool_attr[] = --{ -- { "#f", 0 }, -- { "#t", 1 }, -- { 0, 0 } --}; -- --static const CGEN_ATTR_ENTRY MACH_attr[] ATTRIBUTE_UNUSED = --{ -- { "base", MACH_BASE }, -- { "openrisc", MACH_OPENRISC }, -- { "or1300", MACH_OR1300 }, -- { "max", MACH_MAX }, -- { 0, 0 } --}; -- --static const CGEN_ATTR_ENTRY ISA_attr[] ATTRIBUTE_UNUSED = --{ -- { "or32", ISA_OR32 }, -- { "max", ISA_MAX }, -- { 0, 0 } --}; -- --static const CGEN_ATTR_ENTRY HAS_CACHE_attr[] ATTRIBUTE_UNUSED = --{ -- { "DATA_CACHE", HAS_CACHE_DATA_CACHE }, -- { "INSN_CACHE", HAS_CACHE_INSN_CACHE }, -- { 0, 0 } --}; -- --const CGEN_ATTR_TABLE openrisc_cgen_ifield_attr_table[] = --{ -- { "MACH", & MACH_attr[0], & MACH_attr[0] }, -- { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -- { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, -- { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, -- { "RESERVED", &bool_attr[0], &bool_attr[0] }, -- { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, -- { "SIGNED", &bool_attr[0], &bool_attr[0] }, -- { 0, 0, 0 } --}; -- --const CGEN_ATTR_TABLE openrisc_cgen_hardware_attr_table[] = --{ -- { "MACH", & MACH_attr[0], & MACH_attr[0] }, -- { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -- { "CACHE-ADDR", &bool_attr[0], &bool_attr[0] }, -- { "PC", &bool_attr[0], &bool_attr[0] }, -- { "PROFILE", &bool_attr[0], &bool_attr[0] }, -- { 0, 0, 0 } --}; -- --const CGEN_ATTR_TABLE openrisc_cgen_operand_attr_table[] = --{ -- { "MACH", & MACH_attr[0], & MACH_attr[0] }, -- { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -- { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, -- { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, -- { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, -- { "SIGNED", &bool_attr[0], &bool_attr[0] }, -- { "NEGATIVE", &bool_attr[0], &bool_attr[0] }, -- { "RELAX", &bool_attr[0], &bool_attr[0] }, -- { "SEM-ONLY", &bool_attr[0], &bool_attr[0] }, -- { 0, 0, 0 } --}; -- --const CGEN_ATTR_TABLE openrisc_cgen_insn_attr_table[] = --{ -- { "MACH", & MACH_attr[0], & MACH_attr[0] }, -- { "ALIAS", &bool_attr[0], &bool_attr[0] }, -- { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -- { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] }, -- { "COND-CTI", &bool_attr[0], &bool_attr[0] }, -- { "SKIP-CTI", &bool_attr[0], &bool_attr[0] }, -- { "DELAY-SLOT", &bool_attr[0], &bool_attr[0] }, -- { "RELAXABLE", &bool_attr[0], &bool_attr[0] }, -- { "RELAXED", &bool_attr[0], &bool_attr[0] }, -- { "NO-DIS", &bool_attr[0], &bool_attr[0] }, -- { "PBB", &bool_attr[0], &bool_attr[0] }, -- { "NOT-IN-DELAY-SLOT", &bool_attr[0], &bool_attr[0] }, -- { 0, 0, 0 } --}; -- --/* Instruction set variants. */ -- --static const CGEN_ISA openrisc_cgen_isa_table[] = { -- { "or32", 32, 32, 32, 32 }, -- { 0, 0, 0, 0, 0 } --}; -- --/* Machine variants. */ -- --static const CGEN_MACH openrisc_cgen_mach_table[] = { -- { "openrisc", "openrisc", MACH_OPENRISC, 0 }, -- { "or1300", "openrisc:1300", MACH_OR1300, 0 }, -- { 0, 0, 0, 0 } --}; -- --static CGEN_KEYWORD_ENTRY openrisc_cgen_opval_h_gr_entries[] = --{ -- { "r0", 0, {0, {{{0, 0}}}}, 0, 0 }, -- { "r1", 1, {0, {{{0, 0}}}}, 0, 0 }, -- { "r2", 2, {0, {{{0, 0}}}}, 0, 0 }, -- { "r3", 3, {0, {{{0, 0}}}}, 0, 0 }, -- { "r4", 4, {0, {{{0, 0}}}}, 0, 0 }, -- { "r5", 5, {0, {{{0, 0}}}}, 0, 0 }, -- { "r6", 6, {0, {{{0, 0}}}}, 0, 0 }, -- { "r7", 7, {0, {{{0, 0}}}}, 0, 0 }, -- { "r8", 8, {0, {{{0, 0}}}}, 0, 0 }, -- { "r9", 9, {0, {{{0, 0}}}}, 0, 0 }, -- { "r10", 10, {0, {{{0, 0}}}}, 0, 0 }, -- { "r11", 11, {0, {{{0, 0}}}}, 0, 0 }, -- { "r12", 12, {0, {{{0, 0}}}}, 0, 0 }, -- { "r13", 13, {0, {{{0, 0}}}}, 0, 0 }, -- { "r14", 14, {0, {{{0, 0}}}}, 0, 0 }, -- { "r15", 15, {0, {{{0, 0}}}}, 0, 0 }, -- { "r16", 16, {0, {{{0, 0}}}}, 0, 0 }, -- { "r17", 17, {0, {{{0, 0}}}}, 0, 0 }, -- { "r18", 18, {0, {{{0, 0}}}}, 0, 0 }, -- { "r19", 19, {0, {{{0, 0}}}}, 0, 0 }, -- { "r20", 20, {0, {{{0, 0}}}}, 0, 0 }, -- { "r21", 21, {0, {{{0, 0}}}}, 0, 0 }, -- { "r22", 22, {0, {{{0, 0}}}}, 0, 0 }, -- { "r23", 23, {0, {{{0, 0}}}}, 0, 0 }, -- { "r24", 24, {0, {{{0, 0}}}}, 0, 0 }, -- { "r25", 25, {0, {{{0, 0}}}}, 0, 0 }, -- { "r26", 26, {0, {{{0, 0}}}}, 0, 0 }, -- { "r27", 27, {0, {{{0, 0}}}}, 0, 0 }, -- { "r28", 28, {0, {{{0, 0}}}}, 0, 0 }, -- { "r29", 29, {0, {{{0, 0}}}}, 0, 0 }, -- { "r30", 30, {0, {{{0, 0}}}}, 0, 0 }, -- { "r31", 31, {0, {{{0, 0}}}}, 0, 0 }, -- { "lr", 11, {0, {{{0, 0}}}}, 0, 0 }, -- { "sp", 1, {0, {{{0, 0}}}}, 0, 0 }, -- { "fp", 2, {0, {{{0, 0}}}}, 0, 0 } --}; -- --CGEN_KEYWORD openrisc_cgen_opval_h_gr = --{ -- & openrisc_cgen_opval_h_gr_entries[0], -- 35, -- 0, 0, 0, 0, "" --}; -- -- --/* The hardware table. */ -- --#define A(a) (1 << CGEN_HW_##a) -- --const CGEN_HW_ENTRY openrisc_cgen_hw_table[] = --{ -- { "h-memory", HW_H_MEMORY, CGEN_ASM_NONE, 0, { 0, { { { (1<name) -- { -- if (strcmp (name, table->bfd_name) == 0) -- return table; -- ++table; -- } -- abort (); --} -- --/* Subroutine of openrisc_cgen_cpu_open to build the hardware table. */ -- --static void --build_hw_table (CGEN_CPU_TABLE *cd) --{ -- int i; -- int machs = cd->machs; -- const CGEN_HW_ENTRY *init = & openrisc_cgen_hw_table[0]; -- /* MAX_HW is only an upper bound on the number of selected entries. -- However each entry is indexed by it's enum so there can be holes in -- the table. */ -- const CGEN_HW_ENTRY **selected = -- (const CGEN_HW_ENTRY **) xmalloc (MAX_HW * sizeof (CGEN_HW_ENTRY *)); -- -- cd->hw_table.init_entries = init; -- cd->hw_table.entry_size = sizeof (CGEN_HW_ENTRY); -- memset (selected, 0, MAX_HW * sizeof (CGEN_HW_ENTRY *)); -- /* ??? For now we just use machs to determine which ones we want. */ -- for (i = 0; init[i].name != NULL; ++i) -- if (CGEN_HW_ATTR_VALUE (&init[i], CGEN_HW_MACH) -- & machs) -- selected[init[i].type] = &init[i]; -- cd->hw_table.entries = selected; -- cd->hw_table.num_entries = MAX_HW; --} -- --/* Subroutine of openrisc_cgen_cpu_open to build the hardware table. */ -- --static void --build_ifield_table (CGEN_CPU_TABLE *cd) --{ -- cd->ifld_table = & openrisc_cgen_ifld_table[0]; --} -- --/* Subroutine of openrisc_cgen_cpu_open to build the hardware table. */ -- --static void --build_operand_table (CGEN_CPU_TABLE *cd) --{ -- int i; -- int machs = cd->machs; -- const CGEN_OPERAND *init = & openrisc_cgen_operand_table[0]; -- /* MAX_OPERANDS is only an upper bound on the number of selected entries. -- However each entry is indexed by it's enum so there can be holes in -- the table. */ -- const CGEN_OPERAND **selected = xmalloc (MAX_OPERANDS * sizeof (* selected)); -- -- cd->operand_table.init_entries = init; -- cd->operand_table.entry_size = sizeof (CGEN_OPERAND); -- memset (selected, 0, MAX_OPERANDS * sizeof (CGEN_OPERAND *)); -- /* ??? For now we just use mach to determine which ones we want. */ -- for (i = 0; init[i].name != NULL; ++i) -- if (CGEN_OPERAND_ATTR_VALUE (&init[i], CGEN_OPERAND_MACH) -- & machs) -- selected[init[i].type] = &init[i]; -- cd->operand_table.entries = selected; -- cd->operand_table.num_entries = MAX_OPERANDS; --} -- --/* Subroutine of openrisc_cgen_cpu_open to build the hardware table. -- ??? This could leave out insns not supported by the specified mach/isa, -- but that would cause errors like "foo only supported by bar" to become -- "unknown insn", so for now we include all insns and require the app to -- do the checking later. -- ??? On the other hand, parsing of such insns may require their hardware or -- operand elements to be in the table [which they mightn't be]. */ -- --static void --build_insn_table (CGEN_CPU_TABLE *cd) --{ -- int i; -- const CGEN_IBASE *ib = & openrisc_cgen_insn_table[0]; -- CGEN_INSN *insns = xmalloc (MAX_INSNS * sizeof (CGEN_INSN)); -- -- memset (insns, 0, MAX_INSNS * sizeof (CGEN_INSN)); -- for (i = 0; i < MAX_INSNS; ++i) -- insns[i].base = &ib[i]; -- cd->insn_table.init_entries = insns; -- cd->insn_table.entry_size = sizeof (CGEN_IBASE); -- cd->insn_table.num_init_entries = MAX_INSNS; --} -- --/* Subroutine of openrisc_cgen_cpu_open to rebuild the tables. */ -- --static void --openrisc_cgen_rebuild_tables (CGEN_CPU_TABLE *cd) --{ -- int i; -- CGEN_BITSET *isas = cd->isas; -- unsigned int machs = cd->machs; -- -- cd->int_insn_p = CGEN_INT_INSN_P; -- -- /* Data derived from the isa spec. */ --#define UNSET (CGEN_SIZE_UNKNOWN + 1) -- cd->default_insn_bitsize = UNSET; -- cd->base_insn_bitsize = UNSET; -- cd->min_insn_bitsize = 65535; /* Some ridiculously big number. */ -- cd->max_insn_bitsize = 0; -- for (i = 0; i < MAX_ISAS; ++i) -- if (cgen_bitset_contains (isas, i)) -- { -- const CGEN_ISA *isa = & openrisc_cgen_isa_table[i]; -- -- /* Default insn sizes of all selected isas must be -- equal or we set the result to 0, meaning "unknown". */ -- if (cd->default_insn_bitsize == UNSET) -- cd->default_insn_bitsize = isa->default_insn_bitsize; -- else if (isa->default_insn_bitsize == cd->default_insn_bitsize) -- ; /* This is ok. */ -- else -- cd->default_insn_bitsize = CGEN_SIZE_UNKNOWN; -- -- /* Base insn sizes of all selected isas must be equal -- or we set the result to 0, meaning "unknown". */ -- if (cd->base_insn_bitsize == UNSET) -- cd->base_insn_bitsize = isa->base_insn_bitsize; -- else if (isa->base_insn_bitsize == cd->base_insn_bitsize) -- ; /* This is ok. */ -- else -- cd->base_insn_bitsize = CGEN_SIZE_UNKNOWN; -- -- /* Set min,max insn sizes. */ -- if (isa->min_insn_bitsize < cd->min_insn_bitsize) -- cd->min_insn_bitsize = isa->min_insn_bitsize; -- if (isa->max_insn_bitsize > cd->max_insn_bitsize) -- cd->max_insn_bitsize = isa->max_insn_bitsize; -- } -- -- /* Data derived from the mach spec. */ -- for (i = 0; i < MAX_MACHS; ++i) -- if (((1 << i) & machs) != 0) -- { -- const CGEN_MACH *mach = & openrisc_cgen_mach_table[i]; -- -- if (mach->insn_chunk_bitsize != 0) -- { -- if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) -- { -- fprintf (stderr, "openrisc_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", -- cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); -- abort (); -- } -- -- cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; -- } -- } -- -- /* Determine which hw elements are used by MACH. */ -- build_hw_table (cd); -- -- /* Build the ifield table. */ -- build_ifield_table (cd); -- -- /* Determine which operands are used by MACH/ISA. */ -- build_operand_table (cd); -- -- /* Build the instruction table. */ -- build_insn_table (cd); --} -- --/* Initialize a cpu table and return a descriptor. -- It's much like opening a file, and must be the first function called. -- The arguments are a set of (type/value) pairs, terminated with -- CGEN_CPU_OPEN_END. -- -- Currently supported values: -- CGEN_CPU_OPEN_ISAS: bitmap of values in enum isa_attr -- CGEN_CPU_OPEN_MACHS: bitmap of values in enum mach_attr -- CGEN_CPU_OPEN_BFDMACH: specify 1 mach using bfd name -- CGEN_CPU_OPEN_ENDIAN: specify endian choice -- CGEN_CPU_OPEN_END: terminates arguments -- -- ??? Simultaneous multiple isas might not make sense, but it's not (yet) -- precluded. */ -- --CGEN_CPU_DESC --openrisc_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...) --{ -- CGEN_CPU_TABLE *cd = (CGEN_CPU_TABLE *) xmalloc (sizeof (CGEN_CPU_TABLE)); -- static int init_p; -- CGEN_BITSET *isas = 0; /* 0 = "unspecified" */ -- unsigned int machs = 0; /* 0 = "unspecified" */ -- enum cgen_endian endian = CGEN_ENDIAN_UNKNOWN; -- va_list ap; -- -- if (! init_p) -- { -- init_tables (); -- init_p = 1; -- } -- -- memset (cd, 0, sizeof (*cd)); -- -- va_start (ap, arg_type); -- while (arg_type != CGEN_CPU_OPEN_END) -- { -- switch (arg_type) -- { -- case CGEN_CPU_OPEN_ISAS : -- isas = va_arg (ap, CGEN_BITSET *); -- break; -- case CGEN_CPU_OPEN_MACHS : -- machs = va_arg (ap, unsigned int); -- break; -- case CGEN_CPU_OPEN_BFDMACH : -- { -- const char *name = va_arg (ap, const char *); -- const CGEN_MACH *mach = -- lookup_mach_via_bfd_name (openrisc_cgen_mach_table, name); -- -- machs |= 1 << mach->num; -- break; -- } -- case CGEN_CPU_OPEN_ENDIAN : -- endian = va_arg (ap, enum cgen_endian); -- break; -- default : -- fprintf (stderr, "openrisc_cgen_cpu_open: unsupported argument `%d'\n", -- arg_type); -- abort (); /* ??? return NULL? */ -- } -- arg_type = va_arg (ap, enum cgen_cpu_open_arg); -- } -- va_end (ap); -- -- /* Mach unspecified means "all". */ -- if (machs == 0) -- machs = (1 << MAX_MACHS) - 1; -- /* Base mach is always selected. */ -- machs |= 1; -- if (endian == CGEN_ENDIAN_UNKNOWN) -- { -- /* ??? If target has only one, could have a default. */ -- fprintf (stderr, "openrisc_cgen_cpu_open: no endianness specified\n"); -- abort (); -- } -- -- cd->isas = cgen_bitset_copy (isas); -- cd->machs = machs; -- cd->endian = endian; -- /* FIXME: for the sparc case we can determine insn-endianness statically. -- The worry here is where both data and insn endian can be independently -- chosen, in which case this function will need another argument. -- Actually, will want to allow for more arguments in the future anyway. */ -- cd->insn_endian = endian; -- -- /* Table (re)builder. */ -- cd->rebuild_tables = openrisc_cgen_rebuild_tables; -- openrisc_cgen_rebuild_tables (cd); -- -- /* Default to not allowing signed overflow. */ -- cd->signed_overflow_ok_p = 0; -- -- return (CGEN_CPU_DESC) cd; --} -- --/* Cover fn to openrisc_cgen_cpu_open to handle the simple case of 1 isa, 1 mach. -- MACH_NAME is the bfd name of the mach. */ -- --CGEN_CPU_DESC --openrisc_cgen_cpu_open_1 (const char *mach_name, enum cgen_endian endian) --{ -- return openrisc_cgen_cpu_open (CGEN_CPU_OPEN_BFDMACH, mach_name, -- CGEN_CPU_OPEN_ENDIAN, endian, -- CGEN_CPU_OPEN_END); --} -- --/* Close a cpu table. -- ??? This can live in a machine independent file, but there's currently -- no place to put this file (there's no libcgen). libopcodes is the wrong -- place as some simulator ports use this but they don't use libopcodes. */ -- --void --openrisc_cgen_cpu_close (CGEN_CPU_DESC cd) --{ -- unsigned int i; -- const CGEN_INSN *insns; -- -- if (cd->macro_insn_table.init_entries) -- { -- insns = cd->macro_insn_table.init_entries; -- for (i = 0; i < cd->macro_insn_table.num_init_entries; ++i, ++insns) -- if (CGEN_INSN_RX ((insns))) -- regfree (CGEN_INSN_RX (insns)); -- } -- -- if (cd->insn_table.init_entries) -- { -- insns = cd->insn_table.init_entries; -- for (i = 0; i < cd->insn_table.num_init_entries; ++i, ++insns) -- if (CGEN_INSN_RX (insns)) -- regfree (CGEN_INSN_RX (insns)); -- } -- -- if (cd->macro_insn_table.init_entries) -- free ((CGEN_INSN *) cd->macro_insn_table.init_entries); -- -- if (cd->insn_table.init_entries) -- free ((CGEN_INSN *) cd->insn_table.init_entries); -- -- if (cd->hw_table.entries) -- free ((CGEN_HW_ENTRY *) cd->hw_table.entries); -- -- if (cd->operand_table.entries) -- free ((CGEN_HW_ENTRY *) cd->operand_table.entries); -- -- free (cd); --} -- -diff -rNU3 dist.orig/opcodes/openrisc-desc.h dist/opcodes/openrisc-desc.h ---- dist.orig/opcodes/openrisc-desc.h 2010-10-09 08:50:23.000000000 +0200 -+++ dist/opcodes/openrisc-desc.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,288 +0,0 @@ --/* CPU data header for openrisc. -- --THIS FILE IS MACHINE GENERATED WITH CGEN. -- --Copyright 1996-2010 Free Software Foundation, Inc. -- --This file is part of the GNU Binutils and/or GDB, the GNU debugger. -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License along -- with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -- --*/ -- --#ifndef OPENRISC_CPU_H --#define OPENRISC_CPU_H -- --#define CGEN_ARCH openrisc -- --/* Given symbol S, return openrisc_cgen_. */ --#define CGEN_SYM(s) openrisc##_cgen_##s -- -- --/* Selected cpu families. */ --#define HAVE_CPU_OPENRISCBF -- --#define CGEN_INSN_LSB0_P 1 -- --/* Minimum size of any insn (in bytes). */ --#define CGEN_MIN_INSN_SIZE 4 -- --/* Maximum size of any insn (in bytes). */ --#define CGEN_MAX_INSN_SIZE 4 -- --#define CGEN_INT_INSN_P 1 -- --/* Maximum number of syntax elements in an instruction. */ --#define CGEN_ACTUAL_MAX_SYNTAX_ELEMENTS 14 -- --/* CGEN_MNEMONIC_OPERANDS is defined if mnemonics have operands. -- e.g. In "b,a foo" the ",a" is an operand. If mnemonics have operands -- we can't hash on everything up to the space. */ --#define CGEN_MNEMONIC_OPERANDS -- --/* Maximum number of fields in an instruction. */ --#define CGEN_ACTUAL_MAX_IFMT_OPERANDS 9 -- --/* Enums. */ -- --/* Enum declaration for exception vectors. */ --typedef enum e_exception { -- E_RESET, E_BUSERR, E_DPF, E_IPF -- , E_EXTINT, E_ALIGN, E_ILLEGAL, E_PEINT -- , E_DTLBMISS, E_ITLBMISS, E_RRANGE, E_SYSCALL -- , E_BREAK, E_RESERVED --} E_EXCEPTION; -- --/* Enum declaration for FIXME. */ --typedef enum insn_class { -- OP1_0, OP1_1, OP1_2, OP1_3 --} INSN_CLASS; -- --/* Enum declaration for FIXME. */ --typedef enum insn_sub { -- OP2_0, OP2_1, OP2_2, OP2_3 -- , OP2_4, OP2_5, OP2_6, OP2_7 -- , OP2_8, OP2_9, OP2_10, OP2_11 -- , OP2_12, OP2_13, OP2_14, OP2_15 --} INSN_SUB; -- --/* Enum declaration for FIXME. */ --typedef enum insn_op3 { -- OP3_0, OP3_1, OP3_2, OP3_3 --} INSN_OP3; -- --/* Enum declaration for FIXME. */ --typedef enum insn_op4 { -- OP4_0, OP4_1, OP4_2, OP4_3 -- , OP4_4, OP4_5, OP4_6, OP4_7 --} INSN_OP4; -- --/* Enum declaration for FIXME. */ --typedef enum insn_op5 { -- OP5_0, OP5_1, OP5_2, OP5_3 -- , OP5_4, OP5_5, OP5_6, OP5_7 -- , OP5_8, OP5_9, OP5_10, OP5_11 -- , OP5_12, OP5_13, OP5_14, OP5_15 -- , OP5_16, OP5_17, OP5_18, OP5_19 -- , OP5_20, OP5_21, OP5_22, OP5_23 -- , OP5_24, OP5_25, OP5_26, OP5_27 -- , OP5_28, OP5_29, OP5_30, OP5_31 --} INSN_OP5; -- --/* Enum declaration for FIXME. */ --typedef enum insn_op6 { -- OP6_0, OP6_1, OP6_2, OP6_3 -- , OP6_4, OP6_5, OP6_6, OP6_7 --} INSN_OP6; -- --/* Enum declaration for FIXME. */ --typedef enum insn_op7 { -- OP7_0, OP7_1, OP7_2, OP7_3 -- , OP7_4, OP7_5, OP7_6, OP7_7 -- , OP7_8, OP7_9, OP7_10, OP7_11 -- , OP7_12, OP7_13, OP7_14, OP7_15 --} INSN_OP7; -- --/* Attributes. */ -- --/* Enum declaration for machine type selection. */ --typedef enum mach_attr { -- MACH_BASE, MACH_OPENRISC, MACH_OR1300, MACH_MAX --} MACH_ATTR; -- --/* Enum declaration for instruction set selection. */ --typedef enum isa_attr { -- ISA_OR32, ISA_MAX --} ISA_ATTR; -- --/* Enum declaration for if this model has caches. */ --typedef enum has_cache_attr { -- HAS_CACHE_DATA_CACHE, HAS_CACHE_INSN_CACHE --} HAS_CACHE_ATTR; -- --/* Number of architecture variants. */ --#define MAX_ISAS 1 --#define MAX_MACHS ((int) MACH_MAX) -- --/* Ifield support. */ -- --/* Ifield attribute indices. */ -- --/* Enum declaration for cgen_ifld attrs. */ --typedef enum cgen_ifld_attr { -- CGEN_IFLD_VIRTUAL, CGEN_IFLD_PCREL_ADDR, CGEN_IFLD_ABS_ADDR, CGEN_IFLD_RESERVED -- , CGEN_IFLD_SIGN_OPT, CGEN_IFLD_SIGNED, CGEN_IFLD_END_BOOLS, CGEN_IFLD_START_NBOOLS = 31 -- , CGEN_IFLD_MACH, CGEN_IFLD_END_NBOOLS --} CGEN_IFLD_ATTR; -- --/* Number of non-boolean elements in cgen_ifld_attr. */ --#define CGEN_IFLD_NBOOL_ATTRS (CGEN_IFLD_END_NBOOLS - CGEN_IFLD_START_NBOOLS - 1) -- --/* cgen_ifld attribute accessor macros. */ --#define CGEN_ATTR_CGEN_IFLD_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_IFLD_MACH-CGEN_IFLD_START_NBOOLS-1].nonbitset) --#define CGEN_ATTR_CGEN_IFLD_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_VIRTUAL)) != 0) --#define CGEN_ATTR_CGEN_IFLD_PCREL_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_PCREL_ADDR)) != 0) --#define CGEN_ATTR_CGEN_IFLD_ABS_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_ABS_ADDR)) != 0) --#define CGEN_ATTR_CGEN_IFLD_RESERVED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_RESERVED)) != 0) --#define CGEN_ATTR_CGEN_IFLD_SIGN_OPT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_SIGN_OPT)) != 0) --#define CGEN_ATTR_CGEN_IFLD_SIGNED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_SIGNED)) != 0) -- --/* Enum declaration for openrisc ifield types. */ --typedef enum ifield_type { -- OPENRISC_F_NIL, OPENRISC_F_ANYOF, OPENRISC_F_CLASS, OPENRISC_F_SUB -- , OPENRISC_F_R1, OPENRISC_F_R2, OPENRISC_F_R3, OPENRISC_F_SIMM16 -- , OPENRISC_F_UIMM16, OPENRISC_F_UIMM5, OPENRISC_F_HI16, OPENRISC_F_LO16 -- , OPENRISC_F_OP1, OPENRISC_F_OP2, OPENRISC_F_OP3, OPENRISC_F_OP4 -- , OPENRISC_F_OP5, OPENRISC_F_OP6, OPENRISC_F_OP7, OPENRISC_F_I16_1 -- , OPENRISC_F_I16_2, OPENRISC_F_DISP26, OPENRISC_F_ABS26, OPENRISC_F_I16NC -- , OPENRISC_F_F_15_8, OPENRISC_F_F_10_3, OPENRISC_F_F_4_1, OPENRISC_F_F_7_3 -- , OPENRISC_F_F_10_7, OPENRISC_F_F_10_11, OPENRISC_F_MAX --} IFIELD_TYPE; -- --#define MAX_IFLD ((int) OPENRISC_F_MAX) -- --/* Hardware attribute indices. */ -- --/* Enum declaration for cgen_hw attrs. */ --typedef enum cgen_hw_attr { -- CGEN_HW_VIRTUAL, CGEN_HW_CACHE_ADDR, CGEN_HW_PC, CGEN_HW_PROFILE -- , CGEN_HW_END_BOOLS, CGEN_HW_START_NBOOLS = 31, CGEN_HW_MACH, CGEN_HW_END_NBOOLS --} CGEN_HW_ATTR; -- --/* Number of non-boolean elements in cgen_hw_attr. */ --#define CGEN_HW_NBOOL_ATTRS (CGEN_HW_END_NBOOLS - CGEN_HW_START_NBOOLS - 1) -- --/* cgen_hw attribute accessor macros. */ --#define CGEN_ATTR_CGEN_HW_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_HW_MACH-CGEN_HW_START_NBOOLS-1].nonbitset) --#define CGEN_ATTR_CGEN_HW_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_VIRTUAL)) != 0) --#define CGEN_ATTR_CGEN_HW_CACHE_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_CACHE_ADDR)) != 0) --#define CGEN_ATTR_CGEN_HW_PC_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_PC)) != 0) --#define CGEN_ATTR_CGEN_HW_PROFILE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_PROFILE)) != 0) -- --/* Enum declaration for openrisc hardware types. */ --typedef enum cgen_hw_type { -- HW_H_MEMORY, HW_H_SINT, HW_H_UINT, HW_H_ADDR -- , HW_H_IADDR, HW_H_PC, HW_H_GR, HW_H_SR -- , HW_H_HI16, HW_H_LO16, HW_H_CBIT, HW_H_DELAY_INSN -- , HW_MAX --} CGEN_HW_TYPE; -- --#define MAX_HW ((int) HW_MAX) -- --/* Operand attribute indices. */ -- --/* Enum declaration for cgen_operand attrs. */ --typedef enum cgen_operand_attr { -- CGEN_OPERAND_VIRTUAL, CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_SIGN_OPT -- , CGEN_OPERAND_SIGNED, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_RELAX, CGEN_OPERAND_SEM_ONLY -- , CGEN_OPERAND_END_BOOLS, CGEN_OPERAND_START_NBOOLS = 31, CGEN_OPERAND_MACH, CGEN_OPERAND_END_NBOOLS --} CGEN_OPERAND_ATTR; -- --/* Number of non-boolean elements in cgen_operand_attr. */ --#define CGEN_OPERAND_NBOOL_ATTRS (CGEN_OPERAND_END_NBOOLS - CGEN_OPERAND_START_NBOOLS - 1) -- --/* cgen_operand attribute accessor macros. */ --#define CGEN_ATTR_CGEN_OPERAND_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_OPERAND_MACH-CGEN_OPERAND_START_NBOOLS-1].nonbitset) --#define CGEN_ATTR_CGEN_OPERAND_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_VIRTUAL)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_PCREL_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_PCREL_ADDR)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_ABS_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_ABS_ADDR)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_SIGN_OPT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SIGN_OPT)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_SIGNED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SIGNED)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_NEGATIVE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_NEGATIVE)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_RELAX_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_RELAX)) != 0) --#define CGEN_ATTR_CGEN_OPERAND_SEM_ONLY_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SEM_ONLY)) != 0) -- --/* Enum declaration for openrisc operand types. */ --typedef enum cgen_operand_type { -- OPENRISC_OPERAND_PC, OPENRISC_OPERAND_SR, OPENRISC_OPERAND_CBIT, OPENRISC_OPERAND_SIMM_16 -- , OPENRISC_OPERAND_UIMM_16, OPENRISC_OPERAND_DISP_26, OPENRISC_OPERAND_ABS_26, OPENRISC_OPERAND_UIMM_5 -- , OPENRISC_OPERAND_RD, OPENRISC_OPERAND_RA, OPENRISC_OPERAND_RB, OPENRISC_OPERAND_OP_F_23 -- , OPENRISC_OPERAND_OP_F_3, OPENRISC_OPERAND_HI16, OPENRISC_OPERAND_LO16, OPENRISC_OPERAND_UI16NC -- , OPENRISC_OPERAND_MAX --} CGEN_OPERAND_TYPE; -- --/* Number of operands types. */ --#define MAX_OPERANDS 16 -- --/* Maximum number of operands referenced by any insn. */ --#define MAX_OPERAND_INSTANCES 8 -- --/* Insn attribute indices. */ -- --/* Enum declaration for cgen_insn attrs. */ --typedef enum cgen_insn_attr { -- CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI -- , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED -- , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_NOT_IN_DELAY_SLOT, CGEN_INSN_END_BOOLS -- , CGEN_INSN_START_NBOOLS = 31, CGEN_INSN_MACH, CGEN_INSN_END_NBOOLS --} CGEN_INSN_ATTR; -- --/* Number of non-boolean elements in cgen_insn_attr. */ --#define CGEN_INSN_NBOOL_ATTRS (CGEN_INSN_END_NBOOLS - CGEN_INSN_START_NBOOLS - 1) -- --/* cgen_insn attribute accessor macros. */ --#define CGEN_ATTR_CGEN_INSN_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_INSN_MACH-CGEN_INSN_START_NBOOLS-1].nonbitset) --#define CGEN_ATTR_CGEN_INSN_ALIAS_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_ALIAS)) != 0) --#define CGEN_ATTR_CGEN_INSN_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_VIRTUAL)) != 0) --#define CGEN_ATTR_CGEN_INSN_UNCOND_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_UNCOND_CTI)) != 0) --#define CGEN_ATTR_CGEN_INSN_COND_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_COND_CTI)) != 0) --#define CGEN_ATTR_CGEN_INSN_SKIP_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_SKIP_CTI)) != 0) --#define CGEN_ATTR_CGEN_INSN_DELAY_SLOT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_DELAY_SLOT)) != 0) --#define CGEN_ATTR_CGEN_INSN_RELAXABLE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_RELAXABLE)) != 0) --#define CGEN_ATTR_CGEN_INSN_RELAXED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_RELAXED)) != 0) --#define CGEN_ATTR_CGEN_INSN_NO_DIS_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_NO_DIS)) != 0) --#define CGEN_ATTR_CGEN_INSN_PBB_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_PBB)) != 0) --#define CGEN_ATTR_CGEN_INSN_NOT_IN_DELAY_SLOT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_NOT_IN_DELAY_SLOT)) != 0) -- --/* cgen.h uses things we just defined. */ --#include "opcode/cgen.h" -- --extern const struct cgen_ifld openrisc_cgen_ifld_table[]; -- --/* Attributes. */ --extern const CGEN_ATTR_TABLE openrisc_cgen_hardware_attr_table[]; --extern const CGEN_ATTR_TABLE openrisc_cgen_ifield_attr_table[]; --extern const CGEN_ATTR_TABLE openrisc_cgen_operand_attr_table[]; --extern const CGEN_ATTR_TABLE openrisc_cgen_insn_attr_table[]; -- --/* Hardware decls. */ -- --extern CGEN_KEYWORD openrisc_cgen_opval_h_gr; -- --extern const CGEN_HW_ENTRY openrisc_cgen_hw_table[]; -- -- -- --#endif /* OPENRISC_CPU_H */ -diff -rNU3 dist.orig/opcodes/openrisc-dis.c dist/opcodes/openrisc-dis.c ---- dist.orig/opcodes/openrisc-dis.c 2010-02-12 05:42:28.000000000 +0100 -+++ dist/opcodes/openrisc-dis.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,556 +0,0 @@ --/* Disassembler interface for targets using CGEN. -*- C -*- -- CGEN: Cpu tools GENerator -- -- THIS FILE IS MACHINE GENERATED WITH CGEN. -- - the resultant file is machine generated, cgen-dis.in isn't -- -- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007, -- 2008, 2010 Free Software Foundation, Inc. -- -- This file is part of libopcodes. -- -- This library is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -- --/* ??? Eventually more and more of this stuff can go to cpu-independent files. -- Keep that in mind. */ -- --#include "sysdep.h" --#include --#include "ansidecl.h" --#include "dis-asm.h" --#include "bfd.h" --#include "symcat.h" --#include "libiberty.h" --#include "openrisc-desc.h" --#include "openrisc-opc.h" --#include "opintl.h" -- --/* Default text to print if an instruction isn't recognized. */ --#define UNKNOWN_INSN_MSG _("*unknown*") -- --static void print_normal -- (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); --static void print_address -- (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED; --static void print_keyword -- (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED; --static void print_insn_normal -- (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int); --static int print_insn -- (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned); --static int default_print_insn -- (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED; --static int read_insn -- (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *, -- unsigned long *); -- --/* -- disassembler routines inserted here. */ -- -- --void openrisc_cgen_print_operand -- (CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *, void const *, bfd_vma, int); -- --/* Main entry point for printing operands. -- XINFO is a `void *' and not a `disassemble_info *' to not put a requirement -- of dis-asm.h on cgen.h. -- -- This function is basically just a big switch statement. Earlier versions -- used tables to look up the function to use, but -- - if the table contains both assembler and disassembler functions then -- the disassembler contains much of the assembler and vice-versa, -- - there's a lot of inlining possibilities as things grow, -- - using a switch statement avoids the function call overhead. -- -- This function could be moved into `print_insn_normal', but keeping it -- separate makes clear the interface between `print_insn_normal' and each of -- the handlers. */ -- --void --openrisc_cgen_print_operand (CGEN_CPU_DESC cd, -- int opindex, -- void * xinfo, -- CGEN_FIELDS *fields, -- void const *attrs ATTRIBUTE_UNUSED, -- bfd_vma pc, -- int length) --{ -- disassemble_info *info = (disassemble_info *) xinfo; -- -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- print_address (cd, info, fields->f_abs26, 0|(1<f_disp26, 0|(1<f_simm16, 0|(1<f_lo16, 0|(1<f_op4, 0, pc, length); -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- print_normal (cd, info, fields->f_op5, 0, pc, length); -- break; -- case OPENRISC_OPERAND_RA : -- print_keyword (cd, info, & openrisc_cgen_opval_h_gr, fields->f_r2, 0); -- break; -- case OPENRISC_OPERAND_RB : -- print_keyword (cd, info, & openrisc_cgen_opval_h_gr, fields->f_r3, 0); -- break; -- case OPENRISC_OPERAND_RD : -- print_keyword (cd, info, & openrisc_cgen_opval_h_gr, fields->f_r1, 0); -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- print_normal (cd, info, fields->f_simm16, 0|(1<f_i16nc, 0|(1<f_uimm16, 0, pc, length); -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- print_normal (cd, info, fields->f_uimm5, 0, pc, length); -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while printing insn.\n"), -- opindex); -- abort (); -- } --} -- --cgen_print_fn * const openrisc_cgen_print_handlers[] = --{ -- print_insn_normal, --}; -- -- --void --openrisc_cgen_init_dis (CGEN_CPU_DESC cd) --{ -- openrisc_cgen_init_opcode_table (cd); -- openrisc_cgen_init_ibld_table (cd); -- cd->print_handlers = & openrisc_cgen_print_handlers[0]; -- cd->print_operand = openrisc_cgen_print_operand; --} -- -- --/* Default print handler. */ -- --static void --print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- void *dis_info, -- long value, -- unsigned int attrs, -- bfd_vma pc ATTRIBUTE_UNUSED, -- int length ATTRIBUTE_UNUSED) --{ -- disassemble_info *info = (disassemble_info *) dis_info; -- -- /* Print the operand as directed by the attributes. */ -- if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) -- ; /* nothing to do */ -- else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) -- (*info->fprintf_func) (info->stream, "%ld", value); -- else -- (*info->fprintf_func) (info->stream, "0x%lx", value); --} -- --/* Default address handler. */ -- --static void --print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- void *dis_info, -- bfd_vma value, -- unsigned int attrs, -- bfd_vma pc ATTRIBUTE_UNUSED, -- int length ATTRIBUTE_UNUSED) --{ -- disassemble_info *info = (disassemble_info *) dis_info; -- -- /* Print the operand as directed by the attributes. */ -- if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) -- ; /* Nothing to do. */ -- else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR)) -- (*info->print_address_func) (value, info); -- else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR)) -- (*info->print_address_func) (value, info); -- else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) -- (*info->fprintf_func) (info->stream, "%ld", (long) value); -- else -- (*info->fprintf_func) (info->stream, "0x%lx", (long) value); --} -- --/* Keyword print handler. */ -- --static void --print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- void *dis_info, -- CGEN_KEYWORD *keyword_table, -- long value, -- unsigned int attrs ATTRIBUTE_UNUSED) --{ -- disassemble_info *info = (disassemble_info *) dis_info; -- const CGEN_KEYWORD_ENTRY *ke; -- -- ke = cgen_keyword_lookup_value (keyword_table, value); -- if (ke != NULL) -- (*info->fprintf_func) (info->stream, "%s", ke->name); -- else -- (*info->fprintf_func) (info->stream, "???"); --} -- --/* Default insn printer. -- -- DIS_INFO is defined as `void *' so the disassembler needn't know anything -- about disassemble_info. */ -- --static void --print_insn_normal (CGEN_CPU_DESC cd, -- void *dis_info, -- const CGEN_INSN *insn, -- CGEN_FIELDS *fields, -- bfd_vma pc, -- int length) --{ -- const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -- disassemble_info *info = (disassemble_info *) dis_info; -- const CGEN_SYNTAX_CHAR_TYPE *syn; -- -- CGEN_INIT_PRINT (cd); -- -- for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) -- { -- if (CGEN_SYNTAX_MNEMONIC_P (*syn)) -- { -- (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn)); -- continue; -- } -- if (CGEN_SYNTAX_CHAR_P (*syn)) -- { -- (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn)); -- continue; -- } -- -- /* We have an operand. */ -- openrisc_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info, -- fields, CGEN_INSN_ATTRS (insn), pc, length); -- } --} -- --/* Subroutine of print_insn. Reads an insn into the given buffers and updates -- the extract info. -- Returns 0 if all is well, non-zero otherwise. */ -- --static int --read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- bfd_vma pc, -- disassemble_info *info, -- bfd_byte *buf, -- int buflen, -- CGEN_EXTRACT_INFO *ex_info, -- unsigned long *insn_value) --{ -- int status = (*info->read_memory_func) (pc, buf, buflen, info); -- -- if (status != 0) -- { -- (*info->memory_error_func) (status, pc, info); -- return -1; -- } -- -- ex_info->dis_info = info; -- ex_info->valid = (1 << buflen) - 1; -- ex_info->insn_bytes = buf; -- -- *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); -- return 0; --} -- --/* Utility to print an insn. -- BUF is the base part of the insn, target byte order, BUFLEN bytes long. -- The result is the size of the insn in bytes or zero for an unknown insn -- or -1 if an error occurs fetching data (memory_error_func will have -- been called). */ -- --static int --print_insn (CGEN_CPU_DESC cd, -- bfd_vma pc, -- disassemble_info *info, -- bfd_byte *buf, -- unsigned int buflen) --{ -- CGEN_INSN_INT insn_value; -- const CGEN_INSN_LIST *insn_list; -- CGEN_EXTRACT_INFO ex_info; -- int basesize; -- -- /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ -- basesize = cd->base_insn_bitsize < buflen * 8 ? -- cd->base_insn_bitsize : buflen * 8; -- insn_value = cgen_get_insn_value (cd, buf, basesize); -- -- -- /* Fill in ex_info fields like read_insn would. Don't actually call -- read_insn, since the incoming buffer is already read (and possibly -- modified a la m32r). */ -- ex_info.valid = (1 << buflen) - 1; -- ex_info.dis_info = info; -- ex_info.insn_bytes = buf; -- -- /* The instructions are stored in hash lists. -- Pick the first one and keep trying until we find the right one. */ -- -- insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value); -- while (insn_list != NULL) -- { -- const CGEN_INSN *insn = insn_list->insn; -- CGEN_FIELDS fields; -- int length; -- unsigned long insn_value_cropped; -- --#ifdef CGEN_VALIDATE_INSN_SUPPORTED -- /* Not needed as insn shouldn't be in hash lists if not supported. */ -- /* Supported by this cpu? */ -- if (! openrisc_cgen_insn_supported (cd, insn)) -- { -- insn_list = CGEN_DIS_NEXT_INSN (insn_list); -- continue; -- } --#endif -- -- /* Basic bit mask must be correct. */ -- /* ??? May wish to allow target to defer this check until the extract -- handler. */ -- -- /* Base size may exceed this instruction's size. Extract the -- relevant part from the buffer. */ -- if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen && -- (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) -- insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), -- info->endian == BFD_ENDIAN_BIG); -- else -- insn_value_cropped = insn_value; -- -- if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) -- == CGEN_INSN_BASE_VALUE (insn)) -- { -- /* Printing is handled in two passes. The first pass parses the -- machine insn and extracts the fields. The second pass prints -- them. */ -- -- /* Make sure the entire insn is loaded into insn_value, if it -- can fit. */ -- if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) && -- (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) -- { -- unsigned long full_insn_value; -- int rc = read_insn (cd, pc, info, buf, -- CGEN_INSN_BITSIZE (insn) / 8, -- & ex_info, & full_insn_value); -- if (rc != 0) -- return rc; -- length = CGEN_EXTRACT_FN (cd, insn) -- (cd, insn, &ex_info, full_insn_value, &fields, pc); -- } -- else -- length = CGEN_EXTRACT_FN (cd, insn) -- (cd, insn, &ex_info, insn_value_cropped, &fields, pc); -- -- /* Length < 0 -> error. */ -- if (length < 0) -- return length; -- if (length > 0) -- { -- CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length); -- /* Length is in bits, result is in bytes. */ -- return length / 8; -- } -- } -- -- insn_list = CGEN_DIS_NEXT_INSN (insn_list); -- } -- -- return 0; --} -- --/* Default value for CGEN_PRINT_INSN. -- The result is the size of the insn in bytes or zero for an unknown insn -- or -1 if an error occured fetching bytes. */ -- --#ifndef CGEN_PRINT_INSN --#define CGEN_PRINT_INSN default_print_insn --#endif -- --static int --default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info) --{ -- bfd_byte buf[CGEN_MAX_INSN_SIZE]; -- int buflen; -- int status; -- -- /* Attempt to read the base part of the insn. */ -- buflen = cd->base_insn_bitsize / 8; -- status = (*info->read_memory_func) (pc, buf, buflen, info); -- -- /* Try again with the minimum part, if min < base. */ -- if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) -- { -- buflen = cd->min_insn_bitsize / 8; -- status = (*info->read_memory_func) (pc, buf, buflen, info); -- } -- -- if (status != 0) -- { -- (*info->memory_error_func) (status, pc, info); -- return -1; -- } -- -- return print_insn (cd, pc, info, buf, buflen); --} -- --/* Main entry point. -- Print one instruction from PC on INFO->STREAM. -- Return the size of the instruction (in bytes). */ -- --typedef struct cpu_desc_list --{ -- struct cpu_desc_list *next; -- CGEN_BITSET *isa; -- int mach; -- int endian; -- CGEN_CPU_DESC cd; --} cpu_desc_list; -- --int --print_insn_openrisc (bfd_vma pc, disassemble_info *info) --{ -- static cpu_desc_list *cd_list = 0; -- cpu_desc_list *cl = 0; -- static CGEN_CPU_DESC cd = 0; -- static CGEN_BITSET *prev_isa; -- static int prev_mach; -- static int prev_endian; -- int length; -- CGEN_BITSET *isa; -- int mach; -- int endian = (info->endian == BFD_ENDIAN_BIG -- ? CGEN_ENDIAN_BIG -- : CGEN_ENDIAN_LITTLE); -- enum bfd_architecture arch; -- -- /* ??? gdb will set mach but leave the architecture as "unknown" */ --#ifndef CGEN_BFD_ARCH --#define CGEN_BFD_ARCH bfd_arch_openrisc --#endif -- arch = info->arch; -- if (arch == bfd_arch_unknown) -- arch = CGEN_BFD_ARCH; -- -- /* There's no standard way to compute the machine or isa number -- so we leave it to the target. */ --#ifdef CGEN_COMPUTE_MACH -- mach = CGEN_COMPUTE_MACH (info); --#else -- mach = info->mach; --#endif -- --#ifdef CGEN_COMPUTE_ISA -- { -- static CGEN_BITSET *permanent_isa; -- -- if (!permanent_isa) -- permanent_isa = cgen_bitset_create (MAX_ISAS); -- isa = permanent_isa; -- cgen_bitset_clear (isa); -- cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info)); -- } --#else -- isa = info->insn_sets; --#endif -- -- /* If we've switched cpu's, try to find a handle we've used before */ -- if (cd -- && (cgen_bitset_compare (isa, prev_isa) != 0 -- || mach != prev_mach -- || endian != prev_endian)) -- { -- cd = 0; -- for (cl = cd_list; cl; cl = cl->next) -- { -- if (cgen_bitset_compare (cl->isa, isa) == 0 && -- cl->mach == mach && -- cl->endian == endian) -- { -- cd = cl->cd; -- prev_isa = cd->isas; -- break; -- } -- } -- } -- -- /* If we haven't initialized yet, initialize the opcode table. */ -- if (! cd) -- { -- const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach); -- const char *mach_name; -- -- if (!arch_type) -- abort (); -- mach_name = arch_type->printable_name; -- -- prev_isa = cgen_bitset_copy (isa); -- prev_mach = mach; -- prev_endian = endian; -- cd = openrisc_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa, -- CGEN_CPU_OPEN_BFDMACH, mach_name, -- CGEN_CPU_OPEN_ENDIAN, prev_endian, -- CGEN_CPU_OPEN_END); -- if (!cd) -- abort (); -- -- /* Save this away for future reference. */ -- cl = xmalloc (sizeof (struct cpu_desc_list)); -- cl->cd = cd; -- cl->isa = prev_isa; -- cl->mach = mach; -- cl->endian = endian; -- cl->next = cd_list; -- cd_list = cl; -- -- openrisc_cgen_init_dis (cd); -- } -- -- /* We try to have as much common code as possible. -- But at this point some targets need to take over. */ -- /* ??? Some targets may need a hook elsewhere. Try to avoid this, -- but if not possible try to move this hook elsewhere rather than -- have two hooks. */ -- length = CGEN_PRINT_INSN (cd, pc, info); -- if (length > 0) -- return length; -- if (length < 0) -- return -1; -- -- (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG); -- return cd->default_insn_bitsize / 8; --} -diff -rNU3 dist.orig/opcodes/openrisc-ibld.c dist/opcodes/openrisc-ibld.c ---- dist.orig/opcodes/openrisc-ibld.c 2010-01-07 19:05:45.000000000 +0100 -+++ dist/opcodes/openrisc-ibld.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,1009 +0,0 @@ --/* Instruction building/extraction support for openrisc. -*- C -*- -- -- THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator. -- - the resultant file is machine generated, cgen-ibld.in isn't -- -- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006, 2007, -- 2008, 2010 Free Software Foundation, Inc. -- -- This file is part of libopcodes. -- -- This library is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -- --/* ??? Eventually more and more of this stuff can go to cpu-independent files. -- Keep that in mind. */ -- --#include "sysdep.h" --#include --#include "ansidecl.h" --#include "dis-asm.h" --#include "bfd.h" --#include "symcat.h" --#include "openrisc-desc.h" --#include "openrisc-opc.h" --#include "cgen/basic-modes.h" --#include "opintl.h" --#include "safe-ctype.h" -- --#undef min --#define min(a,b) ((a) < (b) ? (a) : (b)) --#undef max --#define max(a,b) ((a) > (b) ? (a) : (b)) -- --/* Used by the ifield rtx function. */ --#define FLD(f) (fields->f) -- --static const char * insert_normal -- (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int, -- unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR); --static const char * insert_insn_normal -- (CGEN_CPU_DESC, const CGEN_INSN *, -- CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma); --static int extract_normal -- (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, -- unsigned int, unsigned int, unsigned int, unsigned int, -- unsigned int, unsigned int, bfd_vma, long *); --static int extract_insn_normal -- (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *, -- CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma); --#if CGEN_INT_INSN_P --static void put_insn_int_value -- (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT); --#endif --#if ! CGEN_INT_INSN_P --static CGEN_INLINE void insert_1 -- (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *); --static CGEN_INLINE int fill_cache -- (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma); --static CGEN_INLINE long extract_1 -- (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma); --#endif -- --/* Operand insertion. */ -- --#if ! CGEN_INT_INSN_P -- --/* Subroutine of insert_normal. */ -- --static CGEN_INLINE void --insert_1 (CGEN_CPU_DESC cd, -- unsigned long value, -- int start, -- int length, -- int word_length, -- unsigned char *bufp) --{ -- unsigned long x,mask; -- int shift; -- -- x = cgen_get_insn_value (cd, bufp, word_length); -- -- /* Written this way to avoid undefined behaviour. */ -- mask = (((1L << (length - 1)) - 1) << 1) | 1; -- if (CGEN_INSN_LSB0_P) -- shift = (start + 1) - length; -- else -- shift = (word_length - (start + length)); -- x = (x & ~(mask << shift)) | ((value & mask) << shift); -- -- cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x); --} -- --#endif /* ! CGEN_INT_INSN_P */ -- --/* Default insertion routine. -- -- ATTRS is a mask of the boolean attributes. -- WORD_OFFSET is the offset in bits from the start of the insn of the value. -- WORD_LENGTH is the length of the word in bits in which the value resides. -- START is the starting bit number in the word, architecture origin. -- LENGTH is the length of VALUE in bits. -- TOTAL_LENGTH is the total length of the insn in bits. -- -- The result is an error message or NULL if success. */ -- --/* ??? This duplicates functionality with bfd's howto table and -- bfd_install_relocation. */ --/* ??? This doesn't handle bfd_vma's. Create another function when -- necessary. */ -- --static const char * --insert_normal (CGEN_CPU_DESC cd, -- long value, -- unsigned int attrs, -- unsigned int word_offset, -- unsigned int start, -- unsigned int length, -- unsigned int word_length, -- unsigned int total_length, -- CGEN_INSN_BYTES_PTR buffer) --{ -- static char errbuf[100]; -- /* Written this way to avoid undefined behaviour. */ -- unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1; -- -- /* If LENGTH is zero, this operand doesn't contribute to the value. */ -- if (length == 0) -- return NULL; -- -- if (word_length > 8 * sizeof (CGEN_INSN_INT)) -- abort (); -- -- /* For architectures with insns smaller than the base-insn-bitsize, -- word_length may be too big. */ -- if (cd->min_insn_bitsize < cd->base_insn_bitsize) -- { -- if (word_offset == 0 -- && word_length > total_length) -- word_length = total_length; -- } -- -- /* Ensure VALUE will fit. */ -- if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) -- { -- long minval = - (1L << (length - 1)); -- unsigned long maxval = mask; -- -- if ((value > 0 && (unsigned long) value > maxval) -- || value < minval) -- { -- /* xgettext:c-format */ -- sprintf (errbuf, -- _("operand out of range (%ld not between %ld and %lu)"), -- value, minval, maxval); -- return errbuf; -- } -- } -- else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) -- { -- unsigned long maxval = mask; -- unsigned long val = (unsigned long) value; -- -- /* For hosts with a word size > 32 check to see if value has been sign -- extended beyond 32 bits. If so then ignore these higher sign bits -- as the user is attempting to store a 32-bit signed value into an -- unsigned 32-bit field which is allowed. */ -- if (sizeof (unsigned long) > 4 && ((value >> 32) == -1)) -- val &= 0xFFFFFFFF; -- -- if (val > maxval) -- { -- /* xgettext:c-format */ -- sprintf (errbuf, -- _("operand out of range (0x%lx not between 0 and 0x%lx)"), -- val, maxval); -- return errbuf; -- } -- } -- else -- { -- if (! cgen_signed_overflow_ok_p (cd)) -- { -- long minval = - (1L << (length - 1)); -- long maxval = (1L << (length - 1)) - 1; -- -- if (value < minval || value > maxval) -- { -- sprintf -- /* xgettext:c-format */ -- (errbuf, _("operand out of range (%ld not between %ld and %ld)"), -- value, minval, maxval); -- return errbuf; -- } -- } -- } -- --#if CGEN_INT_INSN_P -- -- { -- int shift; -- -- if (CGEN_INSN_LSB0_P) -- shift = (word_offset + start + 1) - length; -- else -- shift = total_length - (word_offset + start + length); -- *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift); -- } -- --#else /* ! CGEN_INT_INSN_P */ -- -- { -- unsigned char *bufp = (unsigned char *) buffer + word_offset / 8; -- -- insert_1 (cd, value, start, length, word_length, bufp); -- } -- --#endif /* ! CGEN_INT_INSN_P */ -- -- return NULL; --} -- --/* Default insn builder (insert handler). -- The instruction is recorded in CGEN_INT_INSN_P byte order (meaning -- that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is -- recorded in host byte order, otherwise BUFFER is an array of bytes -- and the value is recorded in target byte order). -- The result is an error message or NULL if success. */ -- --static const char * --insert_insn_normal (CGEN_CPU_DESC cd, -- const CGEN_INSN * insn, -- CGEN_FIELDS * fields, -- CGEN_INSN_BYTES_PTR buffer, -- bfd_vma pc) --{ -- const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -- unsigned long value; -- const CGEN_SYNTAX_CHAR_TYPE * syn; -- -- CGEN_INIT_INSERT (cd); -- value = CGEN_INSN_BASE_VALUE (insn); -- -- /* If we're recording insns as numbers (rather than a string of bytes), -- target byte order handling is deferred until later. */ -- --#if CGEN_INT_INSN_P -- -- put_insn_int_value (cd, buffer, cd->base_insn_bitsize, -- CGEN_FIELDS_BITSIZE (fields), value); -- --#else -- -- cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize, -- (unsigned) CGEN_FIELDS_BITSIZE (fields)), -- value); -- --#endif /* ! CGEN_INT_INSN_P */ -- -- /* ??? It would be better to scan the format's fields. -- Still need to be able to insert a value based on the operand though; -- e.g. storing a branch displacement that got resolved later. -- Needs more thought first. */ -- -- for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn) -- { -- const char *errmsg; -- -- if (CGEN_SYNTAX_CHAR_P (* syn)) -- continue; -- -- errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn), -- fields, buffer, pc); -- if (errmsg) -- return errmsg; -- } -- -- return NULL; --} -- --#if CGEN_INT_INSN_P --/* Cover function to store an insn value into an integral insn. Must go here -- because it needs -desc.h for CGEN_INT_INSN_P. */ -- --static void --put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- CGEN_INSN_BYTES_PTR buf, -- int length, -- int insn_length, -- CGEN_INSN_INT value) --{ -- /* For architectures with insns smaller than the base-insn-bitsize, -- length may be too big. */ -- if (length > insn_length) -- *buf = value; -- else -- { -- int shift = insn_length - length; -- /* Written this way to avoid undefined behaviour. */ -- CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1; -- -- *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift); -- } --} --#endif -- --/* Operand extraction. */ -- --#if ! CGEN_INT_INSN_P -- --/* Subroutine of extract_normal. -- Ensure sufficient bytes are cached in EX_INFO. -- OFFSET is the offset in bytes from the start of the insn of the value. -- BYTES is the length of the needed value. -- Returns 1 for success, 0 for failure. */ -- --static CGEN_INLINE int --fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- CGEN_EXTRACT_INFO *ex_info, -- int offset, -- int bytes, -- bfd_vma pc) --{ -- /* It's doubtful that the middle part has already been fetched so -- we don't optimize that case. kiss. */ -- unsigned int mask; -- disassemble_info *info = (disassemble_info *) ex_info->dis_info; -- -- /* First do a quick check. */ -- mask = (1 << bytes) - 1; -- if (((ex_info->valid >> offset) & mask) == mask) -- return 1; -- -- /* Search for the first byte we need to read. */ -- for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1) -- if (! (mask & ex_info->valid)) -- break; -- -- if (bytes) -- { -- int status; -- -- pc += offset; -- status = (*info->read_memory_func) -- (pc, ex_info->insn_bytes + offset, bytes, info); -- -- if (status != 0) -- { -- (*info->memory_error_func) (status, pc, info); -- return 0; -- } -- -- ex_info->valid |= ((1 << bytes) - 1) << offset; -- } -- -- return 1; --} -- --/* Subroutine of extract_normal. */ -- --static CGEN_INLINE long --extract_1 (CGEN_CPU_DESC cd, -- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED, -- int start, -- int length, -- int word_length, -- unsigned char *bufp, -- bfd_vma pc ATTRIBUTE_UNUSED) --{ -- unsigned long x; -- int shift; -- -- x = cgen_get_insn_value (cd, bufp, word_length); -- -- if (CGEN_INSN_LSB0_P) -- shift = (start + 1) - length; -- else -- shift = (word_length - (start + length)); -- return x >> shift; --} -- --#endif /* ! CGEN_INT_INSN_P */ -- --/* Default extraction routine. -- -- INSN_VALUE is the first base_insn_bitsize bits of the insn in host order, -- or sometimes less for cases like the m32r where the base insn size is 32 -- but some insns are 16 bits. -- ATTRS is a mask of the boolean attributes. We only need `SIGNED', -- but for generality we take a bitmask of all of them. -- WORD_OFFSET is the offset in bits from the start of the insn of the value. -- WORD_LENGTH is the length of the word in bits in which the value resides. -- START is the starting bit number in the word, architecture origin. -- LENGTH is the length of VALUE in bits. -- TOTAL_LENGTH is the total length of the insn in bits. -- -- Returns 1 for success, 0 for failure. */ -- --/* ??? The return code isn't properly used. wip. */ -- --/* ??? This doesn't handle bfd_vma's. Create another function when -- necessary. */ -- --static int --extract_normal (CGEN_CPU_DESC cd, --#if ! CGEN_INT_INSN_P -- CGEN_EXTRACT_INFO *ex_info, --#else -- CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED, --#endif -- CGEN_INSN_INT insn_value, -- unsigned int attrs, -- unsigned int word_offset, -- unsigned int start, -- unsigned int length, -- unsigned int word_length, -- unsigned int total_length, --#if ! CGEN_INT_INSN_P -- bfd_vma pc, --#else -- bfd_vma pc ATTRIBUTE_UNUSED, --#endif -- long *valuep) --{ -- long value, mask; -- -- /* If LENGTH is zero, this operand doesn't contribute to the value -- so give it a standard value of zero. */ -- if (length == 0) -- { -- *valuep = 0; -- return 1; -- } -- -- if (word_length > 8 * sizeof (CGEN_INSN_INT)) -- abort (); -- -- /* For architectures with insns smaller than the insn-base-bitsize, -- word_length may be too big. */ -- if (cd->min_insn_bitsize < cd->base_insn_bitsize) -- { -- if (word_offset + word_length > total_length) -- word_length = total_length - word_offset; -- } -- -- /* Does the value reside in INSN_VALUE, and at the right alignment? */ -- -- if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length)) -- { -- if (CGEN_INSN_LSB0_P) -- value = insn_value >> ((word_offset + start + 1) - length); -- else -- value = insn_value >> (total_length - ( word_offset + start + length)); -- } -- --#if ! CGEN_INT_INSN_P -- -- else -- { -- unsigned char *bufp = ex_info->insn_bytes + word_offset / 8; -- -- if (word_length > 8 * sizeof (CGEN_INSN_INT)) -- abort (); -- -- if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0) -- return 0; -- -- value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc); -- } -- --#endif /* ! CGEN_INT_INSN_P */ -- -- /* Written this way to avoid undefined behaviour. */ -- mask = (((1L << (length - 1)) - 1) << 1) | 1; -- -- value &= mask; -- /* sign extend? */ -- if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED) -- && (value & (1L << (length - 1)))) -- value |= ~mask; -- -- *valuep = value; -- -- return 1; --} -- --/* Default insn extractor. -- -- INSN_VALUE is the first base_insn_bitsize bits, translated to host order. -- The extracted fields are stored in FIELDS. -- EX_INFO is used to handle reading variable length insns. -- Return the length of the insn in bits, or 0 if no match, -- or -1 if an error occurs fetching data (memory_error_func will have -- been called). */ -- --static int --extract_insn_normal (CGEN_CPU_DESC cd, -- const CGEN_INSN *insn, -- CGEN_EXTRACT_INFO *ex_info, -- CGEN_INSN_INT insn_value, -- CGEN_FIELDS *fields, -- bfd_vma pc) --{ -- const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -- const CGEN_SYNTAX_CHAR_TYPE *syn; -- -- CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); -- -- CGEN_INIT_EXTRACT (cd); -- -- for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) -- { -- int length; -- -- if (CGEN_SYNTAX_CHAR_P (*syn)) -- continue; -- -- length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn), -- ex_info, insn_value, fields, pc); -- if (length <= 0) -- return length; -- } -- -- /* We recognized and successfully extracted this insn. */ -- return CGEN_INSN_BITSIZE (insn); --} -- --/* Machine generated code added here. */ -- --const char * openrisc_cgen_insert_operand -- (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma); -- --/* Main entry point for operand insertion. -- -- This function is basically just a big switch statement. Earlier versions -- used tables to look up the function to use, but -- - if the table contains both assembler and disassembler functions then -- the disassembler contains much of the assembler and vice-versa, -- - there's a lot of inlining possibilities as things grow, -- - using a switch statement avoids the function call overhead. -- -- This function could be moved into `parse_insn_normal', but keeping it -- separate makes clear the interface between `parse_insn_normal' and each of -- the handlers. It's also needed by GAS to insert operands that couldn't be -- resolved during parsing. */ -- --const char * --openrisc_cgen_insert_operand (CGEN_CPU_DESC cd, -- int opindex, -- CGEN_FIELDS * fields, -- CGEN_INSN_BYTES_PTR buffer, -- bfd_vma pc ATTRIBUTE_UNUSED) --{ -- const char * errmsg = NULL; -- unsigned int total_length = CGEN_FIELDS_BITSIZE (fields); -- -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- { -- long value = fields->f_abs26; -- value = ((SI) (pc) >> (2)); -- errmsg = insert_normal (cd, value, 0|(1<f_disp26; -- value = ((SI) (((value) - (pc))) >> (2)); -- errmsg = insert_normal (cd, value, 0|(1<f_simm16, 0|(1<f_lo16, 0|(1<f_op4, 0, 0, 23, 3, 32, total_length, buffer); -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- errmsg = insert_normal (cd, fields->f_op5, 0, 0, 25, 5, 32, total_length, buffer); -- break; -- case OPENRISC_OPERAND_RA : -- errmsg = insert_normal (cd, fields->f_r2, 0, 0, 20, 5, 32, total_length, buffer); -- break; -- case OPENRISC_OPERAND_RB : -- errmsg = insert_normal (cd, fields->f_r3, 0, 0, 15, 5, 32, total_length, buffer); -- break; -- case OPENRISC_OPERAND_RD : -- errmsg = insert_normal (cd, fields->f_r1, 0, 0, 25, 5, 32, total_length, buffer); -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- errmsg = insert_normal (cd, fields->f_simm16, 0|(1<> (11))) & (31)); -- FLD (f_i16_1) = ((FLD (f_i16nc)) & (2047)); --} -- errmsg = insert_normal (cd, fields->f_i16_1, 0, 0, 10, 11, 32, total_length, buffer); -- if (errmsg) -- break; -- errmsg = insert_normal (cd, fields->f_i16_2, 0, 0, 25, 5, 32, total_length, buffer); -- if (errmsg) -- break; -- } -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- errmsg = insert_normal (cd, fields->f_uimm16, 0, 0, 15, 16, 32, total_length, buffer); -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- errmsg = insert_normal (cd, fields->f_uimm5, 0, 0, 4, 5, 32, total_length, buffer); -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while building insn.\n"), -- opindex); -- abort (); -- } -- -- return errmsg; --} -- --int openrisc_cgen_extract_operand -- (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma); -- --/* Main entry point for operand extraction. -- The result is <= 0 for error, >0 for success. -- ??? Actual values aren't well defined right now. -- -- This function is basically just a big switch statement. Earlier versions -- used tables to look up the function to use, but -- - if the table contains both assembler and disassembler functions then -- the disassembler contains much of the assembler and vice-versa, -- - there's a lot of inlining possibilities as things grow, -- - using a switch statement avoids the function call overhead. -- -- This function could be moved into `print_insn_normal', but keeping it -- separate makes clear the interface between `print_insn_normal' and each of -- the handlers. */ -- --int --openrisc_cgen_extract_operand (CGEN_CPU_DESC cd, -- int opindex, -- CGEN_EXTRACT_INFO *ex_info, -- CGEN_INSN_INT insn_value, -- CGEN_FIELDS * fields, -- bfd_vma pc) --{ -- /* Assume success (for those operands that are nops). */ -- int length = 1; -- unsigned int total_length = CGEN_FIELDS_BITSIZE (fields); -- -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- { -- long value; -- length = extract_normal (cd, ex_info, insn_value, 0|(1<f_abs26 = value; -- } -- break; -- case OPENRISC_OPERAND_DISP_26 : -- { -- long value; -- length = extract_normal (cd, ex_info, insn_value, 0|(1<f_disp26 = value; -- } -- break; -- case OPENRISC_OPERAND_HI16 : -- length = extract_normal (cd, ex_info, insn_value, 0|(1<f_simm16); -- break; -- case OPENRISC_OPERAND_LO16 : -- length = extract_normal (cd, ex_info, insn_value, 0|(1<f_lo16); -- break; -- case OPENRISC_OPERAND_OP_F_23 : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 3, 32, total_length, pc, & fields->f_op4); -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_op5); -- break; -- case OPENRISC_OPERAND_RA : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 5, 32, total_length, pc, & fields->f_r2); -- break; -- case OPENRISC_OPERAND_RB : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 5, 32, total_length, pc, & fields->f_r3); -- break; -- case OPENRISC_OPERAND_RD : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_r1); -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- length = extract_normal (cd, ex_info, insn_value, 0|(1<f_simm16); -- break; -- case OPENRISC_OPERAND_UI16NC : -- { -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 11, 32, total_length, pc, & fields->f_i16_1); -- if (length <= 0) break; -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_i16_2); -- if (length <= 0) break; --{ -- FLD (f_i16nc) = openrisc_sign_extend_16bit (((((FLD (f_i16_2)) << (11))) | (FLD (f_i16_1)))); --} -- } -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_uimm16); -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 5, 32, total_length, pc, & fields->f_uimm5); -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"), -- opindex); -- abort (); -- } -- -- return length; --} -- --cgen_insert_fn * const openrisc_cgen_insert_handlers[] = --{ -- insert_insn_normal, --}; -- --cgen_extract_fn * const openrisc_cgen_extract_handlers[] = --{ -- extract_insn_normal, --}; -- --int openrisc_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *); --bfd_vma openrisc_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *); -- --/* Getting values from cgen_fields is handled by a collection of functions. -- They are distinguished by the type of the VALUE argument they return. -- TODO: floating point, inlining support, remove cases where result type -- not appropriate. */ -- --int --openrisc_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- int opindex, -- const CGEN_FIELDS * fields) --{ -- int value; -- -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- value = fields->f_abs26; -- break; -- case OPENRISC_OPERAND_DISP_26 : -- value = fields->f_disp26; -- break; -- case OPENRISC_OPERAND_HI16 : -- value = fields->f_simm16; -- break; -- case OPENRISC_OPERAND_LO16 : -- value = fields->f_lo16; -- break; -- case OPENRISC_OPERAND_OP_F_23 : -- value = fields->f_op4; -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- value = fields->f_op5; -- break; -- case OPENRISC_OPERAND_RA : -- value = fields->f_r2; -- break; -- case OPENRISC_OPERAND_RB : -- value = fields->f_r3; -- break; -- case OPENRISC_OPERAND_RD : -- value = fields->f_r1; -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- value = fields->f_simm16; -- break; -- case OPENRISC_OPERAND_UI16NC : -- value = fields->f_i16nc; -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- value = fields->f_uimm16; -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- value = fields->f_uimm5; -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"), -- opindex); -- abort (); -- } -- -- return value; --} -- --bfd_vma --openrisc_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- int opindex, -- const CGEN_FIELDS * fields) --{ -- bfd_vma value; -- -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- value = fields->f_abs26; -- break; -- case OPENRISC_OPERAND_DISP_26 : -- value = fields->f_disp26; -- break; -- case OPENRISC_OPERAND_HI16 : -- value = fields->f_simm16; -- break; -- case OPENRISC_OPERAND_LO16 : -- value = fields->f_lo16; -- break; -- case OPENRISC_OPERAND_OP_F_23 : -- value = fields->f_op4; -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- value = fields->f_op5; -- break; -- case OPENRISC_OPERAND_RA : -- value = fields->f_r2; -- break; -- case OPENRISC_OPERAND_RB : -- value = fields->f_r3; -- break; -- case OPENRISC_OPERAND_RD : -- value = fields->f_r1; -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- value = fields->f_simm16; -- break; -- case OPENRISC_OPERAND_UI16NC : -- value = fields->f_i16nc; -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- value = fields->f_uimm16; -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- value = fields->f_uimm5; -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"), -- opindex); -- abort (); -- } -- -- return value; --} -- --void openrisc_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int); --void openrisc_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma); -- --/* Stuffing values in cgen_fields is handled by a collection of functions. -- They are distinguished by the type of the VALUE argument they accept. -- TODO: floating point, inlining support, remove cases where argument type -- not appropriate. */ -- --void --openrisc_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- int opindex, -- CGEN_FIELDS * fields, -- int value) --{ -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- fields->f_abs26 = value; -- break; -- case OPENRISC_OPERAND_DISP_26 : -- fields->f_disp26 = value; -- break; -- case OPENRISC_OPERAND_HI16 : -- fields->f_simm16 = value; -- break; -- case OPENRISC_OPERAND_LO16 : -- fields->f_lo16 = value; -- break; -- case OPENRISC_OPERAND_OP_F_23 : -- fields->f_op4 = value; -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- fields->f_op5 = value; -- break; -- case OPENRISC_OPERAND_RA : -- fields->f_r2 = value; -- break; -- case OPENRISC_OPERAND_RB : -- fields->f_r3 = value; -- break; -- case OPENRISC_OPERAND_RD : -- fields->f_r1 = value; -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- fields->f_simm16 = value; -- break; -- case OPENRISC_OPERAND_UI16NC : -- fields->f_i16nc = value; -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- fields->f_uimm16 = value; -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- fields->f_uimm5 = value; -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"), -- opindex); -- abort (); -- } --} -- --void --openrisc_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -- int opindex, -- CGEN_FIELDS * fields, -- bfd_vma value) --{ -- switch (opindex) -- { -- case OPENRISC_OPERAND_ABS_26 : -- fields->f_abs26 = value; -- break; -- case OPENRISC_OPERAND_DISP_26 : -- fields->f_disp26 = value; -- break; -- case OPENRISC_OPERAND_HI16 : -- fields->f_simm16 = value; -- break; -- case OPENRISC_OPERAND_LO16 : -- fields->f_lo16 = value; -- break; -- case OPENRISC_OPERAND_OP_F_23 : -- fields->f_op4 = value; -- break; -- case OPENRISC_OPERAND_OP_F_3 : -- fields->f_op5 = value; -- break; -- case OPENRISC_OPERAND_RA : -- fields->f_r2 = value; -- break; -- case OPENRISC_OPERAND_RB : -- fields->f_r3 = value; -- break; -- case OPENRISC_OPERAND_RD : -- fields->f_r1 = value; -- break; -- case OPENRISC_OPERAND_SIMM_16 : -- fields->f_simm16 = value; -- break; -- case OPENRISC_OPERAND_UI16NC : -- fields->f_i16nc = value; -- break; -- case OPENRISC_OPERAND_UIMM_16 : -- fields->f_uimm16 = value; -- break; -- case OPENRISC_OPERAND_UIMM_5 : -- fields->f_uimm5 = value; -- break; -- -- default : -- /* xgettext:c-format */ -- fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"), -- opindex); -- abort (); -- } --} -- --/* Function to call before using the instruction builder tables. */ -- --void --openrisc_cgen_init_ibld_table (CGEN_CPU_DESC cd) --{ -- cd->insert_handlers = & openrisc_cgen_insert_handlers[0]; -- cd->extract_handlers = & openrisc_cgen_extract_handlers[0]; -- -- cd->insert_operand = openrisc_cgen_insert_operand; -- cd->extract_operand = openrisc_cgen_extract_operand; -- -- cd->get_int_operand = openrisc_cgen_get_int_operand; -- cd->set_int_operand = openrisc_cgen_set_int_operand; -- cd->get_vma_operand = openrisc_cgen_get_vma_operand; -- cd->set_vma_operand = openrisc_cgen_set_vma_operand; --} -diff -rNU3 dist.orig/opcodes/openrisc-opc.c dist/opcodes/openrisc-opc.c ---- dist.orig/opcodes/openrisc-opc.c 2010-02-12 04:25:49.000000000 +0100 -+++ dist/opcodes/openrisc-opc.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,682 +0,0 @@ --/* Instruction opcode table for openrisc. -- --THIS FILE IS MACHINE GENERATED WITH CGEN. -- --Copyright 1996-2010 Free Software Foundation, Inc. -- --This file is part of the GNU Binutils and/or GDB, the GNU debugger. -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License along -- with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -- --*/ -- --#include "sysdep.h" --#include "ansidecl.h" --#include "bfd.h" --#include "symcat.h" --#include "openrisc-desc.h" --#include "openrisc-opc.h" --#include "libiberty.h" -- --/* -- opc.c */ --/* -- */ --/* The hash functions are recorded here to help keep assembler code out of -- the disassembler and vice versa. */ -- --static int asm_hash_insn_p (const CGEN_INSN *); --static unsigned int asm_hash_insn (const char *); --static int dis_hash_insn_p (const CGEN_INSN *); --static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT); -- --/* Instruction formats. */ -- --#define F(f) & openrisc_cgen_ifld_table[OPENRISC_##f] --static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = { -- 0, 0, 0x0, { { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_j ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_ABS26) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_jr ATTRIBUTE_UNUSED = { -- 32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP3) }, { F (F_OP4) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_bal ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_DISP26) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_movhi ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_mfsr ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_mtsr ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_I16_1) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_lw ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_sw ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R3) }, { F (F_I16NC) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_sll ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_3) }, { F (F_OP6) }, { F (F_F_4_1) }, { F (F_OP7) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_slli ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc00ffe0, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_F_15_8) }, { F (F_OP6) }, { F (F_UIMM5) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_add ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_7) }, { F (F_OP7) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_addi ATTRIBUTE_UNUSED = { -- 32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_LO16) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_sfgts ATTRIBUTE_UNUSED = { -- 32, 32, 0xffe007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_11) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_sfgtsi ATTRIBUTE_UNUSED = { -- 32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } } --}; -- --static const CGEN_IFMT ifmt_l_sfgtui ATTRIBUTE_UNUSED = { -- 32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } } --}; -- --#undef F -- --#define A(a) (1 << CGEN_INSN_##a) --#define OPERAND(op) OPENRISC_OPERAND_##op --#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */ --#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field)) -- --/* The instruction table. */ -- --static const CGEN_OPCODE openrisc_cgen_insn_opcode_table[MAX_INSNS] = --{ -- /* Special null first entry. -- A `num' value of zero is thus invalid. -- Also, the special `invalid' insn resides here. */ -- { { 0, 0, 0, 0 }, {{0}}, 0, {0}}, --/* l.j ${abs-26} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (ABS_26), 0 } }, -- & ifmt_l_j, { 0x0 } -- }, --/* l.jal ${abs-26} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (ABS_26), 0 } }, -- & ifmt_l_j, { 0x4000000 } -- }, --/* l.jr $rA */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), 0 } }, -- & ifmt_l_jr, { 0x14000000 } -- }, --/* l.jalr $rA */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), 0 } }, -- & ifmt_l_jr, { 0x14200000 } -- }, --/* l.bal ${disp-26} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (DISP_26), 0 } }, -- & ifmt_l_bal, { 0x8000000 } -- }, --/* l.bnf ${disp-26} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (DISP_26), 0 } }, -- & ifmt_l_bal, { 0xc000000 } -- }, --/* l.bf ${disp-26} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (DISP_26), 0 } }, -- & ifmt_l_bal, { 0x10000000 } -- }, --/* l.brk ${uimm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (UIMM_16), 0 } }, -- & ifmt_l_jr, { 0x17000000 } -- }, --/* l.rfe $rA */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), 0 } }, -- & ifmt_l_jr, { 0x14400000 } -- }, --/* l.sys ${uimm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (UIMM_16), 0 } }, -- & ifmt_l_jr, { 0x16000000 } -- }, --/* l.nop */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, 0 } }, -- & ifmt_l_jr, { 0x15000000 } -- }, --/* l.movhi $rD,$hi16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (HI16), 0 } }, -- & ifmt_l_movhi, { 0x18000000 } -- }, --/* l.mfsr $rD,$rA */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -- & ifmt_l_mfsr, { 0x1c000000 } -- }, --/* l.mtsr $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_mtsr, { 0x40000000 } -- }, --/* l.lw $rD,${simm-16}($rA) */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } }, -- & ifmt_l_lw, { 0x80000000 } -- }, --/* l.lbz $rD,${simm-16}($rA) */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } }, -- & ifmt_l_lw, { 0x84000000 } -- }, --/* l.lbs $rD,${simm-16}($rA) */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } }, -- & ifmt_l_lw, { 0x88000000 } -- }, --/* l.lhz $rD,${simm-16}($rA) */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } }, -- & ifmt_l_lw, { 0x8c000000 } -- }, --/* l.lhs $rD,${simm-16}($rA) */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } }, -- & ifmt_l_lw, { 0x90000000 } -- }, --/* l.sw ${ui16nc}($rA),$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } }, -- & ifmt_l_sw, { 0xd4000000 } -- }, --/* l.sb ${ui16nc}($rA),$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } }, -- & ifmt_l_sw, { 0xd8000000 } -- }, --/* l.sh ${ui16nc}($rA),$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } }, -- & ifmt_l_sw, { 0xdc000000 } -- }, --/* l.sll $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sll, { 0xe0000008 } -- }, --/* l.slli $rD,$rA,${uimm-5} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } }, -- & ifmt_l_slli, { 0xb4000000 } -- }, --/* l.srl $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sll, { 0xe0000028 } -- }, --/* l.srli $rD,$rA,${uimm-5} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } }, -- & ifmt_l_slli, { 0xb4000020 } -- }, --/* l.sra $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sll, { 0xe0000048 } -- }, --/* l.srai $rD,$rA,${uimm-5} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } }, -- & ifmt_l_slli, { 0xb4000040 } -- }, --/* l.ror $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sll, { 0xe0000088 } -- }, --/* l.rori $rD,$rA,${uimm-5} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } }, -- & ifmt_l_slli, { 0xb4000080 } -- }, --/* l.add $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000000 } -- }, --/* l.addi $rD,$rA,$lo16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } }, -- & ifmt_l_addi, { 0x94000000 } -- }, --/* l.sub $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000002 } -- }, --/* l.subi $rD,$rA,$lo16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } }, -- & ifmt_l_addi, { 0x9c000000 } -- }, --/* l.and $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000003 } -- }, --/* l.andi $rD,$rA,$lo16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } }, -- & ifmt_l_addi, { 0xa0000000 } -- }, --/* l.or $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000004 } -- }, --/* l.ori $rD,$rA,$lo16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } }, -- & ifmt_l_addi, { 0xa4000000 } -- }, --/* l.xor $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000005 } -- }, --/* l.xori $rD,$rA,$lo16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } }, -- & ifmt_l_addi, { 0xa8000000 } -- }, --/* l.mul $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000006 } -- }, --/* l.muli $rD,$rA,$lo16 */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } }, -- & ifmt_l_addi, { 0xac000000 } -- }, --/* l.div $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe0000009 } -- }, --/* l.divu $rD,$rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_add, { 0xe000000a } -- }, --/* l.sfgts $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4c00000 } -- }, --/* l.sfgtu $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4400000 } -- }, --/* l.sfges $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4e00000 } -- }, --/* l.sfgeu $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4600000 } -- }, --/* l.sflts $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe5000000 } -- }, --/* l.sfltu $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4800000 } -- }, --/* l.sfles $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe5200000 } -- }, --/* l.sfleu $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4a00000 } -- }, --/* l.sfgtsi $rA,${simm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } }, -- & ifmt_l_sfgtsi, { 0xb8c00000 } -- }, --/* l.sfgtui $rA,${uimm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } }, -- & ifmt_l_sfgtui, { 0xb8400000 } -- }, --/* l.sfgesi $rA,${simm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } }, -- & ifmt_l_sfgtsi, { 0xb8e00000 } -- }, --/* l.sfgeui $rA,${uimm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } }, -- & ifmt_l_sfgtui, { 0xb8600000 } -- }, --/* l.sfltsi $rA,${simm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } }, -- & ifmt_l_sfgtsi, { 0xb9000000 } -- }, --/* l.sfltui $rA,${uimm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } }, -- & ifmt_l_sfgtui, { 0xb8800000 } -- }, --/* l.sflesi $rA,${simm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } }, -- & ifmt_l_sfgtsi, { 0xb9200000 } -- }, --/* l.sfleui $rA,${uimm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } }, -- & ifmt_l_sfgtui, { 0xb8a00000 } -- }, --/* l.sfeq $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4000000 } -- }, --/* l.sfeqi $rA,${simm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } }, -- & ifmt_l_sfgtsi, { 0xb8000000 } -- }, --/* l.sfne $rA,$rB */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -- & ifmt_l_sfgts, { 0xe4200000 } -- }, --/* l.sfnei $rA,${simm-16} */ -- { -- { 0, 0, 0, 0 }, -- { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } }, -- & ifmt_l_sfgtsi, { 0xb8200000 } -- }, --}; -- --#undef A --#undef OPERAND --#undef MNEM --#undef OP -- --/* Formats for ALIAS macro-insns. */ -- --#define F(f) & openrisc_cgen_ifld_table[OPENRISC_##f] --static const CGEN_IFMT ifmt_l_ret ATTRIBUTE_UNUSED = { -- 32, 32, 0xffffffff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP3) }, { F (F_OP4) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } } --}; -- --#undef F -- --/* Each non-simple macro entry points to an array of expansion possibilities. */ -- --#define A(a) (1 << CGEN_INSN_##a) --#define OPERAND(op) OPENRISC_OPERAND_##op --#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */ --#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field)) -- --/* The macro instruction table. */ -- --static const CGEN_IBASE openrisc_cgen_macro_insn_table[] = --{ --/* l.ret */ -- { -- -1, "l-ret", "l.ret", 32, -- { 0|A(ALIAS), { { { (1<= 1) -- memset (insns, 0, num_macros * sizeof (CGEN_INSN)); -- for (i = 0; i < num_macros; ++i) -- { -- insns[i].base = &ib[i]; -- insns[i].opcode = &oc[i]; -- openrisc_cgen_build_insn_regex (& insns[i]); -- } -- cd->macro_insn_table.init_entries = insns; -- cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE); -- cd->macro_insn_table.num_init_entries = num_macros; -- -- oc = & openrisc_cgen_insn_opcode_table[0]; -- insns = (CGEN_INSN *) cd->insn_table.init_entries; -- for (i = 0; i < MAX_INSNS; ++i) -- { -- insns[i].opcode = &oc[i]; -- openrisc_cgen_build_insn_regex (& insns[i]); -- } -- -- cd->sizeof_fields = sizeof (CGEN_FIELDS); -- cd->set_fields_bitsize = set_fields_bitsize; -- -- cd->asm_hash_p = asm_hash_insn_p; -- cd->asm_hash = asm_hash_insn; -- cd->asm_hash_size = CGEN_ASM_HASH_SIZE; -- -- cd->dis_hash_p = dis_hash_insn_p; -- cd->dis_hash = dis_hash_insn; -- cd->dis_hash_size = CGEN_DIS_HASH_SIZE; --} -diff -rNU3 dist.orig/opcodes/openrisc-opc.h dist/opcodes/openrisc-opc.h ---- dist.orig/opcodes/openrisc-opc.h 2010-01-02 19:50:59.000000000 +0100 -+++ dist/opcodes/openrisc-opc.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,113 +0,0 @@ --/* Instruction opcode header for openrisc. -- --THIS FILE IS MACHINE GENERATED WITH CGEN. -- --Copyright 1996-2010 Free Software Foundation, Inc. -- --This file is part of the GNU Binutils and/or GDB, the GNU debugger. -- -- This file is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License along -- with this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -- --*/ -- --#ifndef OPENRISC_OPC_H --#define OPENRISC_OPC_H -- --/* -- opc.h */ --#undef CGEN_DIS_HASH_SIZE --#define CGEN_DIS_HASH_SIZE 64 --#undef CGEN_DIS_HASH --#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2) -- --extern long openrisc_sign_extend_16bit (long); --/* -- */ --/* Enum declaration for openrisc instruction types. */ --typedef enum cgen_insn_type { -- OPENRISC_INSN_INVALID, OPENRISC_INSN_L_J, OPENRISC_INSN_L_JAL, OPENRISC_INSN_L_JR -- , OPENRISC_INSN_L_JALR, OPENRISC_INSN_L_BAL, OPENRISC_INSN_L_BNF, OPENRISC_INSN_L_BF -- , OPENRISC_INSN_L_BRK, OPENRISC_INSN_L_RFE, OPENRISC_INSN_L_SYS, OPENRISC_INSN_L_NOP -- , OPENRISC_INSN_L_MOVHI, OPENRISC_INSN_L_MFSR, OPENRISC_INSN_L_MTSR, OPENRISC_INSN_L_LW -- , OPENRISC_INSN_L_LBZ, OPENRISC_INSN_L_LBS, OPENRISC_INSN_L_LHZ, OPENRISC_INSN_L_LHS -- , OPENRISC_INSN_L_SW, OPENRISC_INSN_L_SB, OPENRISC_INSN_L_SH, OPENRISC_INSN_L_SLL -- , OPENRISC_INSN_L_SLLI, OPENRISC_INSN_L_SRL, OPENRISC_INSN_L_SRLI, OPENRISC_INSN_L_SRA -- , OPENRISC_INSN_L_SRAI, OPENRISC_INSN_L_ROR, OPENRISC_INSN_L_RORI, OPENRISC_INSN_L_ADD -- , OPENRISC_INSN_L_ADDI, OPENRISC_INSN_L_SUB, OPENRISC_INSN_L_SUBI, OPENRISC_INSN_L_AND -- , OPENRISC_INSN_L_ANDI, OPENRISC_INSN_L_OR, OPENRISC_INSN_L_ORI, OPENRISC_INSN_L_XOR -- , OPENRISC_INSN_L_XORI, OPENRISC_INSN_L_MUL, OPENRISC_INSN_L_MULI, OPENRISC_INSN_L_DIV -- , OPENRISC_INSN_L_DIVU, OPENRISC_INSN_L_SFGTS, OPENRISC_INSN_L_SFGTU, OPENRISC_INSN_L_SFGES -- , OPENRISC_INSN_L_SFGEU, OPENRISC_INSN_L_SFLTS, OPENRISC_INSN_L_SFLTU, OPENRISC_INSN_L_SFLES -- , OPENRISC_INSN_L_SFLEU, OPENRISC_INSN_L_SFGTSI, OPENRISC_INSN_L_SFGTUI, OPENRISC_INSN_L_SFGESI -- , OPENRISC_INSN_L_SFGEUI, OPENRISC_INSN_L_SFLTSI, OPENRISC_INSN_L_SFLTUI, OPENRISC_INSN_L_SFLESI -- , OPENRISC_INSN_L_SFLEUI, OPENRISC_INSN_L_SFEQ, OPENRISC_INSN_L_SFEQI, OPENRISC_INSN_L_SFNE -- , OPENRISC_INSN_L_SFNEI --} CGEN_INSN_TYPE; -- --/* Index of `invalid' insn place holder. */ --#define CGEN_INSN_INVALID OPENRISC_INSN_INVALID -- --/* Total number of insns in table. */ --#define MAX_INSNS ((int) OPENRISC_INSN_L_SFNEI + 1) -- --/* This struct records data prior to insertion or after extraction. */ --struct cgen_fields --{ -- int length; -- long f_nil; -- long f_anyof; -- long f_class; -- long f_sub; -- long f_r1; -- long f_r2; -- long f_r3; -- long f_simm16; -- long f_uimm16; -- long f_uimm5; -- long f_hi16; -- long f_lo16; -- long f_op1; -- long f_op2; -- long f_op3; -- long f_op4; -- long f_op5; -- long f_op6; -- long f_op7; -- long f_i16_1; -- long f_i16_2; -- long f_disp26; -- long f_abs26; -- long f_i16nc; -- long f_f_15_8; -- long f_f_10_3; -- long f_f_4_1; -- long f_f_7_3; -- long f_f_10_7; -- long f_f_10_11; --}; -- --#define CGEN_INIT_PARSE(od) \ --{\ --} --#define CGEN_INIT_INSERT(od) \ --{\ --} --#define CGEN_INIT_EXTRACT(od) \ --{\ --} --#define CGEN_INIT_PRINT(od) \ --{\ --} -- -- --#endif /* OPENRISC_OPC_H */ -diff -rNU3 dist.orig/opcodes/or1k-asm.c dist/opcodes/or1k-asm.c ---- dist.orig/opcodes/or1k-asm.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-asm.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,910 @@ -+/* Assembler interface for targets using CGEN. -*- C -*- -+ CGEN: Cpu tools GENerator -+ -+ THIS FILE IS MACHINE GENERATED WITH CGEN. -+ - the resultant file is machine generated, cgen-asm.in isn't -+ -+ Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+ This file is part of libopcodes. -+ -+ This library is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -+ -+ -+/* ??? Eventually more and more of this stuff can go to cpu-independent files. -+ Keep that in mind. */ -+ -+#include "sysdep.h" -+#include -+#include "ansidecl.h" -+#include "bfd.h" -+#include "symcat.h" -+#include "or1k-desc.h" -+#include "or1k-opc.h" -+#include "opintl.h" -+#include "xregex.h" -+#include "libiberty.h" -+#include "safe-ctype.h" -+ -+#undef min -+#define min(a,b) ((a) < (b) ? (a) : (b)) -+#undef max -+#define max(a,b) ((a) > (b) ? (a) : (b)) -+ -+static const char * parse_insn_normal -+ (CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *); -+ -+/* -- assembler routines inserted here. */ -+ -+/* -- asm.c */ -+ -+static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'"); -+ -+#define CGEN_VERBOSE_ASSEMBLER_ERRORS -+ -+static const char * -+parse_disp26 (CGEN_CPU_DESC cd, -+ const char ** strp, -+ int opindex, -+ int opinfo, -+ enum cgen_parse_operand_result * resultp, -+ bfd_vma * valuep) -+{ -+ const char *errmsg = NULL; -+ enum cgen_parse_operand_result result_type; -+ -+ if (strncasecmp (*strp, "plt(", 4) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 4; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_OR1K_PLT26, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 2) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ return cgen_parse_address (cd, strp, opindex, opinfo, resultp, valuep); -+} -+ -+static const char * -+parse_simm16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep) -+{ -+ const char *errmsg; -+ enum cgen_parse_operand_result result_type; -+ long ret; -+ -+ if (**strp == '#') -+ ++*strp; -+ -+ if (strncasecmp (*strp, "hi(", 3) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 3; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16, -+ & result_type, & value); -+ if (**strp != ')') -+ errmsg = MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ -+ ret = value; -+ -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ { -+ ret >>= 16; -+ ret &= 0xffff; -+ ret = (ret ^ 0x8000) - 0x8000; -+ } -+ } -+ else if (strncasecmp (*strp, "lo(", 3) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 3; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ -+ ret = value; -+ -+ if (result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ { -+ ret &= 0xffff; -+ ret = (ret ^ 0x8000) - 0x8000; -+ } -+ } -+ else if (strncasecmp (*strp, "got(", 4) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 4; -+ errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_OR1K_GOT16, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotpchi(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTPC_HI16, -+ & result_type, & value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotpclo(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTPC_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotoffhi(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTOFF_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gotofflo(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_GOTOFF_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsgdhi(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_GD_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsgdlo(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_GD_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsldmhi(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDM_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tlsldmlo(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDM_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "dtpoffhi(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDO_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "dtpofflo(", 9) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 9; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LDO_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gottpoffhi(", 11) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 11; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_IE_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "gottpofflo(", 11) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 11; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_IE_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tpoffhi(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LE_HI16, -+ & result_type, & value); -+ -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value = (value >> 16) & 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else if (strncasecmp (*strp, "tpofflo(", 8) == 0) -+ { -+ bfd_vma value; -+ -+ *strp += 8; -+ errmsg = cgen_parse_address (cd, strp, opindex, -+ BFD_RELOC_OR1K_TLS_LE_LO16, -+ &result_type, &value); -+ if (**strp != ')') -+ return MISSING_CLOSING_PARENTHESIS; -+ ++*strp; -+ if (errmsg == NULL -+ && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER) -+ value &= 0xffff; -+ *valuep = value; -+ return errmsg; -+ } -+ else -+ { -+ long value; -+ errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value); -+ ret = value; -+ } -+ -+ if (errmsg == NULL) -+ *valuep = ret; -+ -+ return errmsg; -+} -+ -+static const char * -+parse_uimm16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, unsigned long * valuep) -+{ -+ const char *errmsg = parse_simm16(cd, strp, opindex, (long *) valuep); -+ -+ if (errmsg == NULL) -+ *valuep &= 0xffff; -+ return errmsg; -+} -+ -+/* -- */ -+ -+const char * or1k_cgen_parse_operand -+ (CGEN_CPU_DESC, int, const char **, CGEN_FIELDS *); -+ -+/* Main entry point for operand parsing. -+ -+ This function is basically just a big switch statement. Earlier versions -+ used tables to look up the function to use, but -+ - if the table contains both assembler and disassembler functions then -+ the disassembler contains much of the assembler and vice-versa, -+ - there's a lot of inlining possibilities as things grow, -+ - using a switch statement avoids the function call overhead. -+ -+ This function could be moved into `parse_insn_normal', but keeping it -+ separate makes clear the interface between `parse_insn_normal' and each of -+ the handlers. */ -+ -+const char * -+or1k_cgen_parse_operand (CGEN_CPU_DESC cd, -+ int opindex, -+ const char ** strp, -+ CGEN_FIELDS * fields) -+{ -+ const char * errmsg = NULL; -+ /* Used by scalar operands that still need to be parsed. */ -+ long junk ATTRIBUTE_UNUSED; -+ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ { -+ bfd_vma value = 0; -+ errmsg = parse_disp26 (cd, strp, OR1K_OPERAND_DISP26, 0, NULL, & value); -+ fields->f_disp26 = value; -+ } -+ break; -+ case OR1K_OPERAND_RA : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_gpr, & fields->f_r2); -+ break; -+ case OR1K_OPERAND_RADF : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_fdr, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RASF : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_fsr, & fields->f_r2); -+ break; -+ case OR1K_OPERAND_RB : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_gpr, & fields->f_r3); -+ break; -+ case OR1K_OPERAND_RBDF : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_fdr, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RBSF : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_fsr, & fields->f_r3); -+ break; -+ case OR1K_OPERAND_RD : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_gpr, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RDDF : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_fdr, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RDSF : -+ errmsg = cgen_parse_keyword (cd, strp, & or1k_cgen_opval_h_fsr, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ errmsg = parse_simm16 (cd, strp, OR1K_OPERAND_SIMM16, (long *) (& fields->f_simm16)); -+ break; -+ case OR1K_OPERAND_SIMM16_SPLIT : -+ errmsg = parse_simm16 (cd, strp, OR1K_OPERAND_SIMM16_SPLIT, (long *) (& fields->f_simm16_split)); -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ errmsg = parse_uimm16 (cd, strp, OR1K_OPERAND_UIMM16, (unsigned long *) (& fields->f_uimm16)); -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ errmsg = parse_uimm16 (cd, strp, OR1K_OPERAND_UIMM16_SPLIT, (unsigned long *) (& fields->f_uimm16_split)); -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ errmsg = cgen_parse_unsigned_integer (cd, strp, OR1K_OPERAND_UIMM6, (unsigned long *) (& fields->f_uimm6)); -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while parsing.\n"), opindex); -+ abort (); -+ } -+ -+ return errmsg; -+} -+ -+cgen_parse_fn * const or1k_cgen_parse_handlers[] = -+{ -+ parse_insn_normal, -+}; -+ -+void -+or1k_cgen_init_asm (CGEN_CPU_DESC cd) -+{ -+ or1k_cgen_init_opcode_table (cd); -+ or1k_cgen_init_ibld_table (cd); -+ cd->parse_handlers = & or1k_cgen_parse_handlers[0]; -+ cd->parse_operand = or1k_cgen_parse_operand; -+#ifdef CGEN_ASM_INIT_HOOK -+CGEN_ASM_INIT_HOOK -+#endif -+} -+ -+ -+ -+/* Regex construction routine. -+ -+ This translates an opcode syntax string into a regex string, -+ by replacing any non-character syntax element (such as an -+ opcode) with the pattern '.*' -+ -+ It then compiles the regex and stores it in the opcode, for -+ later use by or1k_cgen_assemble_insn -+ -+ Returns NULL for success, an error message for failure. */ -+ -+char * -+or1k_cgen_build_insn_regex (CGEN_INSN *insn) -+{ -+ CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn); -+ const char *mnem = CGEN_INSN_MNEMONIC (insn); -+ char rxbuf[CGEN_MAX_RX_ELEMENTS]; -+ char *rx = rxbuf; -+ const CGEN_SYNTAX_CHAR_TYPE *syn; -+ int reg_err; -+ -+ syn = CGEN_SYNTAX_STRING (CGEN_OPCODE_SYNTAX (opc)); -+ -+ /* Mnemonics come first in the syntax string. */ -+ if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) -+ return _("missing mnemonic in syntax string"); -+ ++syn; -+ -+ /* Generate a case sensitive regular expression that emulates case -+ insensitive matching in the "C" locale. We cannot generate a case -+ insensitive regular expression because in Turkish locales, 'i' and 'I' -+ are not equal modulo case conversion. */ -+ -+ /* Copy the literal mnemonic out of the insn. */ -+ for (; *mnem; mnem++) -+ { -+ char c = *mnem; -+ -+ if (ISALPHA (c)) -+ { -+ *rx++ = '['; -+ *rx++ = TOLOWER (c); -+ *rx++ = TOUPPER (c); -+ *rx++ = ']'; -+ } -+ else -+ *rx++ = c; -+ } -+ -+ /* Copy any remaining literals from the syntax string into the rx. */ -+ for(; * syn != 0 && rx <= rxbuf + (CGEN_MAX_RX_ELEMENTS - 7 - 4); ++syn) -+ { -+ if (CGEN_SYNTAX_CHAR_P (* syn)) -+ { -+ char c = CGEN_SYNTAX_CHAR (* syn); -+ -+ switch (c) -+ { -+ /* Escape any regex metacharacters in the syntax. */ -+ case '.': case '[': case '\\': -+ case '*': case '^': case '$': -+ -+#ifdef CGEN_ESCAPE_EXTENDED_REGEX -+ case '?': case '{': case '}': -+ case '(': case ')': case '*': -+ case '|': case '+': case ']': -+#endif -+ *rx++ = '\\'; -+ *rx++ = c; -+ break; -+ -+ default: -+ if (ISALPHA (c)) -+ { -+ *rx++ = '['; -+ *rx++ = TOLOWER (c); -+ *rx++ = TOUPPER (c); -+ *rx++ = ']'; -+ } -+ else -+ *rx++ = c; -+ break; -+ } -+ } -+ else -+ { -+ /* Replace non-syntax fields with globs. */ -+ *rx++ = '.'; -+ *rx++ = '*'; -+ } -+ } -+ -+ /* Trailing whitespace ok. */ -+ * rx++ = '['; -+ * rx++ = ' '; -+ * rx++ = '\t'; -+ * rx++ = ']'; -+ * rx++ = '*'; -+ -+ /* But anchor it after that. */ -+ * rx++ = '$'; -+ * rx = '\0'; -+ -+ CGEN_INSN_RX (insn) = xmalloc (sizeof (regex_t)); -+ reg_err = regcomp ((regex_t *) CGEN_INSN_RX (insn), rxbuf, REG_NOSUB); -+ -+ if (reg_err == 0) -+ return NULL; -+ else -+ { -+ static char msg[80]; -+ -+ regerror (reg_err, (regex_t *) CGEN_INSN_RX (insn), msg, 80); -+ regfree ((regex_t *) CGEN_INSN_RX (insn)); -+ free (CGEN_INSN_RX (insn)); -+ (CGEN_INSN_RX (insn)) = NULL; -+ return msg; -+ } -+} -+ -+ -+/* Default insn parser. -+ -+ The syntax string is scanned and operands are parsed and stored in FIELDS. -+ Relocs are queued as we go via other callbacks. -+ -+ ??? Note that this is currently an all-or-nothing parser. If we fail to -+ parse the instruction, we return 0 and the caller will start over from -+ the beginning. Backtracking will be necessary in parsing subexpressions, -+ but that can be handled there. Not handling backtracking here may get -+ expensive in the case of the m68k. Deal with later. -+ -+ Returns NULL for success, an error message for failure. */ -+ -+static const char * -+parse_insn_normal (CGEN_CPU_DESC cd, -+ const CGEN_INSN *insn, -+ const char **strp, -+ CGEN_FIELDS *fields) -+{ -+ /* ??? Runtime added insns not handled yet. */ -+ const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -+ const char *str = *strp; -+ const char *errmsg; -+ const char *p; -+ const CGEN_SYNTAX_CHAR_TYPE * syn; -+#ifdef CGEN_MNEMONIC_OPERANDS -+ /* FIXME: wip */ -+ int past_opcode_p; -+#endif -+ -+ /* For now we assume the mnemonic is first (there are no leading operands). -+ We can parse it without needing to set up operand parsing. -+ GAS's input scrubber will ensure mnemonics are lowercase, but we may -+ not be called from GAS. */ -+ p = CGEN_INSN_MNEMONIC (insn); -+ while (*p && TOLOWER (*p) == TOLOWER (*str)) -+ ++p, ++str; -+ -+ if (* p) -+ return _("unrecognized instruction"); -+ -+#ifndef CGEN_MNEMONIC_OPERANDS -+ if (* str && ! ISSPACE (* str)) -+ return _("unrecognized instruction"); -+#endif -+ -+ CGEN_INIT_PARSE (cd); -+ cgen_init_parse_operand (cd); -+#ifdef CGEN_MNEMONIC_OPERANDS -+ past_opcode_p = 0; -+#endif -+ -+ /* We don't check for (*str != '\0') here because we want to parse -+ any trailing fake arguments in the syntax string. */ -+ syn = CGEN_SYNTAX_STRING (syntax); -+ -+ /* Mnemonics come first for now, ensure valid string. */ -+ if (! CGEN_SYNTAX_MNEMONIC_P (* syn)) -+ abort (); -+ -+ ++syn; -+ -+ while (* syn != 0) -+ { -+ /* Non operand chars must match exactly. */ -+ if (CGEN_SYNTAX_CHAR_P (* syn)) -+ { -+ /* FIXME: While we allow for non-GAS callers above, we assume the -+ first char after the mnemonic part is a space. */ -+ /* FIXME: We also take inappropriate advantage of the fact that -+ GAS's input scrubber will remove extraneous blanks. */ -+ if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn))) -+ { -+#ifdef CGEN_MNEMONIC_OPERANDS -+ if (CGEN_SYNTAX_CHAR(* syn) == ' ') -+ past_opcode_p = 1; -+#endif -+ ++ syn; -+ ++ str; -+ } -+ else if (*str) -+ { -+ /* Syntax char didn't match. Can't be this insn. */ -+ static char msg [80]; -+ -+ /* xgettext:c-format */ -+ sprintf (msg, _("syntax error (expected char `%c', found `%c')"), -+ CGEN_SYNTAX_CHAR(*syn), *str); -+ return msg; -+ } -+ else -+ { -+ /* Ran out of input. */ -+ static char msg [80]; -+ -+ /* xgettext:c-format */ -+ sprintf (msg, _("syntax error (expected char `%c', found end of instruction)"), -+ CGEN_SYNTAX_CHAR(*syn)); -+ return msg; -+ } -+ continue; -+ } -+ -+#ifdef CGEN_MNEMONIC_OPERANDS -+ (void) past_opcode_p; -+#endif -+ /* We have an operand of some sort. */ -+ errmsg = cd->parse_operand (cd, CGEN_SYNTAX_FIELD (*syn), &str, fields); -+ if (errmsg) -+ return errmsg; -+ -+ /* Done with this operand, continue with next one. */ -+ ++ syn; -+ } -+ -+ /* If we're at the end of the syntax string, we're done. */ -+ if (* syn == 0) -+ { -+ /* FIXME: For the moment we assume a valid `str' can only contain -+ blanks now. IE: We needn't try again with a longer version of -+ the insn and it is assumed that longer versions of insns appear -+ before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */ -+ while (ISSPACE (* str)) -+ ++ str; -+ -+ if (* str != '\0') -+ return _("junk at end of line"); /* FIXME: would like to include `str' */ -+ -+ return NULL; -+ } -+ -+ /* We couldn't parse it. */ -+ return _("unrecognized instruction"); -+} -+ -+/* Main entry point. -+ This routine is called for each instruction to be assembled. -+ STR points to the insn to be assembled. -+ We assume all necessary tables have been initialized. -+ The assembled instruction, less any fixups, is stored in BUF. -+ Remember that if CGEN_INT_INSN_P then BUF is an int and thus the value -+ still needs to be converted to target byte order, otherwise BUF is an array -+ of bytes in target byte order. -+ The result is a pointer to the insn's entry in the opcode table, -+ or NULL if an error occured (an error message will have already been -+ printed). -+ -+ Note that when processing (non-alias) macro-insns, -+ this function recurses. -+ -+ ??? It's possible to make this cpu-independent. -+ One would have to deal with a few minor things. -+ At this point in time doing so would be more of a curiosity than useful -+ [for example this file isn't _that_ big], but keeping the possibility in -+ mind helps keep the design clean. */ -+ -+const CGEN_INSN * -+or1k_cgen_assemble_insn (CGEN_CPU_DESC cd, -+ const char *str, -+ CGEN_FIELDS *fields, -+ CGEN_INSN_BYTES_PTR buf, -+ char **errmsg) -+{ -+ const char *start; -+ CGEN_INSN_LIST *ilist; -+ const char *parse_errmsg = NULL; -+ const char *insert_errmsg = NULL; -+ int recognized_mnemonic = 0; -+ -+ /* Skip leading white space. */ -+ while (ISSPACE (* str)) -+ ++ str; -+ -+ /* The instructions are stored in hashed lists. -+ Get the first in the list. */ -+ ilist = CGEN_ASM_LOOKUP_INSN (cd, str); -+ -+ /* Keep looking until we find a match. */ -+ start = str; -+ for ( ; ilist != NULL ; ilist = CGEN_ASM_NEXT_INSN (ilist)) -+ { -+ const CGEN_INSN *insn = ilist->insn; -+ recognized_mnemonic = 1; -+ -+#ifdef CGEN_VALIDATE_INSN_SUPPORTED -+ /* Not usually needed as unsupported opcodes -+ shouldn't be in the hash lists. */ -+ /* Is this insn supported by the selected cpu? */ -+ if (! or1k_cgen_insn_supported (cd, insn)) -+ continue; -+#endif -+ /* If the RELAXED attribute is set, this is an insn that shouldn't be -+ chosen immediately. Instead, it is used during assembler/linker -+ relaxation if possible. */ -+ if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED) != 0) -+ continue; -+ -+ str = start; -+ -+ /* Skip this insn if str doesn't look right lexically. */ -+ if (CGEN_INSN_RX (insn) != NULL && -+ regexec ((regex_t *) CGEN_INSN_RX (insn), str, 0, NULL, 0) == REG_NOMATCH) -+ continue; -+ -+ /* Allow parse/insert handlers to obtain length of insn. */ -+ CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); -+ -+ parse_errmsg = CGEN_PARSE_FN (cd, insn) (cd, insn, & str, fields); -+ if (parse_errmsg != NULL) -+ continue; -+ -+ /* ??? 0 is passed for `pc'. */ -+ insert_errmsg = CGEN_INSERT_FN (cd, insn) (cd, insn, fields, buf, -+ (bfd_vma) 0); -+ if (insert_errmsg != NULL) -+ continue; -+ -+ /* It is up to the caller to actually output the insn and any -+ queued relocs. */ -+ return insn; -+ } -+ -+ { -+ static char errbuf[150]; -+ const char *tmp_errmsg; -+#ifdef CGEN_VERBOSE_ASSEMBLER_ERRORS -+#define be_verbose 1 -+#else -+#define be_verbose 0 -+#endif -+ -+ if (be_verbose) -+ { -+ /* If requesting verbose error messages, use insert_errmsg. -+ Failing that, use parse_errmsg. */ -+ tmp_errmsg = (insert_errmsg ? insert_errmsg : -+ parse_errmsg ? parse_errmsg : -+ recognized_mnemonic ? -+ _("unrecognized form of instruction") : -+ _("unrecognized instruction")); -+ -+ if (strlen (start) > 50) -+ /* xgettext:c-format */ -+ sprintf (errbuf, "%s `%.50s...'", tmp_errmsg, start); -+ else -+ /* xgettext:c-format */ -+ sprintf (errbuf, "%s `%.50s'", tmp_errmsg, start); -+ } -+ else -+ { -+ if (strlen (start) > 50) -+ /* xgettext:c-format */ -+ sprintf (errbuf, _("bad instruction `%.50s...'"), start); -+ else -+ /* xgettext:c-format */ -+ sprintf (errbuf, _("bad instruction `%.50s'"), start); -+ } -+ -+ *errmsg = errbuf; -+ return NULL; -+ } -+} -diff -rNU3 dist.orig/opcodes/or1k-desc.c dist/opcodes/or1k-desc.c ---- dist.orig/opcodes/or1k-desc.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-desc.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,2110 @@ -+/* CPU data for or1k. -+ -+THIS FILE IS MACHINE GENERATED WITH CGEN. -+ -+Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+This file is part of the GNU Binutils and/or GDB, the GNU debugger. -+ -+ This file is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -+ -+*/ -+ -+#include "sysdep.h" -+#include -+#include -+#include "ansidecl.h" -+#include "bfd.h" -+#include "symcat.h" -+#include "or1k-desc.h" -+#include "or1k-opc.h" -+#include "opintl.h" -+#include "libiberty.h" -+#include "xregex.h" -+ -+/* Attributes. */ -+ -+static const CGEN_ATTR_ENTRY bool_attr[] = -+{ -+ { "#f", 0 }, -+ { "#t", 1 }, -+ { 0, 0 } -+}; -+ -+static const CGEN_ATTR_ENTRY MACH_attr[] ATTRIBUTE_UNUSED = -+{ -+ { "base", MACH_BASE }, -+ { "or32", MACH_OR32 }, -+ { "or32nd", MACH_OR32ND }, -+ { "or64", MACH_OR64 }, -+ { "or64nd", MACH_OR64ND }, -+ { "max", MACH_MAX }, -+ { 0, 0 } -+}; -+ -+static const CGEN_ATTR_ENTRY ISA_attr[] ATTRIBUTE_UNUSED = -+{ -+ { "openrisc", ISA_OPENRISC }, -+ { "max", ISA_MAX }, -+ { 0, 0 } -+}; -+ -+const CGEN_ATTR_TABLE or1k_cgen_ifield_attr_table[] = -+{ -+ { "MACH", & MACH_attr[0], & MACH_attr[0] }, -+ { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -+ { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, -+ { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, -+ { "RESERVED", &bool_attr[0], &bool_attr[0] }, -+ { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, -+ { "SIGNED", &bool_attr[0], &bool_attr[0] }, -+ { 0, 0, 0 } -+}; -+ -+const CGEN_ATTR_TABLE or1k_cgen_hardware_attr_table[] = -+{ -+ { "MACH", & MACH_attr[0], & MACH_attr[0] }, -+ { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -+ { "CACHE-ADDR", &bool_attr[0], &bool_attr[0] }, -+ { "PC", &bool_attr[0], &bool_attr[0] }, -+ { "PROFILE", &bool_attr[0], &bool_attr[0] }, -+ { 0, 0, 0 } -+}; -+ -+const CGEN_ATTR_TABLE or1k_cgen_operand_attr_table[] = -+{ -+ { "MACH", & MACH_attr[0], & MACH_attr[0] }, -+ { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -+ { "PCREL-ADDR", &bool_attr[0], &bool_attr[0] }, -+ { "ABS-ADDR", &bool_attr[0], &bool_attr[0] }, -+ { "SIGN-OPT", &bool_attr[0], &bool_attr[0] }, -+ { "SIGNED", &bool_attr[0], &bool_attr[0] }, -+ { "NEGATIVE", &bool_attr[0], &bool_attr[0] }, -+ { "RELAX", &bool_attr[0], &bool_attr[0] }, -+ { "SEM-ONLY", &bool_attr[0], &bool_attr[0] }, -+ { 0, 0, 0 } -+}; -+ -+const CGEN_ATTR_TABLE or1k_cgen_insn_attr_table[] = -+{ -+ { "MACH", & MACH_attr[0], & MACH_attr[0] }, -+ { "ALIAS", &bool_attr[0], &bool_attr[0] }, -+ { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, -+ { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] }, -+ { "COND-CTI", &bool_attr[0], &bool_attr[0] }, -+ { "SKIP-CTI", &bool_attr[0], &bool_attr[0] }, -+ { "DELAY-SLOT", &bool_attr[0], &bool_attr[0] }, -+ { "RELAXABLE", &bool_attr[0], &bool_attr[0] }, -+ { "RELAXED", &bool_attr[0], &bool_attr[0] }, -+ { "NO-DIS", &bool_attr[0], &bool_attr[0] }, -+ { "PBB", &bool_attr[0], &bool_attr[0] }, -+ { "DELAYED-CTI", &bool_attr[0], &bool_attr[0] }, -+ { "NOT-IN-DELAY-SLOT", &bool_attr[0], &bool_attr[0] }, -+ { "FORCED-CTI", &bool_attr[0], &bool_attr[0] }, -+ { 0, 0, 0 } -+}; -+ -+/* Instruction set variants. */ -+ -+static const CGEN_ISA or1k_cgen_isa_table[] = { -+ { "openrisc", 32, 32, 32, 32 }, -+ { 0, 0, 0, 0, 0 } -+}; -+ -+/* Machine variants. */ -+ -+static const CGEN_MACH or1k_cgen_mach_table[] = { -+ { "or32", "or1k", MACH_OR32, 0 }, -+ { "or32nd", "or1knd", MACH_OR32ND, 0 }, -+ { "or64", "or1k64", MACH_OR64, 0 }, -+ { "or64nd", "or1k64nd", MACH_OR64ND, 0 }, -+ { 0, 0, 0, 0 } -+}; -+ -+static CGEN_KEYWORD_ENTRY or1k_cgen_opval_h_fsr_entries[] = -+{ -+ { "r0", 0, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r1", 1, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r2", 2, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r3", 3, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r4", 4, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r5", 5, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r6", 6, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r7", 7, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r8", 8, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r9", 9, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r10", 10, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r11", 11, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r12", 12, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r13", 13, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r14", 14, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r15", 15, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r16", 16, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r17", 17, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r18", 18, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r19", 19, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r20", 20, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r21", 21, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r22", 22, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r23", 23, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r24", 24, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r25", 25, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r26", 26, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r27", 27, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r28", 28, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r29", 29, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r30", 30, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r31", 31, {0, {{{0, 0}}}}, 0, 0 }, -+ { "lr", 9, {0, {{{0, 0}}}}, 0, 0 }, -+ { "sp", 1, {0, {{{0, 0}}}}, 0, 0 }, -+ { "fp", 2, {0, {{{0, 0}}}}, 0, 0 } -+}; -+ -+CGEN_KEYWORD or1k_cgen_opval_h_fsr = -+{ -+ & or1k_cgen_opval_h_fsr_entries[0], -+ 35, -+ 0, 0, 0, 0, "" -+}; -+ -+static CGEN_KEYWORD_ENTRY or1k_cgen_opval_h_fdr_entries[] = -+{ -+ { "r0", 0, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r1", 1, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r2", 2, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r3", 3, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r4", 4, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r5", 5, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r6", 6, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r7", 7, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r8", 8, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r9", 9, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r10", 10, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r11", 11, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r12", 12, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r13", 13, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r14", 14, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r15", 15, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r16", 16, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r17", 17, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r18", 18, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r19", 19, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r20", 20, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r21", 21, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r22", 22, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r23", 23, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r24", 24, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r25", 25, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r26", 26, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r27", 27, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r28", 28, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r29", 29, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r30", 30, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r31", 31, {0, {{{0, 0}}}}, 0, 0 }, -+ { "lr", 9, {0, {{{0, 0}}}}, 0, 0 }, -+ { "sp", 1, {0, {{{0, 0}}}}, 0, 0 }, -+ { "fp", 2, {0, {{{0, 0}}}}, 0, 0 } -+}; -+ -+CGEN_KEYWORD or1k_cgen_opval_h_fdr = -+{ -+ & or1k_cgen_opval_h_fdr_entries[0], -+ 35, -+ 0, 0, 0, 0, "" -+}; -+ -+static CGEN_KEYWORD_ENTRY or1k_cgen_opval_h_gpr_entries[] = -+{ -+ { "r0", 0, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r1", 1, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r2", 2, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r3", 3, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r4", 4, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r5", 5, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r6", 6, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r7", 7, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r8", 8, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r9", 9, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r10", 10, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r11", 11, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r12", 12, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r13", 13, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r14", 14, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r15", 15, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r16", 16, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r17", 17, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r18", 18, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r19", 19, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r20", 20, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r21", 21, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r22", 22, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r23", 23, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r24", 24, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r25", 25, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r26", 26, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r27", 27, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r28", 28, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r29", 29, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r30", 30, {0, {{{0, 0}}}}, 0, 0 }, -+ { "r31", 31, {0, {{{0, 0}}}}, 0, 0 }, -+ { "lr", 9, {0, {{{0, 0}}}}, 0, 0 }, -+ { "sp", 1, {0, {{{0, 0}}}}, 0, 0 }, -+ { "fp", 2, {0, {{{0, 0}}}}, 0, 0 } -+}; -+ -+CGEN_KEYWORD or1k_cgen_opval_h_gpr = -+{ -+ & or1k_cgen_opval_h_gpr_entries[0], -+ 35, -+ 0, 0, 0, 0, "" -+}; -+ -+ -+/* The hardware table. */ -+ -+#define A(a) (1 << CGEN_HW_##a) -+ -+const CGEN_HW_ENTRY or1k_cgen_hw_table[] = -+{ -+ { "h-memory", HW_H_MEMORY, CGEN_ASM_NONE, 0, { 0, { { { (1<name) -+ { -+ if (strcmp (name, table->bfd_name) == 0) -+ return table; -+ ++table; -+ } -+ abort (); -+} -+ -+/* Subroutine of or1k_cgen_cpu_open to build the hardware table. */ -+ -+static void -+build_hw_table (CGEN_CPU_TABLE *cd) -+{ -+ int i; -+ int machs = cd->machs; -+ const CGEN_HW_ENTRY *init = & or1k_cgen_hw_table[0]; -+ /* MAX_HW is only an upper bound on the number of selected entries. -+ However each entry is indexed by it's enum so there can be holes in -+ the table. */ -+ const CGEN_HW_ENTRY **selected = -+ (const CGEN_HW_ENTRY **) xmalloc (MAX_HW * sizeof (CGEN_HW_ENTRY *)); -+ -+ cd->hw_table.init_entries = init; -+ cd->hw_table.entry_size = sizeof (CGEN_HW_ENTRY); -+ memset (selected, 0, MAX_HW * sizeof (CGEN_HW_ENTRY *)); -+ /* ??? For now we just use machs to determine which ones we want. */ -+ for (i = 0; init[i].name != NULL; ++i) -+ if (CGEN_HW_ATTR_VALUE (&init[i], CGEN_HW_MACH) -+ & machs) -+ selected[init[i].type] = &init[i]; -+ cd->hw_table.entries = selected; -+ cd->hw_table.num_entries = MAX_HW; -+} -+ -+/* Subroutine of or1k_cgen_cpu_open to build the hardware table. */ -+ -+static void -+build_ifield_table (CGEN_CPU_TABLE *cd) -+{ -+ cd->ifld_table = & or1k_cgen_ifld_table[0]; -+} -+ -+/* Subroutine of or1k_cgen_cpu_open to build the hardware table. */ -+ -+static void -+build_operand_table (CGEN_CPU_TABLE *cd) -+{ -+ int i; -+ int machs = cd->machs; -+ const CGEN_OPERAND *init = & or1k_cgen_operand_table[0]; -+ /* MAX_OPERANDS is only an upper bound on the number of selected entries. -+ However each entry is indexed by it's enum so there can be holes in -+ the table. */ -+ const CGEN_OPERAND **selected = xmalloc (MAX_OPERANDS * sizeof (* selected)); -+ -+ cd->operand_table.init_entries = init; -+ cd->operand_table.entry_size = sizeof (CGEN_OPERAND); -+ memset (selected, 0, MAX_OPERANDS * sizeof (CGEN_OPERAND *)); -+ /* ??? For now we just use mach to determine which ones we want. */ -+ for (i = 0; init[i].name != NULL; ++i) -+ if (CGEN_OPERAND_ATTR_VALUE (&init[i], CGEN_OPERAND_MACH) -+ & machs) -+ selected[init[i].type] = &init[i]; -+ cd->operand_table.entries = selected; -+ cd->operand_table.num_entries = MAX_OPERANDS; -+} -+ -+/* Subroutine of or1k_cgen_cpu_open to build the hardware table. -+ ??? This could leave out insns not supported by the specified mach/isa, -+ but that would cause errors like "foo only supported by bar" to become -+ "unknown insn", so for now we include all insns and require the app to -+ do the checking later. -+ ??? On the other hand, parsing of such insns may require their hardware or -+ operand elements to be in the table [which they mightn't be]. */ -+ -+static void -+build_insn_table (CGEN_CPU_TABLE *cd) -+{ -+ int i; -+ const CGEN_IBASE *ib = & or1k_cgen_insn_table[0]; -+ CGEN_INSN *insns = xmalloc (MAX_INSNS * sizeof (CGEN_INSN)); -+ -+ memset (insns, 0, MAX_INSNS * sizeof (CGEN_INSN)); -+ for (i = 0; i < MAX_INSNS; ++i) -+ insns[i].base = &ib[i]; -+ cd->insn_table.init_entries = insns; -+ cd->insn_table.entry_size = sizeof (CGEN_IBASE); -+ cd->insn_table.num_init_entries = MAX_INSNS; -+} -+ -+/* Subroutine of or1k_cgen_cpu_open to rebuild the tables. */ -+ -+static void -+or1k_cgen_rebuild_tables (CGEN_CPU_TABLE *cd) -+{ -+ int i; -+ CGEN_BITSET *isas = cd->isas; -+ unsigned int machs = cd->machs; -+ -+ cd->int_insn_p = CGEN_INT_INSN_P; -+ -+ /* Data derived from the isa spec. */ -+#define UNSET (CGEN_SIZE_UNKNOWN + 1) -+ cd->default_insn_bitsize = UNSET; -+ cd->base_insn_bitsize = UNSET; -+ cd->min_insn_bitsize = 65535; /* Some ridiculously big number. */ -+ cd->max_insn_bitsize = 0; -+ for (i = 0; i < MAX_ISAS; ++i) -+ if (cgen_bitset_contains (isas, i)) -+ { -+ const CGEN_ISA *isa = & or1k_cgen_isa_table[i]; -+ -+ /* Default insn sizes of all selected isas must be -+ equal or we set the result to 0, meaning "unknown". */ -+ if (cd->default_insn_bitsize == UNSET) -+ cd->default_insn_bitsize = isa->default_insn_bitsize; -+ else if (isa->default_insn_bitsize == cd->default_insn_bitsize) -+ ; /* This is ok. */ -+ else -+ cd->default_insn_bitsize = CGEN_SIZE_UNKNOWN; -+ -+ /* Base insn sizes of all selected isas must be equal -+ or we set the result to 0, meaning "unknown". */ -+ if (cd->base_insn_bitsize == UNSET) -+ cd->base_insn_bitsize = isa->base_insn_bitsize; -+ else if (isa->base_insn_bitsize == cd->base_insn_bitsize) -+ ; /* This is ok. */ -+ else -+ cd->base_insn_bitsize = CGEN_SIZE_UNKNOWN; -+ -+ /* Set min,max insn sizes. */ -+ if (isa->min_insn_bitsize < cd->min_insn_bitsize) -+ cd->min_insn_bitsize = isa->min_insn_bitsize; -+ if (isa->max_insn_bitsize > cd->max_insn_bitsize) -+ cd->max_insn_bitsize = isa->max_insn_bitsize; -+ } -+ -+ /* Data derived from the mach spec. */ -+ for (i = 0; i < MAX_MACHS; ++i) -+ if (((1 << i) & machs) != 0) -+ { -+ const CGEN_MACH *mach = & or1k_cgen_mach_table[i]; -+ -+ if (mach->insn_chunk_bitsize != 0) -+ { -+ if (cd->insn_chunk_bitsize != 0 && cd->insn_chunk_bitsize != mach->insn_chunk_bitsize) -+ { -+ fprintf (stderr, "or1k_cgen_rebuild_tables: conflicting insn-chunk-bitsize values: `%d' vs. `%d'\n", -+ cd->insn_chunk_bitsize, mach->insn_chunk_bitsize); -+ abort (); -+ } -+ -+ cd->insn_chunk_bitsize = mach->insn_chunk_bitsize; -+ } -+ } -+ -+ /* Determine which hw elements are used by MACH. */ -+ build_hw_table (cd); -+ -+ /* Build the ifield table. */ -+ build_ifield_table (cd); -+ -+ /* Determine which operands are used by MACH/ISA. */ -+ build_operand_table (cd); -+ -+ /* Build the instruction table. */ -+ build_insn_table (cd); -+} -+ -+/* Initialize a cpu table and return a descriptor. -+ It's much like opening a file, and must be the first function called. -+ The arguments are a set of (type/value) pairs, terminated with -+ CGEN_CPU_OPEN_END. -+ -+ Currently supported values: -+ CGEN_CPU_OPEN_ISAS: bitmap of values in enum isa_attr -+ CGEN_CPU_OPEN_MACHS: bitmap of values in enum mach_attr -+ CGEN_CPU_OPEN_BFDMACH: specify 1 mach using bfd name -+ CGEN_CPU_OPEN_ENDIAN: specify endian choice -+ CGEN_CPU_OPEN_END: terminates arguments -+ -+ ??? Simultaneous multiple isas might not make sense, but it's not (yet) -+ precluded. */ -+ -+CGEN_CPU_DESC -+or1k_cgen_cpu_open (enum cgen_cpu_open_arg arg_type, ...) -+{ -+ CGEN_CPU_TABLE *cd = (CGEN_CPU_TABLE *) xmalloc (sizeof (CGEN_CPU_TABLE)); -+ static int init_p; -+ CGEN_BITSET *isas = 0; /* 0 = "unspecified" */ -+ unsigned int machs = 0; /* 0 = "unspecified" */ -+ enum cgen_endian endian = CGEN_ENDIAN_UNKNOWN; -+ va_list ap; -+ -+ if (! init_p) -+ { -+ init_tables (); -+ init_p = 1; -+ } -+ -+ memset (cd, 0, sizeof (*cd)); -+ -+ va_start (ap, arg_type); -+ while (arg_type != CGEN_CPU_OPEN_END) -+ { -+ switch (arg_type) -+ { -+ case CGEN_CPU_OPEN_ISAS : -+ isas = va_arg (ap, CGEN_BITSET *); -+ break; -+ case CGEN_CPU_OPEN_MACHS : -+ machs = va_arg (ap, unsigned int); -+ break; -+ case CGEN_CPU_OPEN_BFDMACH : -+ { -+ const char *name = va_arg (ap, const char *); -+ const CGEN_MACH *mach = -+ lookup_mach_via_bfd_name (or1k_cgen_mach_table, name); -+ -+ machs |= 1 << mach->num; -+ break; -+ } -+ case CGEN_CPU_OPEN_ENDIAN : -+ endian = va_arg (ap, enum cgen_endian); -+ break; -+ default : -+ fprintf (stderr, "or1k_cgen_cpu_open: unsupported argument `%d'\n", -+ arg_type); -+ abort (); /* ??? return NULL? */ -+ } -+ arg_type = va_arg (ap, enum cgen_cpu_open_arg); -+ } -+ va_end (ap); -+ -+ /* Mach unspecified means "all". */ -+ if (machs == 0) -+ machs = (1 << MAX_MACHS) - 1; -+ /* Base mach is always selected. */ -+ machs |= 1; -+ if (endian == CGEN_ENDIAN_UNKNOWN) -+ { -+ /* ??? If target has only one, could have a default. */ -+ fprintf (stderr, "or1k_cgen_cpu_open: no endianness specified\n"); -+ abort (); -+ } -+ -+ cd->isas = cgen_bitset_copy (isas); -+ cd->machs = machs; -+ cd->endian = endian; -+ /* FIXME: for the sparc case we can determine insn-endianness statically. -+ The worry here is where both data and insn endian can be independently -+ chosen, in which case this function will need another argument. -+ Actually, will want to allow for more arguments in the future anyway. */ -+ cd->insn_endian = endian; -+ -+ /* Table (re)builder. */ -+ cd->rebuild_tables = or1k_cgen_rebuild_tables; -+ or1k_cgen_rebuild_tables (cd); -+ -+ /* Default to not allowing signed overflow. */ -+ cd->signed_overflow_ok_p = 0; -+ -+ return (CGEN_CPU_DESC) cd; -+} -+ -+/* Cover fn to or1k_cgen_cpu_open to handle the simple case of 1 isa, 1 mach. -+ MACH_NAME is the bfd name of the mach. */ -+ -+CGEN_CPU_DESC -+or1k_cgen_cpu_open_1 (const char *mach_name, enum cgen_endian endian) -+{ -+ return or1k_cgen_cpu_open (CGEN_CPU_OPEN_BFDMACH, mach_name, -+ CGEN_CPU_OPEN_ENDIAN, endian, -+ CGEN_CPU_OPEN_END); -+} -+ -+/* Close a cpu table. -+ ??? This can live in a machine independent file, but there's currently -+ no place to put this file (there's no libcgen). libopcodes is the wrong -+ place as some simulator ports use this but they don't use libopcodes. */ -+ -+void -+or1k_cgen_cpu_close (CGEN_CPU_DESC cd) -+{ -+ unsigned int i; -+ const CGEN_INSN *insns; -+ -+ if (cd->macro_insn_table.init_entries) -+ { -+ insns = cd->macro_insn_table.init_entries; -+ for (i = 0; i < cd->macro_insn_table.num_init_entries; ++i, ++insns) -+ if (CGEN_INSN_RX ((insns))) -+ regfree (CGEN_INSN_RX (insns)); -+ } -+ -+ if (cd->insn_table.init_entries) -+ { -+ insns = cd->insn_table.init_entries; -+ for (i = 0; i < cd->insn_table.num_init_entries; ++i, ++insns) -+ if (CGEN_INSN_RX (insns)) -+ regfree (CGEN_INSN_RX (insns)); -+ } -+ -+ if (cd->macro_insn_table.init_entries) -+ free ((CGEN_INSN *) cd->macro_insn_table.init_entries); -+ -+ if (cd->insn_table.init_entries) -+ free ((CGEN_INSN *) cd->insn_table.init_entries); -+ -+ if (cd->hw_table.entries) -+ free ((CGEN_HW_ENTRY *) cd->hw_table.entries); -+ -+ if (cd->operand_table.entries) -+ free ((CGEN_HW_ENTRY *) cd->operand_table.entries); -+ -+ free (cd); -+} -+ -diff -rNU3 dist.orig/opcodes/or1k-desc.h dist/opcodes/or1k-desc.h ---- dist.orig/opcodes/or1k-desc.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-desc.h 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,682 @@ -+/* CPU data header for or1k. -+ -+THIS FILE IS MACHINE GENERATED WITH CGEN. -+ -+Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+This file is part of the GNU Binutils and/or GDB, the GNU debugger. -+ -+ This file is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -+ -+*/ -+ -+#ifndef OR1K_CPU_H -+#define OR1K_CPU_H -+ -+#define CGEN_ARCH or1k -+ -+/* Given symbol S, return or1k_cgen_. */ -+#define CGEN_SYM(s) or1k##_cgen_##s -+ -+ -+/* Selected cpu families. */ -+#define HAVE_CPU_OR1K32BF -+#define HAVE_CPU_OR1K64BF -+ -+#define CGEN_INSN_LSB0_P 1 -+ -+/* Minimum size of any insn (in bytes). */ -+#define CGEN_MIN_INSN_SIZE 4 -+ -+/* Maximum size of any insn (in bytes). */ -+#define CGEN_MAX_INSN_SIZE 4 -+ -+#define CGEN_INT_INSN_P 1 -+ -+/* Maximum number of syntax elements in an instruction. */ -+#define CGEN_ACTUAL_MAX_SYNTAX_ELEMENTS 17 -+ -+/* CGEN_MNEMONIC_OPERANDS is defined if mnemonics have operands. -+ e.g. In "b,a foo" the ",a" is an operand. If mnemonics have operands -+ we can't hash on everything up to the space. */ -+#define CGEN_MNEMONIC_OPERANDS -+ -+/* Maximum number of fields in an instruction. */ -+#define CGEN_ACTUAL_MAX_IFMT_OPERANDS 8 -+ -+/* Enums. */ -+ -+/* Enum declaration for Exception numbers. */ -+typedef enum except_number { -+ EXCEPT_NONE, EXCEPT_RESET, EXCEPT_BUSERR, EXCEPT_DPF -+ , EXCEPT_IPF, EXCEPT_TICK, EXCEPT_ALIGN, EXCEPT_ILLEGAL -+ , EXCEPT_INT, EXCEPT_DTLBMISS, EXCEPT_ITLBMISS, EXCEPT_RANGE -+ , EXCEPT_SYSCALL, EXCEPT_FPE, EXCEPT_TRAP -+} EXCEPT_NUMBER; -+ -+/* Enum declaration for special purpose register groups. */ -+typedef enum spr_groups { -+ SPR_GROUP_SYS, SPR_GROUP_DMMU, SPR_GROUP_IMMU, SPR_GROUP_DCACHE -+ , SPR_GROUP_ICACHE, SPR_GROUP_MAC, SPR_GROUP_DEBUG, SPR_GROUP_PERF -+ , SPR_GROUP_POWER, SPR_GROUP_PIC, SPR_GROUP_TICK, SPR_GROUP_FPU -+} SPR_GROUPS; -+ -+/* Enum declaration for special purpose register indicies. */ -+typedef enum spr_reg_indices { -+ SPR_INDEX_SYS_VR = 0, SPR_INDEX_SYS_UPR = 1, SPR_INDEX_SYS_CPUCFGR = 2, SPR_INDEX_SYS_DMMUCFGR = 3 -+ , SPR_INDEX_SYS_IMMUCFGR = 4, SPR_INDEX_SYS_DCCFGR = 5, SPR_INDEX_SYS_ICCFGR = 6, SPR_INDEX_SYS_DCFGR = 7 -+ , SPR_INDEX_SYS_PCCFGR = 8, SPR_INDEX_SYS_NPC = 16, SPR_INDEX_SYS_SR = 17, SPR_INDEX_SYS_PPC = 18 -+ , SPR_INDEX_SYS_FPCSR = 20, SPR_INDEX_SYS_EPCR0 = 32, SPR_INDEX_SYS_EPCR1 = 33, SPR_INDEX_SYS_EPCR2 = 34 -+ , SPR_INDEX_SYS_EPCR3 = 35, SPR_INDEX_SYS_EPCR4 = 36, SPR_INDEX_SYS_EPCR5 = 37, SPR_INDEX_SYS_EPCR6 = 38 -+ , SPR_INDEX_SYS_EPCR7 = 39, SPR_INDEX_SYS_EPCR8 = 40, SPR_INDEX_SYS_EPCR9 = 41, SPR_INDEX_SYS_EPCR10 = 42 -+ , SPR_INDEX_SYS_EPCR11 = 43, SPR_INDEX_SYS_EPCR12 = 44, SPR_INDEX_SYS_EPCR13 = 45, SPR_INDEX_SYS_EPCR14 = 46 -+ , SPR_INDEX_SYS_EPCR15 = 47, SPR_INDEX_SYS_EEAR0 = 48, SPR_INDEX_SYS_EEAR1 = 49, SPR_INDEX_SYS_EEAR2 = 50 -+ , SPR_INDEX_SYS_EEAR3 = 51, SPR_INDEX_SYS_EEAR4 = 52, SPR_INDEX_SYS_EEAR5 = 53, SPR_INDEX_SYS_EEAR6 = 54 -+ , SPR_INDEX_SYS_EEAR7 = 55, SPR_INDEX_SYS_EEAR8 = 56, SPR_INDEX_SYS_EEAR9 = 57, SPR_INDEX_SYS_EEAR10 = 58 -+ , SPR_INDEX_SYS_EEAR11 = 59, SPR_INDEX_SYS_EEAR12 = 60, SPR_INDEX_SYS_EEAR13 = 61, SPR_INDEX_SYS_EEAR14 = 62 -+ , SPR_INDEX_SYS_EEAR15 = 63, SPR_INDEX_SYS_ESR0 = 64, SPR_INDEX_SYS_ESR1 = 65, SPR_INDEX_SYS_ESR2 = 66 -+ , SPR_INDEX_SYS_ESR3 = 67, SPR_INDEX_SYS_ESR4 = 68, SPR_INDEX_SYS_ESR5 = 69, SPR_INDEX_SYS_ESR6 = 70 -+ , SPR_INDEX_SYS_ESR7 = 71, SPR_INDEX_SYS_ESR8 = 72, SPR_INDEX_SYS_ESR9 = 73, SPR_INDEX_SYS_ESR10 = 74 -+ , SPR_INDEX_SYS_ESR11 = 75, SPR_INDEX_SYS_ESR12 = 76, SPR_INDEX_SYS_ESR13 = 77, SPR_INDEX_SYS_ESR14 = 78 -+ , SPR_INDEX_SYS_ESR15 = 79, SPR_INDEX_SYS_GPR0 = 1024, SPR_INDEX_SYS_GPR1 = 1025, SPR_INDEX_SYS_GPR2 = 1026 -+ , SPR_INDEX_SYS_GPR3 = 1027, SPR_INDEX_SYS_GPR4 = 1028, SPR_INDEX_SYS_GPR5 = 1029, SPR_INDEX_SYS_GPR6 = 1030 -+ , SPR_INDEX_SYS_GPR7 = 1031, SPR_INDEX_SYS_GPR8 = 1032, SPR_INDEX_SYS_GPR9 = 1033, SPR_INDEX_SYS_GPR10 = 1034 -+ , SPR_INDEX_SYS_GPR11 = 1035, SPR_INDEX_SYS_GPR12 = 1036, SPR_INDEX_SYS_GPR13 = 1037, SPR_INDEX_SYS_GPR14 = 1038 -+ , SPR_INDEX_SYS_GPR15 = 1039, SPR_INDEX_SYS_GPR16 = 1040, SPR_INDEX_SYS_GPR17 = 1041, SPR_INDEX_SYS_GPR18 = 1042 -+ , SPR_INDEX_SYS_GPR19 = 1043, SPR_INDEX_SYS_GPR20 = 1044, SPR_INDEX_SYS_GPR21 = 1045, SPR_INDEX_SYS_GPR22 = 1046 -+ , SPR_INDEX_SYS_GPR23 = 1047, SPR_INDEX_SYS_GPR24 = 1048, SPR_INDEX_SYS_GPR25 = 1049, SPR_INDEX_SYS_GPR26 = 1050 -+ , SPR_INDEX_SYS_GPR27 = 1051, SPR_INDEX_SYS_GPR28 = 1052, SPR_INDEX_SYS_GPR29 = 1053, SPR_INDEX_SYS_GPR30 = 1054 -+ , SPR_INDEX_SYS_GPR31 = 1055, SPR_INDEX_SYS_GPR32 = 1056, SPR_INDEX_SYS_GPR33 = 1057, SPR_INDEX_SYS_GPR34 = 1058 -+ , SPR_INDEX_SYS_GPR35 = 1059, SPR_INDEX_SYS_GPR36 = 1060, SPR_INDEX_SYS_GPR37 = 1061, SPR_INDEX_SYS_GPR38 = 1062 -+ , SPR_INDEX_SYS_GPR39 = 1063, SPR_INDEX_SYS_GPR40 = 1064, SPR_INDEX_SYS_GPR41 = 1065, SPR_INDEX_SYS_GPR42 = 1066 -+ , SPR_INDEX_SYS_GPR43 = 1067, SPR_INDEX_SYS_GPR44 = 1068, SPR_INDEX_SYS_GPR45 = 1069, SPR_INDEX_SYS_GPR46 = 1070 -+ , SPR_INDEX_SYS_GPR47 = 1071, SPR_INDEX_SYS_GPR48 = 1072, SPR_INDEX_SYS_GPR49 = 1073, SPR_INDEX_SYS_GPR50 = 1074 -+ , SPR_INDEX_SYS_GPR51 = 1075, SPR_INDEX_SYS_GPR52 = 1076, SPR_INDEX_SYS_GPR53 = 1077, SPR_INDEX_SYS_GPR54 = 1078 -+ , SPR_INDEX_SYS_GPR55 = 1079, SPR_INDEX_SYS_GPR56 = 1080, SPR_INDEX_SYS_GPR57 = 1081, SPR_INDEX_SYS_GPR58 = 1082 -+ , SPR_INDEX_SYS_GPR59 = 1083, SPR_INDEX_SYS_GPR60 = 1084, SPR_INDEX_SYS_GPR61 = 1085, SPR_INDEX_SYS_GPR62 = 1086 -+ , SPR_INDEX_SYS_GPR63 = 1087, SPR_INDEX_SYS_GPR64 = 1088, SPR_INDEX_SYS_GPR65 = 1089, SPR_INDEX_SYS_GPR66 = 1090 -+ , SPR_INDEX_SYS_GPR67 = 1091, SPR_INDEX_SYS_GPR68 = 1092, SPR_INDEX_SYS_GPR69 = 1093, SPR_INDEX_SYS_GPR70 = 1094 -+ , SPR_INDEX_SYS_GPR71 = 1095, SPR_INDEX_SYS_GPR72 = 1096, SPR_INDEX_SYS_GPR73 = 1097, SPR_INDEX_SYS_GPR74 = 1098 -+ , SPR_INDEX_SYS_GPR75 = 1099, SPR_INDEX_SYS_GPR76 = 1100, SPR_INDEX_SYS_GPR77 = 1101, SPR_INDEX_SYS_GPR78 = 1102 -+ , SPR_INDEX_SYS_GPR79 = 1103, SPR_INDEX_SYS_GPR80 = 1104, SPR_INDEX_SYS_GPR81 = 1105, SPR_INDEX_SYS_GPR82 = 1106 -+ , SPR_INDEX_SYS_GPR83 = 1107, SPR_INDEX_SYS_GPR84 = 1108, SPR_INDEX_SYS_GPR85 = 1109, SPR_INDEX_SYS_GPR86 = 1110 -+ , SPR_INDEX_SYS_GPR87 = 1111, SPR_INDEX_SYS_GPR88 = 1112, SPR_INDEX_SYS_GPR89 = 1113, SPR_INDEX_SYS_GPR90 = 1114 -+ , SPR_INDEX_SYS_GPR91 = 1115, SPR_INDEX_SYS_GPR92 = 1116, SPR_INDEX_SYS_GPR93 = 1117, SPR_INDEX_SYS_GPR94 = 1118 -+ , SPR_INDEX_SYS_GPR95 = 1119, SPR_INDEX_SYS_GPR96 = 1120, SPR_INDEX_SYS_GPR97 = 1121, SPR_INDEX_SYS_GPR98 = 1122 -+ , SPR_INDEX_SYS_GPR99 = 1123, SPR_INDEX_SYS_GPR100 = 1124, SPR_INDEX_SYS_GPR101 = 1125, SPR_INDEX_SYS_GPR102 = 1126 -+ , SPR_INDEX_SYS_GPR103 = 1127, SPR_INDEX_SYS_GPR104 = 1128, SPR_INDEX_SYS_GPR105 = 1129, SPR_INDEX_SYS_GPR106 = 1130 -+ , SPR_INDEX_SYS_GPR107 = 1131, SPR_INDEX_SYS_GPR108 = 1132, SPR_INDEX_SYS_GPR109 = 1133, SPR_INDEX_SYS_GPR110 = 1134 -+ , SPR_INDEX_SYS_GPR111 = 1135, SPR_INDEX_SYS_GPR112 = 1136, SPR_INDEX_SYS_GPR113 = 1137, SPR_INDEX_SYS_GPR114 = 1138 -+ , SPR_INDEX_SYS_GPR115 = 1139, SPR_INDEX_SYS_GPR116 = 1140, SPR_INDEX_SYS_GPR117 = 1141, SPR_INDEX_SYS_GPR118 = 1142 -+ , SPR_INDEX_SYS_GPR119 = 1143, SPR_INDEX_SYS_GPR120 = 1144, SPR_INDEX_SYS_GPR121 = 1145, SPR_INDEX_SYS_GPR122 = 1146 -+ , SPR_INDEX_SYS_GPR123 = 1147, SPR_INDEX_SYS_GPR124 = 1148, SPR_INDEX_SYS_GPR125 = 1149, SPR_INDEX_SYS_GPR126 = 1150 -+ , SPR_INDEX_SYS_GPR127 = 1151, SPR_INDEX_SYS_GPR128 = 1152, SPR_INDEX_SYS_GPR129 = 1153, SPR_INDEX_SYS_GPR130 = 1154 -+ , SPR_INDEX_SYS_GPR131 = 1155, SPR_INDEX_SYS_GPR132 = 1156, SPR_INDEX_SYS_GPR133 = 1157, SPR_INDEX_SYS_GPR134 = 1158 -+ , SPR_INDEX_SYS_GPR135 = 1159, SPR_INDEX_SYS_GPR136 = 1160, SPR_INDEX_SYS_GPR137 = 1161, SPR_INDEX_SYS_GPR138 = 1162 -+ , SPR_INDEX_SYS_GPR139 = 1163, SPR_INDEX_SYS_GPR140 = 1164, SPR_INDEX_SYS_GPR141 = 1165, SPR_INDEX_SYS_GPR142 = 1166 -+ , SPR_INDEX_SYS_GPR143 = 1167, SPR_INDEX_SYS_GPR144 = 1168, SPR_INDEX_SYS_GPR145 = 1169, SPR_INDEX_SYS_GPR146 = 1170 -+ , SPR_INDEX_SYS_GPR147 = 1171, SPR_INDEX_SYS_GPR148 = 1172, SPR_INDEX_SYS_GPR149 = 1173, SPR_INDEX_SYS_GPR150 = 1174 -+ , SPR_INDEX_SYS_GPR151 = 1175, SPR_INDEX_SYS_GPR152 = 1176, SPR_INDEX_SYS_GPR153 = 1177, SPR_INDEX_SYS_GPR154 = 1178 -+ , SPR_INDEX_SYS_GPR155 = 1179, SPR_INDEX_SYS_GPR156 = 1180, SPR_INDEX_SYS_GPR157 = 1181, SPR_INDEX_SYS_GPR158 = 1182 -+ , SPR_INDEX_SYS_GPR159 = 1183, SPR_INDEX_SYS_GPR160 = 1184, SPR_INDEX_SYS_GPR161 = 1185, SPR_INDEX_SYS_GPR162 = 1186 -+ , SPR_INDEX_SYS_GPR163 = 1187, SPR_INDEX_SYS_GPR164 = 1188, SPR_INDEX_SYS_GPR165 = 1189, SPR_INDEX_SYS_GPR166 = 1190 -+ , SPR_INDEX_SYS_GPR167 = 1191, SPR_INDEX_SYS_GPR168 = 1192, SPR_INDEX_SYS_GPR169 = 1193, SPR_INDEX_SYS_GPR170 = 1194 -+ , SPR_INDEX_SYS_GPR171 = 1195, SPR_INDEX_SYS_GPR172 = 1196, SPR_INDEX_SYS_GPR173 = 1197, SPR_INDEX_SYS_GPR174 = 1198 -+ , SPR_INDEX_SYS_GPR175 = 1199, SPR_INDEX_SYS_GPR176 = 1200, SPR_INDEX_SYS_GPR177 = 1201, SPR_INDEX_SYS_GPR178 = 1202 -+ , SPR_INDEX_SYS_GPR179 = 1203, SPR_INDEX_SYS_GPR180 = 1204, SPR_INDEX_SYS_GPR181 = 1205, SPR_INDEX_SYS_GPR182 = 1206 -+ , SPR_INDEX_SYS_GPR183 = 1207, SPR_INDEX_SYS_GPR184 = 1208, SPR_INDEX_SYS_GPR185 = 1209, SPR_INDEX_SYS_GPR186 = 1210 -+ , SPR_INDEX_SYS_GPR187 = 1211, SPR_INDEX_SYS_GPR188 = 1212, SPR_INDEX_SYS_GPR189 = 1213, SPR_INDEX_SYS_GPR190 = 1214 -+ , SPR_INDEX_SYS_GPR191 = 1215, SPR_INDEX_SYS_GPR192 = 1216, SPR_INDEX_SYS_GPR193 = 1217, SPR_INDEX_SYS_GPR194 = 1218 -+ , SPR_INDEX_SYS_GPR195 = 1219, SPR_INDEX_SYS_GPR196 = 1220, SPR_INDEX_SYS_GPR197 = 1221, SPR_INDEX_SYS_GPR198 = 1222 -+ , SPR_INDEX_SYS_GPR199 = 1223, SPR_INDEX_SYS_GPR200 = 1224, SPR_INDEX_SYS_GPR201 = 1225, SPR_INDEX_SYS_GPR202 = 1226 -+ , SPR_INDEX_SYS_GPR203 = 1227, SPR_INDEX_SYS_GPR204 = 1228, SPR_INDEX_SYS_GPR205 = 1229, SPR_INDEX_SYS_GPR206 = 1230 -+ , SPR_INDEX_SYS_GPR207 = 1231, SPR_INDEX_SYS_GPR208 = 1232, SPR_INDEX_SYS_GPR209 = 1233, SPR_INDEX_SYS_GPR210 = 1234 -+ , SPR_INDEX_SYS_GPR211 = 1235, SPR_INDEX_SYS_GPR212 = 1236, SPR_INDEX_SYS_GPR213 = 1237, SPR_INDEX_SYS_GPR214 = 1238 -+ , SPR_INDEX_SYS_GPR215 = 1239, SPR_INDEX_SYS_GPR216 = 1240, SPR_INDEX_SYS_GPR217 = 1241, SPR_INDEX_SYS_GPR218 = 1242 -+ , SPR_INDEX_SYS_GPR219 = 1243, SPR_INDEX_SYS_GPR220 = 1244, SPR_INDEX_SYS_GPR221 = 1245, SPR_INDEX_SYS_GPR222 = 1246 -+ , SPR_INDEX_SYS_GPR223 = 1247, SPR_INDEX_SYS_GPR224 = 1248, SPR_INDEX_SYS_GPR225 = 1249, SPR_INDEX_SYS_GPR226 = 1250 -+ , SPR_INDEX_SYS_GPR227 = 1251, SPR_INDEX_SYS_GPR228 = 1252, SPR_INDEX_SYS_GPR229 = 1253, SPR_INDEX_SYS_GPR230 = 1254 -+ , SPR_INDEX_SYS_GPR231 = 1255, SPR_INDEX_SYS_GPR232 = 1256, SPR_INDEX_SYS_GPR233 = 1257, SPR_INDEX_SYS_GPR234 = 1258 -+ , SPR_INDEX_SYS_GPR235 = 1259, SPR_INDEX_SYS_GPR236 = 1260, SPR_INDEX_SYS_GPR237 = 1261, SPR_INDEX_SYS_GPR238 = 1262 -+ , SPR_INDEX_SYS_GPR239 = 1263, SPR_INDEX_SYS_GPR240 = 1264, SPR_INDEX_SYS_GPR241 = 1265, SPR_INDEX_SYS_GPR242 = 1266 -+ , SPR_INDEX_SYS_GPR243 = 1267, SPR_INDEX_SYS_GPR244 = 1268, SPR_INDEX_SYS_GPR245 = 1269, SPR_INDEX_SYS_GPR246 = 1270 -+ , SPR_INDEX_SYS_GPR247 = 1271, SPR_INDEX_SYS_GPR248 = 1272, SPR_INDEX_SYS_GPR249 = 1273, SPR_INDEX_SYS_GPR250 = 1274 -+ , SPR_INDEX_SYS_GPR251 = 1275, SPR_INDEX_SYS_GPR252 = 1276, SPR_INDEX_SYS_GPR253 = 1277, SPR_INDEX_SYS_GPR254 = 1278 -+ , SPR_INDEX_SYS_GPR255 = 1279, SPR_INDEX_SYS_GPR256 = 1280, SPR_INDEX_SYS_GPR257 = 1281, SPR_INDEX_SYS_GPR258 = 1282 -+ , SPR_INDEX_SYS_GPR259 = 1283, SPR_INDEX_SYS_GPR260 = 1284, SPR_INDEX_SYS_GPR261 = 1285, SPR_INDEX_SYS_GPR262 = 1286 -+ , SPR_INDEX_SYS_GPR263 = 1287, SPR_INDEX_SYS_GPR264 = 1288, SPR_INDEX_SYS_GPR265 = 1289, SPR_INDEX_SYS_GPR266 = 1290 -+ , SPR_INDEX_SYS_GPR267 = 1291, SPR_INDEX_SYS_GPR268 = 1292, SPR_INDEX_SYS_GPR269 = 1293, SPR_INDEX_SYS_GPR270 = 1294 -+ , SPR_INDEX_SYS_GPR271 = 1295, SPR_INDEX_SYS_GPR272 = 1296, SPR_INDEX_SYS_GPR273 = 1297, SPR_INDEX_SYS_GPR274 = 1298 -+ , SPR_INDEX_SYS_GPR275 = 1299, SPR_INDEX_SYS_GPR276 = 1300, SPR_INDEX_SYS_GPR277 = 1301, SPR_INDEX_SYS_GPR278 = 1302 -+ , SPR_INDEX_SYS_GPR279 = 1303, SPR_INDEX_SYS_GPR280 = 1304, SPR_INDEX_SYS_GPR281 = 1305, SPR_INDEX_SYS_GPR282 = 1306 -+ , SPR_INDEX_SYS_GPR283 = 1307, SPR_INDEX_SYS_GPR284 = 1308, SPR_INDEX_SYS_GPR285 = 1309, SPR_INDEX_SYS_GPR286 = 1310 -+ , SPR_INDEX_SYS_GPR287 = 1311, SPR_INDEX_SYS_GPR288 = 1312, SPR_INDEX_SYS_GPR289 = 1313, SPR_INDEX_SYS_GPR290 = 1314 -+ , SPR_INDEX_SYS_GPR291 = 1315, SPR_INDEX_SYS_GPR292 = 1316, SPR_INDEX_SYS_GPR293 = 1317, SPR_INDEX_SYS_GPR294 = 1318 -+ , SPR_INDEX_SYS_GPR295 = 1319, SPR_INDEX_SYS_GPR296 = 1320, SPR_INDEX_SYS_GPR297 = 1321, SPR_INDEX_SYS_GPR298 = 1322 -+ , SPR_INDEX_SYS_GPR299 = 1323, SPR_INDEX_SYS_GPR300 = 1324, SPR_INDEX_SYS_GPR301 = 1325, SPR_INDEX_SYS_GPR302 = 1326 -+ , SPR_INDEX_SYS_GPR303 = 1327, SPR_INDEX_SYS_GPR304 = 1328, SPR_INDEX_SYS_GPR305 = 1329, SPR_INDEX_SYS_GPR306 = 1330 -+ , SPR_INDEX_SYS_GPR307 = 1331, SPR_INDEX_SYS_GPR308 = 1332, SPR_INDEX_SYS_GPR309 = 1333, SPR_INDEX_SYS_GPR310 = 1334 -+ , SPR_INDEX_SYS_GPR311 = 1335, SPR_INDEX_SYS_GPR312 = 1336, SPR_INDEX_SYS_GPR313 = 1337, SPR_INDEX_SYS_GPR314 = 1338 -+ , SPR_INDEX_SYS_GPR315 = 1339, SPR_INDEX_SYS_GPR316 = 1340, SPR_INDEX_SYS_GPR317 = 1341, SPR_INDEX_SYS_GPR318 = 1342 -+ , SPR_INDEX_SYS_GPR319 = 1343, SPR_INDEX_SYS_GPR320 = 1344, SPR_INDEX_SYS_GPR321 = 1345, SPR_INDEX_SYS_GPR322 = 1346 -+ , SPR_INDEX_SYS_GPR323 = 1347, SPR_INDEX_SYS_GPR324 = 1348, SPR_INDEX_SYS_GPR325 = 1349, SPR_INDEX_SYS_GPR326 = 1350 -+ , SPR_INDEX_SYS_GPR327 = 1351, SPR_INDEX_SYS_GPR328 = 1352, SPR_INDEX_SYS_GPR329 = 1353, SPR_INDEX_SYS_GPR330 = 1354 -+ , SPR_INDEX_SYS_GPR331 = 1355, SPR_INDEX_SYS_GPR332 = 1356, SPR_INDEX_SYS_GPR333 = 1357, SPR_INDEX_SYS_GPR334 = 1358 -+ , SPR_INDEX_SYS_GPR335 = 1359, SPR_INDEX_SYS_GPR336 = 1360, SPR_INDEX_SYS_GPR337 = 1361, SPR_INDEX_SYS_GPR338 = 1362 -+ , SPR_INDEX_SYS_GPR339 = 1363, SPR_INDEX_SYS_GPR340 = 1364, SPR_INDEX_SYS_GPR341 = 1365, SPR_INDEX_SYS_GPR342 = 1366 -+ , SPR_INDEX_SYS_GPR343 = 1367, SPR_INDEX_SYS_GPR344 = 1368, SPR_INDEX_SYS_GPR345 = 1369, SPR_INDEX_SYS_GPR346 = 1370 -+ , SPR_INDEX_SYS_GPR347 = 1371, SPR_INDEX_SYS_GPR348 = 1372, SPR_INDEX_SYS_GPR349 = 1373, SPR_INDEX_SYS_GPR350 = 1374 -+ , SPR_INDEX_SYS_GPR351 = 1375, SPR_INDEX_SYS_GPR352 = 1376, SPR_INDEX_SYS_GPR353 = 1377, SPR_INDEX_SYS_GPR354 = 1378 -+ , SPR_INDEX_SYS_GPR355 = 1379, SPR_INDEX_SYS_GPR356 = 1380, SPR_INDEX_SYS_GPR357 = 1381, SPR_INDEX_SYS_GPR358 = 1382 -+ , SPR_INDEX_SYS_GPR359 = 1383, SPR_INDEX_SYS_GPR360 = 1384, SPR_INDEX_SYS_GPR361 = 1385, SPR_INDEX_SYS_GPR362 = 1386 -+ , SPR_INDEX_SYS_GPR363 = 1387, SPR_INDEX_SYS_GPR364 = 1388, SPR_INDEX_SYS_GPR365 = 1389, SPR_INDEX_SYS_GPR366 = 1390 -+ , SPR_INDEX_SYS_GPR367 = 1391, SPR_INDEX_SYS_GPR368 = 1392, SPR_INDEX_SYS_GPR369 = 1393, SPR_INDEX_SYS_GPR370 = 1394 -+ , SPR_INDEX_SYS_GPR371 = 1395, SPR_INDEX_SYS_GPR372 = 1396, SPR_INDEX_SYS_GPR373 = 1397, SPR_INDEX_SYS_GPR374 = 1398 -+ , SPR_INDEX_SYS_GPR375 = 1399, SPR_INDEX_SYS_GPR376 = 1400, SPR_INDEX_SYS_GPR377 = 1401, SPR_INDEX_SYS_GPR378 = 1402 -+ , SPR_INDEX_SYS_GPR379 = 1403, SPR_INDEX_SYS_GPR380 = 1404, SPR_INDEX_SYS_GPR381 = 1405, SPR_INDEX_SYS_GPR382 = 1406 -+ , SPR_INDEX_SYS_GPR383 = 1407, SPR_INDEX_SYS_GPR384 = 1408, SPR_INDEX_SYS_GPR385 = 1409, SPR_INDEX_SYS_GPR386 = 1410 -+ , SPR_INDEX_SYS_GPR387 = 1411, SPR_INDEX_SYS_GPR388 = 1412, SPR_INDEX_SYS_GPR389 = 1413, SPR_INDEX_SYS_GPR390 = 1414 -+ , SPR_INDEX_SYS_GPR391 = 1415, SPR_INDEX_SYS_GPR392 = 1416, SPR_INDEX_SYS_GPR393 = 1417, SPR_INDEX_SYS_GPR394 = 1418 -+ , SPR_INDEX_SYS_GPR395 = 1419, SPR_INDEX_SYS_GPR396 = 1420, SPR_INDEX_SYS_GPR397 = 1421, SPR_INDEX_SYS_GPR398 = 1422 -+ , SPR_INDEX_SYS_GPR399 = 1423, SPR_INDEX_SYS_GPR400 = 1424, SPR_INDEX_SYS_GPR401 = 1425, SPR_INDEX_SYS_GPR402 = 1426 -+ , SPR_INDEX_SYS_GPR403 = 1427, SPR_INDEX_SYS_GPR404 = 1428, SPR_INDEX_SYS_GPR405 = 1429, SPR_INDEX_SYS_GPR406 = 1430 -+ , SPR_INDEX_SYS_GPR407 = 1431, SPR_INDEX_SYS_GPR408 = 1432, SPR_INDEX_SYS_GPR409 = 1433, SPR_INDEX_SYS_GPR410 = 1434 -+ , SPR_INDEX_SYS_GPR411 = 1435, SPR_INDEX_SYS_GPR412 = 1436, SPR_INDEX_SYS_GPR413 = 1437, SPR_INDEX_SYS_GPR414 = 1438 -+ , SPR_INDEX_SYS_GPR415 = 1439, SPR_INDEX_SYS_GPR416 = 1440, SPR_INDEX_SYS_GPR417 = 1441, SPR_INDEX_SYS_GPR418 = 1442 -+ , SPR_INDEX_SYS_GPR419 = 1443, SPR_INDEX_SYS_GPR420 = 1444, SPR_INDEX_SYS_GPR421 = 1445, SPR_INDEX_SYS_GPR422 = 1446 -+ , SPR_INDEX_SYS_GPR423 = 1447, SPR_INDEX_SYS_GPR424 = 1448, SPR_INDEX_SYS_GPR425 = 1449, SPR_INDEX_SYS_GPR426 = 1450 -+ , SPR_INDEX_SYS_GPR427 = 1451, SPR_INDEX_SYS_GPR428 = 1452, SPR_INDEX_SYS_GPR429 = 1453, SPR_INDEX_SYS_GPR430 = 1454 -+ , SPR_INDEX_SYS_GPR431 = 1455, SPR_INDEX_SYS_GPR432 = 1456, SPR_INDEX_SYS_GPR433 = 1457, SPR_INDEX_SYS_GPR434 = 1458 -+ , SPR_INDEX_SYS_GPR435 = 1459, SPR_INDEX_SYS_GPR436 = 1460, SPR_INDEX_SYS_GPR437 = 1461, SPR_INDEX_SYS_GPR438 = 1462 -+ , SPR_INDEX_SYS_GPR439 = 1463, SPR_INDEX_SYS_GPR440 = 1464, SPR_INDEX_SYS_GPR441 = 1465, SPR_INDEX_SYS_GPR442 = 1466 -+ , SPR_INDEX_SYS_GPR443 = 1467, SPR_INDEX_SYS_GPR444 = 1468, SPR_INDEX_SYS_GPR445 = 1469, SPR_INDEX_SYS_GPR446 = 1470 -+ , SPR_INDEX_SYS_GPR447 = 1471, SPR_INDEX_SYS_GPR448 = 1472, SPR_INDEX_SYS_GPR449 = 1473, SPR_INDEX_SYS_GPR450 = 1474 -+ , SPR_INDEX_SYS_GPR451 = 1475, SPR_INDEX_SYS_GPR452 = 1476, SPR_INDEX_SYS_GPR453 = 1477, SPR_INDEX_SYS_GPR454 = 1478 -+ , SPR_INDEX_SYS_GPR455 = 1479, SPR_INDEX_SYS_GPR456 = 1480, SPR_INDEX_SYS_GPR457 = 1481, SPR_INDEX_SYS_GPR458 = 1482 -+ , SPR_INDEX_SYS_GPR459 = 1483, SPR_INDEX_SYS_GPR460 = 1484, SPR_INDEX_SYS_GPR461 = 1485, SPR_INDEX_SYS_GPR462 = 1486 -+ , SPR_INDEX_SYS_GPR463 = 1487, SPR_INDEX_SYS_GPR464 = 1488, SPR_INDEX_SYS_GPR465 = 1489, SPR_INDEX_SYS_GPR466 = 1490 -+ , SPR_INDEX_SYS_GPR467 = 1491, SPR_INDEX_SYS_GPR468 = 1492, SPR_INDEX_SYS_GPR469 = 1493, SPR_INDEX_SYS_GPR470 = 1494 -+ , SPR_INDEX_SYS_GPR471 = 1495, SPR_INDEX_SYS_GPR472 = 1496, SPR_INDEX_SYS_GPR473 = 1497, SPR_INDEX_SYS_GPR474 = 1498 -+ , SPR_INDEX_SYS_GPR475 = 1499, SPR_INDEX_SYS_GPR476 = 1500, SPR_INDEX_SYS_GPR477 = 1501, SPR_INDEX_SYS_GPR478 = 1502 -+ , SPR_INDEX_SYS_GPR479 = 1503, SPR_INDEX_SYS_GPR480 = 1504, SPR_INDEX_SYS_GPR481 = 1505, SPR_INDEX_SYS_GPR482 = 1506 -+ , SPR_INDEX_SYS_GPR483 = 1507, SPR_INDEX_SYS_GPR484 = 1508, SPR_INDEX_SYS_GPR485 = 1509, SPR_INDEX_SYS_GPR486 = 1510 -+ , SPR_INDEX_SYS_GPR487 = 1511, SPR_INDEX_SYS_GPR488 = 1512, SPR_INDEX_SYS_GPR489 = 1513, SPR_INDEX_SYS_GPR490 = 1514 -+ , SPR_INDEX_SYS_GPR491 = 1515, SPR_INDEX_SYS_GPR492 = 1516, SPR_INDEX_SYS_GPR493 = 1517, SPR_INDEX_SYS_GPR494 = 1518 -+ , SPR_INDEX_SYS_GPR495 = 1519, SPR_INDEX_SYS_GPR496 = 1520, SPR_INDEX_SYS_GPR497 = 1521, SPR_INDEX_SYS_GPR498 = 1522 -+ , SPR_INDEX_SYS_GPR499 = 1523, SPR_INDEX_SYS_GPR500 = 1524, SPR_INDEX_SYS_GPR501 = 1525, SPR_INDEX_SYS_GPR502 = 1526 -+ , SPR_INDEX_SYS_GPR503 = 1527, SPR_INDEX_SYS_GPR504 = 1528, SPR_INDEX_SYS_GPR505 = 1529, SPR_INDEX_SYS_GPR506 = 1530 -+ , SPR_INDEX_SYS_GPR507 = 1531, SPR_INDEX_SYS_GPR508 = 1532, SPR_INDEX_SYS_GPR509 = 1533, SPR_INDEX_SYS_GPR510 = 1534 -+ , SPR_INDEX_SYS_GPR511 = 1535, SPR_INDEX_MAC_MACLO = 1, SPR_INDEX_MAC_MACHI = 2, SPR_INDEX_TICK_TTMR = 0 -+} SPR_REG_INDICES; -+ -+/* Enum declaration for SPR field msb positions. */ -+typedef enum spr_field_msbs { -+ SPR_FIELD_MSB_SYS_VR_REV = 5, SPR_FIELD_MSB_SYS_VR_CFG = 23, SPR_FIELD_MSB_SYS_VR_VER = 31, SPR_FIELD_MSB_SYS_UPR_UP = 0 -+ , SPR_FIELD_MSB_SYS_UPR_DCP = 1, SPR_FIELD_MSB_SYS_UPR_ICP = 2, SPR_FIELD_MSB_SYS_UPR_DMP = 3, SPR_FIELD_MSB_SYS_UPR_MP = 4 -+ , SPR_FIELD_MSB_SYS_UPR_IMP = 5, SPR_FIELD_MSB_SYS_UPR_DUP = 6, SPR_FIELD_MSB_SYS_UPR_PCUP = 7, SPR_FIELD_MSB_SYS_UPR_PICP = 8 -+ , SPR_FIELD_MSB_SYS_UPR_PMP = 9, SPR_FIELD_MSB_SYS_UPR_TTP = 10, SPR_FIELD_MSB_SYS_UPR_CUP = 31, SPR_FIELD_MSB_SYS_CPUCFGR_NSGR = 3 -+ , SPR_FIELD_MSB_SYS_CPUCFGR_CGF = 4, SPR_FIELD_MSB_SYS_CPUCFGR_OB32S = 5, SPR_FIELD_MSB_SYS_CPUCFGR_OB64S = 6, SPR_FIELD_MSB_SYS_CPUCFGR_OF32S = 7 -+ , SPR_FIELD_MSB_SYS_CPUCFGR_OF64S = 8, SPR_FIELD_MSB_SYS_CPUCFGR_OV64S = 9, SPR_FIELD_MSB_SYS_CPUCFGR_ND = 10, SPR_FIELD_MSB_SYS_SR_SM = 0 -+ , SPR_FIELD_MSB_SYS_SR_TEE = 1, SPR_FIELD_MSB_SYS_SR_IEE = 2, SPR_FIELD_MSB_SYS_SR_DCE = 3, SPR_FIELD_MSB_SYS_SR_ICE = 4 -+ , SPR_FIELD_MSB_SYS_SR_DME = 5, SPR_FIELD_MSB_SYS_SR_IME = 6, SPR_FIELD_MSB_SYS_SR_LEE = 7, SPR_FIELD_MSB_SYS_SR_CE = 8 -+ , SPR_FIELD_MSB_SYS_SR_F = 9, SPR_FIELD_MSB_SYS_SR_CY = 10, SPR_FIELD_MSB_SYS_SR_OV = 11, SPR_FIELD_MSB_SYS_SR_OVE = 12 -+ , SPR_FIELD_MSB_SYS_SR_DSX = 13, SPR_FIELD_MSB_SYS_SR_EPH = 14, SPR_FIELD_MSB_SYS_SR_FO = 15, SPR_FIELD_MSB_SYS_SR_SUMRA = 16 -+ , SPR_FIELD_MSB_SYS_SR_CID = 31, SPR_FIELD_MSB_SYS_FPCSR_FPEE = 0, SPR_FIELD_MSB_SYS_FPCSR_RM = 2, SPR_FIELD_MSB_SYS_FPCSR_OVF = 3 -+ , SPR_FIELD_MSB_SYS_FPCSR_UNF = 4, SPR_FIELD_MSB_SYS_FPCSR_SNF = 5, SPR_FIELD_MSB_SYS_FPCSR_QNF = 6, SPR_FIELD_MSB_SYS_FPCSR_ZF = 7 -+ , SPR_FIELD_MSB_SYS_FPCSR_IXF = 8, SPR_FIELD_MSB_SYS_FPCSR_IVF = 9, SPR_FIELD_MSB_SYS_FPCSR_INF = 10, SPR_FIELD_MSB_SYS_FPCSR_DZF = 11 -+} SPR_FIELD_MSBS; -+ -+/* Enum declaration for SPR field lsb positions. */ -+typedef enum spr_field_lsbs { -+ SPR_FIELD_SIZE_SYS_VR_REV = 0, SPR_FIELD_SIZE_SYS_VR_CFG = 16, SPR_FIELD_SIZE_SYS_VR_VER = 24, SPR_FIELD_SIZE_SYS_UPR_UP = 0 -+ , SPR_FIELD_SIZE_SYS_UPR_DCP = 1, SPR_FIELD_SIZE_SYS_UPR_ICP = 2, SPR_FIELD_SIZE_SYS_UPR_DMP = 3, SPR_FIELD_SIZE_SYS_UPR_MP = 4 -+ , SPR_FIELD_SIZE_SYS_UPR_IMP = 5, SPR_FIELD_SIZE_SYS_UPR_DUP = 6, SPR_FIELD_SIZE_SYS_UPR_PCUP = 7, SPR_FIELD_SIZE_SYS_UPR_PICP = 8 -+ , SPR_FIELD_SIZE_SYS_UPR_PMP = 9, SPR_FIELD_SIZE_SYS_UPR_TTP = 10, SPR_FIELD_SIZE_SYS_UPR_CUP = 24, SPR_FIELD_SIZE_SYS_CPUCFGR_NSGR = 0 -+ , SPR_FIELD_SIZE_SYS_CPUCFGR_CGF = 4, SPR_FIELD_SIZE_SYS_CPUCFGR_OB32S = 5, SPR_FIELD_SIZE_SYS_CPUCFGR_OB64S = 6, SPR_FIELD_SIZE_SYS_CPUCFGR_OF32S = 7 -+ , SPR_FIELD_SIZE_SYS_CPUCFGR_OF64S = 8, SPR_FIELD_SIZE_SYS_CPUCFGR_OV64S = 9, SPR_FIELD_SIZE_SYS_CPUCFGR_ND = 10, SPR_FIELD_SIZE_SYS_SR_SM = 0 -+ , SPR_FIELD_SIZE_SYS_SR_TEE = 1, SPR_FIELD_SIZE_SYS_SR_IEE = 2, SPR_FIELD_SIZE_SYS_SR_DCE = 3, SPR_FIELD_SIZE_SYS_SR_ICE = 4 -+ , SPR_FIELD_SIZE_SYS_SR_DME = 5, SPR_FIELD_SIZE_SYS_SR_IME = 6, SPR_FIELD_SIZE_SYS_SR_LEE = 7, SPR_FIELD_SIZE_SYS_SR_CE = 8 -+ , SPR_FIELD_SIZE_SYS_SR_F = 9, SPR_FIELD_SIZE_SYS_SR_CY = 10, SPR_FIELD_SIZE_SYS_SR_OV = 11, SPR_FIELD_SIZE_SYS_SR_OVE = 12 -+ , SPR_FIELD_SIZE_SYS_SR_DSX = 13, SPR_FIELD_SIZE_SYS_SR_EPH = 14, SPR_FIELD_SIZE_SYS_SR_FO = 15, SPR_FIELD_SIZE_SYS_SR_SUMRA = 16 -+ , SPR_FIELD_SIZE_SYS_SR_CID = 28, SPR_FIELD_SIZE_SYS_FPCSR_FPEE = 0, SPR_FIELD_SIZE_SYS_FPCSR_RM = 1, SPR_FIELD_SIZE_SYS_FPCSR_OVF = 3 -+ , SPR_FIELD_SIZE_SYS_FPCSR_UNF = 4, SPR_FIELD_SIZE_SYS_FPCSR_SNF = 5, SPR_FIELD_SIZE_SYS_FPCSR_QNF = 6, SPR_FIELD_SIZE_SYS_FPCSR_ZF = 7 -+ , SPR_FIELD_SIZE_SYS_FPCSR_IXF = 8, SPR_FIELD_SIZE_SYS_FPCSR_IVF = 9, SPR_FIELD_SIZE_SYS_FPCSR_INF = 10, SPR_FIELD_SIZE_SYS_FPCSR_DZF = 11 -+} SPR_FIELD_LSBS; -+ -+/* Enum declaration for SPR field masks. */ -+typedef enum spr_field_masks { -+ SPR_FIELD_MASK_SYS_VR_REV = 63, SPR_FIELD_MASK_SYS_VR_CFG = 16711680, SPR_FIELD_MASK_SYS_VR_VER = 4278190080u, SPR_FIELD_MASK_SYS_UPR_UP = 1 -+ , SPR_FIELD_MASK_SYS_UPR_DCP = 2, SPR_FIELD_MASK_SYS_UPR_ICP = 4, SPR_FIELD_MASK_SYS_UPR_DMP = 8, SPR_FIELD_MASK_SYS_UPR_MP = 16 -+ , SPR_FIELD_MASK_SYS_UPR_IMP = 32, SPR_FIELD_MASK_SYS_UPR_DUP = 64, SPR_FIELD_MASK_SYS_UPR_PCUP = 128, SPR_FIELD_MASK_SYS_UPR_PICP = 256 -+ , SPR_FIELD_MASK_SYS_UPR_PMP = 512, SPR_FIELD_MASK_SYS_UPR_TTP = 1024, SPR_FIELD_MASK_SYS_UPR_CUP = 4278190080u, SPR_FIELD_MASK_SYS_CPUCFGR_NSGR = 15 -+ , SPR_FIELD_MASK_SYS_CPUCFGR_CGF = 16, SPR_FIELD_MASK_SYS_CPUCFGR_OB32S = 32, SPR_FIELD_MASK_SYS_CPUCFGR_OB64S = 64, SPR_FIELD_MASK_SYS_CPUCFGR_OF32S = 128 -+ , SPR_FIELD_MASK_SYS_CPUCFGR_OF64S = 256, SPR_FIELD_MASK_SYS_CPUCFGR_OV64S = 512, SPR_FIELD_MASK_SYS_CPUCFGR_ND = 1024, SPR_FIELD_MASK_SYS_SR_SM = 1 -+ , SPR_FIELD_MASK_SYS_SR_TEE = 2, SPR_FIELD_MASK_SYS_SR_IEE = 4, SPR_FIELD_MASK_SYS_SR_DCE = 8, SPR_FIELD_MASK_SYS_SR_ICE = 16 -+ , SPR_FIELD_MASK_SYS_SR_DME = 32, SPR_FIELD_MASK_SYS_SR_IME = 64, SPR_FIELD_MASK_SYS_SR_LEE = 128, SPR_FIELD_MASK_SYS_SR_CE = 256 -+ , SPR_FIELD_MASK_SYS_SR_F = 512, SPR_FIELD_MASK_SYS_SR_CY = 1024, SPR_FIELD_MASK_SYS_SR_OV = 2048, SPR_FIELD_MASK_SYS_SR_OVE = 4096 -+ , SPR_FIELD_MASK_SYS_SR_DSX = 8192, SPR_FIELD_MASK_SYS_SR_EPH = 16384, SPR_FIELD_MASK_SYS_SR_FO = 32768, SPR_FIELD_MASK_SYS_SR_SUMRA = 65536 -+ , SPR_FIELD_MASK_SYS_SR_CID = 4026531840u, SPR_FIELD_MASK_SYS_FPCSR_FPEE = 1, SPR_FIELD_MASK_SYS_FPCSR_RM = 6, SPR_FIELD_MASK_SYS_FPCSR_OVF = 8 -+ , SPR_FIELD_MASK_SYS_FPCSR_UNF = 16, SPR_FIELD_MASK_SYS_FPCSR_SNF = 32, SPR_FIELD_MASK_SYS_FPCSR_QNF = 64, SPR_FIELD_MASK_SYS_FPCSR_ZF = 128 -+ , SPR_FIELD_MASK_SYS_FPCSR_IXF = 256, SPR_FIELD_MASK_SYS_FPCSR_IVF = 512, SPR_FIELD_MASK_SYS_FPCSR_INF = 1024, SPR_FIELD_MASK_SYS_FPCSR_DZF = 2048 -+} SPR_FIELD_MASKS; -+ -+/* Enum declaration for insn main opcode enums. */ -+typedef enum insn_opcode { -+ OPC_J = 0, OPC_JAL = 1, OPC_BNF = 3, OPC_BF = 4 -+ , OPC_NOP = 5, OPC_MOVHIMACRC = 6, OPC_SYSTRAPSYNCS = 8, OPC_RFE = 9 -+ , OPC_VECTOR = 10, OPC_JR = 17, OPC_JALR = 18, OPC_MACI = 19 -+ , OPC_LWA = 27, OPC_CUST1 = 28, OPC_CUST2 = 29, OPC_CUST3 = 30 -+ , OPC_CUST4 = 31, OPC_LD = 32, OPC_LWZ = 33, OPC_LWS = 34 -+ , OPC_LBZ = 35, OPC_LBS = 36, OPC_LHZ = 37, OPC_LHS = 38 -+ , OPC_ADDI = 39, OPC_ADDIC = 40, OPC_ANDI = 41, OPC_ORI = 42 -+ , OPC_XORI = 43, OPC_MULI = 44, OPC_MFSPR = 45, OPC_SHROTI = 46 -+ , OPC_SFI = 47, OPC_MTSPR = 48, OPC_MAC = 49, OPC_FLOAT = 50 -+ , OPC_SWA = 51, OPC_SD = 52, OPC_SW = 53, OPC_SB = 54 -+ , OPC_SH = 55, OPC_ALU = 56, OPC_SF = 57, OPC_CUST5 = 60 -+ , OPC_CUST6 = 61, OPC_CUST7 = 62, OPC_CUST8 = 63 -+} INSN_OPCODE; -+ -+/* Enum declaration for systrapsync insn opcode enums. */ -+typedef enum insn_opcode_systrapsyncs { -+ OPC_SYSTRAPSYNCS_SYSCALL = 0, OPC_SYSTRAPSYNCS_TRAP = 8, OPC_SYSTRAPSYNCS_MSYNC = 16, OPC_SYSTRAPSYNCS_PSYNC = 20 -+ , OPC_SYSTRAPSYNCS_CSYNC = 24 -+} INSN_OPCODE_SYSTRAPSYNCS; -+ -+/* Enum declaration for movhi/macrc insn opcode enums. */ -+typedef enum insn_opcode_movehimacrc { -+ OPC_MOVHIMACRC_MOVHI, OPC_MOVHIMACRC_MACRC -+} INSN_OPCODE_MOVEHIMACRC; -+ -+/* Enum declaration for multiply/accumulate insn opcode enums. */ -+typedef enum insn_opcode_mac { -+ OPC_MAC_MAC = 1, OPC_MAC_MSB = 2 -+} INSN_OPCODE_MAC; -+ -+/* Enum declaration for shift/rotate insn opcode enums. */ -+typedef enum insn_opcode_shorts { -+ OPC_SHROTS_SLL, OPC_SHROTS_SRL, OPC_SHROTS_SRA, OPC_SHROTS_ROR -+} INSN_OPCODE_SHORTS; -+ -+/* Enum declaration for extend byte/half opcode enums. */ -+typedef enum insn_opcode_extbhs { -+ OPC_EXTBHS_EXTHS, OPC_EXTBHS_EXTBS, OPC_EXTBHS_EXTHZ, OPC_EXTBHS_EXTBZ -+} INSN_OPCODE_EXTBHS; -+ -+/* Enum declaration for extend word opcode enums. */ -+typedef enum insn_opcode_extws { -+ OPC_EXTWS_EXTWS, OPC_EXTWS_EXTWZ -+} INSN_OPCODE_EXTWS; -+ -+/* Enum declaration for alu reg/reg insn opcode enums. */ -+typedef enum insn_opcode_alu_regreg { -+ OPC_ALU_REGREG_ADD = 0, OPC_ALU_REGREG_ADDC = 1, OPC_ALU_REGREG_SUB = 2, OPC_ALU_REGREG_AND = 3 -+ , OPC_ALU_REGREG_OR = 4, OPC_ALU_REGREG_XOR = 5, OPC_ALU_REGREG_MUL = 6, OPC_ALU_REGREG_SHROT = 8 -+ , OPC_ALU_REGREG_DIV = 9, OPC_ALU_REGREG_DIVU = 10, OPC_ALU_REGREG_MULU = 11, OPC_ALU_REGREG_EXTBH = 12 -+ , OPC_ALU_REGREG_EXTW = 13, OPC_ALU_REGREG_CMOV = 14, OPC_ALU_REGREG_FFL1 = 15 -+} INSN_OPCODE_ALU_REGREG; -+ -+/* Enum declaration for setflag insn opcode enums. */ -+typedef enum insn_opcode_setflag { -+ OPC_SF_EQ = 0, OPC_SF_NE = 1, OPC_SF_GTU = 2, OPC_SF_GEU = 3 -+ , OPC_SF_LTU = 4, OPC_SF_LEU = 5, OPC_SF_GTS = 10, OPC_SF_GES = 11 -+ , OPC_SF_LTS = 12, OPC_SF_LES = 13 -+} INSN_OPCODE_SETFLAG; -+ -+/* Enum declaration for floating point reg/reg insn opcode enums. */ -+typedef enum insn_opcode_float_regreg { -+ OPC_FLOAT_REGREG_ADD_S = 0, OPC_FLOAT_REGREG_SUB_S = 1, OPC_FLOAT_REGREG_MUL_S = 2, OPC_FLOAT_REGREG_DIV_S = 3 -+ , OPC_FLOAT_REGREG_ITOF_S = 4, OPC_FLOAT_REGREG_FTOI_S = 5, OPC_FLOAT_REGREG_REM_S = 6, OPC_FLOAT_REGREG_MADD_S = 7 -+ , OPC_FLOAT_REGREG_SFEQ_S = 8, OPC_FLOAT_REGREG_SFNE_S = 9, OPC_FLOAT_REGREG_SFGT_S = 10, OPC_FLOAT_REGREG_SFGE_S = 11 -+ , OPC_FLOAT_REGREG_SFLT_S = 12, OPC_FLOAT_REGREG_SFLE_S = 13, OPC_FLOAT_REGREG_ADD_D = 16, OPC_FLOAT_REGREG_SUB_D = 17 -+ , OPC_FLOAT_REGREG_MUL_D = 18, OPC_FLOAT_REGREG_DIV_D = 19, OPC_FLOAT_REGREG_ITOF_D = 20, OPC_FLOAT_REGREG_FTOI_D = 21 -+ , OPC_FLOAT_REGREG_REM_D = 22, OPC_FLOAT_REGREG_MADD_D = 23, OPC_FLOAT_REGREG_SFEQ_D = 24, OPC_FLOAT_REGREG_SFNE_D = 25 -+ , OPC_FLOAT_REGREG_SFGT_D = 26, OPC_FLOAT_REGREG_SFGE_D = 27, OPC_FLOAT_REGREG_SFLT_D = 28, OPC_FLOAT_REGREG_SFLE_D = 29 -+ , OPC_FLOAT_REGREG_CUST1_S = 208, OPC_FLOAT_REGREG_CUST1_D = 224 -+} INSN_OPCODE_FLOAT_REGREG; -+ -+/* Attributes. */ -+ -+/* Enum declaration for machine type selection. */ -+typedef enum mach_attr { -+ MACH_BASE, MACH_OR32, MACH_OR32ND, MACH_OR64 -+ , MACH_OR64ND, MACH_MAX -+} MACH_ATTR; -+ -+/* Enum declaration for instruction set selection. */ -+typedef enum isa_attr { -+ ISA_OPENRISC, ISA_MAX -+} ISA_ATTR; -+ -+/* Number of architecture variants. */ -+#define MAX_ISAS 1 -+#define MAX_MACHS ((int) MACH_MAX) -+ -+/* Ifield support. */ -+ -+/* Ifield attribute indices. */ -+ -+/* Enum declaration for cgen_ifld attrs. */ -+typedef enum cgen_ifld_attr { -+ CGEN_IFLD_VIRTUAL, CGEN_IFLD_PCREL_ADDR, CGEN_IFLD_ABS_ADDR, CGEN_IFLD_RESERVED -+ , CGEN_IFLD_SIGN_OPT, CGEN_IFLD_SIGNED, CGEN_IFLD_END_BOOLS, CGEN_IFLD_START_NBOOLS = 31 -+ , CGEN_IFLD_MACH, CGEN_IFLD_END_NBOOLS -+} CGEN_IFLD_ATTR; -+ -+/* Number of non-boolean elements in cgen_ifld_attr. */ -+#define CGEN_IFLD_NBOOL_ATTRS (CGEN_IFLD_END_NBOOLS - CGEN_IFLD_START_NBOOLS - 1) -+ -+/* cgen_ifld attribute accessor macros. */ -+#define CGEN_ATTR_CGEN_IFLD_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_IFLD_MACH-CGEN_IFLD_START_NBOOLS-1].nonbitset) -+#define CGEN_ATTR_CGEN_IFLD_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_VIRTUAL)) != 0) -+#define CGEN_ATTR_CGEN_IFLD_PCREL_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_PCREL_ADDR)) != 0) -+#define CGEN_ATTR_CGEN_IFLD_ABS_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_ABS_ADDR)) != 0) -+#define CGEN_ATTR_CGEN_IFLD_RESERVED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_RESERVED)) != 0) -+#define CGEN_ATTR_CGEN_IFLD_SIGN_OPT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_SIGN_OPT)) != 0) -+#define CGEN_ATTR_CGEN_IFLD_SIGNED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_IFLD_SIGNED)) != 0) -+ -+/* Enum declaration for or1k ifield types. */ -+typedef enum ifield_type { -+ OR1K_F_NIL, OR1K_F_ANYOF, OR1K_F_OPCODE, OR1K_F_R1 -+ , OR1K_F_R2, OR1K_F_R3, OR1K_F_OP_25_2, OR1K_F_OP_25_5 -+ , OR1K_F_OP_16_1, OR1K_F_OP_7_4, OR1K_F_OP_3_4, OR1K_F_OP_9_2 -+ , OR1K_F_OP_9_4, OR1K_F_OP_7_8, OR1K_F_OP_7_2, OR1K_F_RESV_25_26 -+ , OR1K_F_RESV_25_10, OR1K_F_RESV_25_5, OR1K_F_RESV_23_8, OR1K_F_RESV_20_21 -+ , OR1K_F_RESV_20_5, OR1K_F_RESV_20_4, OR1K_F_RESV_15_8, OR1K_F_RESV_15_6 -+ , OR1K_F_RESV_10_11, OR1K_F_RESV_10_7, OR1K_F_RESV_10_3, OR1K_F_RESV_10_1 -+ , OR1K_F_RESV_7_4, OR1K_F_RESV_5_2, OR1K_F_IMM16_25_5, OR1K_F_IMM16_10_11 -+ , OR1K_F_DISP26, OR1K_F_UIMM16, OR1K_F_SIMM16, OR1K_F_UIMM6 -+ , OR1K_F_UIMM16_SPLIT, OR1K_F_SIMM16_SPLIT, OR1K_F_MAX -+} IFIELD_TYPE; -+ -+#define MAX_IFLD ((int) OR1K_F_MAX) -+ -+/* Hardware attribute indices. */ -+ -+/* Enum declaration for cgen_hw attrs. */ -+typedef enum cgen_hw_attr { -+ CGEN_HW_VIRTUAL, CGEN_HW_CACHE_ADDR, CGEN_HW_PC, CGEN_HW_PROFILE -+ , CGEN_HW_END_BOOLS, CGEN_HW_START_NBOOLS = 31, CGEN_HW_MACH, CGEN_HW_END_NBOOLS -+} CGEN_HW_ATTR; -+ -+/* Number of non-boolean elements in cgen_hw_attr. */ -+#define CGEN_HW_NBOOL_ATTRS (CGEN_HW_END_NBOOLS - CGEN_HW_START_NBOOLS - 1) -+ -+/* cgen_hw attribute accessor macros. */ -+#define CGEN_ATTR_CGEN_HW_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_HW_MACH-CGEN_HW_START_NBOOLS-1].nonbitset) -+#define CGEN_ATTR_CGEN_HW_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_VIRTUAL)) != 0) -+#define CGEN_ATTR_CGEN_HW_CACHE_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_CACHE_ADDR)) != 0) -+#define CGEN_ATTR_CGEN_HW_PC_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_PC)) != 0) -+#define CGEN_ATTR_CGEN_HW_PROFILE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_HW_PROFILE)) != 0) -+ -+/* Enum declaration for or1k hardware types. */ -+typedef enum cgen_hw_type { -+ HW_H_MEMORY, HW_H_SINT, HW_H_UINT, HW_H_ADDR -+ , HW_H_IADDR, HW_H_PC, HW_H_FSR, HW_H_FDR -+ , HW_H_SPR, HW_H_GPR, HW_H_SYS_VR, HW_H_SYS_UPR -+ , HW_H_SYS_CPUCFGR, HW_H_SYS_DMMUCFGR, HW_H_SYS_IMMUCFGR, HW_H_SYS_DCCFGR -+ , HW_H_SYS_ICCFGR, HW_H_SYS_DCFGR, HW_H_SYS_PCCFGR, HW_H_SYS_NPC -+ , HW_H_SYS_SR, HW_H_SYS_PPC, HW_H_SYS_FPCSR, HW_H_SYS_EPCR0 -+ , HW_H_SYS_EPCR1, HW_H_SYS_EPCR2, HW_H_SYS_EPCR3, HW_H_SYS_EPCR4 -+ , HW_H_SYS_EPCR5, HW_H_SYS_EPCR6, HW_H_SYS_EPCR7, HW_H_SYS_EPCR8 -+ , HW_H_SYS_EPCR9, HW_H_SYS_EPCR10, HW_H_SYS_EPCR11, HW_H_SYS_EPCR12 -+ , HW_H_SYS_EPCR13, HW_H_SYS_EPCR14, HW_H_SYS_EPCR15, HW_H_SYS_EEAR0 -+ , HW_H_SYS_EEAR1, HW_H_SYS_EEAR2, HW_H_SYS_EEAR3, HW_H_SYS_EEAR4 -+ , HW_H_SYS_EEAR5, HW_H_SYS_EEAR6, HW_H_SYS_EEAR7, HW_H_SYS_EEAR8 -+ , HW_H_SYS_EEAR9, HW_H_SYS_EEAR10, HW_H_SYS_EEAR11, HW_H_SYS_EEAR12 -+ , HW_H_SYS_EEAR13, HW_H_SYS_EEAR14, HW_H_SYS_EEAR15, HW_H_SYS_ESR0 -+ , HW_H_SYS_ESR1, HW_H_SYS_ESR2, HW_H_SYS_ESR3, HW_H_SYS_ESR4 -+ , HW_H_SYS_ESR5, HW_H_SYS_ESR6, HW_H_SYS_ESR7, HW_H_SYS_ESR8 -+ , HW_H_SYS_ESR9, HW_H_SYS_ESR10, HW_H_SYS_ESR11, HW_H_SYS_ESR12 -+ , HW_H_SYS_ESR13, HW_H_SYS_ESR14, HW_H_SYS_ESR15, HW_H_SYS_GPR0 -+ , HW_H_SYS_GPR1, HW_H_SYS_GPR2, HW_H_SYS_GPR3, HW_H_SYS_GPR4 -+ , HW_H_SYS_GPR5, HW_H_SYS_GPR6, HW_H_SYS_GPR7, HW_H_SYS_GPR8 -+ , HW_H_SYS_GPR9, HW_H_SYS_GPR10, HW_H_SYS_GPR11, HW_H_SYS_GPR12 -+ , HW_H_SYS_GPR13, HW_H_SYS_GPR14, HW_H_SYS_GPR15, HW_H_SYS_GPR16 -+ , HW_H_SYS_GPR17, HW_H_SYS_GPR18, HW_H_SYS_GPR19, HW_H_SYS_GPR20 -+ , HW_H_SYS_GPR21, HW_H_SYS_GPR22, HW_H_SYS_GPR23, HW_H_SYS_GPR24 -+ , HW_H_SYS_GPR25, HW_H_SYS_GPR26, HW_H_SYS_GPR27, HW_H_SYS_GPR28 -+ , HW_H_SYS_GPR29, HW_H_SYS_GPR30, HW_H_SYS_GPR31, HW_H_SYS_GPR32 -+ , HW_H_SYS_GPR33, HW_H_SYS_GPR34, HW_H_SYS_GPR35, HW_H_SYS_GPR36 -+ , HW_H_SYS_GPR37, HW_H_SYS_GPR38, HW_H_SYS_GPR39, HW_H_SYS_GPR40 -+ , HW_H_SYS_GPR41, HW_H_SYS_GPR42, HW_H_SYS_GPR43, HW_H_SYS_GPR44 -+ , HW_H_SYS_GPR45, HW_H_SYS_GPR46, HW_H_SYS_GPR47, HW_H_SYS_GPR48 -+ , HW_H_SYS_GPR49, HW_H_SYS_GPR50, HW_H_SYS_GPR51, HW_H_SYS_GPR52 -+ , HW_H_SYS_GPR53, HW_H_SYS_GPR54, HW_H_SYS_GPR55, HW_H_SYS_GPR56 -+ , HW_H_SYS_GPR57, HW_H_SYS_GPR58, HW_H_SYS_GPR59, HW_H_SYS_GPR60 -+ , HW_H_SYS_GPR61, HW_H_SYS_GPR62, HW_H_SYS_GPR63, HW_H_SYS_GPR64 -+ , HW_H_SYS_GPR65, HW_H_SYS_GPR66, HW_H_SYS_GPR67, HW_H_SYS_GPR68 -+ , HW_H_SYS_GPR69, HW_H_SYS_GPR70, HW_H_SYS_GPR71, HW_H_SYS_GPR72 -+ , HW_H_SYS_GPR73, HW_H_SYS_GPR74, HW_H_SYS_GPR75, HW_H_SYS_GPR76 -+ , HW_H_SYS_GPR77, HW_H_SYS_GPR78, HW_H_SYS_GPR79, HW_H_SYS_GPR80 -+ , HW_H_SYS_GPR81, HW_H_SYS_GPR82, HW_H_SYS_GPR83, HW_H_SYS_GPR84 -+ , HW_H_SYS_GPR85, HW_H_SYS_GPR86, HW_H_SYS_GPR87, HW_H_SYS_GPR88 -+ , HW_H_SYS_GPR89, HW_H_SYS_GPR90, HW_H_SYS_GPR91, HW_H_SYS_GPR92 -+ , HW_H_SYS_GPR93, HW_H_SYS_GPR94, HW_H_SYS_GPR95, HW_H_SYS_GPR96 -+ , HW_H_SYS_GPR97, HW_H_SYS_GPR98, HW_H_SYS_GPR99, HW_H_SYS_GPR100 -+ , HW_H_SYS_GPR101, HW_H_SYS_GPR102, HW_H_SYS_GPR103, HW_H_SYS_GPR104 -+ , HW_H_SYS_GPR105, HW_H_SYS_GPR106, HW_H_SYS_GPR107, HW_H_SYS_GPR108 -+ , HW_H_SYS_GPR109, HW_H_SYS_GPR110, HW_H_SYS_GPR111, HW_H_SYS_GPR112 -+ , HW_H_SYS_GPR113, HW_H_SYS_GPR114, HW_H_SYS_GPR115, HW_H_SYS_GPR116 -+ , HW_H_SYS_GPR117, HW_H_SYS_GPR118, HW_H_SYS_GPR119, HW_H_SYS_GPR120 -+ , HW_H_SYS_GPR121, HW_H_SYS_GPR122, HW_H_SYS_GPR123, HW_H_SYS_GPR124 -+ , HW_H_SYS_GPR125, HW_H_SYS_GPR126, HW_H_SYS_GPR127, HW_H_SYS_GPR128 -+ , HW_H_SYS_GPR129, HW_H_SYS_GPR130, HW_H_SYS_GPR131, HW_H_SYS_GPR132 -+ , HW_H_SYS_GPR133, HW_H_SYS_GPR134, HW_H_SYS_GPR135, HW_H_SYS_GPR136 -+ , HW_H_SYS_GPR137, HW_H_SYS_GPR138, HW_H_SYS_GPR139, HW_H_SYS_GPR140 -+ , HW_H_SYS_GPR141, HW_H_SYS_GPR142, HW_H_SYS_GPR143, HW_H_SYS_GPR144 -+ , HW_H_SYS_GPR145, HW_H_SYS_GPR146, HW_H_SYS_GPR147, HW_H_SYS_GPR148 -+ , HW_H_SYS_GPR149, HW_H_SYS_GPR150, HW_H_SYS_GPR151, HW_H_SYS_GPR152 -+ , HW_H_SYS_GPR153, HW_H_SYS_GPR154, HW_H_SYS_GPR155, HW_H_SYS_GPR156 -+ , HW_H_SYS_GPR157, HW_H_SYS_GPR158, HW_H_SYS_GPR159, HW_H_SYS_GPR160 -+ , HW_H_SYS_GPR161, HW_H_SYS_GPR162, HW_H_SYS_GPR163, HW_H_SYS_GPR164 -+ , HW_H_SYS_GPR165, HW_H_SYS_GPR166, HW_H_SYS_GPR167, HW_H_SYS_GPR168 -+ , HW_H_SYS_GPR169, HW_H_SYS_GPR170, HW_H_SYS_GPR171, HW_H_SYS_GPR172 -+ , HW_H_SYS_GPR173, HW_H_SYS_GPR174, HW_H_SYS_GPR175, HW_H_SYS_GPR176 -+ , HW_H_SYS_GPR177, HW_H_SYS_GPR178, HW_H_SYS_GPR179, HW_H_SYS_GPR180 -+ , HW_H_SYS_GPR181, HW_H_SYS_GPR182, HW_H_SYS_GPR183, HW_H_SYS_GPR184 -+ , HW_H_SYS_GPR185, HW_H_SYS_GPR186, HW_H_SYS_GPR187, HW_H_SYS_GPR188 -+ , HW_H_SYS_GPR189, HW_H_SYS_GPR190, HW_H_SYS_GPR191, HW_H_SYS_GPR192 -+ , HW_H_SYS_GPR193, HW_H_SYS_GPR194, HW_H_SYS_GPR195, HW_H_SYS_GPR196 -+ , HW_H_SYS_GPR197, HW_H_SYS_GPR198, HW_H_SYS_GPR199, HW_H_SYS_GPR200 -+ , HW_H_SYS_GPR201, HW_H_SYS_GPR202, HW_H_SYS_GPR203, HW_H_SYS_GPR204 -+ , HW_H_SYS_GPR205, HW_H_SYS_GPR206, HW_H_SYS_GPR207, HW_H_SYS_GPR208 -+ , HW_H_SYS_GPR209, HW_H_SYS_GPR210, HW_H_SYS_GPR211, HW_H_SYS_GPR212 -+ , HW_H_SYS_GPR213, HW_H_SYS_GPR214, HW_H_SYS_GPR215, HW_H_SYS_GPR216 -+ , HW_H_SYS_GPR217, HW_H_SYS_GPR218, HW_H_SYS_GPR219, HW_H_SYS_GPR220 -+ , HW_H_SYS_GPR221, HW_H_SYS_GPR222, HW_H_SYS_GPR223, HW_H_SYS_GPR224 -+ , HW_H_SYS_GPR225, HW_H_SYS_GPR226, HW_H_SYS_GPR227, HW_H_SYS_GPR228 -+ , HW_H_SYS_GPR229, HW_H_SYS_GPR230, HW_H_SYS_GPR231, HW_H_SYS_GPR232 -+ , HW_H_SYS_GPR233, HW_H_SYS_GPR234, HW_H_SYS_GPR235, HW_H_SYS_GPR236 -+ , HW_H_SYS_GPR237, HW_H_SYS_GPR238, HW_H_SYS_GPR239, HW_H_SYS_GPR240 -+ , HW_H_SYS_GPR241, HW_H_SYS_GPR242, HW_H_SYS_GPR243, HW_H_SYS_GPR244 -+ , HW_H_SYS_GPR245, HW_H_SYS_GPR246, HW_H_SYS_GPR247, HW_H_SYS_GPR248 -+ , HW_H_SYS_GPR249, HW_H_SYS_GPR250, HW_H_SYS_GPR251, HW_H_SYS_GPR252 -+ , HW_H_SYS_GPR253, HW_H_SYS_GPR254, HW_H_SYS_GPR255, HW_H_SYS_GPR256 -+ , HW_H_SYS_GPR257, HW_H_SYS_GPR258, HW_H_SYS_GPR259, HW_H_SYS_GPR260 -+ , HW_H_SYS_GPR261, HW_H_SYS_GPR262, HW_H_SYS_GPR263, HW_H_SYS_GPR264 -+ , HW_H_SYS_GPR265, HW_H_SYS_GPR266, HW_H_SYS_GPR267, HW_H_SYS_GPR268 -+ , HW_H_SYS_GPR269, HW_H_SYS_GPR270, HW_H_SYS_GPR271, HW_H_SYS_GPR272 -+ , HW_H_SYS_GPR273, HW_H_SYS_GPR274, HW_H_SYS_GPR275, HW_H_SYS_GPR276 -+ , HW_H_SYS_GPR277, HW_H_SYS_GPR278, HW_H_SYS_GPR279, HW_H_SYS_GPR280 -+ , HW_H_SYS_GPR281, HW_H_SYS_GPR282, HW_H_SYS_GPR283, HW_H_SYS_GPR284 -+ , HW_H_SYS_GPR285, HW_H_SYS_GPR286, HW_H_SYS_GPR287, HW_H_SYS_GPR288 -+ , HW_H_SYS_GPR289, HW_H_SYS_GPR290, HW_H_SYS_GPR291, HW_H_SYS_GPR292 -+ , HW_H_SYS_GPR293, HW_H_SYS_GPR294, HW_H_SYS_GPR295, HW_H_SYS_GPR296 -+ , HW_H_SYS_GPR297, HW_H_SYS_GPR298, HW_H_SYS_GPR299, HW_H_SYS_GPR300 -+ , HW_H_SYS_GPR301, HW_H_SYS_GPR302, HW_H_SYS_GPR303, HW_H_SYS_GPR304 -+ , HW_H_SYS_GPR305, HW_H_SYS_GPR306, HW_H_SYS_GPR307, HW_H_SYS_GPR308 -+ , HW_H_SYS_GPR309, HW_H_SYS_GPR310, HW_H_SYS_GPR311, HW_H_SYS_GPR312 -+ , HW_H_SYS_GPR313, HW_H_SYS_GPR314, HW_H_SYS_GPR315, HW_H_SYS_GPR316 -+ , HW_H_SYS_GPR317, HW_H_SYS_GPR318, HW_H_SYS_GPR319, HW_H_SYS_GPR320 -+ , HW_H_SYS_GPR321, HW_H_SYS_GPR322, HW_H_SYS_GPR323, HW_H_SYS_GPR324 -+ , HW_H_SYS_GPR325, HW_H_SYS_GPR326, HW_H_SYS_GPR327, HW_H_SYS_GPR328 -+ , HW_H_SYS_GPR329, HW_H_SYS_GPR330, HW_H_SYS_GPR331, HW_H_SYS_GPR332 -+ , HW_H_SYS_GPR333, HW_H_SYS_GPR334, HW_H_SYS_GPR335, HW_H_SYS_GPR336 -+ , HW_H_SYS_GPR337, HW_H_SYS_GPR338, HW_H_SYS_GPR339, HW_H_SYS_GPR340 -+ , HW_H_SYS_GPR341, HW_H_SYS_GPR342, HW_H_SYS_GPR343, HW_H_SYS_GPR344 -+ , HW_H_SYS_GPR345, HW_H_SYS_GPR346, HW_H_SYS_GPR347, HW_H_SYS_GPR348 -+ , HW_H_SYS_GPR349, HW_H_SYS_GPR350, HW_H_SYS_GPR351, HW_H_SYS_GPR352 -+ , HW_H_SYS_GPR353, HW_H_SYS_GPR354, HW_H_SYS_GPR355, HW_H_SYS_GPR356 -+ , HW_H_SYS_GPR357, HW_H_SYS_GPR358, HW_H_SYS_GPR359, HW_H_SYS_GPR360 -+ , HW_H_SYS_GPR361, HW_H_SYS_GPR362, HW_H_SYS_GPR363, HW_H_SYS_GPR364 -+ , HW_H_SYS_GPR365, HW_H_SYS_GPR366, HW_H_SYS_GPR367, HW_H_SYS_GPR368 -+ , HW_H_SYS_GPR369, HW_H_SYS_GPR370, HW_H_SYS_GPR371, HW_H_SYS_GPR372 -+ , HW_H_SYS_GPR373, HW_H_SYS_GPR374, HW_H_SYS_GPR375, HW_H_SYS_GPR376 -+ , HW_H_SYS_GPR377, HW_H_SYS_GPR378, HW_H_SYS_GPR379, HW_H_SYS_GPR380 -+ , HW_H_SYS_GPR381, HW_H_SYS_GPR382, HW_H_SYS_GPR383, HW_H_SYS_GPR384 -+ , HW_H_SYS_GPR385, HW_H_SYS_GPR386, HW_H_SYS_GPR387, HW_H_SYS_GPR388 -+ , HW_H_SYS_GPR389, HW_H_SYS_GPR390, HW_H_SYS_GPR391, HW_H_SYS_GPR392 -+ , HW_H_SYS_GPR393, HW_H_SYS_GPR394, HW_H_SYS_GPR395, HW_H_SYS_GPR396 -+ , HW_H_SYS_GPR397, HW_H_SYS_GPR398, HW_H_SYS_GPR399, HW_H_SYS_GPR400 -+ , HW_H_SYS_GPR401, HW_H_SYS_GPR402, HW_H_SYS_GPR403, HW_H_SYS_GPR404 -+ , HW_H_SYS_GPR405, HW_H_SYS_GPR406, HW_H_SYS_GPR407, HW_H_SYS_GPR408 -+ , HW_H_SYS_GPR409, HW_H_SYS_GPR410, HW_H_SYS_GPR411, HW_H_SYS_GPR412 -+ , HW_H_SYS_GPR413, HW_H_SYS_GPR414, HW_H_SYS_GPR415, HW_H_SYS_GPR416 -+ , HW_H_SYS_GPR417, HW_H_SYS_GPR418, HW_H_SYS_GPR419, HW_H_SYS_GPR420 -+ , HW_H_SYS_GPR421, HW_H_SYS_GPR422, HW_H_SYS_GPR423, HW_H_SYS_GPR424 -+ , HW_H_SYS_GPR425, HW_H_SYS_GPR426, HW_H_SYS_GPR427, HW_H_SYS_GPR428 -+ , HW_H_SYS_GPR429, HW_H_SYS_GPR430, HW_H_SYS_GPR431, HW_H_SYS_GPR432 -+ , HW_H_SYS_GPR433, HW_H_SYS_GPR434, HW_H_SYS_GPR435, HW_H_SYS_GPR436 -+ , HW_H_SYS_GPR437, HW_H_SYS_GPR438, HW_H_SYS_GPR439, HW_H_SYS_GPR440 -+ , HW_H_SYS_GPR441, HW_H_SYS_GPR442, HW_H_SYS_GPR443, HW_H_SYS_GPR444 -+ , HW_H_SYS_GPR445, HW_H_SYS_GPR446, HW_H_SYS_GPR447, HW_H_SYS_GPR448 -+ , HW_H_SYS_GPR449, HW_H_SYS_GPR450, HW_H_SYS_GPR451, HW_H_SYS_GPR452 -+ , HW_H_SYS_GPR453, HW_H_SYS_GPR454, HW_H_SYS_GPR455, HW_H_SYS_GPR456 -+ , HW_H_SYS_GPR457, HW_H_SYS_GPR458, HW_H_SYS_GPR459, HW_H_SYS_GPR460 -+ , HW_H_SYS_GPR461, HW_H_SYS_GPR462, HW_H_SYS_GPR463, HW_H_SYS_GPR464 -+ , HW_H_SYS_GPR465, HW_H_SYS_GPR466, HW_H_SYS_GPR467, HW_H_SYS_GPR468 -+ , HW_H_SYS_GPR469, HW_H_SYS_GPR470, HW_H_SYS_GPR471, HW_H_SYS_GPR472 -+ , HW_H_SYS_GPR473, HW_H_SYS_GPR474, HW_H_SYS_GPR475, HW_H_SYS_GPR476 -+ , HW_H_SYS_GPR477, HW_H_SYS_GPR478, HW_H_SYS_GPR479, HW_H_SYS_GPR480 -+ , HW_H_SYS_GPR481, HW_H_SYS_GPR482, HW_H_SYS_GPR483, HW_H_SYS_GPR484 -+ , HW_H_SYS_GPR485, HW_H_SYS_GPR486, HW_H_SYS_GPR487, HW_H_SYS_GPR488 -+ , HW_H_SYS_GPR489, HW_H_SYS_GPR490, HW_H_SYS_GPR491, HW_H_SYS_GPR492 -+ , HW_H_SYS_GPR493, HW_H_SYS_GPR494, HW_H_SYS_GPR495, HW_H_SYS_GPR496 -+ , HW_H_SYS_GPR497, HW_H_SYS_GPR498, HW_H_SYS_GPR499, HW_H_SYS_GPR500 -+ , HW_H_SYS_GPR501, HW_H_SYS_GPR502, HW_H_SYS_GPR503, HW_H_SYS_GPR504 -+ , HW_H_SYS_GPR505, HW_H_SYS_GPR506, HW_H_SYS_GPR507, HW_H_SYS_GPR508 -+ , HW_H_SYS_GPR509, HW_H_SYS_GPR510, HW_H_SYS_GPR511, HW_H_MAC_MACLO -+ , HW_H_MAC_MACHI, HW_H_TICK_TTMR, HW_H_SYS_VR_REV, HW_H_SYS_VR_CFG -+ , HW_H_SYS_VR_VER, HW_H_SYS_UPR_UP, HW_H_SYS_UPR_DCP, HW_H_SYS_UPR_ICP -+ , HW_H_SYS_UPR_DMP, HW_H_SYS_UPR_MP, HW_H_SYS_UPR_IMP, HW_H_SYS_UPR_DUP -+ , HW_H_SYS_UPR_PCUP, HW_H_SYS_UPR_PICP, HW_H_SYS_UPR_PMP, HW_H_SYS_UPR_TTP -+ , HW_H_SYS_UPR_CUP, HW_H_SYS_CPUCFGR_NSGR, HW_H_SYS_CPUCFGR_CGF, HW_H_SYS_CPUCFGR_OB32S -+ , HW_H_SYS_CPUCFGR_OB64S, HW_H_SYS_CPUCFGR_OF32S, HW_H_SYS_CPUCFGR_OF64S, HW_H_SYS_CPUCFGR_OV64S -+ , HW_H_SYS_CPUCFGR_ND, HW_H_SYS_SR_SM, HW_H_SYS_SR_TEE, HW_H_SYS_SR_IEE -+ , HW_H_SYS_SR_DCE, HW_H_SYS_SR_ICE, HW_H_SYS_SR_DME, HW_H_SYS_SR_IME -+ , HW_H_SYS_SR_LEE, HW_H_SYS_SR_CE, HW_H_SYS_SR_F, HW_H_SYS_SR_CY -+ , HW_H_SYS_SR_OV, HW_H_SYS_SR_OVE, HW_H_SYS_SR_DSX, HW_H_SYS_SR_EPH -+ , HW_H_SYS_SR_FO, HW_H_SYS_SR_SUMRA, HW_H_SYS_SR_CID, HW_H_SYS_FPCSR_FPEE -+ , HW_H_SYS_FPCSR_RM, HW_H_SYS_FPCSR_OVF, HW_H_SYS_FPCSR_UNF, HW_H_SYS_FPCSR_SNF -+ , HW_H_SYS_FPCSR_QNF, HW_H_SYS_FPCSR_ZF, HW_H_SYS_FPCSR_IXF, HW_H_SYS_FPCSR_IVF -+ , HW_H_SYS_FPCSR_INF, HW_H_SYS_FPCSR_DZF, HW_H_SIMM16, HW_H_UIMM16 -+ , HW_H_UIMM6, HW_H_ATOMIC_RESERVE, HW_H_ATOMIC_ADDRESS, HW_MAX -+} CGEN_HW_TYPE; -+ -+#define MAX_HW ((int) HW_MAX) -+ -+/* Operand attribute indices. */ -+ -+/* Enum declaration for cgen_operand attrs. */ -+typedef enum cgen_operand_attr { -+ CGEN_OPERAND_VIRTUAL, CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_SIGN_OPT -+ , CGEN_OPERAND_SIGNED, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_RELAX, CGEN_OPERAND_SEM_ONLY -+ , CGEN_OPERAND_END_BOOLS, CGEN_OPERAND_START_NBOOLS = 31, CGEN_OPERAND_MACH, CGEN_OPERAND_END_NBOOLS -+} CGEN_OPERAND_ATTR; -+ -+/* Number of non-boolean elements in cgen_operand_attr. */ -+#define CGEN_OPERAND_NBOOL_ATTRS (CGEN_OPERAND_END_NBOOLS - CGEN_OPERAND_START_NBOOLS - 1) -+ -+/* cgen_operand attribute accessor macros. */ -+#define CGEN_ATTR_CGEN_OPERAND_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_OPERAND_MACH-CGEN_OPERAND_START_NBOOLS-1].nonbitset) -+#define CGEN_ATTR_CGEN_OPERAND_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_VIRTUAL)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_PCREL_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_PCREL_ADDR)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_ABS_ADDR_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_ABS_ADDR)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_SIGN_OPT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SIGN_OPT)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_SIGNED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SIGNED)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_NEGATIVE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_NEGATIVE)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_RELAX_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_RELAX)) != 0) -+#define CGEN_ATTR_CGEN_OPERAND_SEM_ONLY_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_OPERAND_SEM_ONLY)) != 0) -+ -+/* Enum declaration for or1k operand types. */ -+typedef enum cgen_operand_type { -+ OR1K_OPERAND_PC, OR1K_OPERAND_SYS_SR, OR1K_OPERAND_SYS_ESR0, OR1K_OPERAND_SYS_EPCR0 -+ , OR1K_OPERAND_SYS_SR_LEE, OR1K_OPERAND_SYS_SR_F, OR1K_OPERAND_SYS_SR_CY, OR1K_OPERAND_SYS_SR_OV -+ , OR1K_OPERAND_SYS_SR_OVE, OR1K_OPERAND_SYS_CPUCFGR_OB64S, OR1K_OPERAND_SYS_CPUCFGR_ND, OR1K_OPERAND_SYS_FPCSR_RM -+ , OR1K_OPERAND_MAC_MACHI, OR1K_OPERAND_MAC_MACLO, OR1K_OPERAND_ATOMIC_RESERVE, OR1K_OPERAND_ATOMIC_ADDRESS -+ , OR1K_OPERAND_UIMM6, OR1K_OPERAND_RD, OR1K_OPERAND_RA, OR1K_OPERAND_RB -+ , OR1K_OPERAND_DISP26, OR1K_OPERAND_SIMM16, OR1K_OPERAND_UIMM16, OR1K_OPERAND_SIMM16_SPLIT -+ , OR1K_OPERAND_UIMM16_SPLIT, OR1K_OPERAND_RDSF, OR1K_OPERAND_RASF, OR1K_OPERAND_RBSF -+ , OR1K_OPERAND_RDDF, OR1K_OPERAND_RADF, OR1K_OPERAND_RBDF, OR1K_OPERAND_MAX -+} CGEN_OPERAND_TYPE; -+ -+/* Number of operands types. */ -+#define MAX_OPERANDS 31 -+ -+/* Maximum number of operands referenced by any insn. */ -+#define MAX_OPERAND_INSTANCES 9 -+ -+/* Insn attribute indices. */ -+ -+/* Enum declaration for cgen_insn attrs. */ -+typedef enum cgen_insn_attr { -+ CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI -+ , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED -+ , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_DELAYED_CTI, CGEN_INSN_NOT_IN_DELAY_SLOT -+ , CGEN_INSN_FORCED_CTI, CGEN_INSN_END_BOOLS, CGEN_INSN_START_NBOOLS = 31, CGEN_INSN_MACH -+ , CGEN_INSN_END_NBOOLS -+} CGEN_INSN_ATTR; -+ -+/* Number of non-boolean elements in cgen_insn_attr. */ -+#define CGEN_INSN_NBOOL_ATTRS (CGEN_INSN_END_NBOOLS - CGEN_INSN_START_NBOOLS - 1) -+ -+/* cgen_insn attribute accessor macros. */ -+#define CGEN_ATTR_CGEN_INSN_MACH_VALUE(attrs) ((attrs)->nonbool[CGEN_INSN_MACH-CGEN_INSN_START_NBOOLS-1].nonbitset) -+#define CGEN_ATTR_CGEN_INSN_ALIAS_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_ALIAS)) != 0) -+#define CGEN_ATTR_CGEN_INSN_VIRTUAL_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_VIRTUAL)) != 0) -+#define CGEN_ATTR_CGEN_INSN_UNCOND_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_UNCOND_CTI)) != 0) -+#define CGEN_ATTR_CGEN_INSN_COND_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_COND_CTI)) != 0) -+#define CGEN_ATTR_CGEN_INSN_SKIP_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_SKIP_CTI)) != 0) -+#define CGEN_ATTR_CGEN_INSN_DELAY_SLOT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_DELAY_SLOT)) != 0) -+#define CGEN_ATTR_CGEN_INSN_RELAXABLE_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_RELAXABLE)) != 0) -+#define CGEN_ATTR_CGEN_INSN_RELAXED_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_RELAXED)) != 0) -+#define CGEN_ATTR_CGEN_INSN_NO_DIS_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_NO_DIS)) != 0) -+#define CGEN_ATTR_CGEN_INSN_PBB_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_PBB)) != 0) -+#define CGEN_ATTR_CGEN_INSN_DELAYED_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_DELAYED_CTI)) != 0) -+#define CGEN_ATTR_CGEN_INSN_NOT_IN_DELAY_SLOT_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_NOT_IN_DELAY_SLOT)) != 0) -+#define CGEN_ATTR_CGEN_INSN_FORCED_CTI_VALUE(attrs) (((attrs)->bool_ & (1 << CGEN_INSN_FORCED_CTI)) != 0) -+ -+/* cgen.h uses things we just defined. */ -+#include "opcode/cgen.h" -+ -+extern const struct cgen_ifld or1k_cgen_ifld_table[]; -+ -+/* Attributes. */ -+extern const CGEN_ATTR_TABLE or1k_cgen_hardware_attr_table[]; -+extern const CGEN_ATTR_TABLE or1k_cgen_ifield_attr_table[]; -+extern const CGEN_ATTR_TABLE or1k_cgen_operand_attr_table[]; -+extern const CGEN_ATTR_TABLE or1k_cgen_insn_attr_table[]; -+ -+/* Hardware decls. */ -+ -+extern CGEN_KEYWORD or1k_cgen_opval_h_fsr; -+extern CGEN_KEYWORD or1k_cgen_opval_h_fdr; -+extern CGEN_KEYWORD or1k_cgen_opval_h_gpr; -+ -+extern const CGEN_HW_ENTRY or1k_cgen_hw_table[]; -+ -+ -+ -+#endif /* OR1K_CPU_H */ -diff -rNU3 dist.orig/opcodes/or1k-dis.c dist/opcodes/or1k-dis.c ---- dist.orig/opcodes/or1k-dis.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-dis.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,561 @@ -+/* Disassembler interface for targets using CGEN. -*- C -*- -+ CGEN: Cpu tools GENerator -+ -+ THIS FILE IS MACHINE GENERATED WITH CGEN. -+ - the resultant file is machine generated, cgen-dis.in isn't -+ -+ Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+ This file is part of libopcodes. -+ -+ This library is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -+ -+/* ??? Eventually more and more of this stuff can go to cpu-independent files. -+ Keep that in mind. */ -+ -+#include "sysdep.h" -+#include -+#include "ansidecl.h" -+#include "dis-asm.h" -+#include "bfd.h" -+#include "symcat.h" -+#include "libiberty.h" -+#include "or1k-desc.h" -+#include "or1k-opc.h" -+#include "opintl.h" -+ -+/* Default text to print if an instruction isn't recognized. */ -+#define UNKNOWN_INSN_MSG _("*unknown*") -+ -+static void print_normal -+ (CGEN_CPU_DESC, void *, long, unsigned int, bfd_vma, int); -+static void print_address -+ (CGEN_CPU_DESC, void *, bfd_vma, unsigned int, bfd_vma, int) ATTRIBUTE_UNUSED; -+static void print_keyword -+ (CGEN_CPU_DESC, void *, CGEN_KEYWORD *, long, unsigned int) ATTRIBUTE_UNUSED; -+static void print_insn_normal -+ (CGEN_CPU_DESC, void *, const CGEN_INSN *, CGEN_FIELDS *, bfd_vma, int); -+static int print_insn -+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, unsigned); -+static int default_print_insn -+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *) ATTRIBUTE_UNUSED; -+static int read_insn -+ (CGEN_CPU_DESC, bfd_vma, disassemble_info *, bfd_byte *, int, CGEN_EXTRACT_INFO *, -+ unsigned long *); -+ -+/* -- disassembler routines inserted here. */ -+ -+ -+void or1k_cgen_print_operand -+ (CGEN_CPU_DESC, int, PTR, CGEN_FIELDS *, void const *, bfd_vma, int); -+ -+/* Main entry point for printing operands. -+ XINFO is a `void *' and not a `disassemble_info *' to not put a requirement -+ of dis-asm.h on cgen.h. -+ -+ This function is basically just a big switch statement. Earlier versions -+ used tables to look up the function to use, but -+ - if the table contains both assembler and disassembler functions then -+ the disassembler contains much of the assembler and vice-versa, -+ - there's a lot of inlining possibilities as things grow, -+ - using a switch statement avoids the function call overhead. -+ -+ This function could be moved into `print_insn_normal', but keeping it -+ separate makes clear the interface between `print_insn_normal' and each of -+ the handlers. */ -+ -+void -+or1k_cgen_print_operand (CGEN_CPU_DESC cd, -+ int opindex, -+ void * xinfo, -+ CGEN_FIELDS *fields, -+ void const *attrs ATTRIBUTE_UNUSED, -+ bfd_vma pc, -+ int length) -+{ -+ disassemble_info *info = (disassemble_info *) xinfo; -+ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ print_address (cd, info, fields->f_disp26, 0|(1<f_r2, 0); -+ break; -+ case OR1K_OPERAND_RADF : -+ print_keyword (cd, info, & or1k_cgen_opval_h_fdr, fields->f_r1, 0); -+ break; -+ case OR1K_OPERAND_RASF : -+ print_keyword (cd, info, & or1k_cgen_opval_h_fsr, fields->f_r2, 0); -+ break; -+ case OR1K_OPERAND_RB : -+ print_keyword (cd, info, & or1k_cgen_opval_h_gpr, fields->f_r3, 0); -+ break; -+ case OR1K_OPERAND_RBDF : -+ print_keyword (cd, info, & or1k_cgen_opval_h_fdr, fields->f_r1, 0); -+ break; -+ case OR1K_OPERAND_RBSF : -+ print_keyword (cd, info, & or1k_cgen_opval_h_fsr, fields->f_r3, 0); -+ break; -+ case OR1K_OPERAND_RD : -+ print_keyword (cd, info, & or1k_cgen_opval_h_gpr, fields->f_r1, 0); -+ break; -+ case OR1K_OPERAND_RDDF : -+ print_keyword (cd, info, & or1k_cgen_opval_h_fdr, fields->f_r1, 0); -+ break; -+ case OR1K_OPERAND_RDSF : -+ print_keyword (cd, info, & or1k_cgen_opval_h_fsr, fields->f_r1, 0); -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ print_normal (cd, info, fields->f_simm16, 0|(1<f_simm16_split, 0|(1<f_uimm16, 0, pc, length); -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ print_normal (cd, info, fields->f_uimm16_split, 0|(1<f_uimm6, 0, pc, length); -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while printing insn.\n"), -+ opindex); -+ abort (); -+ } -+} -+ -+cgen_print_fn * const or1k_cgen_print_handlers[] = -+{ -+ print_insn_normal, -+}; -+ -+ -+void -+or1k_cgen_init_dis (CGEN_CPU_DESC cd) -+{ -+ or1k_cgen_init_opcode_table (cd); -+ or1k_cgen_init_ibld_table (cd); -+ cd->print_handlers = & or1k_cgen_print_handlers[0]; -+ cd->print_operand = or1k_cgen_print_operand; -+} -+ -+ -+/* Default print handler. */ -+ -+static void -+print_normal (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ void *dis_info, -+ long value, -+ unsigned int attrs, -+ bfd_vma pc ATTRIBUTE_UNUSED, -+ int length ATTRIBUTE_UNUSED) -+{ -+ disassemble_info *info = (disassemble_info *) dis_info; -+ -+ /* Print the operand as directed by the attributes. */ -+ if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) -+ ; /* nothing to do */ -+ else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) -+ (*info->fprintf_func) (info->stream, "%ld", value); -+ else -+ (*info->fprintf_func) (info->stream, "0x%lx", value); -+} -+ -+/* Default address handler. */ -+ -+static void -+print_address (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ void *dis_info, -+ bfd_vma value, -+ unsigned int attrs, -+ bfd_vma pc ATTRIBUTE_UNUSED, -+ int length ATTRIBUTE_UNUSED) -+{ -+ disassemble_info *info = (disassemble_info *) dis_info; -+ -+ /* Print the operand as directed by the attributes. */ -+ if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY)) -+ ; /* Nothing to do. */ -+ else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_PCREL_ADDR)) -+ (*info->print_address_func) (value, info); -+ else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_ABS_ADDR)) -+ (*info->print_address_func) (value, info); -+ else if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SIGNED)) -+ (*info->fprintf_func) (info->stream, "%ld", (long) value); -+ else -+ (*info->fprintf_func) (info->stream, "0x%lx", (long) value); -+} -+ -+/* Keyword print handler. */ -+ -+static void -+print_keyword (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ void *dis_info, -+ CGEN_KEYWORD *keyword_table, -+ long value, -+ unsigned int attrs ATTRIBUTE_UNUSED) -+{ -+ disassemble_info *info = (disassemble_info *) dis_info; -+ const CGEN_KEYWORD_ENTRY *ke; -+ -+ ke = cgen_keyword_lookup_value (keyword_table, value); -+ if (ke != NULL) -+ (*info->fprintf_func) (info->stream, "%s", ke->name); -+ else -+ (*info->fprintf_func) (info->stream, "???"); -+} -+ -+/* Default insn printer. -+ -+ DIS_INFO is defined as `void *' so the disassembler needn't know anything -+ about disassemble_info. */ -+ -+static void -+print_insn_normal (CGEN_CPU_DESC cd, -+ void *dis_info, -+ const CGEN_INSN *insn, -+ CGEN_FIELDS *fields, -+ bfd_vma pc, -+ int length) -+{ -+ const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -+ disassemble_info *info = (disassemble_info *) dis_info; -+ const CGEN_SYNTAX_CHAR_TYPE *syn; -+ -+ CGEN_INIT_PRINT (cd); -+ -+ for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) -+ { -+ if (CGEN_SYNTAX_MNEMONIC_P (*syn)) -+ { -+ (*info->fprintf_func) (info->stream, "%s", CGEN_INSN_MNEMONIC (insn)); -+ continue; -+ } -+ if (CGEN_SYNTAX_CHAR_P (*syn)) -+ { -+ (*info->fprintf_func) (info->stream, "%c", CGEN_SYNTAX_CHAR (*syn)); -+ continue; -+ } -+ -+ /* We have an operand. */ -+ or1k_cgen_print_operand (cd, CGEN_SYNTAX_FIELD (*syn), info, -+ fields, CGEN_INSN_ATTRS (insn), pc, length); -+ } -+} -+ -+/* Subroutine of print_insn. Reads an insn into the given buffers and updates -+ the extract info. -+ Returns 0 if all is well, non-zero otherwise. */ -+ -+static int -+read_insn (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ bfd_vma pc, -+ disassemble_info *info, -+ bfd_byte *buf, -+ int buflen, -+ CGEN_EXTRACT_INFO *ex_info, -+ unsigned long *insn_value) -+{ -+ int status = (*info->read_memory_func) (pc, buf, buflen, info); -+ -+ if (status != 0) -+ { -+ (*info->memory_error_func) (status, pc, info); -+ return -1; -+ } -+ -+ ex_info->dis_info = info; -+ ex_info->valid = (1 << buflen) - 1; -+ ex_info->insn_bytes = buf; -+ -+ *insn_value = bfd_get_bits (buf, buflen * 8, info->endian == BFD_ENDIAN_BIG); -+ return 0; -+} -+ -+/* Utility to print an insn. -+ BUF is the base part of the insn, target byte order, BUFLEN bytes long. -+ The result is the size of the insn in bytes or zero for an unknown insn -+ or -1 if an error occurs fetching data (memory_error_func will have -+ been called). */ -+ -+static int -+print_insn (CGEN_CPU_DESC cd, -+ bfd_vma pc, -+ disassemble_info *info, -+ bfd_byte *buf, -+ unsigned int buflen) -+{ -+ CGEN_INSN_INT insn_value; -+ const CGEN_INSN_LIST *insn_list; -+ CGEN_EXTRACT_INFO ex_info; -+ int basesize; -+ -+ /* Extract base part of instruction, just in case CGEN_DIS_* uses it. */ -+ basesize = cd->base_insn_bitsize < buflen * 8 ? -+ cd->base_insn_bitsize : buflen * 8; -+ insn_value = cgen_get_insn_value (cd, buf, basesize); -+ -+ -+ /* Fill in ex_info fields like read_insn would. Don't actually call -+ read_insn, since the incoming buffer is already read (and possibly -+ modified a la m32r). */ -+ ex_info.valid = (1 << buflen) - 1; -+ ex_info.dis_info = info; -+ ex_info.insn_bytes = buf; -+ -+ /* The instructions are stored in hash lists. -+ Pick the first one and keep trying until we find the right one. */ -+ -+ insn_list = CGEN_DIS_LOOKUP_INSN (cd, (char *) buf, insn_value); -+ while (insn_list != NULL) -+ { -+ const CGEN_INSN *insn = insn_list->insn; -+ CGEN_FIELDS fields; -+ int length; -+ unsigned long insn_value_cropped; -+ -+#ifdef CGEN_VALIDATE_INSN_SUPPORTED -+ /* Not needed as insn shouldn't be in hash lists if not supported. */ -+ /* Supported by this cpu? */ -+ if (! or1k_cgen_insn_supported (cd, insn)) -+ { -+ insn_list = CGEN_DIS_NEXT_INSN (insn_list); -+ continue; -+ } -+#endif -+ -+ /* Basic bit mask must be correct. */ -+ /* ??? May wish to allow target to defer this check until the extract -+ handler. */ -+ -+ /* Base size may exceed this instruction's size. Extract the -+ relevant part from the buffer. */ -+ if ((unsigned) (CGEN_INSN_BITSIZE (insn) / 8) < buflen && -+ (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) -+ insn_value_cropped = bfd_get_bits (buf, CGEN_INSN_BITSIZE (insn), -+ info->endian == BFD_ENDIAN_BIG); -+ else -+ insn_value_cropped = insn_value; -+ -+ if ((insn_value_cropped & CGEN_INSN_BASE_MASK (insn)) -+ == CGEN_INSN_BASE_VALUE (insn)) -+ { -+ /* Printing is handled in two passes. The first pass parses the -+ machine insn and extracts the fields. The second pass prints -+ them. */ -+ -+ /* Make sure the entire insn is loaded into insn_value, if it -+ can fit. */ -+ if (((unsigned) CGEN_INSN_BITSIZE (insn) > cd->base_insn_bitsize) && -+ (unsigned) (CGEN_INSN_BITSIZE (insn) / 8) <= sizeof (unsigned long)) -+ { -+ unsigned long full_insn_value; -+ int rc = read_insn (cd, pc, info, buf, -+ CGEN_INSN_BITSIZE (insn) / 8, -+ & ex_info, & full_insn_value); -+ if (rc != 0) -+ return rc; -+ length = CGEN_EXTRACT_FN (cd, insn) -+ (cd, insn, &ex_info, full_insn_value, &fields, pc); -+ } -+ else -+ length = CGEN_EXTRACT_FN (cd, insn) -+ (cd, insn, &ex_info, insn_value_cropped, &fields, pc); -+ -+ /* Length < 0 -> error. */ -+ if (length < 0) -+ return length; -+ if (length > 0) -+ { -+ CGEN_PRINT_FN (cd, insn) (cd, info, insn, &fields, pc, length); -+ /* Length is in bits, result is in bytes. */ -+ return length / 8; -+ } -+ } -+ -+ insn_list = CGEN_DIS_NEXT_INSN (insn_list); -+ } -+ -+ return 0; -+} -+ -+/* Default value for CGEN_PRINT_INSN. -+ The result is the size of the insn in bytes or zero for an unknown insn -+ or -1 if an error occured fetching bytes. */ -+ -+#ifndef CGEN_PRINT_INSN -+#define CGEN_PRINT_INSN default_print_insn -+#endif -+ -+static int -+default_print_insn (CGEN_CPU_DESC cd, bfd_vma pc, disassemble_info *info) -+{ -+ bfd_byte buf[CGEN_MAX_INSN_SIZE]; -+ int buflen; -+ int status; -+ -+ /* Attempt to read the base part of the insn. */ -+ buflen = cd->base_insn_bitsize / 8; -+ status = (*info->read_memory_func) (pc, buf, buflen, info); -+ -+ /* Try again with the minimum part, if min < base. */ -+ if (status != 0 && (cd->min_insn_bitsize < cd->base_insn_bitsize)) -+ { -+ buflen = cd->min_insn_bitsize / 8; -+ status = (*info->read_memory_func) (pc, buf, buflen, info); -+ } -+ -+ if (status != 0) -+ { -+ (*info->memory_error_func) (status, pc, info); -+ return -1; -+ } -+ -+ return print_insn (cd, pc, info, buf, buflen); -+} -+ -+/* Main entry point. -+ Print one instruction from PC on INFO->STREAM. -+ Return the size of the instruction (in bytes). */ -+ -+typedef struct cpu_desc_list -+{ -+ struct cpu_desc_list *next; -+ CGEN_BITSET *isa; -+ int mach; -+ int endian; -+ CGEN_CPU_DESC cd; -+} cpu_desc_list; -+ -+int -+print_insn_or1k (bfd_vma pc, disassemble_info *info) -+{ -+ static cpu_desc_list *cd_list = 0; -+ cpu_desc_list *cl = 0; -+ static CGEN_CPU_DESC cd = 0; -+ static CGEN_BITSET *prev_isa; -+ static int prev_mach; -+ static int prev_endian; -+ int length; -+ CGEN_BITSET *isa; -+ int mach; -+ int endian = (info->endian == BFD_ENDIAN_BIG -+ ? CGEN_ENDIAN_BIG -+ : CGEN_ENDIAN_LITTLE); -+ enum bfd_architecture arch; -+ -+ /* ??? gdb will set mach but leave the architecture as "unknown" */ -+#ifndef CGEN_BFD_ARCH -+#define CGEN_BFD_ARCH bfd_arch_or1k -+#endif -+ arch = info->arch; -+ if (arch == bfd_arch_unknown) -+ arch = CGEN_BFD_ARCH; -+ -+ /* There's no standard way to compute the machine or isa number -+ so we leave it to the target. */ -+#ifdef CGEN_COMPUTE_MACH -+ mach = CGEN_COMPUTE_MACH (info); -+#else -+ mach = info->mach; -+#endif -+ -+#ifdef CGEN_COMPUTE_ISA -+ { -+ static CGEN_BITSET *permanent_isa; -+ -+ if (!permanent_isa) -+ permanent_isa = cgen_bitset_create (MAX_ISAS); -+ isa = permanent_isa; -+ cgen_bitset_clear (isa); -+ cgen_bitset_add (isa, CGEN_COMPUTE_ISA (info)); -+ } -+#else -+ isa = info->insn_sets; -+#endif -+ -+ /* If we've switched cpu's, try to find a handle we've used before */ -+ if (cd -+ && (cgen_bitset_compare (isa, prev_isa) != 0 -+ || mach != prev_mach -+ || endian != prev_endian)) -+ { -+ cd = 0; -+ for (cl = cd_list; cl; cl = cl->next) -+ { -+ if (cgen_bitset_compare (cl->isa, isa) == 0 && -+ cl->mach == mach && -+ cl->endian == endian) -+ { -+ cd = cl->cd; -+ prev_isa = cd->isas; -+ break; -+ } -+ } -+ } -+ -+ /* If we haven't initialized yet, initialize the opcode table. */ -+ if (! cd) -+ { -+ const bfd_arch_info_type *arch_type = bfd_lookup_arch (arch, mach); -+ const char *mach_name; -+ -+ if (!arch_type) -+ abort (); -+ mach_name = arch_type->printable_name; -+ -+ prev_isa = cgen_bitset_copy (isa); -+ prev_mach = mach; -+ prev_endian = endian; -+ cd = or1k_cgen_cpu_open (CGEN_CPU_OPEN_ISAS, prev_isa, -+ CGEN_CPU_OPEN_BFDMACH, mach_name, -+ CGEN_CPU_OPEN_ENDIAN, prev_endian, -+ CGEN_CPU_OPEN_END); -+ if (!cd) -+ abort (); -+ -+ /* Save this away for future reference. */ -+ cl = xmalloc (sizeof (struct cpu_desc_list)); -+ cl->cd = cd; -+ cl->isa = prev_isa; -+ cl->mach = mach; -+ cl->endian = endian; -+ cl->next = cd_list; -+ cd_list = cl; -+ -+ or1k_cgen_init_dis (cd); -+ } -+ -+ /* We try to have as much common code as possible. -+ But at this point some targets need to take over. */ -+ /* ??? Some targets may need a hook elsewhere. Try to avoid this, -+ but if not possible try to move this hook elsewhere rather than -+ have two hooks. */ -+ length = CGEN_PRINT_INSN (cd, pc, info); -+ if (length > 0) -+ return length; -+ if (length < 0) -+ return -1; -+ -+ (*info->fprintf_func) (info->stream, UNKNOWN_INSN_MSG); -+ return cd->default_insn_bitsize / 8; -+} -diff -rNU3 dist.orig/opcodes/or1k-ibld.c dist/opcodes/or1k-ibld.c ---- dist.orig/opcodes/or1k-ibld.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-ibld.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,1050 @@ -+/* Instruction building/extraction support for or1k. -*- C -*- -+ -+ THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator. -+ - the resultant file is machine generated, cgen-ibld.in isn't -+ -+ Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+ This file is part of libopcodes. -+ -+ This library is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -+ -+/* ??? Eventually more and more of this stuff can go to cpu-independent files. -+ Keep that in mind. */ -+ -+#include "sysdep.h" -+#include -+#include "ansidecl.h" -+#include "dis-asm.h" -+#include "bfd.h" -+#include "symcat.h" -+#include "or1k-desc.h" -+#include "or1k-opc.h" -+#include "cgen/basic-modes.h" -+#include "opintl.h" -+#include "safe-ctype.h" -+ -+#undef min -+#define min(a,b) ((a) < (b) ? (a) : (b)) -+#undef max -+#define max(a,b) ((a) > (b) ? (a) : (b)) -+ -+/* Used by the ifield rtx function. */ -+#define FLD(f) (fields->f) -+ -+static const char * insert_normal -+ (CGEN_CPU_DESC, long, unsigned int, unsigned int, unsigned int, -+ unsigned int, unsigned int, unsigned int, CGEN_INSN_BYTES_PTR); -+static const char * insert_insn_normal -+ (CGEN_CPU_DESC, const CGEN_INSN *, -+ CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma); -+static int extract_normal -+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, -+ unsigned int, unsigned int, unsigned int, unsigned int, -+ unsigned int, unsigned int, bfd_vma, long *); -+static int extract_insn_normal -+ (CGEN_CPU_DESC, const CGEN_INSN *, CGEN_EXTRACT_INFO *, -+ CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma); -+#if CGEN_INT_INSN_P -+static void put_insn_int_value -+ (CGEN_CPU_DESC, CGEN_INSN_BYTES_PTR, int, int, CGEN_INSN_INT); -+#endif -+#if ! CGEN_INT_INSN_P -+static CGEN_INLINE void insert_1 -+ (CGEN_CPU_DESC, unsigned long, int, int, int, unsigned char *); -+static CGEN_INLINE int fill_cache -+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, bfd_vma); -+static CGEN_INLINE long extract_1 -+ (CGEN_CPU_DESC, CGEN_EXTRACT_INFO *, int, int, int, unsigned char *, bfd_vma); -+#endif -+ -+/* Operand insertion. */ -+ -+#if ! CGEN_INT_INSN_P -+ -+/* Subroutine of insert_normal. */ -+ -+static CGEN_INLINE void -+insert_1 (CGEN_CPU_DESC cd, -+ unsigned long value, -+ int start, -+ int length, -+ int word_length, -+ unsigned char *bufp) -+{ -+ unsigned long x,mask; -+ int shift; -+ -+ x = cgen_get_insn_value (cd, bufp, word_length); -+ -+ /* Written this way to avoid undefined behaviour. */ -+ mask = (((1L << (length - 1)) - 1) << 1) | 1; -+ if (CGEN_INSN_LSB0_P) -+ shift = (start + 1) - length; -+ else -+ shift = (word_length - (start + length)); -+ x = (x & ~(mask << shift)) | ((value & mask) << shift); -+ -+ cgen_put_insn_value (cd, bufp, word_length, (bfd_vma) x); -+} -+ -+#endif /* ! CGEN_INT_INSN_P */ -+ -+/* Default insertion routine. -+ -+ ATTRS is a mask of the boolean attributes. -+ WORD_OFFSET is the offset in bits from the start of the insn of the value. -+ WORD_LENGTH is the length of the word in bits in which the value resides. -+ START is the starting bit number in the word, architecture origin. -+ LENGTH is the length of VALUE in bits. -+ TOTAL_LENGTH is the total length of the insn in bits. -+ -+ The result is an error message or NULL if success. */ -+ -+/* ??? This duplicates functionality with bfd's howto table and -+ bfd_install_relocation. */ -+/* ??? This doesn't handle bfd_vma's. Create another function when -+ necessary. */ -+ -+static const char * -+insert_normal (CGEN_CPU_DESC cd, -+ long value, -+ unsigned int attrs, -+ unsigned int word_offset, -+ unsigned int start, -+ unsigned int length, -+ unsigned int word_length, -+ unsigned int total_length, -+ CGEN_INSN_BYTES_PTR buffer) -+{ -+ static char errbuf[100]; -+ /* Written this way to avoid undefined behaviour. */ -+ unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1; -+ -+ /* If LENGTH is zero, this operand doesn't contribute to the value. */ -+ if (length == 0) -+ return NULL; -+ -+ if (word_length > 8 * sizeof (CGEN_INSN_INT)) -+ abort (); -+ -+ /* For architectures with insns smaller than the base-insn-bitsize, -+ word_length may be too big. */ -+ if (cd->min_insn_bitsize < cd->base_insn_bitsize) -+ { -+ if (word_offset == 0 -+ && word_length > total_length) -+ word_length = total_length; -+ } -+ -+ /* Ensure VALUE will fit. */ -+ if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT)) -+ { -+ long minval = - (1L << (length - 1)); -+ unsigned long maxval = mask; -+ -+ if ((value > 0 && (unsigned long) value > maxval) -+ || value < minval) -+ { -+ /* xgettext:c-format */ -+ sprintf (errbuf, -+ _("operand out of range (%ld not between %ld and %lu)"), -+ value, minval, maxval); -+ return errbuf; -+ } -+ } -+ else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)) -+ { -+ unsigned long maxval = mask; -+ unsigned long val = (unsigned long) value; -+ -+ /* For hosts with a word size > 32 check to see if value has been sign -+ extended beyond 32 bits. If so then ignore these higher sign bits -+ as the user is attempting to store a 32-bit signed value into an -+ unsigned 32-bit field which is allowed. */ -+ if (sizeof (unsigned long) > 4 && ((value >> 32) == -1)) -+ val &= 0xFFFFFFFF; -+ -+ if (val > maxval) -+ { -+ /* xgettext:c-format */ -+ sprintf (errbuf, -+ _("operand out of range (0x%lx not between 0 and 0x%lx)"), -+ val, maxval); -+ return errbuf; -+ } -+ } -+ else -+ { -+ if (! cgen_signed_overflow_ok_p (cd)) -+ { -+ long minval = - (1L << (length - 1)); -+ long maxval = (1L << (length - 1)) - 1; -+ -+ if (value < minval || value > maxval) -+ { -+ sprintf -+ /* xgettext:c-format */ -+ (errbuf, _("operand out of range (%ld not between %ld and %ld)"), -+ value, minval, maxval); -+ return errbuf; -+ } -+ } -+ } -+ -+#if CGEN_INT_INSN_P -+ -+ { -+ int shift; -+ -+ if (CGEN_INSN_LSB0_P) -+ shift = (word_offset + start + 1) - length; -+ else -+ shift = total_length - (word_offset + start + length); -+ *buffer = (*buffer & ~(mask << shift)) | ((value & mask) << shift); -+ } -+ -+#else /* ! CGEN_INT_INSN_P */ -+ -+ { -+ unsigned char *bufp = (unsigned char *) buffer + word_offset / 8; -+ -+ insert_1 (cd, value, start, length, word_length, bufp); -+ } -+ -+#endif /* ! CGEN_INT_INSN_P */ -+ -+ return NULL; -+} -+ -+/* Default insn builder (insert handler). -+ The instruction is recorded in CGEN_INT_INSN_P byte order (meaning -+ that if CGEN_INSN_BYTES_PTR is an int * and thus, the value is -+ recorded in host byte order, otherwise BUFFER is an array of bytes -+ and the value is recorded in target byte order). -+ The result is an error message or NULL if success. */ -+ -+static const char * -+insert_insn_normal (CGEN_CPU_DESC cd, -+ const CGEN_INSN * insn, -+ CGEN_FIELDS * fields, -+ CGEN_INSN_BYTES_PTR buffer, -+ bfd_vma pc) -+{ -+ const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -+ unsigned long value; -+ const CGEN_SYNTAX_CHAR_TYPE * syn; -+ -+ CGEN_INIT_INSERT (cd); -+ value = CGEN_INSN_BASE_VALUE (insn); -+ -+ /* If we're recording insns as numbers (rather than a string of bytes), -+ target byte order handling is deferred until later. */ -+ -+#if CGEN_INT_INSN_P -+ -+ put_insn_int_value (cd, buffer, cd->base_insn_bitsize, -+ CGEN_FIELDS_BITSIZE (fields), value); -+ -+#else -+ -+ cgen_put_insn_value (cd, buffer, min ((unsigned) cd->base_insn_bitsize, -+ (unsigned) CGEN_FIELDS_BITSIZE (fields)), -+ value); -+ -+#endif /* ! CGEN_INT_INSN_P */ -+ -+ /* ??? It would be better to scan the format's fields. -+ Still need to be able to insert a value based on the operand though; -+ e.g. storing a branch displacement that got resolved later. -+ Needs more thought first. */ -+ -+ for (syn = CGEN_SYNTAX_STRING (syntax); * syn; ++ syn) -+ { -+ const char *errmsg; -+ -+ if (CGEN_SYNTAX_CHAR_P (* syn)) -+ continue; -+ -+ errmsg = (* cd->insert_operand) (cd, CGEN_SYNTAX_FIELD (*syn), -+ fields, buffer, pc); -+ if (errmsg) -+ return errmsg; -+ } -+ -+ return NULL; -+} -+ -+#if CGEN_INT_INSN_P -+/* Cover function to store an insn value into an integral insn. Must go here -+ because it needs -desc.h for CGEN_INT_INSN_P. */ -+ -+static void -+put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ CGEN_INSN_BYTES_PTR buf, -+ int length, -+ int insn_length, -+ CGEN_INSN_INT value) -+{ -+ /* For architectures with insns smaller than the base-insn-bitsize, -+ length may be too big. */ -+ if (length > insn_length) -+ *buf = value; -+ else -+ { -+ int shift = insn_length - length; -+ /* Written this way to avoid undefined behaviour. */ -+ CGEN_INSN_INT mask = (((1L << (length - 1)) - 1) << 1) | 1; -+ -+ *buf = (*buf & ~(mask << shift)) | ((value & mask) << shift); -+ } -+} -+#endif -+ -+/* Operand extraction. */ -+ -+#if ! CGEN_INT_INSN_P -+ -+/* Subroutine of extract_normal. -+ Ensure sufficient bytes are cached in EX_INFO. -+ OFFSET is the offset in bytes from the start of the insn of the value. -+ BYTES is the length of the needed value. -+ Returns 1 for success, 0 for failure. */ -+ -+static CGEN_INLINE int -+fill_cache (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ CGEN_EXTRACT_INFO *ex_info, -+ int offset, -+ int bytes, -+ bfd_vma pc) -+{ -+ /* It's doubtful that the middle part has already been fetched so -+ we don't optimize that case. kiss. */ -+ unsigned int mask; -+ disassemble_info *info = (disassemble_info *) ex_info->dis_info; -+ -+ /* First do a quick check. */ -+ mask = (1 << bytes) - 1; -+ if (((ex_info->valid >> offset) & mask) == mask) -+ return 1; -+ -+ /* Search for the first byte we need to read. */ -+ for (mask = 1 << offset; bytes > 0; --bytes, ++offset, mask <<= 1) -+ if (! (mask & ex_info->valid)) -+ break; -+ -+ if (bytes) -+ { -+ int status; -+ -+ pc += offset; -+ status = (*info->read_memory_func) -+ (pc, ex_info->insn_bytes + offset, bytes, info); -+ -+ if (status != 0) -+ { -+ (*info->memory_error_func) (status, pc, info); -+ return 0; -+ } -+ -+ ex_info->valid |= ((1 << bytes) - 1) << offset; -+ } -+ -+ return 1; -+} -+ -+/* Subroutine of extract_normal. */ -+ -+static CGEN_INLINE long -+extract_1 (CGEN_CPU_DESC cd, -+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED, -+ int start, -+ int length, -+ int word_length, -+ unsigned char *bufp, -+ bfd_vma pc ATTRIBUTE_UNUSED) -+{ -+ unsigned long x; -+ int shift; -+ -+ x = cgen_get_insn_value (cd, bufp, word_length); -+ -+ if (CGEN_INSN_LSB0_P) -+ shift = (start + 1) - length; -+ else -+ shift = (word_length - (start + length)); -+ return x >> shift; -+} -+ -+#endif /* ! CGEN_INT_INSN_P */ -+ -+/* Default extraction routine. -+ -+ INSN_VALUE is the first base_insn_bitsize bits of the insn in host order, -+ or sometimes less for cases like the m32r where the base insn size is 32 -+ but some insns are 16 bits. -+ ATTRS is a mask of the boolean attributes. We only need `SIGNED', -+ but for generality we take a bitmask of all of them. -+ WORD_OFFSET is the offset in bits from the start of the insn of the value. -+ WORD_LENGTH is the length of the word in bits in which the value resides. -+ START is the starting bit number in the word, architecture origin. -+ LENGTH is the length of VALUE in bits. -+ TOTAL_LENGTH is the total length of the insn in bits. -+ -+ Returns 1 for success, 0 for failure. */ -+ -+/* ??? The return code isn't properly used. wip. */ -+ -+/* ??? This doesn't handle bfd_vma's. Create another function when -+ necessary. */ -+ -+static int -+extract_normal (CGEN_CPU_DESC cd, -+#if ! CGEN_INT_INSN_P -+ CGEN_EXTRACT_INFO *ex_info, -+#else -+ CGEN_EXTRACT_INFO *ex_info ATTRIBUTE_UNUSED, -+#endif -+ CGEN_INSN_INT insn_value, -+ unsigned int attrs, -+ unsigned int word_offset, -+ unsigned int start, -+ unsigned int length, -+ unsigned int word_length, -+ unsigned int total_length, -+#if ! CGEN_INT_INSN_P -+ bfd_vma pc, -+#else -+ bfd_vma pc ATTRIBUTE_UNUSED, -+#endif -+ long *valuep) -+{ -+ long value, mask; -+ -+ /* If LENGTH is zero, this operand doesn't contribute to the value -+ so give it a standard value of zero. */ -+ if (length == 0) -+ { -+ *valuep = 0; -+ return 1; -+ } -+ -+ if (word_length > 8 * sizeof (CGEN_INSN_INT)) -+ abort (); -+ -+ /* For architectures with insns smaller than the insn-base-bitsize, -+ word_length may be too big. */ -+ if (cd->min_insn_bitsize < cd->base_insn_bitsize) -+ { -+ if (word_offset + word_length > total_length) -+ word_length = total_length - word_offset; -+ } -+ -+ /* Does the value reside in INSN_VALUE, and at the right alignment? */ -+ -+ if (CGEN_INT_INSN_P || (word_offset == 0 && word_length == total_length)) -+ { -+ if (CGEN_INSN_LSB0_P) -+ value = insn_value >> ((word_offset + start + 1) - length); -+ else -+ value = insn_value >> (total_length - ( word_offset + start + length)); -+ } -+ -+#if ! CGEN_INT_INSN_P -+ -+ else -+ { -+ unsigned char *bufp = ex_info->insn_bytes + word_offset / 8; -+ -+ if (word_length > 8 * sizeof (CGEN_INSN_INT)) -+ abort (); -+ -+ if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0) -+ return 0; -+ -+ value = extract_1 (cd, ex_info, start, length, word_length, bufp, pc); -+ } -+ -+#endif /* ! CGEN_INT_INSN_P */ -+ -+ /* Written this way to avoid undefined behaviour. */ -+ mask = (((1L << (length - 1)) - 1) << 1) | 1; -+ -+ value &= mask; -+ /* sign extend? */ -+ if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED) -+ && (value & (1L << (length - 1)))) -+ value |= ~mask; -+ -+ *valuep = value; -+ -+ return 1; -+} -+ -+/* Default insn extractor. -+ -+ INSN_VALUE is the first base_insn_bitsize bits, translated to host order. -+ The extracted fields are stored in FIELDS. -+ EX_INFO is used to handle reading variable length insns. -+ Return the length of the insn in bits, or 0 if no match, -+ or -1 if an error occurs fetching data (memory_error_func will have -+ been called). */ -+ -+static int -+extract_insn_normal (CGEN_CPU_DESC cd, -+ const CGEN_INSN *insn, -+ CGEN_EXTRACT_INFO *ex_info, -+ CGEN_INSN_INT insn_value, -+ CGEN_FIELDS *fields, -+ bfd_vma pc) -+{ -+ const CGEN_SYNTAX *syntax = CGEN_INSN_SYNTAX (insn); -+ const CGEN_SYNTAX_CHAR_TYPE *syn; -+ -+ CGEN_FIELDS_BITSIZE (fields) = CGEN_INSN_BITSIZE (insn); -+ -+ CGEN_INIT_EXTRACT (cd); -+ -+ for (syn = CGEN_SYNTAX_STRING (syntax); *syn; ++syn) -+ { -+ int length; -+ -+ if (CGEN_SYNTAX_CHAR_P (*syn)) -+ continue; -+ -+ length = (* cd->extract_operand) (cd, CGEN_SYNTAX_FIELD (*syn), -+ ex_info, insn_value, fields, pc); -+ if (length <= 0) -+ return length; -+ } -+ -+ /* We recognized and successfully extracted this insn. */ -+ return CGEN_INSN_BITSIZE (insn); -+} -+ -+/* Machine generated code added here. */ -+ -+const char * or1k_cgen_insert_operand -+ (CGEN_CPU_DESC, int, CGEN_FIELDS *, CGEN_INSN_BYTES_PTR, bfd_vma); -+ -+/* Main entry point for operand insertion. -+ -+ This function is basically just a big switch statement. Earlier versions -+ used tables to look up the function to use, but -+ - if the table contains both assembler and disassembler functions then -+ the disassembler contains much of the assembler and vice-versa, -+ - there's a lot of inlining possibilities as things grow, -+ - using a switch statement avoids the function call overhead. -+ -+ This function could be moved into `parse_insn_normal', but keeping it -+ separate makes clear the interface between `parse_insn_normal' and each of -+ the handlers. It's also needed by GAS to insert operands that couldn't be -+ resolved during parsing. */ -+ -+const char * -+or1k_cgen_insert_operand (CGEN_CPU_DESC cd, -+ int opindex, -+ CGEN_FIELDS * fields, -+ CGEN_INSN_BYTES_PTR buffer, -+ bfd_vma pc ATTRIBUTE_UNUSED) -+{ -+ const char * errmsg = NULL; -+ unsigned int total_length = CGEN_FIELDS_BITSIZE (fields); -+ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ { -+ long value = fields->f_disp26; -+ value = ((SI) (((value) - (pc))) >> (2)); -+ errmsg = insert_normal (cd, value, 0|(1<f_r2, 0, 0, 20, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RADF : -+ errmsg = insert_normal (cd, fields->f_r1, 0, 0, 25, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RASF : -+ errmsg = insert_normal (cd, fields->f_r2, 0, 0, 20, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RB : -+ errmsg = insert_normal (cd, fields->f_r3, 0, 0, 15, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RBDF : -+ errmsg = insert_normal (cd, fields->f_r1, 0, 0, 25, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RBSF : -+ errmsg = insert_normal (cd, fields->f_r3, 0, 0, 15, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RD : -+ errmsg = insert_normal (cd, fields->f_r1, 0, 0, 25, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RDDF : -+ errmsg = insert_normal (cd, fields->f_r1, 0, 0, 25, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_RDSF : -+ errmsg = insert_normal (cd, fields->f_r1, 0, 0, 25, 5, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ errmsg = insert_normal (cd, fields->f_simm16, 0|(1<> (11))) & (31)); -+ FLD (f_imm16_10_11) = ((FLD (f_simm16_split)) & (2047)); -+} -+ errmsg = insert_normal (cd, fields->f_imm16_25_5, 0, 0, 25, 5, 32, total_length, buffer); -+ if (errmsg) -+ break; -+ errmsg = insert_normal (cd, fields->f_imm16_10_11, 0, 0, 10, 11, 32, total_length, buffer); -+ if (errmsg) -+ break; -+ } -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ errmsg = insert_normal (cd, fields->f_uimm16, 0, 0, 15, 16, 32, total_length, buffer); -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ { -+{ -+ FLD (f_imm16_25_5) = ((((UINT) (FLD (f_uimm16_split)) >> (11))) & (31)); -+ FLD (f_imm16_10_11) = ((FLD (f_uimm16_split)) & (2047)); -+} -+ errmsg = insert_normal (cd, fields->f_imm16_25_5, 0, 0, 25, 5, 32, total_length, buffer); -+ if (errmsg) -+ break; -+ errmsg = insert_normal (cd, fields->f_imm16_10_11, 0, 0, 10, 11, 32, total_length, buffer); -+ if (errmsg) -+ break; -+ } -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ errmsg = insert_normal (cd, fields->f_uimm6, 0, 0, 5, 6, 32, total_length, buffer); -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while building insn.\n"), -+ opindex); -+ abort (); -+ } -+ -+ return errmsg; -+} -+ -+int or1k_cgen_extract_operand -+ (CGEN_CPU_DESC, int, CGEN_EXTRACT_INFO *, CGEN_INSN_INT, CGEN_FIELDS *, bfd_vma); -+ -+/* Main entry point for operand extraction. -+ The result is <= 0 for error, >0 for success. -+ ??? Actual values aren't well defined right now. -+ -+ This function is basically just a big switch statement. Earlier versions -+ used tables to look up the function to use, but -+ - if the table contains both assembler and disassembler functions then -+ the disassembler contains much of the assembler and vice-versa, -+ - there's a lot of inlining possibilities as things grow, -+ - using a switch statement avoids the function call overhead. -+ -+ This function could be moved into `print_insn_normal', but keeping it -+ separate makes clear the interface between `print_insn_normal' and each of -+ the handlers. */ -+ -+int -+or1k_cgen_extract_operand (CGEN_CPU_DESC cd, -+ int opindex, -+ CGEN_EXTRACT_INFO *ex_info, -+ CGEN_INSN_INT insn_value, -+ CGEN_FIELDS * fields, -+ bfd_vma pc) -+{ -+ /* Assume success (for those operands that are nops). */ -+ int length = 1; -+ unsigned int total_length = CGEN_FIELDS_BITSIZE (fields); -+ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ { -+ long value; -+ length = extract_normal (cd, ex_info, insn_value, 0|(1<f_disp26 = value; -+ } -+ break; -+ case OR1K_OPERAND_RA : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 5, 32, total_length, pc, & fields->f_r2); -+ break; -+ case OR1K_OPERAND_RADF : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RASF : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 5, 32, total_length, pc, & fields->f_r2); -+ break; -+ case OR1K_OPERAND_RB : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 5, 32, total_length, pc, & fields->f_r3); -+ break; -+ case OR1K_OPERAND_RBDF : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RBSF : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 5, 32, total_length, pc, & fields->f_r3); -+ break; -+ case OR1K_OPERAND_RD : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RDDF : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_RDSF : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_r1); -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ length = extract_normal (cd, ex_info, insn_value, 0|(1<f_simm16); -+ break; -+ case OR1K_OPERAND_SIMM16_SPLIT : -+ { -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_imm16_25_5); -+ if (length <= 0) break; -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 11, 32, total_length, pc, & fields->f_imm16_10_11); -+ if (length <= 0) break; -+ FLD (f_simm16_split) = ((HI) (UINT) (((((FLD (f_imm16_25_5)) << (11))) | (FLD (f_imm16_10_11))))); -+ } -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 16, 32, total_length, pc, & fields->f_uimm16); -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ { -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 5, 32, total_length, pc, & fields->f_imm16_25_5); -+ if (length <= 0) break; -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 11, 32, total_length, pc, & fields->f_imm16_10_11); -+ if (length <= 0) break; -+ FLD (f_uimm16_split) = ((UHI) (UINT) (((((FLD (f_imm16_25_5)) << (11))) | (FLD (f_imm16_10_11))))); -+ } -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 6, 32, total_length, pc, & fields->f_uimm6); -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while decoding insn.\n"), -+ opindex); -+ abort (); -+ } -+ -+ return length; -+} -+ -+cgen_insert_fn * const or1k_cgen_insert_handlers[] = -+{ -+ insert_insn_normal, -+}; -+ -+cgen_extract_fn * const or1k_cgen_extract_handlers[] = -+{ -+ extract_insn_normal, -+}; -+ -+int or1k_cgen_get_int_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *); -+bfd_vma or1k_cgen_get_vma_operand (CGEN_CPU_DESC, int, const CGEN_FIELDS *); -+ -+/* Getting values from cgen_fields is handled by a collection of functions. -+ They are distinguished by the type of the VALUE argument they return. -+ TODO: floating point, inlining support, remove cases where result type -+ not appropriate. */ -+ -+int -+or1k_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ int opindex, -+ const CGEN_FIELDS * fields) -+{ -+ int value; -+ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ value = fields->f_disp26; -+ break; -+ case OR1K_OPERAND_RA : -+ value = fields->f_r2; -+ break; -+ case OR1K_OPERAND_RADF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RASF : -+ value = fields->f_r2; -+ break; -+ case OR1K_OPERAND_RB : -+ value = fields->f_r3; -+ break; -+ case OR1K_OPERAND_RBDF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RBSF : -+ value = fields->f_r3; -+ break; -+ case OR1K_OPERAND_RD : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RDDF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RDSF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ value = fields->f_simm16; -+ break; -+ case OR1K_OPERAND_SIMM16_SPLIT : -+ value = fields->f_simm16_split; -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ value = fields->f_uimm16; -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ value = fields->f_uimm16_split; -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ value = fields->f_uimm6; -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while getting int operand.\n"), -+ opindex); -+ abort (); -+ } -+ -+ return value; -+} -+ -+bfd_vma -+or1k_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ int opindex, -+ const CGEN_FIELDS * fields) -+{ -+ bfd_vma value; -+ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ value = fields->f_disp26; -+ break; -+ case OR1K_OPERAND_RA : -+ value = fields->f_r2; -+ break; -+ case OR1K_OPERAND_RADF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RASF : -+ value = fields->f_r2; -+ break; -+ case OR1K_OPERAND_RB : -+ value = fields->f_r3; -+ break; -+ case OR1K_OPERAND_RBDF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RBSF : -+ value = fields->f_r3; -+ break; -+ case OR1K_OPERAND_RD : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RDDF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_RDSF : -+ value = fields->f_r1; -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ value = fields->f_simm16; -+ break; -+ case OR1K_OPERAND_SIMM16_SPLIT : -+ value = fields->f_simm16_split; -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ value = fields->f_uimm16; -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ value = fields->f_uimm16_split; -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ value = fields->f_uimm6; -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while getting vma operand.\n"), -+ opindex); -+ abort (); -+ } -+ -+ return value; -+} -+ -+void or1k_cgen_set_int_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, int); -+void or1k_cgen_set_vma_operand (CGEN_CPU_DESC, int, CGEN_FIELDS *, bfd_vma); -+ -+/* Stuffing values in cgen_fields is handled by a collection of functions. -+ They are distinguished by the type of the VALUE argument they accept. -+ TODO: floating point, inlining support, remove cases where argument type -+ not appropriate. */ -+ -+void -+or1k_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ int opindex, -+ CGEN_FIELDS * fields, -+ int value) -+{ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ fields->f_disp26 = value; -+ break; -+ case OR1K_OPERAND_RA : -+ fields->f_r2 = value; -+ break; -+ case OR1K_OPERAND_RADF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RASF : -+ fields->f_r2 = value; -+ break; -+ case OR1K_OPERAND_RB : -+ fields->f_r3 = value; -+ break; -+ case OR1K_OPERAND_RBDF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RBSF : -+ fields->f_r3 = value; -+ break; -+ case OR1K_OPERAND_RD : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RDDF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RDSF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ fields->f_simm16 = value; -+ break; -+ case OR1K_OPERAND_SIMM16_SPLIT : -+ fields->f_simm16_split = value; -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ fields->f_uimm16 = value; -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ fields->f_uimm16_split = value; -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ fields->f_uimm6 = value; -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while setting int operand.\n"), -+ opindex); -+ abort (); -+ } -+} -+ -+void -+or1k_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, -+ int opindex, -+ CGEN_FIELDS * fields, -+ bfd_vma value) -+{ -+ switch (opindex) -+ { -+ case OR1K_OPERAND_DISP26 : -+ fields->f_disp26 = value; -+ break; -+ case OR1K_OPERAND_RA : -+ fields->f_r2 = value; -+ break; -+ case OR1K_OPERAND_RADF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RASF : -+ fields->f_r2 = value; -+ break; -+ case OR1K_OPERAND_RB : -+ fields->f_r3 = value; -+ break; -+ case OR1K_OPERAND_RBDF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RBSF : -+ fields->f_r3 = value; -+ break; -+ case OR1K_OPERAND_RD : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RDDF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_RDSF : -+ fields->f_r1 = value; -+ break; -+ case OR1K_OPERAND_SIMM16 : -+ fields->f_simm16 = value; -+ break; -+ case OR1K_OPERAND_SIMM16_SPLIT : -+ fields->f_simm16_split = value; -+ break; -+ case OR1K_OPERAND_UIMM16 : -+ fields->f_uimm16 = value; -+ break; -+ case OR1K_OPERAND_UIMM16_SPLIT : -+ fields->f_uimm16_split = value; -+ break; -+ case OR1K_OPERAND_UIMM6 : -+ fields->f_uimm6 = value; -+ break; -+ -+ default : -+ /* xgettext:c-format */ -+ fprintf (stderr, _("Unrecognized field %d while setting vma operand.\n"), -+ opindex); -+ abort (); -+ } -+} -+ -+/* Function to call before using the instruction builder tables. */ -+ -+void -+or1k_cgen_init_ibld_table (CGEN_CPU_DESC cd) -+{ -+ cd->insert_handlers = & or1k_cgen_insert_handlers[0]; -+ cd->extract_handlers = & or1k_cgen_extract_handlers[0]; -+ -+ cd->insert_operand = or1k_cgen_insert_operand; -+ cd->extract_operand = or1k_cgen_extract_operand; -+ -+ cd->get_int_operand = or1k_cgen_get_int_operand; -+ cd->set_int_operand = or1k_cgen_set_int_operand; -+ cd->get_vma_operand = or1k_cgen_get_vma_operand; -+ cd->set_vma_operand = or1k_cgen_set_vma_operand; -+} -diff -rNU3 dist.orig/opcodes/or1k-opc.c dist/opcodes/or1k-opc.c ---- dist.orig/opcodes/or1k-opc.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-opc.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,1081 @@ -+/* Instruction opcode table for or1k. -+ -+THIS FILE IS MACHINE GENERATED WITH CGEN. -+ -+Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+This file is part of the GNU Binutils and/or GDB, the GNU debugger. -+ -+ This file is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -+ -+*/ -+ -+#include "sysdep.h" -+#include "ansidecl.h" -+#include "bfd.h" -+#include "symcat.h" -+#include "or1k-desc.h" -+#include "or1k-opc.h" -+#include "libiberty.h" -+ -+/* -- opc.c */ -+/* -- */ -+/* The hash functions are recorded here to help keep assembler code out of -+ the disassembler and vice versa. */ -+ -+static int asm_hash_insn_p (const CGEN_INSN *); -+static unsigned int asm_hash_insn (const char *); -+static int dis_hash_insn_p (const CGEN_INSN *); -+static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT); -+ -+/* Instruction formats. */ -+ -+#define F(f) & or1k_cgen_ifld_table[OR1K_##f] -+static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = { -+ 0, 0, 0x0, { { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_j ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_DISP26) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_jr ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffff07ff, { { F (F_OPCODE) }, { F (F_RESV_25_10) }, { F (F_R3) }, { F (F_RESV_10_11) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_trap ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffff0000, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_RESV_20_5) }, { F (F_UIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_msync ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffffffff, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_RESV_20_21) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_rfe ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffffffff, { { F (F_OPCODE) }, { F (F_RESV_25_26) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_nop_imm ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffff0000, { { F (F_OPCODE) }, { F (F_OP_25_2) }, { F (F_RESV_23_8) }, { F (F_UIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_movhi ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc1f0000, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_RESV_20_4) }, { F (F_OP_16_1) }, { F (F_UIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_macrc ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc1fffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_RESV_20_4) }, { F (F_OP_16_1) }, { F (F_UIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_mfspr ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_mtspr ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R2) }, { F (F_R3) }, { F (F_UIMM16_SPLIT) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_lwz ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_sw ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R2) }, { F (F_R3) }, { F (F_SIMM16_SPLIT) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_swa ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc000000, { { F (F_OPCODE) }, { F (F_R2) }, { F (F_R3) }, { F (F_SIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_sll ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_2) }, { F (F_RESV_5_2) }, { F (F_OP_3_4) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_slli ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc00ffc0, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_RESV_15_8) }, { F (F_OP_7_2) }, { F (F_UIMM6) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_and ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_7) }, { F (F_OP_3_4) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_exths ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_RESV_15_6) }, { F (F_OP_9_4) }, { F (F_RESV_5_2) }, { F (F_OP_3_4) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_cmov ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_1) }, { F (F_OP_9_2) }, { F (F_RESV_7_4) }, { F (F_OP_3_4) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_sfgts ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_11) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_sfgtsi ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe00000, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_mac ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_OP_25_5) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_7) }, { F (F_OP_3_4) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_l_maci ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe00000, { { F (F_OPCODE) }, { F (F_RESV_25_5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_add_s ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_add_d ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc0007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R1) }, { F (F_R1) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_itof_s ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_ftoi_s ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_ftoi_d ATTRIBUTE_UNUSED = { -+ 32, 32, 0xfc00ffff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R1) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_eq_s ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_cust1_s ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_RESV_25_5) }, { F (F_R2) }, { F (F_R3) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+static const CGEN_IFMT ifmt_lf_cust1_d ATTRIBUTE_UNUSED = { -+ 32, 32, 0xffe007ff, { { F (F_OPCODE) }, { F (F_RESV_25_5) }, { F (F_R1) }, { F (F_R1) }, { F (F_RESV_10_3) }, { F (F_OP_7_8) }, { 0 } } -+}; -+ -+#undef F -+ -+#define A(a) (1 << CGEN_INSN_##a) -+#define OPERAND(op) OR1K_OPERAND_##op -+#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */ -+#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field)) -+ -+/* The instruction table. */ -+ -+static const CGEN_OPCODE or1k_cgen_insn_opcode_table[MAX_INSNS] = -+{ -+ /* Special null first entry. -+ A `num' value of zero is thus invalid. -+ Also, the special `invalid' insn resides here. */ -+ { { 0, 0, 0, 0 }, {{0}}, 0, {0}}, -+/* l.j ${disp26} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (DISP26), 0 } }, -+ & ifmt_l_j, { 0x0 } -+ }, -+/* l.jal ${disp26} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (DISP26), 0 } }, -+ & ifmt_l_j, { 0x4000000 } -+ }, -+/* l.jr $rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RB), 0 } }, -+ & ifmt_l_jr, { 0x44000000 } -+ }, -+/* l.jalr $rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RB), 0 } }, -+ & ifmt_l_jr, { 0x48000000 } -+ }, -+/* l.bnf ${disp26} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (DISP26), 0 } }, -+ & ifmt_l_j, { 0xc000000 } -+ }, -+/* l.bf ${disp26} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (DISP26), 0 } }, -+ & ifmt_l_j, { 0x10000000 } -+ }, -+/* l.trap ${uimm16} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (UIMM16), 0 } }, -+ & ifmt_l_trap, { 0x21000000 } -+ }, -+/* l.sys ${uimm16} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (UIMM16), 0 } }, -+ & ifmt_l_trap, { 0x20000000 } -+ }, -+/* l.msync */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_msync, { 0x22000000 } -+ }, -+/* l.psync */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_msync, { 0x22800000 } -+ }, -+/* l.csync */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_msync, { 0x23000000 } -+ }, -+/* l.rfe */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0x24000000 } -+ }, -+/* l.nop ${uimm16} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (UIMM16), 0 } }, -+ & ifmt_l_nop_imm, { 0x15000000 } -+ }, -+/* l.nop */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_nop_imm, { 0x15000000 } -+ }, -+/* l.movhi $rD,$uimm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (UIMM16), 0 } }, -+ & ifmt_l_movhi, { 0x18000000 } -+ }, -+/* l.macrc $rD */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), 0 } }, -+ & ifmt_l_macrc, { 0x18010000 } -+ }, -+/* l.mfspr $rD,$rA,${uimm16} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM16), 0 } }, -+ & ifmt_l_mfspr, { 0xb4000000 } -+ }, -+/* l.mtspr $rA,$rB,${uimm16-split} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), ',', OP (UIMM16_SPLIT), 0 } }, -+ & ifmt_l_mtspr, { 0xc0000000 } -+ }, -+/* l.lwz $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x84000000 } -+ }, -+/* l.lws $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x88000000 } -+ }, -+/* l.lwa $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x6c000000 } -+ }, -+/* l.lbz $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x8c000000 } -+ }, -+/* l.lbs $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x90000000 } -+ }, -+/* l.lhz $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x94000000 } -+ }, -+/* l.lhs $rD,${simm16}($rA) */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (SIMM16), '(', OP (RA), ')', 0 } }, -+ & ifmt_l_lwz, { 0x98000000 } -+ }, -+/* l.sw ${simm16-split}($rA),$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } }, -+ & ifmt_l_sw, { 0xd4000000 } -+ }, -+/* l.sb ${simm16-split}($rA),$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } }, -+ & ifmt_l_sw, { 0xd8000000 } -+ }, -+/* l.sh ${simm16-split}($rA),$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } }, -+ & ifmt_l_sw, { 0xdc000000 } -+ }, -+/* l.swa ${simm16-split}($rA),$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (SIMM16_SPLIT), '(', OP (RA), ')', ',', OP (RB), 0 } }, -+ & ifmt_l_swa, { 0xcc000000 } -+ }, -+/* l.sll $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sll, { 0xe0000008 } -+ }, -+/* l.slli $rD,$rA,${uimm6} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } }, -+ & ifmt_l_slli, { 0xb8000000 } -+ }, -+/* l.srl $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sll, { 0xe0000048 } -+ }, -+/* l.srli $rD,$rA,${uimm6} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } }, -+ & ifmt_l_slli, { 0xb8000040 } -+ }, -+/* l.sra $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sll, { 0xe0000088 } -+ }, -+/* l.srai $rD,$rA,${uimm6} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } }, -+ & ifmt_l_slli, { 0xb8000080 } -+ }, -+/* l.ror $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sll, { 0xe00000c8 } -+ }, -+/* l.rori $rD,$rA,${uimm6} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM6), 0 } }, -+ & ifmt_l_slli, { 0xb80000c0 } -+ }, -+/* l.and $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000003 } -+ }, -+/* l.or $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000004 } -+ }, -+/* l.xor $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000005 } -+ }, -+/* l.add $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000000 } -+ }, -+/* l.sub $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000002 } -+ }, -+/* l.addc $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000001 } -+ }, -+/* l.mul $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000306 } -+ }, -+/* l.mulu $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe000030b } -+ }, -+/* l.div $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe0000309 } -+ }, -+/* l.divu $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_and, { 0xe000030a } -+ }, -+/* l.ff1 $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_and, { 0xe000000f } -+ }, -+/* l.fl1 $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_and, { 0xe000010f } -+ }, -+/* l.andi $rD,$rA,$uimm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM16), 0 } }, -+ & ifmt_l_mfspr, { 0xa4000000 } -+ }, -+/* l.ori $rD,$rA,$uimm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM16), 0 } }, -+ & ifmt_l_mfspr, { 0xa8000000 } -+ }, -+/* l.xori $rD,$rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_lwz, { 0xac000000 } -+ }, -+/* l.addi $rD,$rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_lwz, { 0x9c000000 } -+ }, -+/* l.addic $rD,$rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_lwz, { 0xa0000000 } -+ }, -+/* l.muli $rD,$rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_lwz, { 0xb0000000 } -+ }, -+/* l.exths $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_exths, { 0xe000000c } -+ }, -+/* l.extbs $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_exths, { 0xe000004c } -+ }, -+/* l.exthz $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_exths, { 0xe000008c } -+ }, -+/* l.extbz $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_exths, { 0xe00000cc } -+ }, -+/* l.extws $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_exths, { 0xe000000d } -+ }, -+/* l.extwz $rD,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } }, -+ & ifmt_l_exths, { 0xe000004d } -+ }, -+/* l.cmov $rD,$rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_cmov, { 0xe000000e } -+ }, -+/* l.sfgts $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe5400000 } -+ }, -+/* l.sfgtsi $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbd400000 } -+ }, -+/* l.sfgtu $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe4400000 } -+ }, -+/* l.sfgtui $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbc400000 } -+ }, -+/* l.sfges $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe5600000 } -+ }, -+/* l.sfgesi $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbd600000 } -+ }, -+/* l.sfgeu $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe4600000 } -+ }, -+/* l.sfgeui $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbc600000 } -+ }, -+/* l.sflts $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe5800000 } -+ }, -+/* l.sfltsi $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbd800000 } -+ }, -+/* l.sfltu $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe4800000 } -+ }, -+/* l.sfltui $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbc800000 } -+ }, -+/* l.sfles $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe5a00000 } -+ }, -+/* l.sflesi $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbda00000 } -+ }, -+/* l.sfleu $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe4a00000 } -+ }, -+/* l.sfleui $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbca00000 } -+ }, -+/* l.sfeq $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe4000000 } -+ }, -+/* l.sfeqi $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbc000000 } -+ }, -+/* l.sfne $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_sfgts, { 0xe4200000 } -+ }, -+/* l.sfnei $rA,$simm16 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_sfgtsi, { 0xbc200000 } -+ }, -+/* l.mac $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_mac, { 0xc4000001 } -+ }, -+/* l.msb $rA,$rB */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } }, -+ & ifmt_l_mac, { 0xc4000002 } -+ }, -+/* l.maci $rA,${simm16} */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RA), ',', OP (SIMM16), 0 } }, -+ & ifmt_l_maci, { 0x4c000000 } -+ }, -+/* l.cust1 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0x70000000 } -+ }, -+/* l.cust2 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0x74000000 } -+ }, -+/* l.cust3 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0x78000000 } -+ }, -+/* l.cust4 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0x7c000000 } -+ }, -+/* l.cust5 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0xf0000000 } -+ }, -+/* l.cust6 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0xf4000000 } -+ }, -+/* l.cust7 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0xf8000000 } -+ }, -+/* l.cust8 */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_l_rfe, { 0xfc000000 } -+ }, -+/* lf.add.s $rDSF,$rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_add_s, { 0xc8000000 } -+ }, -+/* lf.add.d $rDDF,$rADF,$rBDF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } }, -+ & ifmt_lf_add_d, { 0xc8000010 } -+ }, -+/* lf.sub.s $rDSF,$rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_add_s, { 0xc8000001 } -+ }, -+/* lf.sub.d $rDDF,$rADF,$rBDF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } }, -+ & ifmt_lf_add_d, { 0xc8000011 } -+ }, -+/* lf.mul.s $rDSF,$rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_add_s, { 0xc8000002 } -+ }, -+/* lf.mul.d $rDDF,$rADF,$rBDF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } }, -+ & ifmt_lf_add_d, { 0xc8000012 } -+ }, -+/* lf.div.s $rDSF,$rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_add_s, { 0xc8000003 } -+ }, -+/* lf.div.d $rDDF,$rADF,$rBDF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } }, -+ & ifmt_lf_add_d, { 0xc8000013 } -+ }, -+/* lf.rem.s $rDSF,$rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_add_s, { 0xc8000006 } -+ }, -+/* lf.rem.d $rDDF,$rADF,$rBDF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } }, -+ & ifmt_lf_add_d, { 0xc8000016 } -+ }, -+/* lf.itof.s $rDSF,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RA), 0 } }, -+ & ifmt_lf_itof_s, { 0xc8000004 } -+ }, -+/* lf.itof.d $rDSF,$rA */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RA), 0 } }, -+ & ifmt_lf_itof_s, { 0xc8000014 } -+ }, -+/* lf.ftoi.s $rD,$rASF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RASF), 0 } }, -+ & ifmt_lf_ftoi_s, { 0xc8000005 } -+ }, -+/* lf.ftoi.d $rD,$rADF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RD), ',', OP (RADF), 0 } }, -+ & ifmt_lf_ftoi_d, { 0xc8000015 } -+ }, -+/* lf.sfeq.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc8000008 } -+ }, -+/* lf.sfeq.d $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc8000018 } -+ }, -+/* lf.sfne.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc8000009 } -+ }, -+/* lf.sfne.d $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc8000019 } -+ }, -+/* lf.sfge.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800000b } -+ }, -+/* lf.sfge.d $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800001b } -+ }, -+/* lf.sfgt.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800000a } -+ }, -+/* lf.sfgt.d $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800001a } -+ }, -+/* lf.sflt.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800000c } -+ }, -+/* lf.sflt.d $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800001c } -+ }, -+/* lf.sfle.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800000d } -+ }, -+/* lf.sfle.d $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_eq_s, { 0xc800001d } -+ }, -+/* lf.madd.s $rDSF,$rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDSF), ',', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_add_s, { 0xc8000007 } -+ }, -+/* lf.madd.d $rDDF,$rADF,$rBDF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RDDF), ',', OP (RADF), ',', OP (RBDF), 0 } }, -+ & ifmt_lf_add_d, { 0xc8000017 } -+ }, -+/* lf.cust1.s $rASF,$rBSF */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, ' ', OP (RASF), ',', OP (RBSF), 0 } }, -+ & ifmt_lf_cust1_s, { 0xc80000d0 } -+ }, -+/* lf.cust1.d */ -+ { -+ { 0, 0, 0, 0 }, -+ { { MNEM, 0 } }, -+ & ifmt_lf_cust1_d, { 0xc80000e0 } -+ }, -+}; -+ -+#undef A -+#undef OPERAND -+#undef MNEM -+#undef OP -+ -+/* Formats for ALIAS macro-insns. */ -+ -+#define F(f) & or1k_cgen_ifld_table[OR1K_##f] -+#undef F -+ -+/* Each non-simple macro entry points to an array of expansion possibilities. */ -+ -+#define A(a) (1 << CGEN_INSN_##a) -+#define OPERAND(op) OR1K_OPERAND_##op -+#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */ -+#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field)) -+ -+/* The macro instruction table. */ -+ -+static const CGEN_IBASE or1k_cgen_macro_insn_table[] = -+{ -+}; -+ -+/* The macro instruction opcode table. */ -+ -+static const CGEN_OPCODE or1k_cgen_macro_insn_opcode_table[] = -+{ -+}; -+ -+#undef A -+#undef OPERAND -+#undef MNEM -+#undef OP -+ -+#ifndef CGEN_ASM_HASH_P -+#define CGEN_ASM_HASH_P(insn) 1 -+#endif -+ -+#ifndef CGEN_DIS_HASH_P -+#define CGEN_DIS_HASH_P(insn) 1 -+#endif -+ -+/* Return non-zero if INSN is to be added to the hash table. -+ Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */ -+ -+static int -+asm_hash_insn_p (insn) -+ const CGEN_INSN *insn ATTRIBUTE_UNUSED; -+{ -+ return CGEN_ASM_HASH_P (insn); -+} -+ -+static int -+dis_hash_insn_p (insn) -+ const CGEN_INSN *insn; -+{ -+ /* If building the hash table and the NO-DIS attribute is present, -+ ignore. */ -+ if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS)) -+ return 0; -+ return CGEN_DIS_HASH_P (insn); -+} -+ -+#ifndef CGEN_ASM_HASH -+#define CGEN_ASM_HASH_SIZE 127 -+#ifdef CGEN_MNEMONIC_OPERANDS -+#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) -+#else -+#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/ -+#endif -+#endif -+ -+/* It doesn't make much sense to provide a default here, -+ but while this is under development we do. -+ BUFFER is a pointer to the bytes of the insn, target order. -+ VALUE is the first base_insn_bitsize bits as an int in host order. */ -+ -+#ifndef CGEN_DIS_HASH -+#define CGEN_DIS_HASH_SIZE 256 -+#define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf)) -+#endif -+ -+/* The result is the hash value of the insn. -+ Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */ -+ -+static unsigned int -+asm_hash_insn (mnem) -+ const char * mnem; -+{ -+ return CGEN_ASM_HASH (mnem); -+} -+ -+/* BUF is a pointer to the bytes of the insn, target order. -+ VALUE is the first base_insn_bitsize bits as an int in host order. */ -+ -+static unsigned int -+dis_hash_insn (buf, value) -+ const char * buf ATTRIBUTE_UNUSED; -+ CGEN_INSN_INT value ATTRIBUTE_UNUSED; -+{ -+ return CGEN_DIS_HASH (buf, value); -+} -+ -+/* Set the recorded length of the insn in the CGEN_FIELDS struct. */ -+ -+static void -+set_fields_bitsize (CGEN_FIELDS *fields, int size) -+{ -+ CGEN_FIELDS_BITSIZE (fields) = size; -+} -+ -+/* Function to call before using the operand instance table. -+ This plugs the opcode entries and macro instructions into the cpu table. */ -+ -+void -+or1k_cgen_init_opcode_table (CGEN_CPU_DESC cd) -+{ -+ int i; -+ int num_macros = (sizeof (or1k_cgen_macro_insn_table) / -+ sizeof (or1k_cgen_macro_insn_table[0])); -+ const CGEN_IBASE *ib = & or1k_cgen_macro_insn_table[0]; -+ const CGEN_OPCODE *oc = & or1k_cgen_macro_insn_opcode_table[0]; -+ CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN)); -+ -+ /* This test has been added to avoid a warning generated -+ if memset is called with a third argument of value zero. */ -+ if (num_macros >= 1) -+ memset (insns, 0, num_macros * sizeof (CGEN_INSN)); -+ for (i = 0; i < num_macros; ++i) -+ { -+ insns[i].base = &ib[i]; -+ insns[i].opcode = &oc[i]; -+ or1k_cgen_build_insn_regex (& insns[i]); -+ } -+ cd->macro_insn_table.init_entries = insns; -+ cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE); -+ cd->macro_insn_table.num_init_entries = num_macros; -+ -+ oc = & or1k_cgen_insn_opcode_table[0]; -+ insns = (CGEN_INSN *) cd->insn_table.init_entries; -+ for (i = 0; i < MAX_INSNS; ++i) -+ { -+ insns[i].opcode = &oc[i]; -+ or1k_cgen_build_insn_regex (& insns[i]); -+ } -+ -+ cd->sizeof_fields = sizeof (CGEN_FIELDS); -+ cd->set_fields_bitsize = set_fields_bitsize; -+ -+ cd->asm_hash_p = asm_hash_insn_p; -+ cd->asm_hash = asm_hash_insn; -+ cd->asm_hash_size = CGEN_ASM_HASH_SIZE; -+ -+ cd->dis_hash_p = dis_hash_insn_p; -+ cd->dis_hash = dis_hash_insn; -+ cd->dis_hash_size = CGEN_DIS_HASH_SIZE; -+} -diff -rNU3 dist.orig/opcodes/or1k-opc.h dist/opcodes/or1k-opc.h ---- dist.orig/opcodes/or1k-opc.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-opc.h 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,135 @@ -+/* Instruction opcode header for or1k. -+ -+THIS FILE IS MACHINE GENERATED WITH CGEN. -+ -+Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+This file is part of the GNU Binutils and/or GDB, the GNU debugger. -+ -+ This file is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -+ -+*/ -+ -+#ifndef OR1K_OPC_H -+#define OR1K_OPC_H -+ -+/* -- opc.h */ -+ -+#undef CGEN_DIS_HASH_SIZE -+#define CGEN_DIS_HASH_SIZE 256 -+#undef CGEN_DIS_HASH -+#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2) -+ -+/* -- */ -+/* Enum declaration for or1k instruction types. */ -+typedef enum cgen_insn_type { -+ OR1K_INSN_INVALID, OR1K_INSN_L_J, OR1K_INSN_L_JAL, OR1K_INSN_L_JR -+ , OR1K_INSN_L_JALR, OR1K_INSN_L_BNF, OR1K_INSN_L_BF, OR1K_INSN_L_TRAP -+ , OR1K_INSN_L_SYS, OR1K_INSN_L_MSYNC, OR1K_INSN_L_PSYNC, OR1K_INSN_L_CSYNC -+ , OR1K_INSN_L_RFE, OR1K_INSN_L_NOP_IMM, OR1K_INSN_L_NOP, OR1K_INSN_L_MOVHI -+ , OR1K_INSN_L_MACRC, OR1K_INSN_L_MFSPR, OR1K_INSN_L_MTSPR, OR1K_INSN_L_LWZ -+ , OR1K_INSN_L_LWS, OR1K_INSN_L_LWA, OR1K_INSN_L_LBZ, OR1K_INSN_L_LBS -+ , OR1K_INSN_L_LHZ, OR1K_INSN_L_LHS, OR1K_INSN_L_SW, OR1K_INSN_L_SB -+ , OR1K_INSN_L_SH, OR1K_INSN_L_SWA, OR1K_INSN_L_SLL, OR1K_INSN_L_SLLI -+ , OR1K_INSN_L_SRL, OR1K_INSN_L_SRLI, OR1K_INSN_L_SRA, OR1K_INSN_L_SRAI -+ , OR1K_INSN_L_ROR, OR1K_INSN_L_RORI, OR1K_INSN_L_AND, OR1K_INSN_L_OR -+ , OR1K_INSN_L_XOR, OR1K_INSN_L_ADD, OR1K_INSN_L_SUB, OR1K_INSN_L_ADDC -+ , OR1K_INSN_L_MUL, OR1K_INSN_L_MULU, OR1K_INSN_L_DIV, OR1K_INSN_L_DIVU -+ , OR1K_INSN_L_FF1, OR1K_INSN_L_FL1, OR1K_INSN_L_ANDI, OR1K_INSN_L_ORI -+ , OR1K_INSN_L_XORI, OR1K_INSN_L_ADDI, OR1K_INSN_L_ADDIC, OR1K_INSN_L_MULI -+ , OR1K_INSN_L_EXTHS, OR1K_INSN_L_EXTBS, OR1K_INSN_L_EXTHZ, OR1K_INSN_L_EXTBZ -+ , OR1K_INSN_L_EXTWS, OR1K_INSN_L_EXTWZ, OR1K_INSN_L_CMOV, OR1K_INSN_L_SFGTS -+ , OR1K_INSN_L_SFGTSI, OR1K_INSN_L_SFGTU, OR1K_INSN_L_SFGTUI, OR1K_INSN_L_SFGES -+ , OR1K_INSN_L_SFGESI, OR1K_INSN_L_SFGEU, OR1K_INSN_L_SFGEUI, OR1K_INSN_L_SFLTS -+ , OR1K_INSN_L_SFLTSI, OR1K_INSN_L_SFLTU, OR1K_INSN_L_SFLTUI, OR1K_INSN_L_SFLES -+ , OR1K_INSN_L_SFLESI, OR1K_INSN_L_SFLEU, OR1K_INSN_L_SFLEUI, OR1K_INSN_L_SFEQ -+ , OR1K_INSN_L_SFEQI, OR1K_INSN_L_SFNE, OR1K_INSN_L_SFNEI, OR1K_INSN_L_MAC -+ , OR1K_INSN_L_MSB, OR1K_INSN_L_MACI, OR1K_INSN_L_CUST1, OR1K_INSN_L_CUST2 -+ , OR1K_INSN_L_CUST3, OR1K_INSN_L_CUST4, OR1K_INSN_L_CUST5, OR1K_INSN_L_CUST6 -+ , OR1K_INSN_L_CUST7, OR1K_INSN_L_CUST8, OR1K_INSN_LF_ADD_S, OR1K_INSN_LF_ADD_D -+ , OR1K_INSN_LF_SUB_S, OR1K_INSN_LF_SUB_D, OR1K_INSN_LF_MUL_S, OR1K_INSN_LF_MUL_D -+ , OR1K_INSN_LF_DIV_S, OR1K_INSN_LF_DIV_D, OR1K_INSN_LF_REM_S, OR1K_INSN_LF_REM_D -+ , OR1K_INSN_LF_ITOF_S, OR1K_INSN_LF_ITOF_D, OR1K_INSN_LF_FTOI_S, OR1K_INSN_LF_FTOI_D -+ , OR1K_INSN_LF_EQ_S, OR1K_INSN_LF_EQ_D, OR1K_INSN_LF_NE_S, OR1K_INSN_LF_NE_D -+ , OR1K_INSN_LF_GE_S, OR1K_INSN_LF_GE_D, OR1K_INSN_LF_GT_S, OR1K_INSN_LF_GT_D -+ , OR1K_INSN_LF_LT_S, OR1K_INSN_LF_LT_D, OR1K_INSN_LF_LE_S, OR1K_INSN_LF_LE_D -+ , OR1K_INSN_LF_MADD_S, OR1K_INSN_LF_MADD_D, OR1K_INSN_LF_CUST1_S, OR1K_INSN_LF_CUST1_D -+} CGEN_INSN_TYPE; -+ -+/* Index of `invalid' insn place holder. */ -+#define CGEN_INSN_INVALID OR1K_INSN_INVALID -+ -+/* Total number of insns in table. */ -+#define MAX_INSNS ((int) OR1K_INSN_LF_CUST1_D + 1) -+ -+/* This struct records data prior to insertion or after extraction. */ -+struct cgen_fields -+{ -+ int length; -+ long f_nil; -+ long f_anyof; -+ long f_opcode; -+ long f_r1; -+ long f_r2; -+ long f_r3; -+ long f_op_25_2; -+ long f_op_25_5; -+ long f_op_16_1; -+ long f_op_7_4; -+ long f_op_3_4; -+ long f_op_9_2; -+ long f_op_9_4; -+ long f_op_7_8; -+ long f_op_7_2; -+ long f_resv_25_26; -+ long f_resv_25_10; -+ long f_resv_25_5; -+ long f_resv_23_8; -+ long f_resv_20_21; -+ long f_resv_20_5; -+ long f_resv_20_4; -+ long f_resv_15_8; -+ long f_resv_15_6; -+ long f_resv_10_11; -+ long f_resv_10_7; -+ long f_resv_10_3; -+ long f_resv_10_1; -+ long f_resv_7_4; -+ long f_resv_5_2; -+ long f_imm16_25_5; -+ long f_imm16_10_11; -+ long f_disp26; -+ long f_uimm16; -+ long f_simm16; -+ long f_uimm6; -+ long f_uimm16_split; -+ long f_simm16_split; -+}; -+ -+#define CGEN_INIT_PARSE(od) \ -+{\ -+} -+#define CGEN_INIT_INSERT(od) \ -+{\ -+} -+#define CGEN_INIT_EXTRACT(od) \ -+{\ -+} -+#define CGEN_INIT_PRINT(od) \ -+{\ -+} -+ -+ -+#endif /* OR1K_OPC_H */ -diff -rNU3 dist.orig/opcodes/or1k-opinst.c dist/opcodes/or1k-opinst.c ---- dist.orig/opcodes/or1k-opinst.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/or1k-opinst.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,590 @@ -+/* Semantic operand instances for or1k. -+ -+THIS FILE IS MACHINE GENERATED WITH CGEN. -+ -+Copyright (C) 1996-2014 Free Software Foundation, Inc. -+ -+This file is part of the GNU Binutils and/or GDB, the GNU debugger. -+ -+ This file is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. -+ -+*/ -+ -+#include "sysdep.h" -+#include "ansidecl.h" -+#include "bfd.h" -+#include "symcat.h" -+#include "or1k-desc.h" -+#include "or1k-opc.h" -+ -+/* Operand references. */ -+ -+#define OP_ENT(op) OR1K_OPERAND_##op -+#define INPUT CGEN_OPINST_INPUT -+#define OUTPUT CGEN_OPINST_OUTPUT -+#define END CGEN_OPINST_END -+#define COND_REF CGEN_OPINST_COND_REF -+ -+static const CGEN_OPINST sfmt_empty_ops[] ATTRIBUTE_UNUSED = { -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_j_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "disp26", HW_H_IADDR, CGEN_MODE_UDI, OP_ENT (DISP26), 0, 0 }, -+ { INPUT, "sys_cpucfgr_nd", HW_H_SYS_CPUCFGR_ND, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_jal_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "disp26", HW_H_IADDR, CGEN_MODE_UDI, OP_ENT (DISP26), 0, 0 }, -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_cpucfgr_nd", HW_H_SYS_CPUCFGR_ND, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "h_gpr_UDI_9", HW_H_GPR, CGEN_MODE_UDI, 0, 9, 0 }, -+ { OUTPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_jr_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "sys_cpucfgr_nd", HW_H_SYS_CPUCFGR_ND, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_jalr_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "sys_cpucfgr_nd", HW_H_SYS_CPUCFGR_ND, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "h_gpr_UDI_9", HW_H_GPR, CGEN_MODE_UDI, 0, 9, 0 }, -+ { OUTPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_bnf_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "disp26", HW_H_IADDR, CGEN_MODE_UDI, OP_ENT (DISP26), 0, COND_REF }, -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "sys_cpucfgr_nd", HW_H_SYS_CPUCFGR_ND, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_trap_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_msync_ops[] ATTRIBUTE_UNUSED = { -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_nop_imm_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "uimm16", HW_H_UIMM16, CGEN_MODE_UINT, OP_ENT (UIMM16), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_movhi_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "uimm16", HW_H_UIMM16, CGEN_MODE_UINT, OP_ENT (UIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_macrc_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "mac_maclo", HW_H_MAC_MACLO, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "mac_machi", HW_H_MAC_MACHI, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "mac_maclo", HW_H_MAC_MACLO, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_mfspr_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "uimm16", HW_H_UIMM16, CGEN_MODE_UINT, OP_ENT (UIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_mtspr_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "uimm16_split", HW_H_UIMM16, CGEN_MODE_UINT, OP_ENT (UIMM16_SPLIT), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lwz_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_USI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_4", HW_H_MEMORY, CGEN_MODE_USI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lws_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_SI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_4", HW_H_MEMORY, CGEN_MODE_SI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lwa_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_USI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_4", HW_H_MEMORY, CGEN_MODE_USI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "atomic_address", HW_H_ATOMIC_ADDRESS, CGEN_MODE_SI, 0, 0, 0 }, -+ { OUTPUT, "atomic_reserve", HW_H_ATOMIC_RESERVE, CGEN_MODE_BI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lbz_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_UQI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_1", HW_H_MEMORY, CGEN_MODE_UQI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lbs_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_QI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_1", HW_H_MEMORY, CGEN_MODE_QI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lhz_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_UHI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_2", HW_H_MEMORY, CGEN_MODE_UHI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_lhs_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "h_memory_HI_c_call__AI_@cpu@_make_load_store_addr_rA_ext__SI_simm16_2", HW_H_MEMORY, CGEN_MODE_HI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_sw_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "atomic_address", HW_H_ATOMIC_ADDRESS, CGEN_MODE_SI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "simm16_split", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16_SPLIT), 0, 0 }, -+ { OUTPUT, "atomic_reserve", HW_H_ATOMIC_RESERVE, CGEN_MODE_BI, 0, 0, COND_REF }, -+ { OUTPUT, "h_memory_USI_addr", HW_H_MEMORY, CGEN_MODE_USI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_sb_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "atomic_address", HW_H_ATOMIC_ADDRESS, CGEN_MODE_SI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "simm16_split", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16_SPLIT), 0, 0 }, -+ { OUTPUT, "atomic_reserve", HW_H_ATOMIC_RESERVE, CGEN_MODE_BI, 0, 0, COND_REF }, -+ { OUTPUT, "h_memory_UQI_addr", HW_H_MEMORY, CGEN_MODE_UQI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_sh_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "atomic_address", HW_H_ATOMIC_ADDRESS, CGEN_MODE_SI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "simm16_split", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16_SPLIT), 0, 0 }, -+ { OUTPUT, "atomic_reserve", HW_H_ATOMIC_RESERVE, CGEN_MODE_BI, 0, 0, COND_REF }, -+ { OUTPUT, "h_memory_UHI_addr", HW_H_MEMORY, CGEN_MODE_UHI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_swa_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "atomic_address", HW_H_ATOMIC_ADDRESS, CGEN_MODE_SI, 0, 0, 0 }, -+ { INPUT, "atomic_reserve", HW_H_ATOMIC_RESERVE, CGEN_MODE_BI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, COND_REF }, -+ { INPUT, "simm16_split", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16_SPLIT), 0, 0 }, -+ { INPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "atomic_reserve", HW_H_ATOMIC_RESERVE, CGEN_MODE_BI, 0, 0, 0 }, -+ { OUTPUT, "h_memory_USI_addr", HW_H_MEMORY, CGEN_MODE_USI, 0, 0, COND_REF }, -+ { OUTPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_sll_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_slli_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "uimm6", HW_H_UIMM6, CGEN_MODE_UINT, OP_ENT (UIMM6), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_and_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_add_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ove", HW_H_SYS_SR_OVE, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { OUTPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_addc_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ove", HW_H_SYS_SR_OVE, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { OUTPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_div_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, COND_REF }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { INPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ove", HW_H_SYS_SR_OVE, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, COND_REF }, -+ { OUTPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { OUTPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_ff1_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_xori_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_addi_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { INPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ove", HW_H_SYS_SR_OVE, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { OUTPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_addic_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "pc", HW_H_PC, CGEN_MODE_UDI, 0, 0, COND_REF }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { INPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "sys_sr_ove", HW_H_SYS_SR_OVE, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { OUTPUT, "sys_sr_cy", HW_H_SYS_SR_CY, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "sys_sr_ov", HW_H_SYS_SR_OV, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_exths_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_cmov_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, COND_REF }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, COND_REF }, -+ { INPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, COND_REF }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_sfgts_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { OUTPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_sfgtsi_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_mac_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "mac_machi", HW_H_MAC_MACHI, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "mac_maclo", HW_H_MAC_MACLO, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "rB", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RB), 0, 0 }, -+ { OUTPUT, "mac_machi", HW_H_MAC_MACHI, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "mac_maclo", HW_H_MAC_MACLO, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_l_maci_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "mac_machi", HW_H_MAC_MACHI, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "mac_maclo", HW_H_MAC_MACLO, CGEN_MODE_UDI, 0, 0, 0 }, -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "simm16", HW_H_SIMM16, CGEN_MODE_INT, OP_ENT (SIMM16), 0, 0 }, -+ { OUTPUT, "mac_machi", HW_H_MAC_MACHI, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "mac_maclo", HW_H_MAC_MACLO, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_add_s_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rASF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RASF), 0, 0 }, -+ { INPUT, "rBSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RBSF), 0, 0 }, -+ { OUTPUT, "rDSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RDSF), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_add_d_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rADF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RADF), 0, 0 }, -+ { INPUT, "rBDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RBDF), 0, 0 }, -+ { OUTPUT, "rDDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RDDF), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_itof_s_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "sys_fpcsr_rm", HW_H_SYS_FPCSR_RM, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rDSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RDSF), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_itof_d_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rA", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RA), 0, 0 }, -+ { INPUT, "sys_fpcsr_rm", HW_H_SYS_FPCSR_RM, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rDDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RDDF), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_ftoi_s_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rASF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RASF), 0, 0 }, -+ { INPUT, "sys_fpcsr_rm", HW_H_SYS_FPCSR_RM, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_ftoi_d_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rADF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RADF), 0, 0 }, -+ { INPUT, "sys_fpcsr_rm", HW_H_SYS_FPCSR_RM, CGEN_MODE_UDI, 0, 0, 0 }, -+ { OUTPUT, "rD", HW_H_GPR, CGEN_MODE_UDI, OP_ENT (RD), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_eq_s_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rASF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RASF), 0, 0 }, -+ { INPUT, "rBSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RBSF), 0, 0 }, -+ { OUTPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_eq_d_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rADF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RADF), 0, 0 }, -+ { INPUT, "rBDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RBDF), 0, 0 }, -+ { OUTPUT, "sys_sr_f", HW_H_SYS_SR_F, CGEN_MODE_UDI, 0, 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_madd_s_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rASF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RASF), 0, 0 }, -+ { INPUT, "rBSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RBSF), 0, 0 }, -+ { INPUT, "rDSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RDSF), 0, 0 }, -+ { OUTPUT, "rDSF", HW_H_FSR, CGEN_MODE_SF, OP_ENT (RDSF), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+static const CGEN_OPINST sfmt_lf_madd_d_ops[] ATTRIBUTE_UNUSED = { -+ { INPUT, "rADF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RADF), 0, 0 }, -+ { INPUT, "rBDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RBDF), 0, 0 }, -+ { INPUT, "rDDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RDDF), 0, 0 }, -+ { OUTPUT, "rDDF", HW_H_FDR, CGEN_MODE_DF, OP_ENT (RDDF), 0, 0 }, -+ { END, (const char *)0, (enum cgen_hw_type)0, (enum cgen_mode)0, (enum cgen_operand_type)0, 0, 0 } -+}; -+ -+#undef OP_ENT -+#undef INPUT -+#undef OUTPUT -+#undef END -+#undef COND_REF -+ -+/* Operand instance lookup table. */ -+ -+static const CGEN_OPINST *or1k_cgen_opinst_table[MAX_INSNS] = { -+ 0, -+ & sfmt_l_j_ops[0], -+ & sfmt_l_jal_ops[0], -+ & sfmt_l_jr_ops[0], -+ & sfmt_l_jalr_ops[0], -+ & sfmt_l_bnf_ops[0], -+ & sfmt_l_bnf_ops[0], -+ & sfmt_l_trap_ops[0], -+ & sfmt_l_trap_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_nop_imm_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_movhi_ops[0], -+ & sfmt_l_macrc_ops[0], -+ & sfmt_l_mfspr_ops[0], -+ & sfmt_l_mtspr_ops[0], -+ & sfmt_l_lwz_ops[0], -+ & sfmt_l_lws_ops[0], -+ & sfmt_l_lwa_ops[0], -+ & sfmt_l_lbz_ops[0], -+ & sfmt_l_lbs_ops[0], -+ & sfmt_l_lhz_ops[0], -+ & sfmt_l_lhs_ops[0], -+ & sfmt_l_sw_ops[0], -+ & sfmt_l_sb_ops[0], -+ & sfmt_l_sh_ops[0], -+ & sfmt_l_swa_ops[0], -+ & sfmt_l_sll_ops[0], -+ & sfmt_l_slli_ops[0], -+ & sfmt_l_sll_ops[0], -+ & sfmt_l_slli_ops[0], -+ & sfmt_l_sll_ops[0], -+ & sfmt_l_slli_ops[0], -+ & sfmt_l_sll_ops[0], -+ & sfmt_l_slli_ops[0], -+ & sfmt_l_and_ops[0], -+ & sfmt_l_and_ops[0], -+ & sfmt_l_and_ops[0], -+ & sfmt_l_add_ops[0], -+ & sfmt_l_add_ops[0], -+ & sfmt_l_addc_ops[0], -+ & sfmt_l_add_ops[0], -+ & sfmt_l_add_ops[0], -+ & sfmt_l_div_ops[0], -+ & sfmt_l_div_ops[0], -+ & sfmt_l_ff1_ops[0], -+ & sfmt_l_ff1_ops[0], -+ & sfmt_l_mfspr_ops[0], -+ & sfmt_l_mfspr_ops[0], -+ & sfmt_l_xori_ops[0], -+ & sfmt_l_addi_ops[0], -+ & sfmt_l_addic_ops[0], -+ & sfmt_l_addi_ops[0], -+ & sfmt_l_exths_ops[0], -+ & sfmt_l_exths_ops[0], -+ & sfmt_l_exths_ops[0], -+ & sfmt_l_exths_ops[0], -+ & sfmt_l_exths_ops[0], -+ & sfmt_l_exths_ops[0], -+ & sfmt_l_cmov_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_sfgts_ops[0], -+ & sfmt_l_sfgtsi_ops[0], -+ & sfmt_l_mac_ops[0], -+ & sfmt_l_mac_ops[0], -+ & sfmt_l_maci_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_lf_add_s_ops[0], -+ & sfmt_lf_add_d_ops[0], -+ & sfmt_lf_add_s_ops[0], -+ & sfmt_lf_add_d_ops[0], -+ & sfmt_lf_add_s_ops[0], -+ & sfmt_lf_add_d_ops[0], -+ & sfmt_lf_add_s_ops[0], -+ & sfmt_lf_add_d_ops[0], -+ & sfmt_lf_add_s_ops[0], -+ & sfmt_lf_add_d_ops[0], -+ & sfmt_lf_itof_s_ops[0], -+ & sfmt_lf_itof_d_ops[0], -+ & sfmt_lf_ftoi_s_ops[0], -+ & sfmt_lf_ftoi_d_ops[0], -+ & sfmt_lf_eq_s_ops[0], -+ & sfmt_lf_eq_d_ops[0], -+ & sfmt_lf_eq_s_ops[0], -+ & sfmt_lf_eq_d_ops[0], -+ & sfmt_lf_eq_s_ops[0], -+ & sfmt_lf_eq_d_ops[0], -+ & sfmt_lf_eq_s_ops[0], -+ & sfmt_lf_eq_d_ops[0], -+ & sfmt_lf_eq_s_ops[0], -+ & sfmt_lf_eq_d_ops[0], -+ & sfmt_lf_eq_s_ops[0], -+ & sfmt_lf_eq_d_ops[0], -+ & sfmt_lf_madd_s_ops[0], -+ & sfmt_lf_madd_d_ops[0], -+ & sfmt_l_msync_ops[0], -+ & sfmt_l_msync_ops[0], -+}; -+ -+/* Function to call before using the operand instance table. */ -+ -+void -+or1k_cgen_init_opinst_table (cd) -+ CGEN_CPU_DESC cd; -+{ -+ int i; -+ const CGEN_OPINST **oi = & or1k_cgen_opinst_table[0]; -+ CGEN_INSN *insns = (CGEN_INSN *) cd->insn_table.init_entries; -+ for (i = 0; i < MAX_INSNS; ++i) -+ insns[i].opinst = oi[i]; -+} -diff -rNU3 dist.orig/opcodes/or32-dis.c dist/opcodes/or32-dis.c ---- dist.orig/opcodes/or32-dis.c 2012-05-18 03:59:38.000000000 +0200 -+++ dist/opcodes/or32-dis.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,325 +0,0 @@ --/* Instruction printing code for the OpenRISC 1000 -- Copyright (C) 2002, 2005, 2007, 2012 Free Software Foundation, Inc. -- Contributed by Damjan Lampret . -- Modified from a29k port. -- -- This file is part of the GNU opcodes library. -- -- This library is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#ifndef DEBUG --#define DEBUG 0 --#endif -- --#include "sysdep.h" --#include "dis-asm.h" --#include "opcode/or32.h" --#include "safe-ctype.h" -- --#define EXTEND29(x) ((x) & (unsigned long) 0x10000000 ? ((x) | (unsigned long) 0xf0000000) : ((x))) -- --/* Now find the four bytes of INSN_CH and put them in *INSN. */ -- --static void --find_bytes_big (unsigned char *insn_ch, unsigned long *insn) --{ -- *insn = -- ((unsigned long) insn_ch[0] << 24) + -- ((unsigned long) insn_ch[1] << 16) + -- ((unsigned long) insn_ch[2] << 8) + -- ((unsigned long) insn_ch[3]); --#if DEBUG -- printf ("find_bytes_big3: %lx\n", *insn); --#endif --} -- --static void --find_bytes_little (unsigned char *insn_ch, unsigned long *insn) --{ -- *insn = -- ((unsigned long) insn_ch[3] << 24) + -- ((unsigned long) insn_ch[2] << 16) + -- ((unsigned long) insn_ch[1] << 8) + -- ((unsigned long) insn_ch[0]); --} -- --typedef void (*find_byte_func_type) (unsigned char *, unsigned long *); -- --static unsigned long --or32_extract (char param_ch, char *enc_initial, unsigned long insn) --{ -- char *enc; -- unsigned long ret = 0; -- int opc_pos = 0; -- int param_pos = 0; -- -- for (enc = enc_initial; *enc != '\0'; enc++) -- if (*enc == param_ch) -- { -- if (enc - 2 >= enc_initial && (*(enc - 2) == '0') && (*(enc - 1) == 'x')) -- continue; -- else -- param_pos++; -- } -- --#if DEBUG -- printf ("or32_extract: %c %x ", param_ch, param_pos); --#endif -- opc_pos = 32; -- -- for (enc = enc_initial; *enc != '\0'; ) -- if ((*enc == '0') && (*(enc + 1) == 'x')) -- { -- opc_pos -= 4; -- -- if ((param_ch == '0') || (param_ch == '1')) -- { -- unsigned long tmp = strtoul (enc, NULL, 16); --#if DEBUG -- printf (" enc=%s, tmp=%lx ", enc, tmp); --#endif -- if (param_ch == '0') -- tmp = 15 - tmp; -- ret |= tmp << opc_pos; -- } -- enc += 3; -- } -- else if ((*enc == '0') || (*enc == '1')) -- { -- opc_pos--; -- if (param_ch == *enc) -- ret |= 1 << opc_pos; -- enc++; -- } -- else if (*enc == param_ch) -- { -- opc_pos--; -- param_pos--; --#if DEBUG -- printf ("\n ret=%lx opc_pos=%x, param_pos=%x\n", ret, opc_pos, param_pos); --#endif -- ret += ((insn >> opc_pos) & 0x1) << param_pos; -- -- if (!param_pos -- && letter_signed (param_ch) -- && ret >> (letter_range (param_ch) - 1)) -- { --#if DEBUG -- printf ("\n ret=%lx opc_pos=%x, param_pos=%x\n", -- ret, opc_pos, param_pos); --#endif -- ret |= 0xffffffff << letter_range(param_ch); --#if DEBUG -- printf ("\n after conversion to signed: ret=%lx\n", ret); --#endif -- } -- enc++; -- } -- else if (ISALPHA (*enc)) -- { -- opc_pos--; -- enc++; -- } -- else if (*enc == '-') -- { -- opc_pos--; -- enc++; -- } -- else -- enc++; -- --#if DEBUG -- printf ("ret=%lx\n", ret); --#endif -- return ret; --} -- --static int --or32_opcode_match (unsigned long insn, char *encoding) --{ -- unsigned long ones, zeros; -- --#if DEBUG -- printf ("or32_opcode_match: %.8lx\n", insn); --#endif -- ones = or32_extract ('1', encoding, insn); -- zeros = or32_extract ('0', encoding, insn); -- --#if DEBUG -- printf ("ones: %lx \n", ones); -- printf ("zeros: %lx \n", zeros); --#endif -- if ((insn & ones) != ones) -- { --#if DEBUG -- printf ("ret1\n"); --#endif -- return 0; -- } -- -- if ((~insn & zeros) != zeros) -- { --#if DEBUG -- printf ("ret2\n"); --#endif -- return 0; -- } -- --#if DEBUG -- printf ("ret3\n"); --#endif -- return 1; --} -- --/* Print register to INFO->STREAM. Used only by print_insn. */ -- --static void --or32_print_register (char param_ch, -- char *encoding, -- unsigned long insn, -- struct disassemble_info *info) --{ -- int regnum = or32_extract (param_ch, encoding, insn); -- --#if DEBUG -- printf ("or32_print_register: %c, %s, %lx\n", param_ch, encoding, insn); --#endif -- if (param_ch == 'A') -- (*info->fprintf_func) (info->stream, "r%d", regnum); -- else if (param_ch == 'B') -- (*info->fprintf_func) (info->stream, "r%d", regnum); -- else if (param_ch == 'D') -- (*info->fprintf_func) (info->stream, "r%d", regnum); -- else if (regnum < 16) -- (*info->fprintf_func) (info->stream, "r%d", regnum); -- else if (regnum < 32) -- (*info->fprintf_func) (info->stream, "r%d", regnum-16); -- else -- (*info->fprintf_func) (info->stream, "X%d", regnum); --} -- --/* Print immediate to INFO->STREAM. Used only by print_insn. */ -- --static void --or32_print_immediate (char param_ch, -- char *encoding, -- unsigned long insn, -- struct disassemble_info *info) --{ -- int imm = or32_extract(param_ch, encoding, insn); -- -- if (letter_signed(param_ch)) -- (*info->fprintf_func) (info->stream, "0x%x", imm); --/* (*info->fprintf_func) (info->stream, "%d", imm); */ -- else -- (*info->fprintf_func) (info->stream, "0x%x", imm); --} -- --/* Print one instruction from MEMADDR on INFO->STREAM. -- Return the size of the instruction (always 4 on or32). */ -- --static int --print_insn (bfd_vma memaddr, struct disassemble_info *info) --{ -- /* The raw instruction. */ -- unsigned char insn_ch[4]; -- /* Address. Will be sign extened 27-bit. */ -- unsigned long addr; -- /* The four bytes of the instruction. */ -- unsigned long insn; -- find_byte_func_type find_byte_func = (find_byte_func_type) info->private_data; -- struct or32_opcode const * opcode; -- -- { -- int status = -- (*info->read_memory_func) (memaddr, (bfd_byte *) &insn_ch[0], 4, info); -- -- if (status != 0) -- { -- (*info->memory_error_func) (status, memaddr, info); -- return -1; -- } -- } -- -- (*find_byte_func) (&insn_ch[0], &insn); -- -- for (opcode = &or32_opcodes[0]; -- opcode < &or32_opcodes[or32_num_opcodes]; -- ++opcode) -- { -- if (or32_opcode_match (insn, opcode->encoding)) -- { -- char *s; -- -- (*info->fprintf_func) (info->stream, "%s ", opcode->name); -- -- for (s = opcode->args; *s != '\0'; ++s) -- { -- switch (*s) -- { -- case '\0': -- return 4; -- -- case 'r': -- or32_print_register (*++s, opcode->encoding, insn, info); -- break; -- -- case 'X': -- addr = or32_extract ('X', opcode->encoding, insn) << 2; -- -- /* Calulate the correct address. XXX is this really correct ?? */ -- addr = memaddr + EXTEND29 (addr); -- -- (*info->print_address_func) -- (addr, info); -- break; -- -- default: -- if (strchr (opcode->encoding, *s)) -- or32_print_immediate (*s, opcode->encoding, insn, info); -- else -- (*info->fprintf_func) (info->stream, "%c", *s); -- } -- } -- -- return 4; -- } -- } -- -- /* This used to be %8x for binutils. */ -- (*info->fprintf_func) -- (info->stream, ".word 0x%08lx", insn); -- return 4; --} -- --/* Disassemble a big-endian or32 instruction. */ -- --int --print_insn_big_or32 (bfd_vma memaddr, struct disassemble_info *info) --{ -- info->private_data = find_bytes_big; -- -- return print_insn (memaddr, info); --} -- --/* Disassemble a little-endian or32 instruction. */ -- --int --print_insn_little_or32 (bfd_vma memaddr, struct disassemble_info *info) --{ -- info->private_data = find_bytes_little; -- return print_insn (memaddr, info); --} -diff -rNU3 dist.orig/opcodes/or32-opc.c dist/opcodes/or32-opc.c ---- dist.orig/opcodes/or32-opc.c 2012-05-17 17:13:25.000000000 +0200 -+++ dist/opcodes/or32-opc.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,1031 +0,0 @@ --/* Table of opcodes for the OpenRISC 1000 ISA. -- Copyright 2002, 2004, 2005, 2007, 2008, 2009, 2012 -- Free Software Foundation, Inc. -- Contributed by Damjan Lampret (lampret@opencores.org). -- -- This file is part of the GNU opcodes library. -- -- This library is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3, or (at your option) -- any later version. -- -- It is distributed in the hope that it will be useful, but WITHOUT -- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -- MA 02110-1301, USA. */ -- --#include "sysdep.h" --#include --#include --#include --#include "safe-ctype.h" --#include "ansidecl.h" --#include "opcode/or32.h" -- --/* We treat all letters the same in encode/decode routines so -- we need to assign some characteristics to them like signess etc. */ -- --const struct or32_letter or32_letters[] = --{ -- { 'A', NUM_UNSIGNED }, -- { 'B', NUM_UNSIGNED }, -- { 'D', NUM_UNSIGNED }, -- { 'I', NUM_SIGNED }, -- { 'K', NUM_UNSIGNED }, -- { 'L', NUM_UNSIGNED }, -- { 'N', NUM_SIGNED }, -- { '0', NUM_UNSIGNED }, -- { '\0', 0 } /* Dummy entry. */ --}; -- --/* Opcode encoding: -- machine[31:30]: first two bits of opcode -- 00 - neither of source operands is GPR -- 01 - second source operand is GPR (rB) -- 10 - first source operand is GPR (rA) -- 11 - both source operands are GPRs (rA and rB) -- machine[29:26]: next four bits of opcode -- machine[25:00]: instruction operands (specific to individual instruction) -- -- Recommendation: irrelevant instruction bits should be set with a value of -- bits in same positions of instruction preceding current instruction in the -- code (when assembling). */ -- --#define EFN &l_none -- --#ifdef HAS_EXECUTION --#define EF(func) &(func) --#define EFI &l_invalid --#else /* HAS_EXECUTION */ --#define EF(func) EFN --#define EFI EFN --#endif /* HAS_EXECUTION */ -- --const struct or32_opcode or32_opcodes[] = --{ -- { "l.j", "N", "00 0x0 NNNNN NNNNN NNNN NNNN NNNN NNNN", EF(l_j), OR32_IF_DELAY }, -- { "l.jal", "N", "00 0x1 NNNNN NNNNN NNNN NNNN NNNN NNNN", EF(l_jal), OR32_IF_DELAY }, -- { "l.bnf", "N", "00 0x3 NNNNN NNNNN NNNN NNNN NNNN NNNN", EF(l_bnf), OR32_IF_DELAY | OR32_R_FLAG}, -- { "l.bf", "N", "00 0x4 NNNNN NNNNN NNNN NNNN NNNN NNNN", EF(l_bf), OR32_IF_DELAY | OR32_R_FLAG }, -- { "l.nop", "K", "00 0x5 01--- ----- KKKK KKKK KKKK KKKK", EF(l_nop), 0 }, -- { "l.movhi", "rD,K", "00 0x6 DDDDD ----0 KKKK KKKK KKKK KKKK", EF(l_movhi), 0 }, /*MM*/ -- { "l.macrc", "rD", "00 0x6 DDDDD ----1 0000 0000 0000 0000", EF(l_macrc), 0 }, /*MM*/ -- -- { "l.sys", "K", "00 0x8 00000 00000 KKKK KKKK KKKK KKKK", EF(l_sys), 0 }, -- { "l.trap", "K", "00 0x8 01000 00000 KKKK KKKK KKKK KKKK", EF(l_trap), 0 }, /* CZ 21/06/01 */ -- { "l.msync", "", "00 0x8 10000 00000 0000 0000 0000 0000", EFN, 0 }, -- { "l.psync", "", "00 0x8 10100 00000 0000 0000 0000 0000", EFN, 0 }, -- { "l.csync", "", "00 0x8 11000 00000 0000 0000 0000 0000", EFN, 0 }, -- { "l.rfe", "", "00 0x9 ----- ----- ---- ---- ---- ----", EF(l_rfe), OR32_IF_DELAY }, -- -- { "lv.all_eq.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x0", EFI, 0 }, -- { "lv.all_eq.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x1", EFI, 0 }, -- { "lv.all_ge.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x2", EFI, 0 }, -- { "lv.all_ge.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x3", EFI, 0 }, -- { "lv.all_gt.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x4", EFI, 0 }, -- { "lv.all_gt.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x5", EFI, 0 }, -- { "lv.all_le.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x6", EFI, 0 }, -- { "lv.all_le.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x7", EFI, 0 }, -- { "lv.all_lt.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x8", EFI, 0 }, -- { "lv.all_lt.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0x9", EFI, 0 }, -- { "lv.all_ne.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0xA", EFI, 0 }, -- { "lv.all_ne.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x1 0xB", EFI, 0 }, -- { "lv.any_eq.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x0", EFI, 0 }, -- { "lv.any_eq.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x1", EFI, 0 }, -- { "lv.any_ge.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x2", EFI, 0 }, -- { "lv.any_ge.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x3", EFI, 0 }, -- { "lv.any_gt.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x4", EFI, 0 }, -- { "lv.any_gt.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x5", EFI, 0 }, -- { "lv.any_le.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x6", EFI, 0 }, -- { "lv.any_le.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x7", EFI, 0 }, -- { "lv.any_lt.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x8", EFI, 0 }, -- { "lv.any_lt.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0x9", EFI, 0 }, -- { "lv.any_ne.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0xA", EFI, 0 }, -- { "lv.any_ne.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x2 0xB", EFI, 0 }, -- { "lv.add.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x0", EFI, 0 }, -- { "lv.add.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x1", EFI, 0 }, -- { "lv.adds.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x2", EFI, 0 }, -- { "lv.adds.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x3", EFI, 0 }, -- { "lv.addu.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x4", EFI, 0 }, -- { "lv.addu.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x5", EFI, 0 }, -- { "lv.addus.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x6", EFI, 0 }, -- { "lv.addus.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x7", EFI, 0 }, -- { "lv.and", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x8", EFI, 0 }, -- { "lv.avg.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0x9", EFI, 0 }, -- { "lv.avg.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x3 0xA", EFI, 0 }, -- { "lv.cmp_eq.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x0", EFI, 0 }, -- { "lv.cmp_eq.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x1", EFI, 0 }, -- { "lv.cmp_ge.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x2", EFI, 0 }, -- { "lv.cmp_ge.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x3", EFI, 0 }, -- { "lv.cmp_gt.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x4", EFI, 0 }, -- { "lv.cmp_gt.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x5", EFI, 0 }, -- { "lv.cmp_le.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x6", EFI, 0 }, -- { "lv.cmp_le.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x7", EFI, 0 }, -- { "lv.cmp_lt.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x8", EFI, 0 }, -- { "lv.cmp_lt.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0x9", EFI, 0 }, -- { "lv.cmp_ne.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0xA", EFI, 0 }, -- { "lv.cmp_ne.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x4 0xB", EFI, 0 }, -- { "lv.madds.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0x4", EFI, 0 }, -- { "lv.max.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0x5", EFI, 0 }, -- { "lv.max.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0x6", EFI, 0 }, -- { "lv.merge.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0x7", EFI, 0 }, -- { "lv.merge.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0x8", EFI, 0 }, -- { "lv.min.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0x9", EFI, 0 }, -- { "lv.min.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0xA", EFI, 0 }, -- { "lv.msubs.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0xB", EFI, 0 }, -- { "lv.muls.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0xC", EFI, 0 }, -- { "lv.nand", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0xD", EFI, 0 }, -- { "lv.nor", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0xE", EFI, 0 }, -- { "lv.or", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x5 0xF", EFI, 0 }, -- { "lv.pack.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x0", EFI, 0 }, -- { "lv.pack.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x1", EFI, 0 }, -- { "lv.packs.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x2", EFI, 0 }, -- { "lv.packs.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x3", EFI, 0 }, -- { "lv.packus.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x4", EFI, 0 }, -- { "lv.packus.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x5", EFI, 0 }, -- { "lv.perm.n", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x6", EFI, 0 }, -- { "lv.rl.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x7", EFI, 0 }, -- { "lv.rl.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x8", EFI, 0 }, -- { "lv.sll.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0x9", EFI, 0 }, -- { "lv.sll.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0xA", EFI, 0 }, -- { "lv.sll", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0xB", EFI, 0 }, -- { "lv.srl.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0xC", EFI, 0 }, -- { "lv.srl.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0xD", EFI, 0 }, -- { "lv.sra.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0xE", EFI, 0 }, -- { "lv.sra.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x6 0xF", EFI, 0 }, -- { "lv.srl", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x0", EFI, 0 }, -- { "lv.sub.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x1", EFI, 0 }, -- { "lv.sub.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x2", EFI, 0 }, -- { "lv.subs.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x3", EFI, 0 }, -- { "lv.subs.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x4", EFI, 0 }, -- { "lv.subu.b", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x5", EFI, 0 }, -- { "lv.subu.h", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x6", EFI, 0 }, -- { "lv.subus.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x7", EFI, 0 }, -- { "lv.subus.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x8", EFI, 0 }, -- { "lv.unpack.b","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0x9", EFI, 0 }, -- { "lv.unpack.h","rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0xA", EFI, 0 }, -- { "lv.xor", "rD,rA,rB", "00 0xA DDDDD AAAAA BBBB B--- 0x7 0xB", EFI, 0 }, -- { "lv.cust1", "", "00 0xA ----- ----- ---- ---- 0xC ----", EFI, 0 }, -- { "lv.cust2", "", "00 0xA ----- ----- ---- ---- 0xD ----", EFI, 0 }, -- { "lv.cust3", "", "00 0xA ----- ----- ---- ---- 0xE ----", EFI, 0 }, -- { "lv.cust4", "", "00 0xA ----- ----- ---- ---- 0xF ----", EFI, 0 }, -- -- { "lf.add.s", "rD,rA,rB", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x0", EFI, 0 }, -- { "lf.sub.s", "rD,rA,rB", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x1", EFI, 0 }, -- { "lf.mul.s", "rD,rA,rB", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x2", EFI, 0 }, -- { "lf.div.s", "rD,rA,rB", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x3", EFI, 0 }, -- { "lf.itof.s", "rD,rA", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x4", EFI, 0 }, -- { "lf.ftoi.s", "rD,rA", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x5", EFI, 0 }, -- { "lf.rem.s", "rD,rA,rB", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x6", EFI, 0 }, -- { "lf.madd.s", "rD,rA,rB", "00 0xB DDDDD AAAAA BBBB B--- 0x1 0x7", EFI, 0 }, -- { "lf.sfeq.s", "rA,rB", "00 0xB ----- AAAAA BBBB B--- 0x1 0x8", EFI, 0 }, -- { "lf.sfne.s", "rA,rB", "00 0xB ----- AAAAA BBBB B--- 0x1 0x9", EFI, 0 }, -- { "lf.sfgt.s", "rA,rB", "00 0xB ----- AAAAA BBBB B--- 0x1 0xA", EFI, 0 }, -- { "lf.sfge.s", "rA,rB", "00 0xB ----- AAAAA BBBB B--- 0x1 0xB", EFI, 0 }, -- { "lf.sflt.s", "rA,rB", "00 0xB ----- AAAAA BBBB B--- 0x1 0xC", EFI, 0 }, -- { "lf.sfle.s", "rA,rB", "00 0xB ----- AAAAA BBBB B--- 0x1 0xD", EFI, 0 }, -- { "lf.cust1.s", "", "00 0xB ----- ----- ---- ---- 0xE ----", EFI, 0 }, -- -- { "lf.add.d", "rD,rA,rB", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x0", EFI, 0 }, -- { "lf.sub.d", "rD,rA,rB", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x1", EFI, 0 }, -- { "lf.mul.d", "rD,rA,rB", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x2", EFI, 0 }, -- { "lf.div.d", "rD,rA,rB", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x3", EFI, 0 }, -- { "lf.itof.d", "rD,rA", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x4", EFI, 0 }, -- { "lf.ftoi.d", "rD,rA", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x5", EFI, 0 }, -- { "lf.rem.d", "rD,rA,rB", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x6", EFI, 0 }, -- { "lf.madd.d", "rD,rA,rB", "00 0xC DDDDD AAAAA BBBB B--- 0x1 0x7", EFI, 0 }, -- { "lf.sfeq.d", "rA,rB", "00 0xC ----- AAAAA BBBB B--- 0x1 0x8", EFI, 0 }, -- { "lf.sfne.d", "rA,rB", "00 0xC ----- AAAAA BBBB B--- 0x1 0x9", EFI, 0 }, -- { "lf.sfgt.d", "rA,rB", "00 0xC ----- AAAAA BBBB B--- 0x1 0xA", EFI, 0 }, -- { "lf.sfge.d", "rA,rB", "00 0xC ----- AAAAA BBBB B--- 0x1 0xB", EFI, 0 }, -- { "lf.sflt.d", "rA,rB", "00 0xC ----- AAAAA BBBB B--- 0x1 0xC", EFI, 0 }, -- { "lf.sfle.d", "rA,rB", "00 0xC ----- AAAAA BBBB B--- 0x1 0xD", EFI, 0 }, -- { "lf.cust1.d", "", "00 0xC ----- ----- ---- ---- 0xE ----", EFI, 0 }, -- -- { "lvf.ld", "rD,0(rA)", "00 0xD DDDDD AAAAA ---- ---- 0x0 0x0", EFI, 0 }, -- { "lvf.lw", "rD,0(rA)", "00 0xD DDDDD AAAAA ---- ---- 0x0 0x1", EFI, 0 }, -- { "lvf.sd", "0(rA),rB", "00 0xD ----- AAAAA BBBB B--- 0x1 0x0", EFI, 0 }, -- { "lvf.sw", "0(rA),rB", "00 0xD ----- AAAAA BBBB B--- 0x1 0x1", EFI, 0 }, -- -- { "l.jr", "rB", "01 0x1 ----- ----- BBBB B--- ---- ----", EF(l_jr), OR32_IF_DELAY }, -- { "l.jalr", "rB", "01 0x2 ----- ----- BBBB B--- ---- ----", EF(l_jalr), OR32_IF_DELAY }, -- { "l.maci", "rB,I", "01 0x3 IIIII ----- BBBB BIII IIII IIII", EF(l_mac), 0 }, -- { "l.cust1", "", "01 0xC ----- ----- ---- ---- ---- ----", EF(l_cust1), 0 }, -- { "l.cust2", "", "01 0xD ----- ----- ---- ---- ---- ----", EF(l_cust2), 0 }, -- { "l.cust3", "", "01 0xE ----- ----- ---- ---- ---- ----", EF(l_cust3), 0 }, -- { "l.cust4", "", "01 0xF ----- ----- ---- ---- ---- ----", EF(l_cust4), 0 }, -- -- { "l.ld", "rD,I(rA)", "10 0x0 DDDDD AAAAA IIII IIII IIII IIII", EFI, 0 }, -- { "l.lwz", "rD,I(rA)", "10 0x1 DDDDD AAAAA IIII IIII IIII IIII", EF(l_lwz), 0 }, -- { "l.lws", "rD,I(rA)", "10 0x2 DDDDD AAAAA IIII IIII IIII IIII", EFI, 0 }, -- { "l.lbz", "rD,I(rA)", "10 0x3 DDDDD AAAAA IIII IIII IIII IIII", EF(l_lbz), 0 }, -- { "l.lbs", "rD,I(rA)", "10 0x4 DDDDD AAAAA IIII IIII IIII IIII", EF(l_lbs), 0 }, -- { "l.lhz", "rD,I(rA)", "10 0x5 DDDDD AAAAA IIII IIII IIII IIII", EF(l_lhz), 0 }, -- { "l.lhs", "rD,I(rA)", "10 0x6 DDDDD AAAAA IIII IIII IIII IIII", EF(l_lhs), 0 }, -- -- { "l.addi", "rD,rA,I", "10 0x7 DDDDD AAAAA IIII IIII IIII IIII", EF(l_add), 0 }, -- { "l.addic", "rD,rA,I", "10 0x8 DDDDD AAAAA IIII IIII IIII IIII", EFI, 0 }, -- { "l.andi", "rD,rA,K", "10 0x9 DDDDD AAAAA KKKK KKKK KKKK KKKK", EF(l_and), 0 }, -- { "l.ori", "rD,rA,K", "10 0xA DDDDD AAAAA KKKK KKKK KKKK KKKK", EF(l_or), 0 }, -- { "l.xori", "rD,rA,I", "10 0xB DDDDD AAAAA IIII IIII IIII IIII", EF(l_xor), 0 }, -- { "l.muli", "rD,rA,I", "10 0xC DDDDD AAAAA IIII IIII IIII IIII", EFI, 0 }, -- { "l.mfspr", "rD,rA,K", "10 0xD DDDDD AAAAA KKKK KKKK KKKK KKKK", EF(l_mfspr), 0 }, -- { "l.slli", "rD,rA,L", "10 0xE DDDDD AAAAA ---- ---- 00LL LLLL", EF(l_sll), 0 }, -- { "l.srli", "rD,rA,L", "10 0xE DDDDD AAAAA ---- ---- 01LL LLLL", EF(l_srl), 0 }, -- { "l.srai", "rD,rA,L", "10 0xE DDDDD AAAAA ---- ---- 10LL LLLL", EF(l_sra), 0 }, -- { "l.rori", "rD,rA,L", "10 0xE DDDDD AAAAA ---- ---- 11LL LLLL", EFI, 0 }, -- -- { "l.sfeqi", "rA,I", "10 0xF 00000 AAAAA IIII IIII IIII IIII", EF(l_sfeq), OR32_W_FLAG }, -- { "l.sfnei", "rA,I", "10 0xF 00001 AAAAA IIII IIII IIII IIII", EF(l_sfne), OR32_W_FLAG }, -- { "l.sfgtui", "rA,I", "10 0xF 00010 AAAAA IIII IIII IIII IIII", EF(l_sfgtu), OR32_W_FLAG }, -- { "l.sfgeui", "rA,I", "10 0xF 00011 AAAAA IIII IIII IIII IIII", EF(l_sfgeu), OR32_W_FLAG }, -- { "l.sfltui", "rA,I", "10 0xF 00100 AAAAA IIII IIII IIII IIII", EF(l_sfltu), OR32_W_FLAG }, -- { "l.sfleui", "rA,I", "10 0xF 00101 AAAAA IIII IIII IIII IIII", EF(l_sfleu), OR32_W_FLAG }, -- { "l.sfgtsi", "rA,I", "10 0xF 01010 AAAAA IIII IIII IIII IIII", EF(l_sfgts), OR32_W_FLAG }, -- { "l.sfgesi", "rA,I", "10 0xF 01011 AAAAA IIII IIII IIII IIII", EF(l_sfges), OR32_W_FLAG }, -- { "l.sfltsi", "rA,I", "10 0xF 01100 AAAAA IIII IIII IIII IIII", EF(l_sflts), OR32_W_FLAG }, -- { "l.sflesi", "rA,I", "10 0xF 01101 AAAAA IIII IIII IIII IIII", EF(l_sfles), OR32_W_FLAG }, -- -- { "l.mtspr", "rA,rB,K", "11 0x0 KKKKK AAAAA BBBB BKKK KKKK KKKK", EF(l_mtspr), 0 }, -- { "l.mac", "rA,rB", "11 0x1 ----- AAAAA BBBB B--- ---- 0x1", EF(l_mac), 0 }, /*MM*/ -- { "l.msb", "rA,rB", "11 0x1 ----- AAAAA BBBB B--- ---- 0x2", EF(l_msb), 0 }, /*MM*/ -- -- { "l.sd", "I(rA),rB", "11 0x4 IIIII AAAAA BBBB BIII IIII IIII", EFI, 0 }, -- { "l.sw", "I(rA),rB", "11 0x5 IIIII AAAAA BBBB BIII IIII IIII", EF(l_sw), 0 }, -- { "l.sb", "I(rA),rB", "11 0x6 IIIII AAAAA BBBB BIII IIII IIII", EF(l_sb), 0 }, -- { "l.sh", "I(rA),rB", "11 0x7 IIIII AAAAA BBBB BIII IIII IIII", EF(l_sh), 0 }, -- -- { "l.add", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x0", EF(l_add), 0 }, -- { "l.addc", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x1", EFI, 0 }, -- { "l.sub", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x2", EF(l_sub), 0 }, -- { "l.and", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x3", EF(l_and), 0 }, -- { "l.or", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x4", EF(l_or), 0 }, -- { "l.xor", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x5", EF(l_xor), 0 }, -- { "l.mul", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-11 ---- 0x6", EF(l_mul), 0 }, -- -- { "l.sll", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 00-- 0x8", EF(l_sll), 0 }, -- { "l.srl", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 01-- 0x8", EF(l_srl), 0 }, -- { "l.sra", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 10-- 0x8", EF(l_sra), 0 }, -- { "l.ror", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 11-- 0x8", EFI, 0 }, -- { "l.div", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0x9", EF(l_div), 0 }, -- { "l.divu", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0xA", EF(l_divu), 0 }, -- { "l.mulu", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-11 ---- 0xB", EFI, 0 }, -- { "l.exths", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 00-- 0xC", EFI, 0 }, -- { "l.extbs", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 01-- 0xC", EFI, 0 }, -- { "l.exthz", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 10-- 0xC", EFI, 0 }, -- { "l.extbz", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 11-- 0xC", EFI, 0 }, -- { "l.extws", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 00-- 0xD", EFI, 0 }, -- { "l.extwz", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 01-- 0xD", EFI, 0 }, -- { "l.cmov", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0xE", EFI, 0 }, -- { "l.ff1", "rD,rA,rB", "11 0x8 DDDDD AAAAA BBBB B-00 ---- 0xF", EFI, 0 }, -- -- { "l.sfeq", "rA,rB", "11 0x9 00000 AAAAA BBBB B--- ---- ----", EF(l_sfeq), OR32_W_FLAG }, -- { "l.sfne", "rA,rB", "11 0x9 00001 AAAAA BBBB B--- ---- ----", EF(l_sfne), OR32_W_FLAG }, -- { "l.sfgtu", "rA,rB", "11 0x9 00010 AAAAA BBBB B--- ---- ----", EF(l_sfgtu), OR32_W_FLAG }, -- { "l.sfgeu", "rA,rB", "11 0x9 00011 AAAAA BBBB B--- ---- ----", EF(l_sfgeu), OR32_W_FLAG }, -- { "l.sfltu", "rA,rB", "11 0x9 00100 AAAAA BBBB B--- ---- ----", EF(l_sfltu), OR32_W_FLAG }, -- { "l.sfleu", "rA,rB", "11 0x9 00101 AAAAA BBBB B--- ---- ----", EF(l_sfleu), OR32_W_FLAG }, -- { "l.sfgts", "rA,rB", "11 0x9 01010 AAAAA BBBB B--- ---- ----", EF(l_sfgts), OR32_W_FLAG }, -- { "l.sfges", "rA,rB", "11 0x9 01011 AAAAA BBBB B--- ---- ----", EF(l_sfges), OR32_W_FLAG }, -- { "l.sflts", "rA,rB", "11 0x9 01100 AAAAA BBBB B--- ---- ----", EF(l_sflts), OR32_W_FLAG }, -- { "l.sfles", "rA,rB", "11 0x9 01101 AAAAA BBBB B--- ---- ----", EF(l_sfles), OR32_W_FLAG }, -- -- { "l.cust5", "", "11 0xC ----- ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust6", "", "11 0xD ----- ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust7", "", "11 0xE ----- ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust8", "", "11 0xF ----- ----- ---- ---- ---- ----", EFI, 0 }, -- -- /* This section should not be defined in or1ksim, since it contains duplicates, -- which would cause machine builder to complain. */ --#ifdef HAS_CUST -- { "l.cust5_1", "rD", "11 0xC DDDDD ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust5_2", "rD,rA" , "11 0xC DDDDD AAAAA ---- ---- ---- ----", EFI, 0 }, -- { "l.cust5_3", "rD,rA,rB", "11 0xC DDDDD AAAAA BBBB B--- ---- ----", EFI, 0 }, -- -- { "l.cust6_1", "rD", "11 0xD DDDDD ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust6_2", "rD,rA" , "11 0xD DDDDD AAAAA ---- ---- ---- ----", EFI, 0 }, -- { "l.cust6_3", "rD,rA,rB", "11 0xD DDDDD AAAAA BBBB B--- ---- ----", EFI, 0 }, -- -- { "l.cust7_1", "rD", "11 0xE DDDDD ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust7_2", "rD,rA" , "11 0xE DDDDD AAAAA ---- ---- ---- ----", EFI, 0 }, -- { "l.cust7_3", "rD,rA,rB", "11 0xE DDDDD AAAAA BBBB B--- ---- ----", EFI, 0 }, -- -- { "l.cust8_1", "rD", "11 0xF DDDDD ----- ---- ---- ---- ----", EFI, 0 }, -- { "l.cust8_2", "rD,rA" , "11 0xF DDDDD AAAAA ---- ---- ---- ----", EFI, 0 }, -- { "l.cust8_3", "rD,rA,rB", "11 0xF DDDDD AAAAA BBBB B--- ---- ----", EFI, 0 }, --#endif -- -- /* Dummy entry, not included in num_opcodes. This -- lets code examine entry i+1 without checking -- if we've run off the end of the table. */ -- { "", "", "", EFI, 0 } --}; -- --#undef EFI --#undef EFN --#undef EF -- --/* Define dummy, if debug is not defined. */ -- --#if !defined HAS_DEBUG --static void ATTRIBUTE_PRINTF_2 --debug (int level ATTRIBUTE_UNUSED, const char *format ATTRIBUTE_UNUSED, ...) --{ --} --#endif -- --const unsigned int or32_num_opcodes = ((sizeof(or32_opcodes)) / (sizeof(struct or32_opcode))) - 1; -- --/* Calculates instruction length in bytes. Always 4 for OR32. */ -- --int --insn_len (int i_index ATTRIBUTE_UNUSED) --{ -- return 4; --} -- --/* Is individual insn's operand signed or unsigned? */ -- --int --letter_signed (char l) --{ -- const struct or32_letter *pletter; -- -- for (pletter = or32_letters; pletter->letter != '\0'; pletter++) -- if (pletter->letter == l) -- return pletter->sign; -- -- printf ("letter_signed(%c): Unknown letter.\n", l); -- return 0; --} -- --/* Number of letters in the individual lettered operand. */ -- --int --letter_range (char l) --{ -- const struct or32_opcode *pinsn; -- char *enc; -- int range = 0; -- -- for (pinsn = or32_opcodes; strlen (pinsn->name); pinsn ++) -- { -- if (strchr (pinsn->encoding,l)) -- { -- for (enc = pinsn->encoding; *enc != '\0'; enc ++) -- if ((*enc == '0') && (*(enc + 1) == 'x')) -- enc += 2; -- else if (*enc == l) -- range++; -- return range; -- } -- } -- -- printf ("\nABORT: letter_range(%c): Never used letter.\n", l); -- exit (1); --} -- --/* MM: Returns index of given instruction name. */ -- --int --insn_index (char *insn) --{ -- unsigned int i; -- int found = -1; -- -- for (i = 0; i < or32_num_opcodes; i++) -- if (!strcmp (or32_opcodes[i].name, insn)) -- { -- found = i; -- break; -- } -- return found; --} -- --const char * --insn_name (int op_index) --{ -- if (op_index >= 0 && op_index < (int) or32_num_opcodes) -- return or32_opcodes[op_index].name; -- else -- return "???"; --} -- --void --l_none (void) --{ --} -- --/* Finite automata for instruction decoding building code. */ -- --/* Find simbols in encoding. */ -- --static unsigned long --insn_extract (char param_ch, char *enc_initial) --{ -- char *enc; -- unsigned long ret = 0; -- unsigned opc_pos = 32; -- -- for (enc = enc_initial; *enc != '\0'; ) -- if ((*enc == '0') && (*(enc + 1) == 'x')) -- { -- unsigned long tmp = strtol (enc+2, NULL, 16); -- -- opc_pos -= 4; -- if (param_ch == '0' || param_ch == '1') -- { -- if (param_ch == '0') -- tmp = 15 - tmp; -- ret |= tmp << opc_pos; -- } -- enc += 3; -- } -- else -- { -- if (*enc == '0' || *enc == '1' || *enc == '-' || ISALPHA (*enc)) -- { -- opc_pos--; -- if (param_ch == *enc) -- ret |= 1 << opc_pos; -- } -- enc++; -- } -- return ret; --} -- --#define MAX_AUTOMATA_SIZE 1200 --#define MAX_OP_TABLE_SIZE 1200 --#define LEAF_FLAG 0x80000000 --#define MAX_LEN 8 -- --#ifndef MIN --#define MIN(x, y) ((x) < (y) ? (x) : (y)) --#endif -- --unsigned long *automata; --int nuncovered; --int curpass = 0; -- --/* MM: Struct that hold runtime build information about instructions. */ --struct temp_insn_struct --{ -- unsigned long insn; -- unsigned long insn_mask; -- int in_pass; --} *ti; -- --struct insn_op_struct *op_data, **op_start; -- --/* Recursive utility function used to find best match and to build automata. */ -- --static unsigned long * --cover_insn (unsigned long * cur, int pass, unsigned int mask) --{ -- int best_first = 0, last_match = -1, ninstr = 0; -- unsigned int best_len = 0; -- unsigned int i; -- unsigned long cur_mask = mask; -- unsigned long *next; -- -- for (i = 0; i < or32_num_opcodes; i++) -- if (ti[i].in_pass == pass) -- { -- cur_mask &= ti[i].insn_mask; -- ninstr++; -- last_match = i; -- } -- -- debug (8, "%08X %08lX\n", mask, cur_mask); -- -- if (ninstr == 0) -- return 0; -- -- if (ninstr == 1) -- { -- /* Leaf holds instruction index. */ -- debug (8, "%li>I%i %s\n", -- (long)(cur - automata), last_match, or32_opcodes[last_match].name); -- -- *cur = LEAF_FLAG | last_match; -- cur++; -- nuncovered--; -- } -- else -- { -- /* Find longest match. */ -- for (i = 0; i < 32; i++) -- { -- unsigned int len; -- -- for (len = best_len + 1; len < MIN (MAX_LEN, 33 - i); len++) -- { -- unsigned long m = (1UL << ((unsigned long) len)) - 1; -- -- debug (9, " (%i(%08lX & %08lX>>%i = %08lX, %08lX)", -- len,m, cur_mask, i, (cur_mask >> (unsigned)i), -- (cur_mask >> (unsigned) i) & m); -- -- if ((m & (cur_mask >> (unsigned) i)) == m) -- { -- best_len = len; -- best_first = i; -- debug (9, "!"); -- } -- else -- break; -- } -- } -- -- debug (9, "\n"); -- -- if (!best_len) -- { -- fprintf (stderr, "%i instructions match mask 0x%08X:\n", ninstr, mask); -- -- for (i = 0; i < or32_num_opcodes; i++) -- if (ti[i].in_pass == pass) -- fprintf (stderr, "%s ", or32_opcodes[i].name); -- -- fprintf (stderr, "\n"); -- exit (1); -- } -- -- debug (8, "%li> #### %i << %i (%i) ####\n", -- (long)(cur - automata), best_len, best_first, ninstr); -- -- *cur = best_first; -- cur++; -- *cur = (1 << best_len) - 1; -- cur++; -- next = cur; -- -- /* Allocate space for pointers. */ -- cur += 1 << best_len; -- cur_mask = (1 << (unsigned long) best_len) - 1; -- -- for (i = 0; i < ((unsigned) 1 << best_len); i++) -- { -- unsigned int j; -- unsigned long *c; -- -- curpass++; -- for (j = 0; j < or32_num_opcodes; j++) -- if (ti[j].in_pass == pass -- && ((ti[j].insn >> best_first) & cur_mask) == (unsigned long) i -- && ((ti[j].insn_mask >> best_first) & cur_mask) == cur_mask) -- ti[j].in_pass = curpass; -- -- debug (9, "%08X %08lX %i\n", mask, cur_mask, best_first); -- c = cover_insn (cur, curpass, mask & (~(cur_mask << best_first))); -- if (c) -- { -- debug (8, "%li> #%X -> %lu\n", (long)(next - automata), i, -- (unsigned long)(cur - automata)); -- *next = cur - automata; -- cur = c; -- } -- else -- { -- debug (8, "%li> N/A\n", (long)(next - automata)); -- *next = 0; -- } -- next++; -- } -- } -- return cur; --} -- --/* Returns number of nonzero bits. */ -- --static int --num_ones (unsigned long value) --{ -- int c = 0; -- -- while (value) -- { -- if (value & 1) -- c++; -- value >>= 1; -- } -- return c; --} -- --/* Utility function, which converts parameters from or32_opcode -- format to more binary form. Parameters are stored in ti struct. */ -- --static struct insn_op_struct * --parse_params (const struct or32_opcode * opcode, -- struct insn_op_struct * cur) --{ -- char *args = opcode->args; -- int i, type; -- -- i = 0; -- type = 0; -- /* In case we don't have any parameters, we add dummy read from r0. */ -- -- if (!(*args)) -- { -- cur->type = OPTYPE_REG | OPTYPE_OP | OPTYPE_LAST; -- cur->data = 0; -- debug (9, "#%08lX %08lX\n", cur->type, cur->data); -- cur++; -- return cur; -- } -- -- while (*args != '\0') -- { -- if (*args == 'r') -- { -- args++; -- type |= OPTYPE_REG; -- } -- else if (ISALPHA (*args)) -- { -- unsigned long arg; -- -- arg = insn_extract (*args, opcode->encoding); -- debug (9, "%s : %08lX ------\n", opcode->name, arg); -- if (letter_signed (*args)) -- { -- type |= OPTYPE_SIG; -- type |= ((num_ones (arg) - 1) << OPTYPE_SBIT_SHR) & OPTYPE_SBIT; -- } -- -- /* Split argument to sequences of consecutive ones. */ -- while (arg) -- { -- int shr = 0; -- unsigned long tmp = arg, mask = 0; -- -- while ((tmp & 1) == 0) -- { -- shr++; -- tmp >>= 1; -- } -- while (tmp & 1) -- { -- mask++; -- tmp >>= 1; -- } -- cur->type = type | shr; -- cur->data = mask; -- arg &= ~(((1 << mask) - 1) << shr); -- debug (6, "|%08lX %08lX\n", cur->type, cur->data); -- cur++; -- } -- args++; -- } -- else if (*args == '(') -- { -- /* Next param is displacement. -- Later we will treat them as one operand. */ -- cur--; -- cur->type = type | cur->type | OPTYPE_DIS | OPTYPE_OP; -- debug (9, ">%08lX %08lX\n", cur->type, cur->data); -- cur++; -- type = 0; -- i++; -- args++; -- } -- else if (*args == OPERAND_DELIM) -- { -- cur--; -- cur->type = type | cur->type | OPTYPE_OP; -- debug (9, ">%08lX %08lX\n", cur->type, cur->data); -- cur++; -- type = 0; -- i++; -- args++; -- } -- else if (*args == '0') -- { -- cur->type = type; -- cur->data = 0; -- debug (9, ">%08lX %08lX\n", cur->type, cur->data); -- cur++; -- type = 0; -- i++; -- args++; -- } -- else if (*args == ')') -- args++; -- else -- { -- fprintf (stderr, "%s : parse error in args.\n", opcode->name); -- exit (1); -- } -- } -- -- cur--; -- cur->type = type | cur->type | OPTYPE_OP | OPTYPE_LAST; -- debug (9, "#%08lX %08lX\n", cur->type, cur->data); -- cur++; -- -- return cur; --} -- --/* Constructs new automata based on or32_opcodes array. */ -- --void --build_automata (void) --{ -- unsigned int i; -- unsigned long *end; -- struct insn_op_struct *cur; -- -- automata = malloc (MAX_AUTOMATA_SIZE * sizeof (unsigned long)); -- ti = malloc (sizeof (struct temp_insn_struct) * or32_num_opcodes); -- -- nuncovered = or32_num_opcodes; -- printf ("Building automata... "); -- /* Build temporary information about instructions. */ -- for (i = 0; i < or32_num_opcodes; i++) -- { -- unsigned long ones, zeros; -- char *encoding = or32_opcodes[i].encoding; -- -- ones = insn_extract('1', encoding); -- zeros = insn_extract('0', encoding); -- -- ti[i].insn_mask = ones | zeros; -- ti[i].insn = ones; -- ti[i].in_pass = curpass = 0; -- -- /*debug(9, "%s: %s %08X %08X\n", or32_opcodes[i].name, -- or32_opcodes[i].encoding, ti[i].insn_mask, ti[i].insn);*/ -- } -- -- /* Until all are covered search for best criteria to separate them. */ -- end = cover_insn (automata, curpass, 0xFFFFFFFF); -- -- if (end - automata > MAX_AUTOMATA_SIZE) -- { -- fprintf (stderr, "Automata too large. Increase MAX_AUTOMATA_SIZE."); -- exit (1); -- } -- -- printf ("done, num uncovered: %i/%i.\n", nuncovered, or32_num_opcodes); -- printf ("Parsing operands data... "); -- -- op_data = malloc (MAX_OP_TABLE_SIZE * sizeof (struct insn_op_struct)); -- op_start = malloc (or32_num_opcodes * sizeof (struct insn_op_struct *)); -- cur = op_data; -- -- for (i = 0; i < or32_num_opcodes; i++) -- { -- op_start[i] = cur; -- cur = parse_params (&or32_opcodes[i], cur); -- -- if (cur - op_data > MAX_OP_TABLE_SIZE) -- { -- fprintf (stderr, "Operands table too small, increase MAX_OP_TABLE_SIZE.\n"); -- exit (1); -- } -- } -- printf ("done.\n"); --} -- --void --destruct_automata (void) --{ -- free (ti); -- free (automata); -- free (op_data); -- free (op_start); --} -- --/* Decodes instruction and returns instruction index. */ -- --int --insn_decode (unsigned int insn) --{ -- unsigned long *a = automata; -- int i; -- -- while (!(*a & LEAF_FLAG)) -- { -- unsigned int first = *a; -- -- debug (9, "%li ", (long)(a - automata)); -- -- a++; -- i = (insn >> first) & *a; -- a++; -- if (!*(a + i)) -- { -- /* Invalid instruction found? */ -- debug (9, "XXX\n"); -- return -1; -- } -- a = automata + *(a + i); -- } -- -- i = *a & ~LEAF_FLAG; -- -- debug (9, "%i\n", i); -- -- /* Final check - do we have direct match? -- (based on or32_opcodes this should be the only possibility, -- but in case of invalid/missing instruction we must perform a check) */ -- if ((ti[i].insn_mask & insn) == ti[i].insn) -- return i; -- else -- return -1; --} -- --static char disassembled_str[50]; --char *disassembled = &disassembled_str[0]; -- --/* Automagically does zero- or sign- extension and also finds correct -- sign bit position if sign extension is correct extension. Which extension -- is proper is figured out from letter description. */ -- --static unsigned long --extend_imm (unsigned long imm, char l) --{ -- unsigned long mask; -- int letter_bits; -- -- /* First truncate all bits above valid range for this letter -- in case it is zero extend. */ -- letter_bits = letter_range (l); -- mask = (1 << letter_bits) - 1; -- imm &= mask; -- -- /* Do sign extend if this is the right one. */ -- if (letter_signed(l) && (imm >> (letter_bits - 1))) -- imm |= (~mask); -- -- return imm; --} -- --static unsigned long --or32_extract (char param_ch, char *enc_initial, unsigned long insn) --{ -- char *enc; -- unsigned long ret = 0; -- int opc_pos = 0; -- int param_pos = 0; -- -- for (enc = enc_initial; *enc != '\0'; enc++) -- if (*enc == param_ch) -- { -- if (enc - 2 >= enc_initial && (*(enc - 2) == '0') && (*(enc - 1) == 'x')) -- continue; -- else -- param_pos++; -- } -- --#if DEBUG -- printf ("or32_extract: %x ", param_pos); --#endif -- opc_pos = 32; -- -- for (enc = enc_initial; *enc != '\0'; ) -- if ((*enc == '0') && (*(enc + 1) == 'x')) -- { -- opc_pos -= 4; -- if ((param_ch == '0') || (param_ch == '1')) -- { -- unsigned long tmp = strtol (enc, NULL, 16); --#if DEBUG -- printf (" enc=%s, tmp=%lx ", enc, tmp); --#endif -- if (param_ch == '0') -- tmp = 15 - tmp; -- ret |= tmp << opc_pos; -- } -- enc += 3; -- } -- else if ((*enc == '0') || (*enc == '1')) -- { -- opc_pos--; -- if (param_ch == *enc) -- ret |= 1 << opc_pos; -- enc++; -- } -- else if (*enc == param_ch) -- { -- opc_pos--; -- param_pos--; --#if DEBUG -- printf ("\n ret=%lx opc_pos=%x, param_pos=%x\n", ret, opc_pos, param_pos); --#endif -- if (ISLOWER (param_ch)) -- ret -= ((insn >> opc_pos) & 0x1) << param_pos; -- else -- ret += ((insn >> opc_pos) & 0x1) << param_pos; -- enc++; -- } -- else if (ISALPHA (*enc)) -- { -- opc_pos--; -- enc++; -- } -- else if (*enc == '-') -- { -- opc_pos--; -- enc++; -- } -- else -- enc++; -- --#if DEBUG -- printf ("ret=%lx\n", ret); --#endif -- return ret; --} -- --/* Print register. Used only by print_insn. */ -- --static void --or32_print_register (char param_ch, char *encoding, unsigned long insn) --{ -- int regnum = or32_extract(param_ch, encoding, insn); -- char s_regnum[20]; -- -- sprintf (s_regnum, "r%d", regnum); -- strcat (disassembled, s_regnum); --} -- --/* Print immediate. Used only by print_insn. */ -- --static void --or32_print_immediate (char param_ch, char *encoding, unsigned long insn) --{ -- int imm = or32_extract (param_ch, encoding, insn); -- char s_imm[20]; -- -- imm = extend_imm (imm, param_ch); -- -- if (letter_signed (param_ch)) -- { -- if (imm < 0) -- sprintf (s_imm, "%d", imm); -- else -- sprintf (s_imm, "0x%x", imm); -- } -- else -- sprintf (s_imm, "%#x", imm); -- strcat (disassembled, s_imm); --} -- --/* Disassemble one instruction from insn to disassemble. -- Return the size of the instruction. */ -- --int --disassemble_insn (unsigned long insn) --{ -- int op_index; -- op_index = insn_decode (insn); -- -- if (op_index >= 0) -- { -- struct or32_opcode const *opcode = &or32_opcodes[op_index]; -- char *s; -- -- sprintf (disassembled, "%s ", opcode->name); -- for (s = opcode->args; *s != '\0'; ++s) -- { -- switch (*s) -- { -- case '\0': -- return 4; -- -- case 'r': -- or32_print_register (*++s, opcode->encoding, insn); -- break; -- -- default: -- if (strchr (opcode->encoding, *s)) -- or32_print_immediate (*s, opcode->encoding, insn); -- else -- { -- char s_encoding[2] = { *s, '\0' }; -- -- strcat (disassembled, s_encoding); -- } -- -- } -- } -- } -- else -- { -- char s_insn[20]; -- -- /* This used to be %8x for binutils. */ -- sprintf (s_insn, ".word 0x%08lx", insn); -- strcat (disassembled, s_insn); -- } -- -- return insn_len (insn); --} -diff -rNU3 dist.orig/opcodes/riscv-dis.c dist/opcodes/riscv-dis.c ---- dist.orig/opcodes/riscv-dis.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/riscv-dis.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,492 @@ -+/* RISC-V disassembler -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on MIPS target. -+ -+ This file is part of the GNU opcodes library. -+ -+ This library is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+#include "sysdep.h" -+#include "dis-asm.h" -+#include "libiberty.h" -+#include "opcode/riscv.h" -+#include "opintl.h" -+#include "elf-bfd.h" -+#include "elf/riscv.h" -+ -+#include -+#include -+ -+struct riscv_private_data -+{ -+ bfd_vma gp; -+ bfd_vma print_addr; -+ bfd_vma hi_addr[OP_MASK_RD + 1]; -+}; -+ -+static const char * const *riscv_gpr_names; -+static const char * const *riscv_fpr_names; -+ -+/* Other options */ -+static int no_aliases; /* If set disassemble as most general inst. */ -+ -+static void -+set_default_riscv_dis_options (void) -+{ -+ riscv_gpr_names = riscv_gpr_names_abi; -+ riscv_fpr_names = riscv_fpr_names_abi; -+ no_aliases = 0; -+} -+ -+static void -+parse_riscv_dis_option (const char *option) -+{ -+ if (CONST_STRNEQ (option, "no-aliases")) -+ no_aliases = 1; -+ else if (CONST_STRNEQ (option, "numeric")) -+ { -+ riscv_gpr_names = riscv_gpr_names_numeric; -+ riscv_fpr_names = riscv_fpr_names_numeric; -+ } -+ -+ /* Invalid option. */ -+ fprintf (stderr, _("Unrecognized disassembler option: %s\n"), option); -+} -+ -+static void -+parse_riscv_dis_options (const char *opts_in) -+{ -+ char *opts = xstrdup (opts_in), *opt = opts, *opt_end = opts; -+ -+ set_default_riscv_dis_options (); -+ -+ for ( ; opt_end != NULL; opt = opt_end + 1) -+ { -+ if ((opt_end = strchr (opt, ',')) != NULL) -+ *opt_end = 0; -+ parse_riscv_dis_option (opt); -+ } -+ -+ free (opts); -+} -+ -+/* Print one argument from an array. */ -+ -+static void -+arg_print (struct disassemble_info *info, unsigned long val, -+ const char* const* array, size_t size) -+{ -+ const char *s = val >= size || array[val] == NULL ? "unknown" : array[val]; -+ (*info->fprintf_func) (info->stream, "%s", s); -+} -+ -+static void -+maybe_print_address (struct riscv_private_data *pd, int base_reg, int offset) -+{ -+ if (pd->hi_addr[base_reg] != (bfd_vma)-1) -+ { -+ pd->print_addr = pd->hi_addr[base_reg] + offset; -+ pd->hi_addr[base_reg] = -1; -+ } -+ else if (base_reg == X_GP && pd->gp != (bfd_vma)-1) -+ pd->print_addr = pd->gp + offset; -+ else if (base_reg == X_TP) -+ pd->print_addr = offset; -+} -+ -+/* Print insn arguments for 32/64-bit code. */ -+ -+static void -+print_insn_args (const char *d, insn_t l, bfd_vma pc, disassemble_info *info) -+{ -+ struct riscv_private_data *pd = info->private_data; -+ int rs1 = (l >> OP_SH_RS1) & OP_MASK_RS1; -+ int rd = (l >> OP_SH_RD) & OP_MASK_RD; -+ -+ if (*d != '\0') -+ (*info->fprintf_func) (info->stream, "\t"); -+ -+ for (; *d != '\0'; d++) -+ { -+ switch (*d) -+ { -+ /* Xcustom */ -+ case '^': -+ switch (*++d) -+ { -+ case 'd': -+ (*info->fprintf_func) (info->stream, "%d", rd); -+ break; -+ case 's': -+ (*info->fprintf_func) (info->stream, "%d", rs1); -+ break; -+ case 't': -+ (*info->fprintf_func) -+ ( info->stream, "%d", (int)((l >> OP_SH_RS2) & OP_MASK_RS2)); -+ break; -+ case 'j': -+ (*info->fprintf_func) -+ ( info->stream, "%d", (int)((l >> OP_SH_CUSTOM_IMM) & OP_MASK_CUSTOM_IMM)); -+ break; -+ } -+ break; -+ -+ /* Xhwacha */ -+ case '#': -+ switch ( *++d ) { -+ case 'g': -+ (*info->fprintf_func) -+ ( info->stream, "%d", -+ (int)((l >> OP_SH_IMMNGPR) & OP_MASK_IMMNGPR)); -+ break; -+ case 'f': -+ (*info->fprintf_func) -+ ( info->stream, "%d", -+ (int)((l >> OP_SH_IMMNFPR) & OP_MASK_IMMNFPR)); -+ break; -+ case 'p': -+ (*info->fprintf_func) -+ ( info->stream, "%d", -+ (int)((l >> OP_SH_CUSTOM_IMM) & OP_MASK_CUSTOM_IMM)); -+ break; -+ case 'n': -+ (*info->fprintf_func) -+ ( info->stream, "%d", -+ (int)(((l >> OP_SH_IMMSEGNELM) & OP_MASK_IMMSEGNELM) + 1)); -+ break; -+ case 'd': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_gpr_names[(l >> OP_SH_VRD) & OP_MASK_VRD]); -+ break; -+ case 's': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_gpr_names[(l >> OP_SH_VRS) & OP_MASK_VRS]); -+ break; -+ case 't': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_gpr_names[(l >> OP_SH_VRT) & OP_MASK_VRT]); -+ break; -+ case 'r': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_gpr_names[(l >> OP_SH_VRR) & OP_MASK_VRR]); -+ break; -+ case 'D': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_fpr_names[(l >> OP_SH_VFD) & OP_MASK_VFD]); -+ break; -+ case 'S': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_fpr_names[(l >> OP_SH_VFS) & OP_MASK_VFS]); -+ break; -+ case 'T': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_fpr_names[(l >> OP_SH_VFT) & OP_MASK_VFT]); -+ break; -+ case 'R': -+ (*info->fprintf_func) -+ ( info->stream, "%s", -+ riscv_vec_fpr_names[(l >> OP_SH_VFR) & OP_MASK_VFR]); -+ break; -+ } -+ break; -+ -+ case ',': -+ case '(': -+ case ')': -+ case '[': -+ case ']': -+ (*info->fprintf_func) (info->stream, "%c", *d); -+ break; -+ -+ case '0': -+ break; -+ -+ case 'b': -+ case 's': -+ (*info->fprintf_func) (info->stream, "%s", riscv_gpr_names[rs1]); -+ break; -+ -+ case 't': -+ (*info->fprintf_func) (info->stream, "%s", -+ riscv_gpr_names[(l >> OP_SH_RS2) & OP_MASK_RS2]); -+ break; -+ -+ case 'u': -+ (*info->fprintf_func) (info->stream, "0x%x", (unsigned)EXTRACT_UTYPE_IMM (l) >> RISCV_IMM_BITS); -+ break; -+ -+ case 'm': -+ arg_print(info, (l >> OP_SH_RM) & OP_MASK_RM, -+ riscv_rm, ARRAY_SIZE(riscv_rm)); -+ break; -+ -+ case 'P': -+ arg_print(info, (l >> OP_SH_PRED) & OP_MASK_PRED, -+ riscv_pred_succ, ARRAY_SIZE(riscv_pred_succ)); -+ break; -+ -+ case 'Q': -+ arg_print(info, (l >> OP_SH_SUCC) & OP_MASK_SUCC, -+ riscv_pred_succ, ARRAY_SIZE(riscv_pred_succ)); -+ break; -+ -+ case 'o': -+ maybe_print_address (pd, rs1, EXTRACT_ITYPE_IMM (l)); -+ case 'j': -+ if ((l & MASK_ADDI) == MATCH_ADDI || (l & MASK_JALR) == MATCH_JALR) -+ maybe_print_address (pd, rs1, EXTRACT_ITYPE_IMM (l)); -+ (*info->fprintf_func) (info->stream, "%d", (int)EXTRACT_ITYPE_IMM (l)); -+ break; -+ -+ case 'q': -+ maybe_print_address (pd, rs1, EXTRACT_STYPE_IMM (l)); -+ (*info->fprintf_func) (info->stream, "%d", (int)EXTRACT_STYPE_IMM (l)); -+ break; -+ -+ case 'a': -+ info->target = EXTRACT_UJTYPE_IMM (l) + pc; -+ (*info->print_address_func) (info->target, info); -+ break; -+ -+ case 'p': -+ info->target = EXTRACT_SBTYPE_IMM (l) + pc; -+ (*info->print_address_func) (info->target, info); -+ break; -+ -+ case 'd': -+ if ((l & MASK_AUIPC) == MATCH_AUIPC) -+ pd->hi_addr[rd] = pc + EXTRACT_UTYPE_IMM (l); -+ else if ((l & MASK_LUI) == MATCH_LUI) -+ pd->hi_addr[rd] = EXTRACT_UTYPE_IMM (l); -+ (*info->fprintf_func) (info->stream, "%s", riscv_gpr_names[rd]); -+ break; -+ -+ case 'z': -+ (*info->fprintf_func) (info->stream, "%s", riscv_gpr_names[0]); -+ break; -+ -+ case '>': -+ (*info->fprintf_func) (info->stream, "0x%x", -+ (unsigned)((l >> OP_SH_SHAMT) & OP_MASK_SHAMT)); -+ break; -+ -+ case '<': -+ (*info->fprintf_func) (info->stream, "0x%x", -+ (unsigned)((l >> OP_SH_SHAMTW) & OP_MASK_SHAMTW)); -+ break; -+ -+ case 'S': -+ case 'U': -+ (*info->fprintf_func) (info->stream, "%s", riscv_fpr_names[rs1]); -+ break; -+ -+ case 'T': -+ (*info->fprintf_func) (info->stream, "%s", -+ riscv_fpr_names[(l >> OP_SH_RS2) & OP_MASK_RS2]); -+ break; -+ -+ case 'D': -+ (*info->fprintf_func) (info->stream, "%s", riscv_fpr_names[rd]); -+ break; -+ -+ case 'R': -+ (*info->fprintf_func) (info->stream, "%s", -+ riscv_fpr_names[(l >> OP_SH_RS3) & OP_MASK_RS3]); -+ break; -+ -+ case 'E': -+ { -+ const char* csr_name = NULL; -+ unsigned int csr = (l >> OP_SH_CSR) & OP_MASK_CSR; -+ switch (csr) -+ { -+ #define DECLARE_CSR(name, num) case num: csr_name = #name; break; -+ #include "opcode/riscv-opc.h" -+ #undef DECLARE_CSR -+ } -+ if (csr_name) -+ (*info->fprintf_func) (info->stream, "%s", csr_name); -+ else -+ (*info->fprintf_func) (info->stream, "0x%x", csr); -+ break; -+ } -+ -+ case 'Z': -+ (*info->fprintf_func) (info->stream, "%d", rs1); -+ break; -+ -+ default: -+ /* xgettext:c-format */ -+ (*info->fprintf_func) (info->stream, -+ _("# internal error, undefined modifier (%c)"), -+ *d); -+ return; -+ } -+ } -+} -+ -+/* Print the RISC-V instruction at address MEMADDR in debugged memory, -+ on using INFO. Returns length of the instruction, in bytes. -+ BIGENDIAN must be 1 if this is big-endian code, 0 if -+ this is little-endian code. */ -+ -+static int -+riscv_disassemble_insn (bfd_vma memaddr, insn_t word, disassemble_info *info) -+{ -+ const struct riscv_opcode *op; -+ static bfd_boolean init = 0; -+ static const char *extension = NULL; -+ static const struct riscv_opcode *riscv_hash[OP_MASK_OP + 1]; -+ struct riscv_private_data *pd; -+ int insnlen; -+ -+ /* Build a hash table to shorten the search time. */ -+ if (! init) -+ { -+ unsigned int i; -+ unsigned int e_flags = elf_elfheader (info->section->owner)->e_flags; -+ extension = riscv_elf_flag_to_name(EF_GET_RISCV_EXT(e_flags)); -+ -+ for (i = 0; i <= OP_MASK_OP; i++) -+ for (op = riscv_opcodes; op < &riscv_opcodes[NUMOPCODES]; op++) -+ if (i == ((op->match >> OP_SH_OP) & OP_MASK_OP)) -+ { -+ riscv_hash[i] = op; -+ break; -+ } -+ -+ init = 1; -+ } -+ -+ if (info->private_data == NULL) -+ { -+ int i; -+ -+ pd = info->private_data = calloc(1, sizeof (struct riscv_private_data)); -+ pd->gp = -1; -+ pd->print_addr = -1; -+ for (i = 0; i < (int) ARRAY_SIZE(pd->hi_addr); i++) -+ pd->hi_addr[i] = -1; -+ -+ for (i = 0; i < info->symtab_size; i++) -+ if (strcmp (bfd_asymbol_name (info->symtab[i]), "_gp") == 0) -+ pd->gp = bfd_asymbol_value (info->symtab[i]); -+ } -+ else -+ pd = info->private_data; -+ -+ insnlen = riscv_insn_length (word); -+ -+ info->bytes_per_chunk = insnlen % 4 == 0 ? 4 : 2; -+ info->bytes_per_line = 8; -+ info->display_endian = info->endian; -+ info->insn_info_valid = 1; -+ info->branch_delay_insns = 0; -+ info->data_size = 0; -+ info->insn_type = dis_nonbranch; -+ info->target = 0; -+ info->target2 = 0; -+ -+ op = riscv_hash[(word >> OP_SH_OP) & OP_MASK_OP]; -+ if (op != NULL) -+ { -+ for (; op < &riscv_opcodes[NUMOPCODES]; op++) -+ { -+ if ((op->match_func) (op, word) -+ && !(no_aliases && (op->pinfo & INSN_ALIAS)) -+ && !(op->subset[0] == 'X' && strcmp(op->subset, extension))) -+ { -+ (*info->fprintf_func) (info->stream, "%s", op->name); -+ print_insn_args (op->args, word, memaddr, info); -+ if (pd->print_addr != (bfd_vma)-1) -+ { -+ info->target = pd->print_addr; -+ (*info->fprintf_func) (info->stream, " # "); -+ (*info->print_address_func) (info->target, info); -+ pd->print_addr = -1; -+ } -+ return insnlen; -+ } -+ } -+ } -+ -+ /* Handle undefined instructions. */ -+ info->insn_type = dis_noninsn; -+ (*info->fprintf_func) (info->stream, "0x%llx", (unsigned long long)word); -+ return insnlen; -+} -+ -+int -+print_insn_riscv (bfd_vma memaddr, struct disassemble_info *info) -+{ -+ uint16_t i2; -+ insn_t insn = 0; -+ bfd_vma n; -+ int status; -+ -+ if (info->disassembler_options != NULL) -+ { -+ parse_riscv_dis_options (info->disassembler_options); -+ /* Avoid repeatedly parsing the options. */ -+ info->disassembler_options = NULL; -+ } -+ else if (riscv_gpr_names == NULL) -+ set_default_riscv_dis_options (); -+ -+ /* Instructions are a sequence of 2-byte packets in little-endian order. */ -+ for (n = 0; n < sizeof(insn) && n < riscv_insn_length (insn); n += 2) -+ { -+ status = (*info->read_memory_func) (memaddr + n, (bfd_byte*)&i2, 2, info); -+ if (status != 0) -+ { -+ if (n > 0) /* Don't fail just because we fell off the end. */ -+ break; -+ (*info->memory_error_func) (status, memaddr, info); -+ return status; -+ } -+ -+ i2 = bfd_getl16 (&i2); -+ insn |= (insn_t)i2 << (8*n); -+ } -+ -+ return riscv_disassemble_insn (memaddr, insn, info); -+} -+ -+void -+print_riscv_disassembler_options (FILE *stream) -+{ -+ fprintf (stream, _("\n\ -+The following RISC-V-specific disassembler options are supported for use\n\ -+with the -M switch (multiple options should be separated by commas):\n")); -+ -+ fprintf (stream, _("\n\ -+ numeric Print numeric reigster names, rather than ABI names.\n")); -+ -+ fprintf (stream, _("\n\ -+ no-aliases Disassemble only into canonical instructions, rather\n\ -+ than into pseudoinstructions.\n")); -+ -+ fprintf (stream, _("\n")); -+} -diff -rNU3 dist.orig/opcodes/riscv-opc.c dist/opcodes/riscv-opc.c ---- dist.orig/opcodes/riscv-opc.c 1970-01-01 01:00:00.000000000 +0100 -+++ dist/opcodes/riscv-opc.c 2015-10-18 13:11:20.000000000 +0200 -@@ -0,0 +1,734 @@ -+/* RISC-V opcode list -+ Copyright 2011-2014 Free Software Foundation, Inc. -+ -+ Contributed by Andrew Waterman (waterman@cs.berkeley.edu) at UC Berkeley. -+ Based on MIPS target. -+ -+ This file is part of the GNU opcodes library. -+ -+ This library is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3, or (at your option) -+ any later version. -+ -+ It is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -+ License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this file; see the file COPYING. If not, write to the -+ Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, -+ MA 02110-1301, USA. */ -+ -+#include "sysdep.h" -+#include "opcode/riscv.h" -+#include -+ -+/* Register names used by gas and objdump. */ -+ -+const char * const riscv_gpr_names_numeric[32] = -+{ -+ "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", -+ "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", -+ "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", -+ "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31" -+}; -+ -+const char * const riscv_gpr_names_abi[32] = { -+ "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", -+ "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5", -+ "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7", -+ "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6" -+}; -+ -+const char * const riscv_fpr_names_numeric[32] = -+{ -+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", -+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", -+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", -+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31" -+}; -+ -+const char * const riscv_fpr_names_abi[32] = { -+ "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", -+ "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", -+ "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", -+ "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11" -+}; -+ -+const char * const riscv_vec_gpr_names[32] = -+{ -+ "vx0", "vx1", "vx2", "vx3", "vx4", "vx5", "vx6", "vx7", -+ "vx8", "vx9", "vx10", "vx11", "vx12", "vx13", "vx14", "vx15", -+ "vx16", "vx17", "vx18", "vx19", "vx20", "vx21", "vx22", "vx23", -+ "vx24", "vx25", "vx26", "vx27", "vx28", "vx29", "vx30", "vx31" -+}; -+ -+const char * const riscv_vec_fpr_names[32] = -+{ -+ "vf0", "vf1", "vf2", "vf3", "vf4", "vf5", "vf6", "vf7", -+ "vf8", "vf9", "vf10", "vf11", "vf12", "vf13", "vf14", "vf15", -+ "vf16", "vf17", "vf18", "vf19", "vf20", "vf21", "vf22", "vf23", -+ "vf24", "vf25", "vf26", "vf27", "vf28", "vf29", "vf30", "vf31" -+}; -+ -+/* The order of overloaded instructions matters. Label arguments and -+ register arguments look the same. Instructions that can have either -+ for arguments must apear in the correct order in this table for the -+ assembler to pick the right one. In other words, entries with -+ immediate operands must apear after the same instruction with -+ registers. -+ -+ Because of the lookup algorithm used, entries with the same opcode -+ name must be contiguous. */ -+ -+#define WR_xd INSN_WRITE_GPR_D -+#define WR_fd INSN_WRITE_FPR_D -+#define RD_xs1 INSN_READ_GPR_S -+#define RD_xs2 INSN_READ_GPR_T -+#define RD_fs1 INSN_READ_FPR_S -+#define RD_fs2 INSN_READ_FPR_T -+#define RD_fs3 INSN_READ_FPR_R -+ -+#define MASK_RS1 (OP_MASK_RS1 << OP_SH_RS1) -+#define MASK_RS2 (OP_MASK_RS2 << OP_SH_RS2) -+#define MASK_RD (OP_MASK_RD << OP_SH_RD) -+#define MASK_IMM ENCODE_ITYPE_IMM(-1U) -+#define MASK_UIMM ENCODE_UTYPE_IMM(-1U) -+#define MASK_RM (OP_MASK_RM << OP_SH_RM) -+#define MASK_PRED (OP_MASK_PRED << OP_SH_PRED) -+#define MASK_SUCC (OP_MASK_SUCC << OP_SH_SUCC) -+#define MASK_AQ (OP_MASK_AQ << OP_SH_AQ) -+#define MASK_RL (OP_MASK_RL << OP_SH_RL) -+#define MASK_AQRL (MASK_AQ | MASK_RL) -+ -+static int match_opcode(const struct riscv_opcode *op, insn_t insn) -+{ -+ return (insn & op->mask) == op->match; -+} -+ -+static int match_never(const struct riscv_opcode *op ATTRIBUTE_UNUSED, -+ insn_t insn ATTRIBUTE_UNUSED) -+{ -+ return 0; -+} -+ -+static int match_rs1_eq_rs2(const struct riscv_opcode *op, insn_t insn) -+{ -+ return match_opcode(op, insn) && -+ ((insn & MASK_RS1) >> OP_SH_RS1) == ((insn & MASK_RS2) >> OP_SH_RS2); -+} -+ -+const struct riscv_opcode riscv_builtin_opcodes[] = -+{ -+/* These instructions appear first so that the disassembler will find -+ them first. The assemblers uses a hash table based on the -+ instruction name anyhow. */ -+/* name, isa, operands, match, mask, pinfo */ -+{"unimp", "I", "", 0, 0xffff, match_opcode, 0 }, -+{"nop", "I", "", MATCH_ADDI, MASK_ADDI | MASK_RD | MASK_RS1 | MASK_IMM, match_opcode, INSN_ALIAS }, -+{"li", "I", "d,j", MATCH_ADDI, MASK_ADDI | MASK_RS1, match_opcode, INSN_ALIAS|WR_xd }, /* addi */ -+{"li", "I", "d,I", 0, (int) M_LI, match_never, INSN_MACRO }, -+{"mv", "I", "d,s", MATCH_ADDI, MASK_ADDI | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"move", "I", "d,s", MATCH_ADDI, MASK_ADDI | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"andi", "I", "d,s,j", MATCH_ANDI, MASK_ANDI, match_opcode, WR_xd|RD_xs1 }, -+{"and", "I", "d,s,t", MATCH_AND, MASK_AND, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"and", "I", "d,s,j", MATCH_ANDI, MASK_ANDI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"beqz", "I", "s,p", MATCH_BEQ, MASK_BEQ | MASK_RS2, match_opcode, INSN_ALIAS|RD_xs1 }, -+{"beq", "I", "s,t,p", MATCH_BEQ, MASK_BEQ, match_opcode, RD_xs1|RD_xs2 }, -+{"blez", "I", "t,p", MATCH_BGE, MASK_BGE | MASK_RS1, match_opcode, INSN_ALIAS|RD_xs2 }, -+{"bgez", "I", "s,p", MATCH_BGE, MASK_BGE | MASK_RS2, match_opcode, INSN_ALIAS|RD_xs1 }, -+{"ble", "I", "t,s,p", MATCH_BGE, MASK_BGE, match_opcode, INSN_ALIAS|RD_xs1|RD_xs2 }, -+{"bleu", "I", "t,s,p", MATCH_BGEU, MASK_BGEU, match_opcode, INSN_ALIAS|RD_xs1|RD_xs2 }, -+{"bge", "I", "s,t,p", MATCH_BGE, MASK_BGE, match_opcode, RD_xs1|RD_xs2 }, -+{"bgeu", "I", "s,t,p", MATCH_BGEU, MASK_BGEU, match_opcode, RD_xs1|RD_xs2 }, -+{"bltz", "I", "s,p", MATCH_BLT, MASK_BLT | MASK_RS2, match_opcode, INSN_ALIAS|RD_xs1 }, -+{"bgtz", "I", "t,p", MATCH_BLT, MASK_BLT | MASK_RS1, match_opcode, INSN_ALIAS|RD_xs2 }, -+{"blt", "I", "s,t,p", MATCH_BLT, MASK_BLT, match_opcode, RD_xs1|RD_xs2 }, -+{"bltu", "I", "s,t,p", MATCH_BLTU, MASK_BLTU, match_opcode, RD_xs1|RD_xs2 }, -+{"bgt", "I", "t,s,p", MATCH_BLT, MASK_BLT, match_opcode, INSN_ALIAS|RD_xs1|RD_xs2 }, -+{"bgtu", "I", "t,s,p", MATCH_BLTU, MASK_BLTU, match_opcode, INSN_ALIAS|RD_xs1|RD_xs2 }, -+{"bnez", "I", "s,p", MATCH_BNE, MASK_BNE | MASK_RS2, match_opcode, INSN_ALIAS|RD_xs1 }, -+{"bne", "I", "s,t,p", MATCH_BNE, MASK_BNE, match_opcode, RD_xs1|RD_xs2 }, -+{"addi", "I", "d,s,j", MATCH_ADDI, MASK_ADDI, match_opcode, WR_xd|RD_xs1 }, -+{"add", "I", "d,s,t", MATCH_ADD, MASK_ADD, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"add", "I", "d,s,t,0",MATCH_ADD, MASK_ADD, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"add", "I", "d,s,j", MATCH_ADDI, MASK_ADDI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"la", "I", "d,A", 0, (int) M_LA, match_never, INSN_MACRO }, -+{"lla", "I", "d,A", 0, (int) M_LLA, match_never, INSN_MACRO }, -+{"la.tls.gd", "I", "d,A", 0, (int) M_LA_TLS_GD, match_never, INSN_MACRO }, -+{"la.tls.ie", "I", "d,A", 0, (int) M_LA_TLS_IE, match_never, INSN_MACRO }, -+{"neg", "I", "d,t", MATCH_SUB, MASK_SUB | MASK_RS1, match_opcode, INSN_ALIAS|WR_xd|RD_xs2 }, /* sub 0 */ -+{"slli", "I", "d,s,>", MATCH_SLLI, MASK_SLLI, match_opcode, WR_xd|RD_xs1 }, -+{"sll", "I", "d,s,t", MATCH_SLL, MASK_SLL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"sll", "I", "d,s,>", MATCH_SLLI, MASK_SLLI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"srli", "I", "d,s,>", MATCH_SRLI, MASK_SRLI, match_opcode, WR_xd|RD_xs1 }, -+{"srl", "I", "d,s,t", MATCH_SRL, MASK_SRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"srl", "I", "d,s,>", MATCH_SRLI, MASK_SRLI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"srai", "I", "d,s,>", MATCH_SRAI, MASK_SRAI, match_opcode, WR_xd|RD_xs1 }, -+{"sra", "I", "d,s,t", MATCH_SRA, MASK_SRA, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"sra", "I", "d,s,>", MATCH_SRAI, MASK_SRAI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"sub", "I", "d,s,t", MATCH_SUB, MASK_SUB, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"ret", "I", "", MATCH_JALR | (X_RA << OP_SH_RS1), MASK_JALR | MASK_RD | MASK_RS1 | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"j", "I", "a", MATCH_JAL, MASK_JAL | MASK_RD, match_opcode, INSN_ALIAS }, -+{"jal", "I", "a", MATCH_JAL | (X_RA << OP_SH_RD), MASK_JAL | MASK_RD, match_opcode, INSN_ALIAS|WR_xd }, -+{"jal", "I", "d,a", MATCH_JAL, MASK_JAL, match_opcode, WR_xd }, -+{"call", "I", "c", (X_T0 << OP_SH_RS1) | (X_RA << OP_SH_RD), (int) M_CALL, match_never, INSN_MACRO }, -+{"tail", "I", "c", (X_T0 << OP_SH_RS1), (int) M_CALL, match_never, INSN_MACRO }, -+{"jump", "I", "c,s", 0, (int) M_CALL, match_never, INSN_MACRO }, -+{"jr", "I", "s", MATCH_JALR, MASK_JALR | MASK_RD | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"jr", "I", "s,j", MATCH_JALR, MASK_JALR | MASK_RD, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"jalr", "I", "s", MATCH_JALR | (X_RA << OP_SH_RD), MASK_JALR | MASK_RD | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"jalr", "I", "s,j", MATCH_JALR | (X_RA << OP_SH_RD), MASK_JALR | MASK_RD, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"jalr", "I", "d,s", MATCH_JALR, MASK_JALR | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"jalr", "I", "d,s,j", MATCH_JALR, MASK_JALR, match_opcode, WR_xd|RD_xs1 }, -+{"lb", "I", "d,o(s)", MATCH_LB, MASK_LB, match_opcode, WR_xd|RD_xs1 }, -+{"lb", "I", "d,A", 0, (int) M_LB, match_never, INSN_MACRO }, -+{"lbu", "I", "d,o(s)", MATCH_LBU, MASK_LBU, match_opcode, WR_xd|RD_xs1 }, -+{"lbu", "I", "d,A", 0, (int) M_LBU, match_never, INSN_MACRO }, -+{"lh", "I", "d,o(s)", MATCH_LH, MASK_LH, match_opcode, WR_xd|RD_xs1 }, -+{"lh", "I", "d,A", 0, (int) M_LH, match_never, INSN_MACRO }, -+{"lhu", "I", "d,o(s)", MATCH_LHU, MASK_LHU, match_opcode, WR_xd|RD_xs1 }, -+{"lhu", "I", "d,A", 0, (int) M_LHU, match_never, INSN_MACRO }, -+{"lw", "I", "d,o(s)", MATCH_LW, MASK_LW, match_opcode, WR_xd|RD_xs1 }, -+{"lw", "I", "d,A", 0, (int) M_LW, match_never, INSN_MACRO }, -+{"lui", "I", "d,u", MATCH_LUI, MASK_LUI, match_opcode, WR_xd }, -+{"not", "I", "d,s", MATCH_XORI | MASK_IMM, MASK_XORI | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"ori", "I", "d,s,j", MATCH_ORI, MASK_ORI, match_opcode, WR_xd|RD_xs1 }, -+{"or", "I", "d,s,t", MATCH_OR, MASK_OR, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"or", "I", "d,s,j", MATCH_ORI, MASK_ORI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"auipc", "I", "d,u", MATCH_AUIPC, MASK_AUIPC, match_opcode, WR_xd }, -+{"seqz", "I", "d,s", MATCH_SLTIU | ENCODE_ITYPE_IMM(1), MASK_SLTIU | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"snez", "I", "d,t", MATCH_SLTU, MASK_SLTU | MASK_RS1, match_opcode, INSN_ALIAS|WR_xd|RD_xs2 }, -+{"sltz", "I", "d,s", MATCH_SLT, MASK_SLT | MASK_RS2, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"sgtz", "I", "d,t", MATCH_SLT, MASK_SLT | MASK_RS1, match_opcode, INSN_ALIAS|WR_xd|RD_xs2 }, -+{"slti", "I", "d,s,j", MATCH_SLTI, MASK_SLTI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"slt", "I", "d,s,t", MATCH_SLT, MASK_SLT, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"slt", "I", "d,s,j", MATCH_SLTI, MASK_SLTI, match_opcode, WR_xd|RD_xs1 }, -+{"sltiu", "I", "d,s,j", MATCH_SLTIU, MASK_SLTIU, match_opcode, WR_xd|RD_xs1 }, -+{"sltu", "I", "d,s,t", MATCH_SLTU, MASK_SLTU, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"sltu", "I", "d,s,j", MATCH_SLTIU, MASK_SLTIU, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"sgt", "I", "d,t,s", MATCH_SLT, MASK_SLT, match_opcode, INSN_ALIAS|WR_xd|RD_xs1|RD_xs2 }, -+{"sgtu", "I", "d,t,s", MATCH_SLTU, MASK_SLTU, match_opcode, INSN_ALIAS|WR_xd|RD_xs1|RD_xs2 }, -+{"sb", "I", "t,q(s)", MATCH_SB, MASK_SB, match_opcode, RD_xs1|RD_xs2 }, -+{"sb", "I", "t,A,s", 0, (int) M_SB, match_never, INSN_MACRO }, -+{"sh", "I", "t,q(s)", MATCH_SH, MASK_SH, match_opcode, RD_xs1|RD_xs2 }, -+{"sh", "I", "t,A,s", 0, (int) M_SH, match_never, INSN_MACRO }, -+{"sw", "I", "t,q(s)", MATCH_SW, MASK_SW, match_opcode, RD_xs1|RD_xs2 }, -+{"sw", "I", "t,A,s", 0, (int) M_SW, match_never, INSN_MACRO }, -+{"fence", "I", "", MATCH_FENCE | MASK_PRED | MASK_SUCC, MASK_FENCE | MASK_RD | MASK_RS1 | MASK_IMM, match_opcode, INSN_ALIAS }, -+{"fence", "I", "P,Q", MATCH_FENCE, MASK_FENCE | MASK_RD | MASK_RS1 | (MASK_IMM & ~MASK_PRED & ~MASK_SUCC), match_opcode, 0 }, -+{"fence.i", "I", "", MATCH_FENCE_I, MASK_FENCE | MASK_RD | MASK_RS1 | MASK_IMM, match_opcode, 0 }, -+{"rdcycle", "I", "d", MATCH_RDCYCLE, MASK_RDCYCLE, match_opcode, WR_xd }, -+{"rdinstret", "I", "d", MATCH_RDINSTRET, MASK_RDINSTRET, match_opcode, WR_xd }, -+{"rdtime", "I", "d", MATCH_RDTIME, MASK_RDTIME, match_opcode, WR_xd }, -+{"rdcycleh", "32I", "d", MATCH_RDCYCLEH, MASK_RDCYCLEH, match_opcode, WR_xd }, -+{"rdinstreth","32I", "d", MATCH_RDINSTRETH, MASK_RDINSTRETH, match_opcode, WR_xd }, -+{"rdtimeh", "32I", "d", MATCH_RDTIMEH, MASK_RDTIMEH, match_opcode, WR_xd }, -+{"sbreak", "I", "", MATCH_SBREAK, MASK_SBREAK, match_opcode, 0 }, -+{"scall", "I", "", MATCH_SCALL, MASK_SCALL, match_opcode, 0 }, -+{"ecall", "I", "", MATCH_SCALL, MASK_SCALL, match_opcode, 0 }, -+{"xori", "I", "d,s,j", MATCH_XORI, MASK_XORI, match_opcode, WR_xd|RD_xs1 }, -+{"xor", "I", "d,s,t", MATCH_XOR, MASK_XOR, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"xor", "I", "d,s,j", MATCH_XORI, MASK_XORI, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"lwu", "64I", "d,o(s)", MATCH_LWU, MASK_LWU, match_opcode, WR_xd|RD_xs1 }, -+{"lwu", "64I", "d,A", 0, (int) M_LWU, match_never, INSN_MACRO }, -+{"ld", "64I", "d,o(s)", MATCH_LD, MASK_LD, match_opcode, WR_xd|RD_xs1 }, -+{"ld", "64I", "d,A", 0, (int) M_LD, match_never, INSN_MACRO }, -+{"sd", "64I", "t,q(s)", MATCH_SD, MASK_SD, match_opcode, RD_xs1|RD_xs2 }, -+{"sd", "64I", "t,A,s", 0, (int) M_SD, match_never, INSN_MACRO }, -+{"sext.w", "64I", "d,s", MATCH_ADDIW, MASK_ADDIW | MASK_IMM, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"addiw", "64I", "d,s,j", MATCH_ADDIW, MASK_ADDIW, match_opcode, WR_xd|RD_xs1 }, -+{"addw", "64I", "d,s,t", MATCH_ADDW, MASK_ADDW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"addw", "64I", "d,s,j", MATCH_ADDIW, MASK_ADDIW, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"negw", "64I", "d,t", MATCH_SUBW, MASK_SUBW | MASK_RS1, match_opcode, INSN_ALIAS|WR_xd|RD_xs2 }, /* sub 0 */ -+{"slliw", "64I", "d,s,<", MATCH_SLLIW, MASK_SLLIW, match_opcode, WR_xd|RD_xs1 }, -+{"sllw", "64I", "d,s,t", MATCH_SLLW, MASK_SLLW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"sllw", "64I", "d,s,<", MATCH_SLLIW, MASK_SLLIW, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"srliw", "64I", "d,s,<", MATCH_SRLIW, MASK_SRLIW, match_opcode, WR_xd|RD_xs1 }, -+{"srlw", "64I", "d,s,t", MATCH_SRLW, MASK_SRLW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"srlw", "64I", "d,s,<", MATCH_SRLIW, MASK_SRLIW, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"sraiw", "64I", "d,s,<", MATCH_SRAIW, MASK_SRAIW, match_opcode, WR_xd|RD_xs1 }, -+{"sraw", "64I", "d,s,t", MATCH_SRAW, MASK_SRAW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"sraw", "64I", "d,s,<", MATCH_SRAIW, MASK_SRAIW, match_opcode, INSN_ALIAS|WR_xd|RD_xs1 }, -+{"subw", "64I", "d,s,t", MATCH_SUBW, MASK_SUBW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+ -+/* Atomic memory operation instruction subset */ -+{"lr.w", "A", "d,0(s)", MATCH_LR_W, MASK_LR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.w", "A", "d,t,0(s)", MATCH_SC_W, MASK_SC_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.w", "A", "d,t,0(s)", MATCH_AMOADD_W, MASK_AMOADD_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.w", "A", "d,t,0(s)", MATCH_AMOSWAP_W, MASK_AMOSWAP_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.w", "A", "d,t,0(s)", MATCH_AMOAND_W, MASK_AMOAND_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.w", "A", "d,t,0(s)", MATCH_AMOOR_W, MASK_AMOOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.w", "A", "d,t,0(s)", MATCH_AMOXOR_W, MASK_AMOXOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.w", "A", "d,t,0(s)", MATCH_AMOMAX_W, MASK_AMOMAX_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.w", "A", "d,t,0(s)", MATCH_AMOMAXU_W, MASK_AMOMAXU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.w", "A", "d,t,0(s)", MATCH_AMOMIN_W, MASK_AMOMIN_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.w", "A", "d,t,0(s)", MATCH_AMOMINU_W, MASK_AMOMINU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.w.aq", "A", "d,0(s)", MATCH_LR_W | MASK_AQ, MASK_LR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.w.aq", "A", "d,t,0(s)", MATCH_SC_W | MASK_AQ, MASK_SC_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.w.aq", "A", "d,t,0(s)", MATCH_AMOADD_W | MASK_AQ, MASK_AMOADD_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.w.aq", "A", "d,t,0(s)", MATCH_AMOSWAP_W | MASK_AQ, MASK_AMOSWAP_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.w.aq", "A", "d,t,0(s)", MATCH_AMOAND_W | MASK_AQ, MASK_AMOAND_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.w.aq", "A", "d,t,0(s)", MATCH_AMOOR_W | MASK_AQ, MASK_AMOOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.w.aq", "A", "d,t,0(s)", MATCH_AMOXOR_W | MASK_AQ, MASK_AMOXOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.w.aq", "A", "d,t,0(s)", MATCH_AMOMAX_W | MASK_AQ, MASK_AMOMAX_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.w.aq", "A", "d,t,0(s)", MATCH_AMOMAXU_W | MASK_AQ, MASK_AMOMAXU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.w.aq", "A", "d,t,0(s)", MATCH_AMOMIN_W | MASK_AQ, MASK_AMOMIN_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.w.aq", "A", "d,t,0(s)", MATCH_AMOMINU_W | MASK_AQ, MASK_AMOMINU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.w.rl", "A", "d,0(s)", MATCH_LR_W | MASK_RL, MASK_LR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.w.rl", "A", "d,t,0(s)", MATCH_SC_W | MASK_RL, MASK_SC_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.w.rl", "A", "d,t,0(s)", MATCH_AMOADD_W | MASK_RL, MASK_AMOADD_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.w.rl", "A", "d,t,0(s)", MATCH_AMOSWAP_W | MASK_RL, MASK_AMOSWAP_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.w.rl", "A", "d,t,0(s)", MATCH_AMOAND_W | MASK_RL, MASK_AMOAND_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.w.rl", "A", "d,t,0(s)", MATCH_AMOOR_W | MASK_RL, MASK_AMOOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.w.rl", "A", "d,t,0(s)", MATCH_AMOXOR_W | MASK_RL, MASK_AMOXOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.w.rl", "A", "d,t,0(s)", MATCH_AMOMAX_W | MASK_RL, MASK_AMOMAX_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.w.rl", "A", "d,t,0(s)", MATCH_AMOMAXU_W | MASK_RL, MASK_AMOMAXU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.w.rl", "A", "d,t,0(s)", MATCH_AMOMIN_W | MASK_RL, MASK_AMOMIN_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.w.rl", "A", "d,t,0(s)", MATCH_AMOMINU_W | MASK_RL, MASK_AMOMINU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.w.sc", "A", "d,0(s)", MATCH_LR_W | MASK_AQRL, MASK_LR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.w.sc", "A", "d,t,0(s)", MATCH_SC_W | MASK_AQRL, MASK_SC_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.w.sc", "A", "d,t,0(s)", MATCH_AMOADD_W | MASK_AQRL, MASK_AMOADD_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.w.sc", "A", "d,t,0(s)", MATCH_AMOSWAP_W | MASK_AQRL, MASK_AMOSWAP_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.w.sc", "A", "d,t,0(s)", MATCH_AMOAND_W | MASK_AQRL, MASK_AMOAND_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.w.sc", "A", "d,t,0(s)", MATCH_AMOOR_W | MASK_AQRL, MASK_AMOOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.w.sc", "A", "d,t,0(s)", MATCH_AMOXOR_W | MASK_AQRL, MASK_AMOXOR_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.w.sc", "A", "d,t,0(s)", MATCH_AMOMAX_W | MASK_AQRL, MASK_AMOMAX_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.w.sc", "A", "d,t,0(s)", MATCH_AMOMAXU_W | MASK_AQRL, MASK_AMOMAXU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.w.sc", "A", "d,t,0(s)", MATCH_AMOMIN_W | MASK_AQRL, MASK_AMOMIN_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.w.sc", "A", "d,t,0(s)", MATCH_AMOMINU_W | MASK_AQRL, MASK_AMOMINU_W | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.d", "64A", "d,0(s)", MATCH_LR_D, MASK_LR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.d", "64A", "d,t,0(s)", MATCH_SC_D, MASK_SC_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.d", "64A", "d,t,0(s)", MATCH_AMOADD_D, MASK_AMOADD_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.d", "64A", "d,t,0(s)", MATCH_AMOSWAP_D, MASK_AMOSWAP_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.d", "64A", "d,t,0(s)", MATCH_AMOAND_D, MASK_AMOAND_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.d", "64A", "d,t,0(s)", MATCH_AMOOR_D, MASK_AMOOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.d", "64A", "d,t,0(s)", MATCH_AMOXOR_D, MASK_AMOXOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.d", "64A", "d,t,0(s)", MATCH_AMOMAX_D, MASK_AMOMAX_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.d", "64A", "d,t,0(s)", MATCH_AMOMAXU_D, MASK_AMOMAXU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.d", "64A", "d,t,0(s)", MATCH_AMOMIN_D, MASK_AMOMIN_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.d", "64A", "d,t,0(s)", MATCH_AMOMINU_D, MASK_AMOMINU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.d.aq", "64A", "d,0(s)", MATCH_LR_D | MASK_AQ, MASK_LR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.d.aq", "64A", "d,t,0(s)", MATCH_SC_D | MASK_AQ, MASK_SC_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.d.aq", "64A", "d,t,0(s)", MATCH_AMOADD_D | MASK_AQ, MASK_AMOADD_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.d.aq", "64A", "d,t,0(s)", MATCH_AMOSWAP_D | MASK_AQ, MASK_AMOSWAP_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.d.aq", "64A", "d,t,0(s)", MATCH_AMOAND_D | MASK_AQ, MASK_AMOAND_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.d.aq", "64A", "d,t,0(s)", MATCH_AMOOR_D | MASK_AQ, MASK_AMOOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.d.aq", "64A", "d,t,0(s)", MATCH_AMOXOR_D | MASK_AQ, MASK_AMOXOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.d.aq", "64A", "d,t,0(s)", MATCH_AMOMAX_D | MASK_AQ, MASK_AMOMAX_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.d.aq", "64A", "d,t,0(s)", MATCH_AMOMAXU_D | MASK_AQ, MASK_AMOMAXU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.d.aq", "64A", "d,t,0(s)", MATCH_AMOMIN_D | MASK_AQ, MASK_AMOMIN_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.d.aq", "64A", "d,t,0(s)", MATCH_AMOMINU_D | MASK_AQ, MASK_AMOMINU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.d.rl", "64A", "d,0(s)", MATCH_LR_D | MASK_RL, MASK_LR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.d.rl", "64A", "d,t,0(s)", MATCH_SC_D | MASK_RL, MASK_SC_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.d.rl", "64A", "d,t,0(s)", MATCH_AMOADD_D | MASK_RL, MASK_AMOADD_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.d.rl", "64A", "d,t,0(s)", MATCH_AMOSWAP_D | MASK_RL, MASK_AMOSWAP_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.d.rl", "64A", "d,t,0(s)", MATCH_AMOAND_D | MASK_RL, MASK_AMOAND_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.d.rl", "64A", "d,t,0(s)", MATCH_AMOOR_D | MASK_RL, MASK_AMOOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.d.rl", "64A", "d,t,0(s)", MATCH_AMOXOR_D | MASK_RL, MASK_AMOXOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.d.rl", "64A", "d,t,0(s)", MATCH_AMOMAX_D | MASK_RL, MASK_AMOMAX_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.d.rl", "64A", "d,t,0(s)", MATCH_AMOMAXU_D | MASK_RL, MASK_AMOMAXU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.d.rl", "64A", "d,t,0(s)", MATCH_AMOMIN_D | MASK_RL, MASK_AMOMIN_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.d.rl", "64A", "d,t,0(s)", MATCH_AMOMINU_D | MASK_RL, MASK_AMOMINU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"lr.d.sc", "64A", "d,0(s)", MATCH_LR_D | MASK_AQRL, MASK_LR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1 }, -+{"sc.d.sc", "64A", "d,t,0(s)", MATCH_SC_D | MASK_AQRL, MASK_SC_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoadd.d.sc", "64A", "d,t,0(s)", MATCH_AMOADD_D | MASK_AQRL, MASK_AMOADD_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoswap.d.sc", "64A", "d,t,0(s)", MATCH_AMOSWAP_D | MASK_AQRL, MASK_AMOSWAP_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoand.d.sc", "64A", "d,t,0(s)", MATCH_AMOAND_D | MASK_AQRL, MASK_AMOAND_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoor.d.sc", "64A", "d,t,0(s)", MATCH_AMOOR_D | MASK_AQRL, MASK_AMOOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amoxor.d.sc", "64A", "d,t,0(s)", MATCH_AMOXOR_D | MASK_AQRL, MASK_AMOXOR_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomax.d.sc", "64A", "d,t,0(s)", MATCH_AMOMAX_D | MASK_AQRL, MASK_AMOMAX_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomaxu.d.sc", "64A", "d,t,0(s)", MATCH_AMOMAXU_D | MASK_AQRL, MASK_AMOMAXU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amomin.d.sc", "64A", "d,t,0(s)", MATCH_AMOMIN_D | MASK_AQRL, MASK_AMOMIN_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"amominu.d.sc", "64A", "d,t,0(s)", MATCH_AMOMINU_D | MASK_AQRL, MASK_AMOMINU_D | MASK_AQRL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+ -+/* Multiply/Divide instruction subset */ -+{"mul", "M", "d,s,t", MATCH_MUL, MASK_MUL, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"mulh", "M", "d,s,t", MATCH_MULH, MASK_MULH, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"mulhu", "M", "d,s,t", MATCH_MULHU, MASK_MULHU, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"mulhsu", "M", "d,s,t", MATCH_MULHSU, MASK_MULHSU, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"div", "M", "d,s,t", MATCH_DIV, MASK_DIV, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"divu", "M", "d,s,t", MATCH_DIVU, MASK_DIVU, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"rem", "M", "d,s,t", MATCH_REM, MASK_REM, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"remu", "M", "d,s,t", MATCH_REMU, MASK_REMU, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"mulw", "64M", "d,s,t", MATCH_MULW, MASK_MULW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"divw", "64M", "d,s,t", MATCH_DIVW, MASK_DIVW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"divuw", "64M", "d,s,t", MATCH_DIVUW, MASK_DIVUW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"remw", "64M", "d,s,t", MATCH_REMW, MASK_REMW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+{"remuw", "64M", "d,s,t", MATCH_REMUW, MASK_REMUW, match_opcode, WR_xd|RD_xs1|RD_xs2 }, -+ -+/* Single-precision floating-point instruction subset */ -+{"frsr", "F", "d", MATCH_FRCSR, MASK_FRCSR, match_opcode, WR_xd }, -+{"fssr", "F", "s", MATCH_FSCSR, MASK_FSCSR | MASK_RD, match_opcode, RD_xs1 }, -+{"fssr", "F", "d,s", MATCH_FSCSR, MASK_FSCSR, match_opcode, WR_xd|RD_xs1 }, -+{"frcsr", "F", "d", MATCH_FRCSR, MASK_FRCSR, match_opcode, WR_xd }, -+{"fscsr", "F", "s", MATCH_FSCSR, MASK_FSCSR | MASK_RD, match_opcode, RD_xs1 }, -+{"fscsr", "F", "d,s", MATCH_FSCSR, MASK_FSCSR, match_opcode, WR_xd|RD_xs1 }, -+{"frrm", "F", "d", MATCH_FRRM, MASK_FRRM, match_opcode, WR_xd }, -+{"fsrm", "F", "s", MATCH_FSRM, MASK_FSRM | MASK_RD, match_opcode, RD_xs1 }, -+{"fsrm", "F", "d,s", MATCH_FSRM, MASK_FSRM, match_opcode, WR_xd|RD_xs1 }, -+{"frflags", "F", "d", MATCH_FRFLAGS, MASK_FRFLAGS, match_opcode, WR_xd }, -+{"fsflags", "F", "s", MATCH_FSFLAGS, MASK_FSFLAGS | MASK_RD, match_opcode, RD_xs1 }, -+{"fsflags", "F", "d,s", MATCH_FSFLAGS, MASK_FSFLAGS, match_opcode, WR_xd|RD_xs1 }, -+{"flw", "F", "D,o(s)", MATCH_FLW, MASK_FLW, match_opcode, WR_fd|RD_xs1 }, -+{"flw", "F", "D,A,s", 0, (int) M_FLW, match_never, INSN_MACRO }, -+{"fsw", "F", "T,q(s)", MATCH_FSW, MASK_FSW, match_opcode, RD_xs1|RD_fs2 }, -+{"fsw", "F", "T,A,s", 0, (int) M_FSW, match_never, INSN_MACRO }, -+{"fmv.x.s", "F", "d,S", MATCH_FMV_X_S, MASK_FMV_X_S, match_opcode, WR_xd|RD_fs1 }, -+{"fmv.s.x", "F", "D,s", MATCH_FMV_S_X, MASK_FMV_S_X, match_opcode, WR_fd|RD_xs1 }, -+{"fmv.s", "F", "D,U", MATCH_FSGNJ_S, MASK_FSGNJ_S, match_rs1_eq_rs2, INSN_ALIAS|WR_fd|RD_fs1|RD_fs2 }, -+{"fneg.s", "F", "D,U", MATCH_FSGNJN_S, MASK_FSGNJN_S, match_rs1_eq_rs2, INSN_ALIAS|WR_fd|RD_fs1|RD_fs2 }, -+{"fabs.s", "F", "D,U", MATCH_FSGNJX_S, MASK_FSGNJX_S, match_rs1_eq_rs2, INSN_ALIAS|WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnj.s", "F", "D,S,T", MATCH_FSGNJ_S, MASK_FSGNJ_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnjn.s", "F", "D,S,T", MATCH_FSGNJN_S, MASK_FSGNJN_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnjx.s", "F", "D,S,T", MATCH_FSGNJX_S, MASK_FSGNJX_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fadd.s", "F", "D,S,T", MATCH_FADD_S | MASK_RM, MASK_FADD_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fadd.s", "F", "D,S,T,m", MATCH_FADD_S, MASK_FADD_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsub.s", "F", "D,S,T", MATCH_FSUB_S | MASK_RM, MASK_FSUB_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsub.s", "F", "D,S,T,m", MATCH_FSUB_S, MASK_FSUB_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmul.s", "F", "D,S,T", MATCH_FMUL_S | MASK_RM, MASK_FMUL_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmul.s", "F", "D,S,T,m", MATCH_FMUL_S, MASK_FMUL_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fdiv.s", "F", "D,S,T", MATCH_FDIV_S | MASK_RM, MASK_FDIV_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fdiv.s", "F", "D,S,T,m", MATCH_FDIV_S, MASK_FDIV_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsqrt.s", "F", "D,S", MATCH_FSQRT_S | MASK_RM, MASK_FSQRT_S | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fsqrt.s", "F", "D,S,m", MATCH_FSQRT_S, MASK_FSQRT_S, match_opcode, WR_fd|RD_fs1 }, -+{"fmin.s", "F", "D,S,T", MATCH_FMIN_S, MASK_FMIN_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmax.s", "F", "D,S,T", MATCH_FMAX_S, MASK_FMAX_S, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmadd.s", "F", "D,S,T,R", MATCH_FMADD_S | MASK_RM, MASK_FMADD_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmadd.s", "F", "D,S,T,R,m", MATCH_FMADD_S, MASK_FMADD_S, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmadd.s", "F", "D,S,T,R", MATCH_FNMADD_S | MASK_RM, MASK_FNMADD_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmadd.s", "F", "D,S,T,R,m", MATCH_FNMADD_S, MASK_FNMADD_S, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmsub.s", "F", "D,S,T,R", MATCH_FMSUB_S | MASK_RM, MASK_FMSUB_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmsub.s", "F", "D,S,T,R,m", MATCH_FMSUB_S, MASK_FMSUB_S, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmsub.s", "F", "D,S,T,R", MATCH_FNMSUB_S | MASK_RM, MASK_FNMSUB_S | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmsub.s", "F", "D,S,T,R,m", MATCH_FNMSUB_S, MASK_FNMSUB_S, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fcvt.w.s", "F", "d,S", MATCH_FCVT_W_S | MASK_RM, MASK_FCVT_W_S | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.w.s", "F", "d,S,m", MATCH_FCVT_W_S, MASK_FCVT_W_S, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.wu.s", "F", "d,S", MATCH_FCVT_WU_S | MASK_RM, MASK_FCVT_WU_S | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.wu.s", "F", "d,S,m", MATCH_FCVT_WU_S, MASK_FCVT_WU_S, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.s.w", "F", "D,s", MATCH_FCVT_S_W | MASK_RM, MASK_FCVT_S_W | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.s.w", "F", "D,s,m", MATCH_FCVT_S_W, MASK_FCVT_S_W, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.s.wu", "F", "D,s", MATCH_FCVT_S_WU | MASK_RM, MASK_FCVT_S_W | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.s.wu", "F", "D,s,m", MATCH_FCVT_S_WU, MASK_FCVT_S_WU, match_opcode, WR_fd|RD_xs1 }, -+{"fclass.s", "F", "d,S", MATCH_FCLASS_S, MASK_FCLASS_S, match_opcode, WR_xd|RD_fs1 }, -+{"feq.s", "F", "d,S,T", MATCH_FEQ_S, MASK_FEQ_S, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"flt.s", "F", "d,S,T", MATCH_FLT_S, MASK_FLT_S, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fle.s", "F", "d,S,T", MATCH_FLE_S, MASK_FLE_S, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fgt.s", "F", "d,T,S", MATCH_FLT_S, MASK_FLT_S, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fge.s", "F", "d,T,S", MATCH_FLE_S, MASK_FLE_S, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fcvt.l.s", "64F", "d,S", MATCH_FCVT_L_S | MASK_RM, MASK_FCVT_L_S | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.l.s", "64F", "d,S,m", MATCH_FCVT_L_S, MASK_FCVT_L_S, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.lu.s", "64F", "d,S", MATCH_FCVT_LU_S | MASK_RM, MASK_FCVT_LU_S | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.lu.s", "64F", "d,S,m", MATCH_FCVT_LU_S, MASK_FCVT_LU_S, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.s.l", "64F", "D,s", MATCH_FCVT_S_L | MASK_RM, MASK_FCVT_S_L | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.s.l", "64F", "D,s,m", MATCH_FCVT_S_L, MASK_FCVT_S_L, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.s.lu", "64F", "D,s", MATCH_FCVT_S_LU | MASK_RM, MASK_FCVT_S_L | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.s.lu", "64F", "D,s,m", MATCH_FCVT_S_LU, MASK_FCVT_S_LU, match_opcode, WR_fd|RD_xs1 }, -+ -+/* Double-precision floating-point instruction subset */ -+{"fld", "D", "D,o(s)", MATCH_FLD, MASK_FLD, match_opcode, WR_fd|RD_xs1 }, -+{"fld", "D", "D,A,s", 0, (int) M_FLD, match_never, INSN_MACRO }, -+{"fsd", "D", "T,q(s)", MATCH_FSD, MASK_FSD, match_opcode, RD_xs1|RD_fs2 }, -+{"fsd", "D", "T,A,s", 0, (int) M_FSD, match_never, INSN_MACRO }, -+{"fmv.d", "D", "D,U", MATCH_FSGNJ_D, MASK_FSGNJ_D, match_rs1_eq_rs2, INSN_ALIAS|WR_fd|RD_fs1|RD_fs2 }, -+{"fneg.d", "D", "D,U", MATCH_FSGNJN_D, MASK_FSGNJN_D, match_rs1_eq_rs2, INSN_ALIAS|WR_fd|RD_fs1|RD_fs2 }, -+{"fabs.d", "D", "D,U", MATCH_FSGNJX_D, MASK_FSGNJX_D, match_rs1_eq_rs2, INSN_ALIAS|WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnj.d", "D", "D,S,T", MATCH_FSGNJ_D, MASK_FSGNJ_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnjn.d", "D", "D,S,T", MATCH_FSGNJN_D, MASK_FSGNJN_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnjx.d", "D", "D,S,T", MATCH_FSGNJX_D, MASK_FSGNJX_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fadd.d", "D", "D,S,T", MATCH_FADD_D | MASK_RM, MASK_FADD_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fadd.d", "D", "D,S,T,m", MATCH_FADD_D, MASK_FADD_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsub.d", "D", "D,S,T", MATCH_FSUB_D | MASK_RM, MASK_FSUB_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsub.d", "D", "D,S,T,m", MATCH_FSUB_D, MASK_FSUB_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmul.d", "D", "D,S,T", MATCH_FMUL_D | MASK_RM, MASK_FMUL_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmul.d", "D", "D,S,T,m", MATCH_FMUL_D, MASK_FMUL_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fdiv.d", "D", "D,S,T", MATCH_FDIV_D | MASK_RM, MASK_FDIV_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fdiv.d", "D", "D,S,T,m", MATCH_FDIV_D, MASK_FDIV_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsqrt.d", "D", "D,S", MATCH_FSQRT_D | MASK_RM, MASK_FSQRT_D | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fsqrt.d", "D", "D,S,m", MATCH_FSQRT_D, MASK_FSQRT_D, match_opcode, WR_fd|RD_fs1 }, -+{"fmin.d", "D", "D,S,T", MATCH_FMIN_D, MASK_FMIN_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmax.d", "D", "D,S,T", MATCH_FMAX_D, MASK_FMAX_D, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmadd.d", "D", "D,S,T,R", MATCH_FMADD_D | MASK_RM, MASK_FMADD_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmadd.d", "D", "D,S,T,R,m", MATCH_FMADD_D, MASK_FMADD_D, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmadd.d", "D", "D,S,T,R", MATCH_FNMADD_D | MASK_RM, MASK_FNMADD_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmadd.d", "D", "D,S,T,R,m", MATCH_FNMADD_D, MASK_FNMADD_D, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmsub.d", "D", "D,S,T,R", MATCH_FMSUB_D | MASK_RM, MASK_FMSUB_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmsub.d", "D", "D,S,T,R,m", MATCH_FMSUB_D, MASK_FMSUB_D, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmsub.d", "D", "D,S,T,R", MATCH_FNMSUB_D | MASK_RM, MASK_FNMSUB_D | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmsub.d", "D", "D,S,T,R,m", MATCH_FNMSUB_D, MASK_FNMSUB_D, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fcvt.w.d", "D", "d,S", MATCH_FCVT_W_D | MASK_RM, MASK_FCVT_W_D | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.w.d", "D", "d,S,m", MATCH_FCVT_W_D, MASK_FCVT_W_D, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.wu.d", "D", "d,S", MATCH_FCVT_WU_D | MASK_RM, MASK_FCVT_WU_D | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.wu.d", "D", "d,S,m", MATCH_FCVT_WU_D, MASK_FCVT_WU_D, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.d.w", "D", "D,s", MATCH_FCVT_D_W, MASK_FCVT_D_W | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.d.wu", "D", "D,s", MATCH_FCVT_D_WU, MASK_FCVT_D_WU | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.d.s", "D", "D,S", MATCH_FCVT_D_S, MASK_FCVT_D_S | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.s.d", "D", "D,S", MATCH_FCVT_S_D | MASK_RM, MASK_FCVT_S_D | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.s.d", "D", "D,S,m", MATCH_FCVT_S_D, MASK_FCVT_S_D, match_opcode, WR_fd|RD_fs1 }, -+{"fclass.d", "D", "d,S", MATCH_FCLASS_D, MASK_FCLASS_D, match_opcode, WR_xd|RD_fs1 }, -+{"feq.d", "D", "d,S,T", MATCH_FEQ_D, MASK_FEQ_D, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"flt.d", "D", "d,S,T", MATCH_FLT_D, MASK_FLT_D, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fle.d", "D", "d,S,T", MATCH_FLE_D, MASK_FLE_D, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fgt.d", "D", "d,T,S", MATCH_FLT_D, MASK_FLT_D, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fge.d", "D", "d,T,S", MATCH_FLE_D, MASK_FLE_D, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fmv.x.d", "64D", "d,S", MATCH_FMV_X_D, MASK_FMV_X_D, match_opcode, WR_xd|RD_fs1 }, -+{"fmv.d.x", "64D", "D,s", MATCH_FMV_D_X, MASK_FMV_D_X, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.l.d", "64D", "d,S", MATCH_FCVT_L_D | MASK_RM, MASK_FCVT_L_D | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.l.d", "64D", "d,S,m", MATCH_FCVT_L_D, MASK_FCVT_L_D, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.lu.d", "64D", "d,S", MATCH_FCVT_LU_D | MASK_RM, MASK_FCVT_LU_D | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.lu.d", "64D", "d,S,m", MATCH_FCVT_LU_D, MASK_FCVT_LU_D, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.d.l", "64D", "D,s", MATCH_FCVT_D_L | MASK_RM, MASK_FCVT_D_L | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.d.l", "64D", "D,s,m", MATCH_FCVT_D_L, MASK_FCVT_D_L, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.d.lu", "64D", "D,s", MATCH_FCVT_D_LU | MASK_RM, MASK_FCVT_D_L | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.d.lu", "64D", "D,s,m", MATCH_FCVT_D_LU, MASK_FCVT_D_LU, match_opcode, WR_fd|RD_xs1 }, -+ -+/* Supervisor instructions */ -+{"csrr", "I", "d,E", MATCH_CSRRS, MASK_CSRRS | MASK_RS1, match_opcode, WR_xd }, -+{"csrwi", "I", "E,Z", MATCH_CSRRWI, MASK_CSRRWI | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrw", "I", "E,s", MATCH_CSRRW, MASK_CSRRW | MASK_RD, match_opcode, RD_xs1 }, -+{"csrw", "I", "E,Z", MATCH_CSRRWI, MASK_CSRRWI | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrsi", "I", "E,Z", MATCH_CSRRSI, MASK_CSRRSI | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrs", "I", "E,s", MATCH_CSRRS, MASK_CSRRS | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrs", "I", "E,Z", MATCH_CSRRSI, MASK_CSRRSI | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrci", "I", "E,Z", MATCH_CSRRCI, MASK_CSRRCI | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrc", "I", "E,s", MATCH_CSRRC, MASK_CSRRC | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrc", "I", "E,Z", MATCH_CSRRCI, MASK_CSRRCI | MASK_RD, match_opcode, WR_xd|RD_xs1 }, -+{"csrrw", "I", "d,E,s", MATCH_CSRRW, MASK_CSRRW, match_opcode, WR_xd|RD_xs1 }, -+{"csrrw", "I", "d,E,Z", MATCH_CSRRWI, MASK_CSRRWI, match_opcode, WR_xd|RD_xs1 }, -+{"csrrs", "I", "d,E,s", MATCH_CSRRS, MASK_CSRRS, match_opcode, WR_xd|RD_xs1 }, -+{"csrrs", "I", "d,E,Z", MATCH_CSRRSI, MASK_CSRRSI, match_opcode, WR_xd|RD_xs1 }, -+{"csrrc", "I", "d,E,s", MATCH_CSRRC, MASK_CSRRC, match_opcode, WR_xd|RD_xs1 }, -+{"csrrc", "I", "d,E,Z", MATCH_CSRRCI, MASK_CSRRCI, match_opcode, WR_xd|RD_xs1 }, -+{"csrrwi", "I", "d,E,Z", MATCH_CSRRWI, MASK_CSRRWI, match_opcode, WR_xd|RD_xs1 }, -+{"csrrsi", "I", "d,E,Z", MATCH_CSRRSI, MASK_CSRRSI, match_opcode, WR_xd|RD_xs1 }, -+{"csrrci", "I", "d,E,Z", MATCH_CSRRCI, MASK_CSRRCI, match_opcode, WR_xd|RD_xs1 }, -+{"sret", "I", "", MATCH_SRET, MASK_SRET, match_opcode, 0 }, -+{"eret", "I", "", MATCH_SRET, MASK_SRET, match_opcode, 0 }, -+{"mrts", "I", "", MATCH_MRTS, MASK_MRTS, match_opcode, 0 }, -+{"sfence.vm", "I", "", MATCH_SFENCE_VM | MASK_RS1, MASK_SFENCE_VM | MASK_RS1, match_opcode, 0 }, -+{"sfence.vm", "I", "s", MATCH_SFENCE_VM, MASK_SFENCE_VM, match_opcode, RD_xs1 }, -+ -+/* Half-precision floating-point instruction subset */ -+{"flh", "Xhwacha", "D,o(s)", MATCH_FLH, MASK_FLH, match_opcode, WR_fd|RD_xs1 }, -+{"fsh", "Xhwacha", "T,q(s)", MATCH_FSH, MASK_FSH, match_opcode, RD_xs1|RD_fs2 }, -+{"fsgnj.h", "Xhwacha", "D,S,T", MATCH_FSGNJ_H, MASK_FSGNJ_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnjn.h", "Xhwacha", "D,S,T", MATCH_FSGNJN_H, MASK_FSGNJN_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsgnjx.h", "Xhwacha", "D,S,T", MATCH_FSGNJX_H, MASK_FSGNJX_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fadd.h", "Xhwacha", "D,S,T", MATCH_FADD_H | MASK_RM, MASK_FADD_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fadd.h", "Xhwacha", "D,S,T,m", MATCH_FADD_H, MASK_FADD_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsub.h", "Xhwacha", "D,S,T", MATCH_FSUB_H | MASK_RM, MASK_FSUB_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsub.h", "Xhwacha", "D,S,T,m", MATCH_FSUB_H, MASK_FSUB_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmul.h", "Xhwacha", "D,S,T", MATCH_FMUL_H | MASK_RM, MASK_FMUL_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmul.h", "Xhwacha", "D,S,T,m", MATCH_FMUL_H, MASK_FMUL_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fdiv.h", "Xhwacha", "D,S,T", MATCH_FDIV_H | MASK_RM, MASK_FDIV_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fdiv.h", "Xhwacha", "D,S,T,m", MATCH_FDIV_H, MASK_FDIV_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fsqrt.h", "Xhwacha", "D,S", MATCH_FSQRT_H | MASK_RM, MASK_FSQRT_H | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fsqrt.h", "Xhwacha", "D,S,m", MATCH_FSQRT_H, MASK_FSQRT_H, match_opcode, WR_fd|RD_fs1 }, -+{"fmin.h", "Xhwacha", "D,S,T", MATCH_FMIN_H, MASK_FMIN_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmax.h", "Xhwacha", "D,S,T", MATCH_FMAX_H, MASK_FMAX_H, match_opcode, WR_fd|RD_fs1|RD_fs2 }, -+{"fmadd.h", "Xhwacha", "D,S,T,R", MATCH_FMADD_H | MASK_RM, MASK_FMADD_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmadd.h", "Xhwacha", "D,S,T,R,m", MATCH_FMADD_H, MASK_FMADD_H, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmadd.h", "Xhwacha", "D,S,T,R", MATCH_FNMADD_H | MASK_RM, MASK_FNMADD_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmadd.h", "Xhwacha", "D,S,T,R,m", MATCH_FNMADD_H, MASK_FNMADD_H, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmsub.h", "Xhwacha", "D,S,T,R", MATCH_FMSUB_H | MASK_RM, MASK_FMSUB_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fmsub.h", "Xhwacha", "D,S,T,R,m", MATCH_FMSUB_H, MASK_FMSUB_H, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmsub.h", "Xhwacha", "D,S,T,R", MATCH_FNMSUB_H | MASK_RM, MASK_FNMSUB_H | MASK_RM, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fnmsub.h", "Xhwacha", "D,S,T,R,m", MATCH_FNMSUB_H, MASK_FNMSUB_H, match_opcode, WR_fd|RD_fs1|RD_fs2|RD_fs3 }, -+{"fcvt.s.h", "Xhwacha", "D,S", MATCH_FCVT_S_H, MASK_FCVT_S_H | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.h.s", "Xhwacha", "D,S", MATCH_FCVT_H_S | MASK_RM, MASK_FCVT_H_S | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.h.s", "Xhwacha", "D,S,m", MATCH_FCVT_H_S, MASK_FCVT_H_S, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.d.h", "Xhwacha", "D,S", MATCH_FCVT_D_H, MASK_FCVT_D_H | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.h.d", "Xhwacha", "D,S", MATCH_FCVT_H_D | MASK_RM, MASK_FCVT_H_D | MASK_RM, match_opcode, WR_fd|RD_fs1 }, -+{"fcvt.h.d", "Xhwacha", "D,S,m", MATCH_FCVT_H_D, MASK_FCVT_H_D, match_opcode, WR_fd|RD_fs1 }, -+{"feq.h", "Xhwacha", "d,S,T", MATCH_FEQ_H, MASK_FEQ_H, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"flt.h", "Xhwacha", "d,S,T", MATCH_FLT_H, MASK_FLT_H, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fle.h", "Xhwacha", "d,S,T", MATCH_FLE_H, MASK_FLE_H, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fgt.h", "Xhwacha", "d,T,S", MATCH_FLT_H, MASK_FLT_H, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fge.h", "Xhwacha", "d,T,S", MATCH_FLE_H, MASK_FLE_H, match_opcode, WR_xd|RD_fs1|RD_fs2 }, -+{"fmv.x.h", "Xhwacha", "d,S", MATCH_FMV_X_H, MASK_FMV_X_H, match_opcode, WR_xd|RD_fs1 }, -+{"fmv.h.x", "Xhwacha", "D,s", MATCH_FMV_H_X, MASK_FMV_H_X, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.w.h", "Xhwacha", "d,S", MATCH_FCVT_W_H | MASK_RM, MASK_FCVT_W_H | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.w.h", "Xhwacha", "d,S,m", MATCH_FCVT_W_H, MASK_FCVT_W_H, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.wu.h", "Xhwacha", "d,S", MATCH_FCVT_WU_H | MASK_RM, MASK_FCVT_WU_H | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.wu.h", "Xhwacha", "d,S,m", MATCH_FCVT_WU_H, MASK_FCVT_WU_H, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.h.w", "Xhwacha", "D,s", MATCH_FCVT_H_W, MASK_FCVT_H_W | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.h.wu", "Xhwacha", "D,s", MATCH_FCVT_H_WU, MASK_FCVT_H_WU | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.l.h", "Xhwacha", "d,S", MATCH_FCVT_L_H | MASK_RM, MASK_FCVT_L_H | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.l.h", "Xhwacha", "d,S,m", MATCH_FCVT_L_H, MASK_FCVT_L_H, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.lu.h", "Xhwacha", "d,S", MATCH_FCVT_LU_H | MASK_RM, MASK_FCVT_LU_H | MASK_RM, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.lu.h", "Xhwacha", "d,S,m", MATCH_FCVT_LU_H, MASK_FCVT_LU_H, match_opcode, WR_xd|RD_fs1 }, -+{"fcvt.h.l", "Xhwacha", "D,s", MATCH_FCVT_H_L | MASK_RM, MASK_FCVT_H_L | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.h.l", "Xhwacha", "D,s,m", MATCH_FCVT_H_L, MASK_FCVT_H_L, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.h.lu", "Xhwacha", "D,s", MATCH_FCVT_H_LU | MASK_RM, MASK_FCVT_H_L | MASK_RM, match_opcode, WR_fd|RD_xs1 }, -+{"fcvt.h.lu", "Xhwacha", "D,s,m", MATCH_FCVT_H_LU, MASK_FCVT_H_LU, match_opcode, WR_fd|RD_xs1 }, -+ -+/* Rocket Custom Coprocessor extension */ -+{"custom0", "Xcustom", "d,s,t,^j", MATCH_CUSTOM0_RD_RS1_RS2, MASK_CUSTOM0_RD_RS1_RS2, match_opcode, 0}, -+{"custom0", "Xcustom", "d,s,^t,^j", MATCH_CUSTOM0_RD_RS1, MASK_CUSTOM0_RD_RS1, match_opcode, 0}, -+{"custom0", "Xcustom", "d,^s,^t,^j", MATCH_CUSTOM0_RD, MASK_CUSTOM0_RD, match_opcode, 0}, -+{"custom0", "Xcustom", "^d,s,t,^j", MATCH_CUSTOM0_RS1_RS2, MASK_CUSTOM0_RS1_RS2, match_opcode, 0}, -+{"custom0", "Xcustom", "^d,s,^t,^j", MATCH_CUSTOM0_RS1, MASK_CUSTOM0_RS1, match_opcode, 0}, -+{"custom0", "Xcustom", "^d,^s,^t,^j", MATCH_CUSTOM0, MASK_CUSTOM0, match_opcode, 0}, -+{"custom1", "Xcustom", "d,s,t,^j", MATCH_CUSTOM1_RD_RS1_RS2, MASK_CUSTOM1_RD_RS1_RS2, match_opcode, 0}, -+{"custom1", "Xcustom", "d,s,^t,^j", MATCH_CUSTOM1_RD_RS1, MASK_CUSTOM1_RD_RS1, match_opcode, 0}, -+{"custom1", "Xcustom", "d,^s,^t,^j", MATCH_CUSTOM1_RD, MASK_CUSTOM1_RD, match_opcode, 0}, -+{"custom1", "Xcustom", "^d,s,t,^j", MATCH_CUSTOM1_RS1_RS2, MASK_CUSTOM1_RS1_RS2, match_opcode, 0}, -+{"custom1", "Xcustom", "^d,s,^t,^j", MATCH_CUSTOM1_RS1, MASK_CUSTOM1_RS1, match_opcode, 0}, -+{"custom1", "Xcustom", "^d,^s,^t,^j", MATCH_CUSTOM1, MASK_CUSTOM1, match_opcode, 0}, -+{"custom2", "Xcustom", "d,s,t,^j", MATCH_CUSTOM2_RD_RS1_RS2, MASK_CUSTOM2_RD_RS1_RS2, match_opcode, 0}, -+{"custom2", "Xcustom", "d,s,^t,^j", MATCH_CUSTOM2_RD_RS1, MASK_CUSTOM2_RD_RS1, match_opcode, 0}, -+{"custom2", "Xcustom", "d,^s,^t,^j", MATCH_CUSTOM2_RD, MASK_CUSTOM2_RD, match_opcode, 0}, -+{"custom2", "Xcustom", "^d,s,t,^j", MATCH_CUSTOM2_RS1_RS2, MASK_CUSTOM2_RS1_RS2, match_opcode, 0}, -+{"custom2", "Xcustom", "^d,s,^t,^j", MATCH_CUSTOM2_RS1, MASK_CUSTOM2_RS1, match_opcode, 0}, -+{"custom2", "Xcustom", "^d,^s,^t,^j", MATCH_CUSTOM2, MASK_CUSTOM2, match_opcode, 0}, -+{"custom3", "Xcustom", "d,s,t,^j", MATCH_CUSTOM3_RD_RS1_RS2, MASK_CUSTOM3_RD_RS1_RS2, match_opcode, 0}, -+{"custom3", "Xcustom", "d,s,^t,^j", MATCH_CUSTOM3_RD_RS1, MASK_CUSTOM3_RD_RS1, match_opcode, 0}, -+{"custom3", "Xcustom", "d,^s,^t,^j", MATCH_CUSTOM3_RD, MASK_CUSTOM3_RD, match_opcode, 0}, -+{"custom3", "Xcustom", "^d,s,t,^j", MATCH_CUSTOM3_RS1_RS2, MASK_CUSTOM3_RS1_RS2, match_opcode, 0}, -+{"custom3", "Xcustom", "^d,s,^t,^j", MATCH_CUSTOM3_RS1, MASK_CUSTOM3_RS1, match_opcode, 0}, -+{"custom3", "Xcustom", "^d,^s,^t,^j", MATCH_CUSTOM3, MASK_CUSTOM3, match_opcode, 0}, -+ -+/* Xhwacha extension */ -+{"stop", "Xhwacha", "", MATCH_STOP, MASK_STOP, match_opcode, 0}, -+{"utidx", "Xhwacha", "d", MATCH_UTIDX, MASK_UTIDX, match_opcode, WR_xd}, -+{"movz", "Xhwacha", "d,s,t", MATCH_MOVZ, MASK_MOVZ, match_opcode, WR_xd|RD_xs1|RD_xs2}, -+{"movn", "Xhwacha", "d,s,t", MATCH_MOVN, MASK_MOVN, match_opcode, WR_xd|RD_xs1|RD_xs2}, -+{"fmovz", "Xhwacha", "D,s,T", MATCH_FMOVZ, MASK_FMOVZ, match_opcode, WR_fd|RD_xs1|RD_fs2}, -+{"fmovn", "Xhwacha", "D,s,T", MATCH_FMOVN, MASK_FMOVN, match_opcode, WR_fd|RD_xs1|RD_fs2}, -+ -+/* unit stride */ -+/* xloads */ -+{"vld", "Xhwacha", "#d,s", MATCH_VLD, MASK_VLD, match_opcode, 0}, -+{"vlw", "Xhwacha", "#d,s", MATCH_VLW, MASK_VLW, match_opcode, 0}, -+{"vlwu", "Xhwacha", "#d,s", MATCH_VLWU, MASK_VLWU, match_opcode, 0}, -+{"vlh", "Xhwacha", "#d,s", MATCH_VLH, MASK_VLH, match_opcode, 0}, -+{"vlhu", "Xhwacha", "#d,s", MATCH_VLHU, MASK_VLHU, match_opcode, 0}, -+{"vlb", "Xhwacha", "#d,s", MATCH_VLB, MASK_VLB, match_opcode, 0}, -+{"vlbu", "Xhwacha", "#d,s", MATCH_VLBU, MASK_VLBU, match_opcode, 0}, -+/* floads */ -+{"vfld", "Xhwacha", "#D,s", MATCH_VFLD, MASK_VFLD, match_opcode, 0}, -+{"vflw", "Xhwacha", "#D,s", MATCH_VFLW, MASK_VFLW, match_opcode, 0}, -+ -+/* stride */ -+/* xloads */ -+{"vlstd", "Xhwacha", "#d,s,t", MATCH_VLSTD, MASK_VLSTD, match_opcode, 0}, -+{"vlstw", "Xhwacha", "#d,s,t", MATCH_VLSTW, MASK_VLSTW, match_opcode, 0}, -+{"vlstwu", "Xhwacha", "#d,s,t", MATCH_VLSTWU, MASK_VLSTWU, match_opcode, 0}, -+{"vlsth", "Xhwacha", "#d,s,t", MATCH_VLSTH, MASK_VLSTH, match_opcode, 0}, -+{"vlsthu", "Xhwacha", "#d,s,t", MATCH_VLSTHU, MASK_VLSTHU, match_opcode, 0}, -+{"vlstb", "Xhwacha", "#d,s,t", MATCH_VLSTB, MASK_VLSTB, match_opcode, 0}, -+{"vlstbu", "Xhwacha", "#d,s,t", MATCH_VLSTBU, MASK_VLSTBU, match_opcode, 0}, -+/* floads */ -+{"vflstd", "Xhwacha", "#D,s,t", MATCH_VFLSTD, MASK_VFLSTD, match_opcode, 0}, -+{"vflstw", "Xhwacha", "#D,s,t", MATCH_VFLSTW, MASK_VFLSTW, match_opcode, 0}, -+ -+/* segment */ -+/* xloads */ -+{"vlsegd", "Xhwacha", "#d,s,#n", MATCH_VLSEGD, MASK_VLSEGD, match_opcode, 0}, -+{"vlsegw", "Xhwacha", "#d,s,#n", MATCH_VLSEGW, MASK_VLSEGW, match_opcode, 0}, -+{"vlsegwu", "Xhwacha", "#d,s,#n", MATCH_VLSEGWU, MASK_VLSEGWU, match_opcode, 0}, -+{"vlsegh", "Xhwacha", "#d,s,#n", MATCH_VLSEGH, MASK_VLSEGH, match_opcode, 0}, -+{"vlseghu", "Xhwacha", "#d,s,#n", MATCH_VLSEGHU, MASK_VLSEGHU, match_opcode, 0}, -+{"vlsegb", "Xhwacha", "#d,s,#n", MATCH_VLSEGB, MASK_VLSEGB, match_opcode, 0}, -+{"vlsegbu", "Xhwacha", "#d,s,#n", MATCH_VLSEGBU, MASK_VLSEGBU, match_opcode, 0}, -+/* floads */ -+{"vflsegd", "Xhwacha", "#D,s,#n", MATCH_VFLSEGD, MASK_VFLSEGD, match_opcode, 0}, -+{"vflsegw", "Xhwacha", "#D,s,#n", MATCH_VFLSEGW, MASK_VFLSEGW, match_opcode, 0}, -+ -+/* stride segment */ -+/* xloads */ -+{"vlsegstd", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTD, MASK_VLSEGSTD, match_opcode, 0}, -+{"vlsegstw", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTW, MASK_VLSEGSTW, match_opcode, 0}, -+{"vlsegstwu", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTWU, MASK_VLSEGSTWU, match_opcode, 0}, -+{"vlsegsth", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTH, MASK_VLSEGSTH, match_opcode, 0}, -+{"vlsegsthu", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTHU, MASK_VLSEGSTHU, match_opcode, 0}, -+{"vlsegstb", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTB, MASK_VLSEGSTB, match_opcode, 0}, -+{"vlsegstbu", "Xhwacha", "#d,s,t,#n", MATCH_VLSEGSTBU, MASK_VLSEGSTBU, match_opcode, 0}, -+/* floads */ -+{"vflsegstd", "Xhwacha", "#D,s,t,#n", MATCH_VFLSEGSTD, MASK_VFLSEGSTD, match_opcode, 0}, -+{"vflsegstw", "Xhwacha", "#D,s,t,#n", MATCH_VFLSEGSTW, MASK_VFLSEGSTW, match_opcode, 0}, -+ -+/* unit stride */ -+/* xstores */ -+{"vsd", "Xhwacha", "#d,s", MATCH_VSD, MASK_VSD, match_opcode, 0}, -+{"vsw", "Xhwacha", "#d,s", MATCH_VSW, MASK_VSW, match_opcode, 0}, -+{"vsh", "Xhwacha", "#d,s", MATCH_VSH, MASK_VSH, match_opcode, 0}, -+{"vsb", "Xhwacha", "#d,s", MATCH_VSB, MASK_VSB, match_opcode, 0}, -+/* fstores */ -+{"vfsd", "Xhwacha", "#D,s", MATCH_VFSD, MASK_VFSD, match_opcode, 0}, -+{"vfsw", "Xhwacha", "#D,s", MATCH_VFSW, MASK_VFSW, match_opcode, 0}, -+ -+/* stride */ -+/* xstores */ -+{"vsstd", "Xhwacha", "#d,s,t", MATCH_VSSTD, MASK_VSSTD, match_opcode, 0}, -+{"vsstw", "Xhwacha", "#d,s,t", MATCH_VSSTW, MASK_VSSTW, match_opcode, 0}, -+{"vssth", "Xhwacha", "#d,s,t", MATCH_VSSTH, MASK_VSSTH, match_opcode, 0}, -+{"vsstb", "Xhwacha", "#d,s,t", MATCH_VSSTB, MASK_VSSTB, match_opcode, 0}, -+/* fstores */ -+{"vfsstd", "Xhwacha", "#D,s,t", MATCH_VFSSTD, MASK_VFSSTD, match_opcode, 0}, -+{"vfsstw", "Xhwacha", "#D,s,t", MATCH_VFSSTW, MASK_VFSSTW, match_opcode, 0}, -+ -+/* segment */ -+/* xstores */ -+{"vssegd", "Xhwacha", "#d,s,#n", MATCH_VSSEGD, MASK_VSSEGD, match_opcode, 0}, -+{"vssegw", "Xhwacha", "#d,s,#n", MATCH_VSSEGW, MASK_VSSEGW, match_opcode, 0}, -+{"vssegh", "Xhwacha", "#d,s,#n", MATCH_VSSEGH, MASK_VSSEGH, match_opcode, 0}, -+{"vssegb", "Xhwacha", "#d,s,#n", MATCH_VSSEGB, MASK_VSSEGB, match_opcode, 0}, -+/* fstores */ -+{"vfssegd", "Xhwacha", "#D,s,#n", MATCH_VFSSEGD, MASK_VFSSEGD, match_opcode, 0}, -+{"vfssegw", "Xhwacha", "#D,s,#n", MATCH_VFSSEGW, MASK_VFSSEGW, match_opcode, 0}, -+ -+/* stride segment */ -+/* xsegstores */ -+{"vssegstd", "Xhwacha", "#d,s,t,#n", MATCH_VSSEGSTD, MASK_VSSEGSTD, match_opcode, 0}, -+{"vssegstw", "Xhwacha", "#d,s,t,#n", MATCH_VSSEGSTW, MASK_VSSEGSTW, match_opcode, 0}, -+{"vssegsth", "Xhwacha", "#d,s,t,#n", MATCH_VSSEGSTH, MASK_VSSEGSTH, match_opcode, 0}, -+{"vssegstb", "Xhwacha", "#d,s,t,#n", MATCH_VSSEGSTB, MASK_VSSEGSTB, match_opcode, 0}, -+/* fsegstores */ -+{"vfssegstd", "Xhwacha", "#D,s,t,#n", MATCH_VFSSEGSTD, MASK_VFSSEGSTD, match_opcode, 0}, -+{"vfssegstw", "Xhwacha", "#D,s,t,#n", MATCH_VFSSEGSTW, MASK_VFSSEGSTW, match_opcode, 0}, -+ -+{"vsetcfg", "Xhwacha", "s", MATCH_VSETCFG, MASK_VSETCFG | MASK_IMM, match_opcode, 0}, -+{"vsetcfg", "Xhwacha", "#g,#f", MATCH_VSETCFG, MASK_VSETCFG | MASK_RS1, match_opcode, 0}, -+{"vsetcfg", "Xhwacha", "s,#g,#f", MATCH_VSETCFG, MASK_VSETCFG, match_opcode, 0}, -+{"vsetucfg", "Xhwacha", "d,u", MATCH_LUI, MASK_LUI, match_opcode, INSN_ALIAS | WR_xd}, -+{"vsetvl", "Xhwacha", "d,s", MATCH_VSETVL, MASK_VSETVL, match_opcode, 0}, -+{"vgetcfg", "Xhwacha", "d", MATCH_VGETCFG, MASK_VGETCFG, match_opcode, 0}, -+{"vgetvl", "Xhwacha", "d", MATCH_VGETVL, MASK_VGETVL, match_opcode, 0}, -+ -+{"vmvv", "Xhwacha", "#d,#s", MATCH_VMVV, MASK_VMVV, match_opcode, 0}, -+{"vmsv", "Xhwacha", "#d,s", MATCH_VMSV, MASK_VMSV, match_opcode, 0}, -+{"vfmvv", "Xhwacha", "#D,#S", MATCH_VFMVV, MASK_VFMVV, match_opcode, 0}, -+{"vfmsv.d", "Xhwacha", "#D,s", MATCH_VFMSV_D, MASK_VFMSV_D, match_opcode, 0}, -+{"vfmsv.s", "Xhwacha", "#D,s", MATCH_VFMSV_S, MASK_VFMSV_S, match_opcode, 0}, -+ -+{"vf", "Xhwacha", "q(s)", MATCH_VF, MASK_VF, match_opcode, 0}, -+{"vf", "Xhwacha", "A,s", 0, (int) M_VF, match_never, INSN_MACRO }, -+ -+{"vxcptcause", "Xhwacha", "d", MATCH_VXCPTCAUSE, MASK_VXCPTCAUSE, match_opcode, 0}, -+{"vxcptaux", "Xhwacha", "d", MATCH_VXCPTAUX, MASK_VXCPTAUX, match_opcode, 0}, -+ -+{"vxcptsave", "Xhwacha", "s", MATCH_VXCPTSAVE, MASK_VXCPTSAVE, match_opcode, 0}, -+{"vxcptrestore", "Xhwacha", "s", MATCH_VXCPTRESTORE, MASK_VXCPTRESTORE, match_opcode, 0}, -+{"vxcptkill", "Xhwacha", "", MATCH_VXCPTKILL, MASK_VXCPTKILL, match_opcode, 0}, -+ -+{"vxcptevac", "Xhwacha", "s", MATCH_VXCPTEVAC, MASK_VXCPTEVAC, match_opcode, 0}, -+{"vxcpthold", "Xhwacha", "s", MATCH_VXCPTHOLD, MASK_VXCPTHOLD, match_opcode, 0}, -+{"venqcmd", "Xhwacha", "s,t", MATCH_VENQCMD, MASK_VENQCMD, match_opcode, 0}, -+{"venqimm1", "Xhwacha", "s,t", MATCH_VENQIMM1, MASK_VENQIMM1, match_opcode, 0}, -+{"venqimm2", "Xhwacha", "s,t", MATCH_VENQIMM2, MASK_VENQIMM2, match_opcode, 0}, -+{"venqcnt", "Xhwacha", "s,t", MATCH_VENQCNT, MASK_VENQCNT, match_opcode, 0}, -+}; -+ -+#define RISCV_NUM_OPCODES \ -+ ((sizeof riscv_builtin_opcodes) / (sizeof (riscv_builtin_opcodes[0]))) -+const int bfd_riscv_num_builtin_opcodes = RISCV_NUM_OPCODES; -+ -+/* const removed from the following to allow for dynamic extensions to the -+ * built-in instruction set. */ -+struct riscv_opcode *riscv_opcodes = -+ (struct riscv_opcode *) riscv_builtin_opcodes; -+int bfd_riscv_num_opcodes = RISCV_NUM_OPCODES; -+#undef RISCV_NUM_OPCODES diff --git a/external/gpl3/binutils/patches/0001-NetBSD-Minix.patch b/external/gpl3/binutils/patches/0001-NetBSD-Minix.patch new file mode 100644 index 000000000..79ded6a15 --- /dev/null +++ b/external/gpl3/binutils/patches/0001-NetBSD-Minix.patch @@ -0,0 +1,248 @@ +diff -rNU3 a/bfd/config.bfd b/bfd/config.bfd +--- a/bfd/config.bfd 2021-04-01 23:41:19.699481000 -0300 ++++ b/bfd/config.bfd 2021-04-01 23:44:05.966151225 -0300 +@@ -386,6 +386,7 @@ + targ_selvecs=arm_elf32_be_vec + ;; + arm-*-elf | arm*-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \ ++ arm*-*-minix* | \ + arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \ + arm*-*-eabi* | arm-*-rtems* | arm*-*-uclinuxfdpiceabi) + targ_defvec=arm_elf32_le_vec +@@ -620,6 +621,9 @@ + targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;; + esac + ;; ++ i[3-7]86-*-minix) ++ targ_defvec=i386_elf32_minix_vec ++ ;; + i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu) + targ_defvec=i386_elf32_vec + targ_selvecs="iamcu_elf32_vec i386_coff_vec i386_pei_vec i386_aout_bsd_vec i386_aout_nbsd_vec" +diff -rNU3 a/bfd/configure b/bfd/configure +--- a/bfd/configure 2021-04-01 23:41:19.706148000 -0300 ++++ b/bfd/configure 2021-04-01 23:44:05.972817891 -0300 +@@ -14759,6 +14759,7 @@ + i386_coff_lynx_vec) tb="$tb cf-i386lynx.lo lynx-core.lo $coff" ;; + i386_elf32_vec) tb="$tb elf32-i386.lo $elfxx_x86 elf32.lo $elf" ;; + i386_elf32_fbsd_vec) tb="$tb elf32-i386.lo $elfxx_x86 elf32.lo $elf" ;; ++ i386_elf32_minix_vec) tb="$tb elf32-i386.lo $elfxx_x86 elf32.lo $elf" ;; + i386_elf32_nacl_vec) tb="$tb elf32-i386.lo $elfxx_x86 elf32.lo $elf" ;; + i386_elf32_sol2_vec) tb="$tb elf32-i386.lo $elfxx_x86 elf32.lo $elf" ;; + i386_elf32_vxworks_vec) tb="$tb elf32-i386.lo $elfxx_x86 elf32.lo $elf" ;; +diff -rNU3 a/bfd/elf32-i386.c b/bfd/elf32-i386.c +--- a/bfd/elf32-i386.c 2021-04-01 23:41:19.722814000 -0300 ++++ b/bfd/elf32-i386.c 2021-04-01 23:44:05.976151225 -0300 +@@ -4392,6 +4392,18 @@ + + #include "elf32-target.h" + ++/* MINIX3 support. */ ++ ++#undef TARGET_LITTLE_SYM ++#define TARGET_LITTLE_SYM i386_elf32_minix_vec ++#undef TARGET_LITTLE_NAME ++#define TARGET_LITTLE_NAME "elf32-i386-minix" ++ ++#undef elf32_bed ++#define elf32_bed elf32_i386_minix_bed ++ ++#include "elf32-target.h" ++ + /* FreeBSD support. */ + + #undef TARGET_LITTLE_SYM +diff -rNU3 a/bfd/targets.c b/bfd/targets.c +--- a/bfd/targets.c 2021-04-01 23:41:19.776148000 -0300 ++++ b/bfd/targets.c 2021-04-01 23:44:05.979484558 -0300 +@@ -734,6 +734,7 @@ + extern const bfd_target i386_coff_lynx_vec; + extern const bfd_target i386_elf32_vec; + extern const bfd_target i386_elf32_fbsd_vec; ++extern const bfd_target i386_elf32_minix_vec; + extern const bfd_target i386_elf32_nacl_vec; + extern const bfd_target i386_elf32_sol2_vec; + extern const bfd_target i386_elf32_vxworks_vec; +diff -rNU3 a/config.guess b/config.guess +--- a/config.guess 2021-04-01 23:41:19.802814000 -0300 ++++ b/config.guess 2021-04-01 23:44:05.979484558 -0300 +@@ -917,7 +917,7 @@ + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; + *:Minix:*:*) +- echo "$UNAME_MACHINE"-unknown-minix ++ echo "$UNAME_MACHINE"-elf32-minix + exit ;; + aarch64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" +diff -rNU3 a/configure b/configure +--- a/configure 2020-01-18 11:01:13.000000000 -0300 ++++ b/configure 2021-04-01 23:44:05.982817892 -0300 +@@ -3055,7 +3055,7 @@ + *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ + | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ + | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ +- | *-*-solaris2* | *-*-nto* | *-*-nacl*) ++ | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-minix*) + case "${target}" in + *-*-linux*aout* | *-*-linux*oldld*) + ;; +diff -rNU3 a/gas/config/tc-i386.c b/gas/config/tc-i386.c +--- a/gas/config/tc-i386.c 2020-01-18 10:55:47.000000000 -0300 ++++ b/gas/config/tc-i386.c 2021-04-02 00:10:25.766178832 -0300 +@@ -478,6 +478,7 @@ + && !defined (TE_NACL) \ + && !defined (TE_FreeBSD) \ + && !defined (TE_DragonFly) \ ++ && !defined (TE_MINIX) \ + && !defined (TE_NetBSD))) + /* This array holds the chars that always start a comment. If the + pre-processor is disabled, these aren't very useful. The option +diff -rNU3 a/gas/config/tc-i386.h b/gas/config/tc-i386.h +--- a/gas/config/tc-i386.h 2020-01-18 10:55:47.000000000 -0300 ++++ b/gas/config/tc-i386.h 2021-04-01 23:44:05.986151225 -0300 +@@ -72,6 +72,10 @@ + #define ELF_TARGET_FORMAT64 "elf64-x86-64-sol2" + #endif + ++#ifdef TE_MINIX ++#define ELF_TARGET_FORMAT "elf32-i386-minix" ++#endif ++ + #ifndef ELF_TARGET_FORMAT + #define ELF_TARGET_FORMAT "elf32-i386" + #endif +diff -rNU3 a/gas/config/te-minix.h b/gas/config/te-minix.h +--- a/gas/config/te-minix.h 1969-12-31 21:00:00.000000000 -0300 ++++ b/gas/config/te-minix.h 2021-04-01 23:44:05.986151225 -0300 +@@ -0,0 +1,9 @@ ++#define TE_MINIX 1 ++ ++/* Added these, because if we don't know what we're targeting we may ++ need an assembler version of libgcc, and that will use local ++ labels. */ ++#define LOCAL_LABELS_DOLLAR 1 ++#define LOCAL_LABELS_FB 1 ++ ++#include "obj-format.h" +diff -rNU3 a/gas/configure b/gas/configure +--- a/gas/configure 2020-02-01 08:49:51.000000000 -0300 ++++ b/gas/configure 2021-04-01 23:44:05.992817892 -0300 +@@ -6269,6 +6269,10 @@ + fi + ;; + ++minix*) ++ lt_cv_deplibs_check_method=pass_all ++ ;; ++ + gnu*) + lt_cv_deplibs_check_method=pass_all + ;; +diff -rNU3 a/gas/configure.tgt b/gas/configure.tgt +--- a/gas/configure.tgt 2021-04-01 23:41:19.829481000 -0300 ++++ b/gas/configure.tgt 2021-04-01 23:44:05.992817892 -0300 +@@ -438,6 +438,8 @@ + *-*-elf | *-*-rtems* | *-*-sysv4*) fmt=elf ;; + *-*-solaris*) fmt=elf em=solaris ;; + *-*-aros*) fmt=elf em=linux ;; ++ i*-*-minix*) fmt=elf em=minix ;; ++ arm*-*-minix*) fmt=elf em=armeabi ;; + *-*-vxworks* | *-*-windiss) fmt=elf em=vxworks ;; + esac + +diff -rNU3 a/ld/configure.tgt b/ld/configure.tgt +--- a/ld/configure.tgt 2021-04-01 23:41:19.839481000 -0300 ++++ b/ld/configure.tgt 2021-04-01 23:44:05.992817892 -0300 +@@ -167,6 +167,9 @@ + arm-*-elf | arm*-*-eabi* | arm-*-rtems*) + targ_emul=armelf + ;; ++arm*-*-minix*) targ_emul=armelf_minix ++ targ_extra_emuls="armelf" ++ ;; + arm*-*-symbianelf*) targ_emul=armsymbian;; + arm-*-kaos*) targ_emul=armelf + ;; +@@ -344,6 +347,9 @@ + targ64_extra_emuls="elf_x86_64 elf32_x86_64 elf_l1om elf_k1om" + targ64_extra_libpath="elf_x86_64 elf32_x86_64" + ;; ++i[3-7]86-*-minix) targ_emul=elf_i386_minix ++ targ_extra_emuls="elf_i386" ++ ;; + i[3-7]86-*-redox*) targ_emul=elf_i386 + targ_extra_emuls=elf_x86_64 + ;; +diff -rNU3 a/ld/emulparams/armelf_minix.sh b/ld/emulparams/armelf_minix.sh +--- a/ld/emulparams/armelf_minix.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/armelf_minix.sh 2021-04-01 23:44:05.992817892 -0300 +@@ -0,0 +1,15 @@ ++. ${srcdir}/emulparams/armelf.sh ++. ${srcdir}/emulparams/elf_minix.sh ++OUTPUT_FORMAT="elf32-littlearm" ++MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" ++COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" ++TEXT_START_ADDR=0x00010000 ++ ++# Dynamic libraries support ++TARGET2_TYPE=got-rel ++ ++unset EMBEDDED ++unset DATA_START_SYMBOLS ++unset STACK_ADDR ++ ++# Use the ARM ABI-compliant exception-handling sections. ++OTHER_READONLY_SECTIONS=" ++ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } ++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } ++ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } ++ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" ++ +diff -rNU3 a/ld/emulparams/elf_i386_minix.sh b/ld/emulparams/elf_i386_minix.sh +--- a/ld/emulparams/elf_i386_minix.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/elf_i386_minix.sh 2021-04-01 23:44:05.992817892 -0300 +@@ -0,0 +1,3 @@ ++. ${srcdir}/emulparams/elf_i386.sh ++. ${srcdir}/emulparams/elf_minix.sh ++OUTPUT_FORMAT="elf32-i386-minix" +diff -rNU3 a/ld/emulparams/elf_minix.sh b/ld/emulparams/elf_minix.sh +--- a/ld/emulparams/elf_minix.sh 1969-12-31 21:00:00.000000000 -0300 ++++ b/ld/emulparams/elf_minix.sh 2021-04-01 23:44:05.992817892 -0300 +@@ -0,0 +1 @@ ++ELF_INTERPRETER_NAME=\"/libexec/ld-elf.so.1\" +diff -rNU3 a/ld/Makefile.in b/ld/Makefile.in +--- a/ld/Makefile.in 2021-04-01 23:41:19.856148000 -0300 ++++ b/ld/Makefile.in 2021-04-01 23:44:05.996151225 -0300 +@@ -669,6 +669,7 @@ + earmelf_linux.c \ + earmelf_linux_eabi.c \ + earmelf_linux_fdpiceabi.c \ ++ earmelf_minix.c \ + earmelf_nacl.c \ + earmelf_nbsd.c \ + earmelf_nbsd_eabi.c \ +@@ -795,6 +796,7 @@ + eelf_i386_be.c \ + eelf_i386_fbsd.c \ + eelf_i386_ldso.c \ ++ eelf_i386_minix.c \ + eelf_i386_nacl.c \ + eelf_i386_sol2.c \ + eelf_i386_vxworks.c \ +@@ -2298,6 +2300,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_eabi.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_fdpiceabi.Pc@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_minix.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nacl.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nbsd.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_phoenix.Pc@am__quote@ +@@ -2411,6 +2414,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_fbsd.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_ldso.Pc@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_minix.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_nacl.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_sol2.Pc@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_vxworks.Pc@am__quote@ diff --git a/external/gpl3/binutils/patches/0001-minix.patch b/external/gpl3/binutils/patches/0001-minix.patch deleted file mode 100644 index 10561c7ce..000000000 --- a/external/gpl3/binutils/patches/0001-minix.patch +++ /dev/null @@ -1,249 +0,0 @@ -diff -rNU3 dist.nbsd/bfd/config.bfd dist/bfd/config.bfd ---- dist.nbsd/bfd/config.bfd 2014-02-17 14:34:49.407022105 +0100 -+++ dist/bfd/config.bfd 2014-02-17 16:13:26.634958919 +0100 -@@ -316,7 +316,7 @@ - ;; - arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \ - arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \ -- arm*-*-eabi* ) -+ arm*-*-eabi* | arm*-*-minix*) - targ_defvec=bfd_elf32_littlearm_vec - targ_selvecs=bfd_elf32_bigarm_vec - ;; -@@ -711,6 +711,9 @@ - i[3-7]86-none-*) - targ_defvec=i386coff_vec - ;; -+ i[3-7]86-*-minix) -+ targ_defvec=bfd_elf32_i386_minix_vec -+ ;; - i[3-7]86-*-aout* | i[3-7]86*-*-vsta*) - targ_defvec=i386aout_vec - ;; -diff -rNU3 dist.nbsd/bfd/configure dist/bfd/configure ---- dist.nbsd/bfd/configure 2014-02-17 14:34:49.413688892 +0100 -+++ dist/bfd/configure 2014-02-17 16:13:26.638292303 +0100 -@@ -15232,6 +15232,7 @@ - bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; - bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; -+ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; -diff -rNU3 dist.nbsd/bfd/configure.in dist/bfd/configure.in ---- dist.nbsd/bfd/configure.in 2014-02-17 14:34:49.393688529 +0100 -+++ dist/bfd/configure.in 2014-02-17 16:13:26.638292303 +0100 -@@ -724,6 +724,7 @@ - bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; - bfd_elf32_i386_sol2_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; -+ bfd_elf32_i386_minix_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_nacl_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_vxworks_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; - bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf-ifunc.lo elf-nacl.lo elf-vxworks.lo elf32.lo $elf" ;; -diff -rNU3 dist.nbsd/bfd/elf32-i386.c dist/bfd/elf32-i386.c ---- dist.nbsd/bfd/elf32-i386.c 2014-02-17 14:34:49.393688529 +0100 -+++ dist/bfd/elf32-i386.c 2014-02-17 16:13:26.644959071 +0100 -@@ -4979,6 +4979,18 @@ - - #include "elf32-target.h" - -+/* MINIX3 support. */ -+ -+#undef TARGET_LITTLE_SYM -+#define TARGET_LITTLE_SYM bfd_elf32_i386_minix_vec -+#undef TARGET_LITTLE_NAME -+#define TARGET_LITTLE_NAME "elf32-i386-minix" -+ -+#undef elf32_bed -+#define elf32_bed elf32_i386_minix_bed -+ -+#include "elf32-target.h" -+ - /* FreeBSD support. */ - - #undef TARGET_LITTLE_SYM -diff -rNU3 dist.nbsd/bfd/targets.c dist/bfd/targets.c ---- dist.nbsd/bfd/targets.c 2014-02-17 14:34:49.417022286 +0100 -+++ dist/bfd/targets.c 2014-02-17 16:13:26.644959071 +0100 -@@ -624,6 +624,7 @@ - extern const bfd_target bfd_elf32_hppa_vec; - extern const bfd_target bfd_elf32_i370_vec; - extern const bfd_target bfd_elf32_i386_freebsd_vec; -+extern const bfd_target bfd_elf32_i386_minix_vec; - extern const bfd_target bfd_elf32_i386_nacl_vec; - extern const bfd_target bfd_elf32_i386_sol2_vec; - extern const bfd_target bfd_elf32_i386_vxworks_vec; -diff -rNU3 dist.nbsd/config.guess dist/config.guess ---- dist.nbsd/config.guess 2014-02-17 14:34:49.417022286 +0100 -+++ dist/config.guess 2014-02-17 16:13:26.644959071 +0100 -@@ -872,8 +872,8 @@ - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; -- i*86:Minix:*:*) -- echo ${UNAME_MACHINE}-pc-minix -+ *:Minix:*:*) -+ echo ${UNAME_MACHINE}-elf32-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in -diff -rNU3 dist.nbsd/configure dist/configure ---- dist.nbsd/configure 2014-02-17 14:34:49.430355862 +0100 -+++ dist/configure 2014-02-17 16:13:26.648292455 +0100 -@@ -2869,7 +2869,7 @@ - *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \ - | *-*-linux* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \ - | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \ -- | *-*-solaris2* | *-*-nto* | *-*-nacl*) -+ | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-minix*) - case "${target}" in - *-*-linux*aout* | *-*-linux*oldld*) - ;; -diff -rNU3 dist.nbsd/gas/config/tc-i386.h dist/gas/config/tc-i386.h ---- dist.nbsd/gas/config/tc-i386.h 2014-02-17 14:34:48.917013206 +0100 -+++ dist/gas/config/tc-i386.h 2014-02-17 16:13:26.648292455 +0100 -@@ -72,6 +72,10 @@ - #define ELF_TARGET_FORMAT64 "elf64-x86-64-sol2" - #endif - -+#ifdef TE_MINIX -+#define ELF_TARGET_FORMAT "elf32-i386-minix" -+#endif -+ - #ifndef ELF_TARGET_FORMAT - #define ELF_TARGET_FORMAT "elf32-i386" - #endif -diff -rNU3 dist.nbsd/gas/config/te-minix.h dist/gas/config/te-minix.h ---- dist.nbsd/gas/config/te-minix.h 1970-01-01 01:00:00.000000000 +0100 -+++ dist/gas/config/te-minix.h 2014-02-17 16:13:26.648292455 +0100 -@@ -0,0 +1,9 @@ -+#define TE_MINIX 1 -+ -+/* Added these, because if we don't know what we're targeting we may -+ need an assembler version of libgcc, and that will use local -+ labels. */ -+#define LOCAL_LABELS_DOLLAR 1 -+#define LOCAL_LABELS_FB 1 -+ -+#include "obj-format.h" -diff -rNU3 dist.nbsd/gas/configure dist/gas/configure ---- dist.nbsd/gas/configure 2014-02-17 14:34:48.930346782 +0100 -+++ dist/gas/configure 2014-02-17 16:13:26.651625840 +0100 -@@ -6127,6 +6127,10 @@ - fi - ;; - -+minix*) -+ lt_cv_deplibs_check_method=pass_all -+ ;; -+ - gnu*) - lt_cv_deplibs_check_method=pass_all - ;; -diff -rNU3 dist.nbsd/gas/configure.tgt dist/gas/configure.tgt ---- dist.nbsd/gas/configure.tgt 2014-02-17 14:34:48.930346782 +0100 -+++ dist/gas/configure.tgt 2014-02-17 16:13:26.651625840 +0100 -@@ -448,6 +448,8 @@ - *-*-elf | *-*-sysv4*) fmt=elf ;; - *-*-solaris*) fmt=elf em=solaris ;; - *-*-aros*) fmt=elf em=linux ;; -+ i*-*-minix*) fmt=elf em=minix ;; -+ arm*-*-minix*) fmt=elf em=armeabi ;; - *-*-vxworks* | *-*-windiss) fmt=elf em=vxworks ;; - *-*-netware) fmt=elf em=netware ;; - esac -diff -rNU3 dist.nbsd/ld/configure.tgt dist/ld/configure.tgt ---- dist.nbsd/ld/configure.tgt 2014-02-17 14:34:49.170351140 +0100 -+++ dist/ld/configure.tgt 2014-02-17 16:13:26.651625840 +0100 -@@ -82,6 +82,8 @@ - armeb-*-elf) targ_emul=armelfb ;; - arm-*-elf | arm*-*-eabi*) - targ_emul=armelf ;; -+arm*-*-minix*) targ_emul=armelf_minix -+ targ_extra_emuls="armelf" ;; - arm*-*-symbianelf*) targ_emul=armsymbian;; - arm-*-kaos*) targ_emul=armelf ;; - arm9e-*-elf) targ_emul=armelf ;; -@@ -208,6 +210,8 @@ - i[3-7]86-*-bsd386) targ_emul=i386bsd ;; - i[3-7]86-*-bsdi*) targ_emul=i386bsd ;; - i[3-7]86-*-aout) targ_emul=i386aout ;; -+i[3-7]86-*-minix) targ_emul=elf_i386_minix -+ targ_extra_emuls="elf_i386" ;; - i[3-7]86-*-linux*aout*) targ_emul=i386linux - targ_extra_emuls=elf_i386 - tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'` ;; -diff -rNU3 dist.nbsd/ld/emulparams/armelf_minix.sh dist/ld/emulparams/armelf_minix.sh ---- dist.nbsd/ld/emulparams/armelf_minix.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/armelf_minix.sh 2014-02-17 16:13:26.651625840 +0100 -@@ -0,0 +1,15 @@ -+. ${srcdir}/emulparams/armelf.sh -+. ${srcdir}/emulparams/elf_minix.sh -+OUTPUT_FORMAT="elf32-littlearm" -+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" -+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -+ -+DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; -+ -+# Dynamic libraries support -+GENERATE_SHLIB_SCRIPT=yes -+TARGET2_TYPE=got-rel -+ -+GENERATE_PIE_SCRIPT=yes -+ -+unset EMBEDDED -diff -rNU3 dist.nbsd/ld/emulparams/elf_i386_minix.sh dist/ld/emulparams/elf_i386_minix.sh ---- dist.nbsd/ld/emulparams/elf_i386_minix.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf_i386_minix.sh 2014-02-17 16:13:26.651625840 +0100 -@@ -0,0 +1,3 @@ -+. ${srcdir}/emulparams/elf_i386.sh -+. ${srcdir}/emulparams/elf_minix.sh -+OUTPUT_FORMAT="elf32-i386-minix" -diff -rNU3 dist.nbsd/ld/emulparams/elf_minix.sh dist/ld/emulparams/elf_minix.sh ---- dist.nbsd/ld/emulparams/elf_minix.sh 1970-01-01 01:00:00.000000000 +0100 -+++ dist/ld/emulparams/elf_minix.sh 2014-02-17 16:13:26.651625840 +0100 -@@ -0,0 +1 @@ -+ELF_INTERPRETER_NAME=\"/libexec/ld-elf.so.1\" -diff -rNU3 dist.nbsd/ld/Makefile.in dist/ld/Makefile.in ---- dist.nbsd/ld/Makefile.in 2014-02-17 14:34:49.163684353 +0100 -+++ dist/ld/Makefile.in 2014-02-17 16:13:26.651625840 +0100 -@@ -450,6 +450,7 @@ - earmelf_fbsd.c \ - earmelf_linux.c \ - earmelf_linux_eabi.c \ -+ earmelf_minix.c \ - earmelf_nacl.c \ - earmelf_nbsd.c \ - earmelf_nbsd_eabi.c \ -@@ -574,6 +575,7 @@ - eelf_i386_chaos.c \ - eelf_i386_fbsd.c \ - eelf_i386_ldso.c \ -+ eelf_i386_minix.c \ - eelf_i386_nacl.c \ - eelf_i386_sol2.c \ - eelf_i386_vxworks.c \ -@@ -2195,6 +2197,10 @@ - $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \ - $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} armelf_linux_eabi "$(tdir_armelf_linux_abi)" -+earmelf_minix.c: $(srcdir)/emulparams/armelf_minix.sh \ -+ $(srcdir)/emulparams/armelf.sh \ -+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} armelf_minix "$(tdir_armelf_minix)" - earmelf_nacl.c: $(srcdir)/emulparams/armelf_nacl.sh \ - $(srcdir)/emulparams/armelf_linux_eabi.sh \ - $(srcdir)/emulparams/armelf_linux.sh \ -@@ -2715,6 +2721,10 @@ - eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \ - $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} - ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)" -+eelf_i386_minix.c: $(srcdir)/emulparams/elf_i386_minix.sh \ -+ $(srcdir)/emulparams/elf_i386.sh \ -+ $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} -+ ${GENSCRIPTS} elf_i386_minix "$(tdir_elf_i386_minix)" - eelf_i386_nacl.c: $(srcdir)/emulparams/elf_i386_nacl.sh \ - $(srcdir)/emulparams/elf_i386.sh \ - $(srcdir)/emulparams/elf_nacl.sh \ diff --git a/external/gpl3/binutils/patches/0002-minix-on-minix.patch b/external/gpl3/binutils/patches/0002-minix-on-minix.patch deleted file mode 100644 index 5f2092f8e..000000000 --- a/external/gpl3/binutils/patches/0002-minix-on-minix.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -rNU3 dist/binutils/dwarf.c dist.mxm/binutils/dwarf.c ---- dist/binutils/dwarf.c 2012-07-02 16:35:33.000000000 +0200 -+++ dist.mxm/binutils/dwarf.c 2014-02-17 16:11:55.310119155 +0100 -@@ -29,6 +29,7 @@ - #include "dwarf2.h" - #include "dwarf.h" - #include "gdb/gdb-index.h" -+#include "getopt.h" - - static const char *regname (unsigned int regno, int row); - diff --git a/external/gpl3/binutils/patches/0003-gold-target.patch b/external/gpl3/binutils/patches/0003-gold-target.patch deleted file mode 100644 index 98f1ab318..000000000 --- a/external/gpl3/binutils/patches/0003-gold-target.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- dist/gold/i386.cc.orig 2014-03-03 15:51:57.725314830 +0100 -+++ dist/gold/i386.cc 2014-03-03 16:09:42.514935341 +0100 -@@ -3813,8 +3813,8 @@ - public: - Target_selector_i386() - : Target_selector_freebsd(elfcpp::EM_386, 32, false, -- "elf32-i386", "elf32-i386-freebsd", -- "elf_i386") -+ "elf_i386_minix", "elf32-i386-freebsd", -+ "elf_i386_minix") - { } - - Target* diff --git a/external/gpl3/binutils/patches/0004-libdl-and-reconf.patch b/external/gpl3/binutils/patches/0004-libdl-and-reconf.patch deleted file mode 100644 index 2d387960c..000000000 --- a/external/gpl3/binutils/patches/0004-libdl-and-reconf.patch +++ /dev/null @@ -1,238 +0,0 @@ -diff --git a/bfd/Makefile.am b/bfd/Makefile.am -index 49f9662..2ac03e9 100644 ---- a/bfd/Makefile.am -+++ b/bfd/Makefile.am -@@ -35,7 +35,7 @@ AM_CFLAGS = $(WARN_CFLAGS) - AM_CPPFLAGS = -DBINDIR='"$(bindir)"' - if PLUGINS - bfdinclude_HEADERS += $(INCDIR)/plugin-api.h --LIBDL = -ldl -+LIBDL = @lt_cv_dlopen_libs@ - endif - - # bfd.h goes here, for now -diff --git a/bfd/Makefile.in b/bfd/Makefile.in -index 5718fab..7b0f863 100644 ---- a/bfd/Makefile.in -+++ b/bfd/Makefile.in -@@ -293,6 +293,7 @@ libdir = @libdir@ - libexecdir = @libexecdir@ - localedir = @localedir@ - localstatedir = @localstatedir@ -+lt_cv_dlopen_libs = @lt_cv_dlopen_libs@ - mandir = @mandir@ - mkdir_p = @mkdir_p@ - oldincludedir = @oldincludedir@ -@@ -336,7 +337,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -release `cat libtool-soversion` \ - @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libbfd.la - AM_CFLAGS = $(WARN_CFLAGS) - AM_CPPFLAGS = -DBINDIR='"$(bindir)"' --@PLUGINS_TRUE@LIBDL = -ldl -+@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@ - - # bfd.h goes here, for now - BFD_H = bfd.h -diff --git a/bfd/configure b/bfd/configure -index d81719d..fdf5356 100755 ---- a/bfd/configure -+++ b/bfd/configure -@@ -606,6 +606,7 @@ havevecs - tdefaults - bfd_ufile_ptr - bfd_file_ptr -+lt_cv_dlopen_libs - supports_plugins - bfd_default_target_size - bfd_machines -diff --git a/bfd/configure.in b/bfd/configure.in -index 612d032..530bbcb 100644 ---- a/bfd/configure.in -+++ b/bfd/configure.in -@@ -1100,6 +1100,7 @@ else - supports_plugins=0 - fi - AC_SUBST(supports_plugins) -+AC_SUBST(lt_cv_dlopen_libs) - - # Determine the host dependant file_ptr a.k.a. off_t type. In order - # prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and -diff --git a/gold/Makefile.am b/gold/Makefile.am -index df8dcb5..f6ced44 100644 ---- a/gold/Makefile.am -+++ b/gold/Makefile.am -@@ -37,7 +38,7 @@ AM_CPPFLAGS = \ - LIBIBERTY = ../libiberty/libiberty.a - - if PLUGINS --LIBDL = -ldl -+LIBDL = @DLOPEN_LIBS@ - endif - - if THREADS -diff --git a/gold/Makefile.in b/gold/Makefile.in -index 216532a..f12832b 100644 ---- a/gold/Makefile.in -+++ b/gold/Makefile.in -@@ -272,6 +273,7 @@ CYGPATH_W = @CYGPATH_W@ - DATADIRNAME = @DATADIRNAME@ - DEFS = @DEFS@ - DEPDIR = @DEPDIR@ -+DLOPEN_LIBS = @DLOPEN_LIBS@ - ECHO_C = @ECHO_C@ - ECHO_N = @ECHO_N@ - ECHO_T = @ECHO_T@ -@@ -398,7 +400,7 @@ AM_CPPFLAGS = \ - -DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@ - - LIBIBERTY = ../libiberty/libiberty.a --@PLUGINS_TRUE@LIBDL = -ldl -+@PLUGINS_TRUE@LIBDL = @DLOPEN_LIBS@ - @THREADS_TRUE@THREADSLIB = -lpthread - AM_YFLAGS = -d - -diff --git a/gold/config.in b/gold/config.in -index 42252bf..d46fd75 100644 ---- a/gold/config.in -+++ b/gold/config.in -@@ -73,6 +73,9 @@ - don't. */ - #undef HAVE_DECL_VSNPRINTF - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_DLFCN_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_EXT_HASH_MAP - -@@ -184,6 +187,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_UNISTD_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_WINDOWS_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_ZLIB_H - -diff --git a/gold/configure b/gold/configure -index 9e1ee27..7e58cdf 100755 ---- a/gold/configure -+++ b/gold/configure -@@ -596,6 +596,7 @@ MAINTAINER_MODE_FALSE - MAINTAINER_MODE_TRUE - HAVE_PUBNAMES_FALSE - HAVE_PUBNAMES_TRUE -+DLOPEN_LIBS - CXXCPP - HAVE_ZLIB_FALSE - HAVE_ZLIB_TRUE -@@ -7139,6 +7140,35 @@ fi - - done - -+ -+for ac_header in windows.h -+do : -+ ac_fn_cxx_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" -+if test "x$ac_cv_header_windows_h" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_WINDOWS_H 1 -+_ACEOF -+ -+fi -+ -+done -+ -+for ac_header in dlfcn.h -+do : -+ ac_fn_cxx_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -+if test "x$ac_cv_header_dlfcn_h" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_DLFCN_H 1 -+_ACEOF -+ DLOPEN_LIBS="-ldl" -+else -+ DLOPEN_LIBS="" -+fi -+ -+done -+ -+ -+ - for ac_func in mallinfo posix_fallocate fallocate readv sysconf times - do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -diff --git a/gold/configure.ac b/gold/configure.ac -index 804a474..b03c09d 100644 ---- a/gold/configure.ac -+++ b/gold/configure.ac -@@ -505,6 +506,13 @@ AC_LANG_PUSH(C++) - AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map) - AC_CHECK_HEADERS(ext/hash_map ext/hash_set) - AC_CHECK_HEADERS(byteswap.h) -+ -+dnl When plugins enabled dynamic loader interface is required. Check headers -+dnl which may provide this interface. In case of dlfcn.h add libdl to link. -+AC_CHECK_HEADERS(windows.h) -+AC_CHECK_HEADERS(dlfcn.h, [DLOPEN_LIBS="-ldl"], [DLOPEN_LIBS=""]) -+AC_SUBST(DLOPEN_LIBS) -+ - AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times) - AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp, strndup, memmem]) - -diff --git a/gold/plugin.cc b/gold/plugin.cc -index c39e11ec..9176e06 100644 ---- a/gold/plugin.cc -+++ b/gold/plugin.cc -@@ -29,9 +29,39 @@ - #include - - #ifdef ENABLE_PLUGINS -+#ifdef HAVE_DLFCN_H - #include -+#elif defined (HAVE_WINDOWS_H) -+#include -+#else -+#error Unknown how to handle dynamic-load-libraries. - #endif - -+#if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) -+ -+#define RTLD_NOW 0 /* Dummy value. */ -+static void * -+dlopen(const char *file, int mode ATTRIBUTE_UNUSED) -+{ -+ return LoadLibrary(file); -+} -+ -+static void * -+dlsym(void *handle, const char *name) -+{ -+ return reinterpret_cast( -+ GetProcAddress(static_cast(handle),name)); -+} -+ -+static const char * -+dlerror(void) -+{ -+ return "unable to load dll"; -+} -+ -+#endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */ -+#endif /* ENABLE_PLUGINS */ -+ - #include "parameters.h" - #include "errors.h" - #include "fileread.h" -diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in -index 6e22934..b2eb352 100644 ---- a/gold/testsuite/Makefile.in -+++ b/gold/testsuite/Makefile.in -@@ -1878,6 +1878,7 @@ CYGPATH_W = @CYGPATH_W@ - DATADIRNAME = @DATADIRNAME@ - DEFS = @DEFS@ - DEPDIR = @DEPDIR@ -+DLOPEN_LIBS = @DLOPEN_LIBS@ - ECHO_C = @ECHO_C@ - ECHO_N = @ECHO_N@ - ECHO_T = @ECHO_T@ diff --git a/external/gpl3/binutils/patches/0005-gold-libdl.patch b/external/gpl3/binutils/patches/0005-gold-libdl.patch deleted file mode 100644 index f9d805cab..000000000 --- a/external/gpl3/binutils/patches/0005-gold-libdl.patch +++ /dev/null @@ -1,112 +0,0 @@ -commit 6632e8ccecd8fe5de18ad78ced1c14755a24b169 -Author: Cary Coutant -Date: Fri Nov 22 15:46:51 2013 -0800 - - Add check for which library is needed for dlopen. - - gold/ - PR gold/16203 - * configure.ac: Add check for which library is needed for - dlopen. - * configure: Regenerate. - -diff --git a/gold/configure b/gold/configure -index 83f5aa9..24140cf 100755 ---- a/gold/configure -+++ b/gold/configure -@@ -7193,13 +7193,71 @@ if test "x$ac_cv_header_dlfcn_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF - #define HAVE_DLFCN_H 1 - _ACEOF -- DLOPEN_LIBS="-ldl" --else -- DLOPEN_LIBS="" -+ - fi - - done - -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -+$as_echo_n "checking for library containing dlopen... " >&6; } -+if test "${ac_cv_search_dlopen+set}" = set; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char dlopen (); -+int -+main () -+{ -+return dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' dl dld; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_cxx_try_link "$LINENO"; then : -+ ac_cv_search_dlopen=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if test "${ac_cv_search_dlopen+set}" = set; then : -+ break -+fi -+done -+if test "${ac_cv_search_dlopen+set}" = set; then : -+ -+else -+ ac_cv_search_dlopen=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -+$as_echo "$ac_cv_search_dlopen" >&6; } -+ac_res=$ac_cv_search_dlopen -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+case "$ac_cv_search_dlopen" in -+ no*) DLOPEN_LIBS="";; -+ *) DLOPEN_LIBS="$ac_cv_search_dlopen";; -+esac - - - for ac_func in mallinfo posix_fallocate fallocate readv sysconf times -diff --git a/gold/configure.ac b/gold/configure.ac -index 82ad11e..9bc216b 100644 ---- a/gold/configure.ac -+++ b/gold/configure.ac -@@ -528,9 +528,14 @@ AC_CHECK_HEADERS(ext/hash_map ext/hash_set) - AC_CHECK_HEADERS(byteswap.h) - - dnl When plugins enabled dynamic loader interface is required. Check headers --dnl which may provide this interface. In case of dlfcn.h add libdl to link. -+dnl which may provide this interface. Add the necessary library to link. - AC_CHECK_HEADERS(windows.h) --AC_CHECK_HEADERS(dlfcn.h, [DLOPEN_LIBS="-ldl"], [DLOPEN_LIBS=""]) -+AC_CHECK_HEADERS(dlfcn.h) -+AC_SEARCH_LIBS(dlopen, [dl dld]) -+case "$ac_cv_search_dlopen" in -+ no*) DLOPEN_LIBS="";; -+ *) DLOPEN_LIBS="$ac_cv_search_dlopen";; -+esac - AC_SUBST(DLOPEN_LIBS) - - AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times) diff --git a/external/gpl3/binutils/patches/0006-gold-plt.patch b/external/gpl3/binutils/patches/0006-gold-plt.patch deleted file mode 100644 index f7fe9f6d6..000000000 --- a/external/gpl3/binutils/patches/0006-gold-plt.patch +++ /dev/null @@ -1,21 +0,0 @@ -commit 31245c9b262fa983d9711f7795b35ad31c3a6618 -Author: Ben Gras -Date: Sat May 3 19:40:19 2014 +0200 - - plt - -diff --git a/gold/i386.cc b/gold/i386.cc -index a2f7522..f06d60d 100644 ---- a/gold/i386.cc -+++ b/gold/i386.cc -@@ -2543,6 +2543,10 @@ Target_i386::do_finalize_sections( - Symbol* sym = this->global_offset_table_; - if (sym != NULL) - { -+ // create a plt -+ if (this->plt_ == NULL) -+ this->make_plt_section(symtab, layout); -+ - uint32_t data_size = this->got_plt_->current_data_size(); - symtab->get_sized_symbol<32>(sym)->set_symsize(data_size); - } diff --git a/external/gpl3/binutils/patches/0007-gold-as-tool-on-minix.patch b/external/gpl3/binutils/patches/0007-gold-as-tool-on-minix.patch deleted file mode 100644 index 6788495af..000000000 --- a/external/gpl3/binutils/patches/0007-gold-as-tool-on-minix.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff -rNU3 dist/gold/configure dist.mxm/gold/configure ---- dist/gold/configure 2014-07-14 18:21:16.292364610 +0200 -+++ dist.mxm/gold/configure 2014-07-14 18:25:08.509642134 +0200 -@@ -7106,6 +7106,20 @@ - ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - -+for ac_header in unordered_set unordered_map -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+eval as_val=\$$as_ac_Header -+ if test "x$as_val" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ - for ac_header in tr1/unordered_set tr1/unordered_map - do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -diff -rNU3 dist/gold/configure.ac dist.mxm/gold/configure.ac ---- dist/gold/configure.ac 2014-07-14 18:21:16.292364610 +0200 -+++ dist.mxm/gold/configure.ac 2014-07-14 18:15:57.376945885 +0200 -@@ -496,6 +496,7 @@ - - AC_LANG_PUSH(C++) - -+AC_CHECK_HEADERS(unordered_set unordered_map) - AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map) - AC_CHECK_HEADERS(ext/hash_map ext/hash_set) - AC_CHECK_HEADERS(byteswap.h) -diff -rNU3 dist/gold/gold.h dist.mxm/gold/gold.h ---- dist/gold/gold.h 2012-11-09 09:21:28.000000000 +0100 -+++ dist.mxm/gold/gold.h 2014-07-14 18:18:04.885779352 +0200 -@@ -66,7 +66,20 @@ - - // Figure out how to get a hash set and a hash map. - --#if defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \ -+#if defined(HAVE_UNORDERED_SET) && defined(HAVE_UNORDERED_MAP) -+ -+#include -+#include -+ -+// We need a template typedef here. -+ -+#define Unordered_set std::unordered_set -+#define Unordered_map std::unordered_map -+#define Unordered_multimap std::unordered_multimap -+ -+#define reserve_unordered_map(map, n) ((map)->rehash(n)) -+ -+#elif defined(HAVE_TR1_UNORDERED_SET) && defined(HAVE_TR1_UNORDERED_MAP) \ - && defined(HAVE_TR1_UNORDERED_MAP_REHASH) - - #include -diff -rNU3 dist/gold/stringpool.cc dist.mxm/gold/stringpool.cc ---- dist/gold/stringpool.cc 2010-08-25 10:36:54.000000000 +0200 -+++ dist.mxm/gold/stringpool.cc 2014-07-14 18:19:48.650875718 +0200 -@@ -72,7 +72,10 @@ - { - this->key_to_offset_.reserve(n); - --#if defined(HAVE_TR1_UNORDERED_MAP) -+#if defined(HAVE_UNORDERED_MAP) -+ this->string_set_.rehash(this->string_set_.size() + n); -+ return; -+#elif defined(HAVE_TR1_UNORDERED_MAP) - // rehash() implementation is broken in gcc 4.0.3's stl - //this->string_set_.rehash(this->string_set_.size() + n); - //return; -@@ -499,7 +502,7 @@ - void - Stringpool_template::print_stats(const char* name) const - { --#if defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP) -+#if defined(HAVE_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP) - fprintf(stderr, _("%s: %s entries: %zu; buckets: %zu\n"), - program_name, name, this->string_set_.size(), - this->string_set_.bucket_count()); -diff -rNU3 dist/gold/config.in dist.mxm/gold/config.in ---- dist/gold/config.in 2014-07-14 19:21:52.217425468 +0200 -+++ dist.mxm/gold/config.in 2014-07-14 20:08:52.208824229 +0200 -@@ -175,6 +175,12 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_UNISTD_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_UNORDERED_MAP -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_UNORDERED_SET -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_WINDOWS_H - -diff -rNU3 dist/include/safe-ctype.h dist.mxm/include/safe-ctype.h ---- dist/include/safe-ctype.h 2008-07-07 19:09:31.000000000 +0200 -+++ dist.mxm/include/safe-ctype.h 2014-07-15 10:49:44.583026808 +0200 -@@ -119,6 +119,7 @@ - including another system header (for instance gnulib's stdint.h). - So we include ctype.h here and then immediately redefine its macros. */ - -+#if !defined(__minix) || !defined(__clang__) - #include - #undef isalpha - #define isalpha(c) do_not_use_isalpha_with_safe_ctype -@@ -145,6 +146,34 @@ - #undef toupper - #define toupper(c) do_not_use_toupper_with_safe_ctype - #undef tolower --#define tolower(c) do_not_use_tolower_with_safe_ctype -+#else -+#include -+#undef isalpha -+#define isalpha(c) ISALPHA(c) -+#undef isalnum -+#define isalnum(c) ISALNUM(c) -+#undef iscntrl -+#define iscntrl(c) ISCNTRL(c) -+#undef isdigit -+#define isdigit(c) ISDIGIT(c) -+#undef isgraph -+#define isgraph(c) ISGRAPH(c) -+#undef islower -+#define islower(c) ISLOWER(c) -+#undef isprint -+#define isprint(c) ISPRINT(c) -+#undef ispunct -+#define ispunct(c) ISPUNCT(c) -+#undef isspace -+#define isspace(c) ISSPACE(c) -+#undef isupper -+#define isupper(c) ISUPPER(c) -+#undef isxdigit -+#define isxdigit(c) ISXDIGIT(c) -+#undef toupper -+#define toupper(c) TOUPPER(c) -+#undef tolower -+#define tolower(c) TOLOWER(c) -+#endif /* !defined(__minix) || !defined(__clang__) */ - - #endif /* SAFE_CTYPE_H */ diff --git a/external/gpl3/binutils/patches/0008-Fix-build-error-on-OSX.patch b/external/gpl3/binutils/patches/0008-Fix-build-error-on-OSX.patch deleted file mode 100644 index 83f57ab59..000000000 --- a/external/gpl3/binutils/patches/0008-Fix-build-error-on-OSX.patch +++ /dev/null @@ -1,40 +0,0 @@ -From aff3cc514eff051c4c4a838d6c927c816733b01a Mon Sep 17 00:00:00 2001 -From: Thomas Veerman -Date: Fri, 10 Oct 2014 12:17:39 +0200 -Subject: [PATCH] Fix build error on OSX - -When building Gold on OSX 10.9 and Clang 6.0, the build process fails -with the error: - - In file included from /Users/thomas/minix/tools/binutils/../../external/gpl3/binutils/dist/gold/binary.cc:31: - In file included from /Users/thomas/minix/tools/binutils/../../external/gpl3/binutils/dist/gold/stringpool.h:23: - In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:438: - In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:107: - In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype:54: - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype:51:72: error: use of undeclared identifier 'do_not_use_isalnum_with_safe_ctype' - inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);} - -Signed-off-by: Thomas Veerman ---- - gold/binary.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gold/binary.cc b/gold/binary.cc -index 4dab52c..77a78f0 100644 ---- a/gold/binary.cc -+++ b/gold/binary.cc -@@ -24,10 +24,10 @@ - - #include - #include -+#include "stringpool.h" - #include "safe-ctype.h" - - #include "elfcpp.h" --#include "stringpool.h" - #include "fileread.h" - #include "output.h" - #include "binary.h" --- -1.7.12.4 (Apple Git-37) - diff --git a/external/gpl3/binutils/patches/0009-Slash-means-divide.patch b/external/gpl3/binutils/patches/0009-Slash-means-divide.patch deleted file mode 100644 index 5c4755630..000000000 --- a/external/gpl3/binutils/patches/0009-Slash-means-divide.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -rNU3 dist.orig/gas/config/tc-i386.c dist/gas/config/tc-i386.c ---- dist.orig/gas/config/tc-i386.c 2012-11-09 14:32:04.000000000 +0100 -+++ dist/gas/config/tc-i386.c 2015-10-17 16:40:27.000000000 +0200 -@@ -317,6 +317,7 @@ - && !defined (TE_NETWARE) \ - && !defined (TE_FreeBSD) \ - && !defined (TE_DragonFly) \ -+ && !defined (TE_MINIX) \ - && !defined (TE_NetBSD))) - /* This array holds the chars that always start a comment. If the - pre-processor is disabled, these aren't very useful. The option diff --git a/external/gpl3/binutils/patches/0010-armelf_minix-update.patch b/external/gpl3/binutils/patches/0010-armelf_minix-update.patch deleted file mode 100644 index b4e463a44..000000000 --- a/external/gpl3/binutils/patches/0010-armelf_minix-update.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -rNU3 dist.orig/ld/emulparams/armelf_minix.sh dist/ld/emulparams/armelf_minix.sh ---- dist.orig/ld/emulparams/armelf_minix.sh 2015-12-20 16:45:57.000000000 +0100 -+++ dist/ld/emulparams/armelf_minix.sh 2016-01-13 13:21:27.000000000 +0100 -@@ -3,13 +3,19 @@ - OUTPUT_FORMAT="elf32-littlearm" - MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" - COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)" -- --DATA_START_SYMBOLS='PROVIDE (__data_start = .);'; -+TEXT_START_ADDR=0x00010000 - - # Dynamic libraries support --GENERATE_SHLIB_SCRIPT=yes - TARGET2_TYPE=got-rel - --GENERATE_PIE_SCRIPT=yes -- - unset EMBEDDED -+unset DATA_START_SYMBOLS -+unset STACK_ADDR -+ -+# Use the ARM ABI-compliant exception-handling sections. -+OTHER_READONLY_SECTIONS=" -+ .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) } -+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); } -+ .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) } -+ ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }" -+ diff --git a/external/gpl3/binutils/usr.bin/Makefile b/external/gpl3/binutils/usr.bin/Makefile index 1ec042e3d..ba65afdd3 100644 --- a/external/gpl3/binutils/usr.bin/Makefile +++ b/external/gpl3/binutils/usr.bin/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2013/08/06 05:35:57 matt Exp $ +# $NetBSD: Makefile,v 1.6 2016/01/29 14:42:48 christos Exp $ .include @@ -7,7 +7,7 @@ BINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/} .if ${MKBINUTILS} != "no" && exists(${.CURDIR}/common/arch/${BINUTILS_MACHINE_ARCH}/defs.mk) .include "${.CURDIR}/common/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" -SSUBDIR+= gas gprof ld ${G_PROGRAMS:C/-new$//:C/sysdump//:C/srconv//:cxxfilt=c++filt} +SSUBDIR+= gas gprof ld ${G_PROGRAMS:C/-new$//:C/sysdump//:C/bfdtest1//:C/bfdtest2//:C/srconv//:cxxfilt=c++filt/} SUBDIR+= common .WAIT ${SSUBDIR:O} # alphabetize .endif # MKBINUTILS != no diff --git a/external/gpl3/binutils/usr.bin/Makefile.inc b/external/gpl3/binutils/usr.bin/Makefile.inc index 2e860ad98..1d5cc5edf 100644 --- a/external/gpl3/binutils/usr.bin/Makefile.inc +++ b/external/gpl3/binutils/usr.bin/Makefile.inc @@ -1,20 +1,5 @@ -# $NetBSD: Makefile.inc,v 1.6 2013/08/06 05:35:57 matt Exp $ +# $NetBSD: Makefile.inc,v 1.7 2016/01/26 19:37:47 christos Exp $ BINDIR?= /usr/bin - -.if !defined(__MAKEFILE_INC_INCLUDED__) -__MAKEFILE_INC_INCLUDED__=1 - -.include - -BINUTILS_MACHINE_ARCH= ${MACHINE_ARCH:C/armv[4-7]/arm/} - -GNUHOSTDIST= ${DIST} -GNUCPPFLAGS= ${G_DEFS} ${G_INCLUDES} -CPPFLAGS+= ${GNUCPPFLAGS:M-D*:N-DLOCALEDIR*} ${GNUCPPFLAGS:M-I*:N-I.*} \ - -I${TOP}/${BFDSUBDIR}/libbfd/arch/${BINUTILS_MACHINE_ARCH} \ - -I${DIST}/include -I${DIST}/bfd -I${DIST}/binutils \ - -DLOCALEDIR=\"${LOCALEDIR}\" NOGCCERROR= # defined - -.endif # __MAKEFILE_INC_INCLUDED__ +.include "${.PARSEDIR}/../Makefile.inc" diff --git a/external/gpl3/binutils/usr.bin/addr2line/Makefile b/external/gpl3/binutils/usr.bin/addr2line/Makefile index fa65632fb..18ed457c7 100644 --- a/external/gpl3/binutils/usr.bin/addr2line/Makefile +++ b/external/gpl3/binutils/usr.bin/addr2line/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:07 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:47 christos Exp $ PROG= addr2line -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/ar/Makefile b/external/gpl3/binutils/usr.bin/ar/Makefile index 421fbce6a..d7468b480 100644 --- a/external/gpl3/binutils/usr.bin/ar/Makefile +++ b/external/gpl3/binutils/usr.bin/ar/Makefile @@ -1,10 +1,8 @@ -# $NetBSD: Makefile,v 1.2 2011/09/25 04:32:46 christos Exp $ +# $NetBSD: Makefile,v 1.3 2016/01/26 19:37:47 christos Exp $ PROG= ar COPTS.arparse.c = -Wno-stack-protector CPPFLAGS+=-Dbin_dummy_emulation=bin_vanilla_emulation -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/c++filt/Makefile b/external/gpl3/binutils/usr.bin/c++filt/Makefile index 7ce0f008a..b96238d3c 100644 --- a/external/gpl3/binutils/usr.bin/c++filt/Makefile +++ b/external/gpl3/binutils/usr.bin/c++filt/Makefile @@ -1,11 +1,9 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:08 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:47 christos Exp $ PROG= c++filt CPPFLAGS+= -DMAIN CLEANFILES+= c++filt.1 -.include - .include "${.CURDIR}/../common/Makefile.prog" .PATH: ${DIST}/libiberty diff --git a/external/gpl3/binutils/usr.bin/coffdump/Makefile b/external/gpl3/binutils/usr.bin/coffdump/Makefile index 4d200db27..d5dc33bc6 100644 --- a/external/gpl3/binutils/usr.bin/coffdump/Makefile +++ b/external/gpl3/binutils/usr.bin/coffdump/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:08 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:47 christos Exp $ PROG= coffdump -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/common/Makefile b/external/gpl3/binutils/usr.bin/common/Makefile index 58eb946f4..3a3d698fb 100644 --- a/external/gpl3/binutils/usr.bin/common/Makefile +++ b/external/gpl3/binutils/usr.bin/common/Makefile @@ -1,8 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2013/08/05 00:08:58 matt Exp $ - -.include - -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils +# $NetBSD: Makefile,v 1.7 2016/01/26 19:37:47 christos Exp $ .include "${.CURDIR}/../common/Makefile.inc" .include "${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" diff --git a/external/gpl3/binutils/usr.bin/common/Makefile.inc b/external/gpl3/binutils/usr.bin/common/Makefile.inc index 389f12a8d..271edda00 100644 --- a/external/gpl3/binutils/usr.bin/common/Makefile.inc +++ b/external/gpl3/binutils/usr.bin/common/Makefile.inc @@ -1,10 +1,19 @@ -# $NetBSD: Makefile.inc,v 1.3 2013/08/06 05:35:57 matt Exp $ +# $NetBSD: Makefile.inc,v 1.4 2016/01/26 19:37:47 christos Exp $ .if !defined(__COMMON_MAKEFILE_INC_INCLUDED__) __COMMON_MAKEFILE_INC_INCLUDED__=1 +.include + +BINUTILS_MACHINE_ARCH= ${MACHINE_ARCH:C/armv[4-7]/arm/} + +GNUHOSTDIST= ${DIST} +GNUCPPFLAGS= ${G_DEFS} ${G_INCLUDES} +CPPFLAGS+= ${GNUCPPFLAGS:M-D*:N-DLOCALEDIR*} ${GNUCPPFLAGS:M-I*:N-I.*} \ + -I${TOP}/${BFDSUBDIR}/libbfd/arch/${BINUTILS_MACHINE_ARCH} \ + -I${DIST}/include -I${DIST}/bfd -I${DIST}/binutils \ + -DLOCALEDIR=\"${LOCALEDIR}\" BINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/} -DIST= ${NETBSDSRCDIR}/external/gpl3/binutils/dist BFDSUBDIR= lib .endif diff --git a/external/gpl3/binutils/usr.bin/common/Makefile.prog b/external/gpl3/binutils/usr.bin/common/Makefile.prog index 587159401..5758deb2b 100644 --- a/external/gpl3/binutils/usr.bin/common/Makefile.prog +++ b/external/gpl3/binutils/usr.bin/common/Makefile.prog @@ -1,13 +1,12 @@ -# $NetBSD: Makefile.prog,v 1.9 2013/08/06 05:35:57 matt Exp $ +# $NetBSD: Makefile.prog,v 1.10 2016/01/26 19:37:47 christos Exp $ # # Common Makefile fragment for a binutils program. # -.include - BINUTILS_MACHINE_ARCH=${MACHINE_ARCH:C/armv[4-7]/arm/} +CPPFLAGS+= -I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH} -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils +.include .include "${.CURDIR}/../common/Makefile.inc" .include "${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" @@ -20,7 +19,6 @@ SRCS= ${G_${BUPROG}_OBJECTS:.o=.c} \ ${G_${BUPROG}_DEPENDENCIES:M*.o:.o=.c} MAN= ${G_man_MANS:M${PROG}.1} -CPPFLAGS+= -I${.CURDIR}/../common/arch/${BINUTILS_MACHINE_ARCH} .if !empty(G_${BUPROG}_DEPENDENCIES:M*/libopcodes*) PROGDPLIBS+= opcodes ${TOP}/${BFDSUBDIR}/libopcodes diff --git a/external/gpl3/binutils/usr.bin/common/arch/aarch64/config.h b/external/gpl3/binutils/usr.bin/common/arch/aarch64/config.h index 105acc14b..3d999fbdd 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/aarch64/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/aarch64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/aarch64/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/aarch64/defs.mk index 72107e7fd..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/aarch64/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/aarch64/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/aarch64eb/config.h b/external/gpl3/binutils/usr.bin/common/arch/aarch64eb/config.h new file mode 100644 index 000000000..229e3fa23 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/common/arch/aarch64eb/config.h @@ -0,0 +1,309 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Check that config.h is #included before system headers + (this works only for glibc, but that should be enough). */ +#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) +# error config.h must be #included before system headers +#endif +#define __CONFIG_H__ 1 + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Should ar and ranlib use -D behavior by default? */ +#define DEFAULT_AR_DETERMINISTIC 0 + +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Suffix used for executables, if any. */ +#define EXECUTABLE_SUFFIX "" + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the declaration of `environ', and to 0 if you + don't. */ +#define HAVE_DECL_ENVIRON 0 + +/* Define to 1 if you have the declaration of `fprintf', and to 0 if you + don't. */ +#define HAVE_DECL_FPRINTF 1 + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#define HAVE_DECL_GETC_UNLOCKED 1 + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#define HAVE_DECL_GETENV 1 + +/* Is the prototype for getopt in in the expected format? */ +#define HAVE_DECL_GETOPT 1 + +/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't. + */ +#define HAVE_DECL_SBRK 1 + +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#define HAVE_DECL_SNPRINTF 1 + +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. + */ +#define HAVE_DECL_STPCPY 1 + +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + +/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. + */ +#define HAVE_DECL_STRSTR 1 + +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VSNPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Does the platform use an executable suffix? */ +/* #undef HAVE_EXECUTABLE_SUFFIX */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getc_unlocked' function. */ +#define HAVE_GETC_UNLOCKED 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Does define struct utimbuf? */ +#define HAVE_GOOD_UTIME_H 1 + +/* Define if you have the iconv() function. */ +#define HAVE_ICONV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + +/* Define if mbstate_t exists in wchar.h. */ +#define HAVE_MBSTATE_T 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkdtemp' function. */ +#define HAVE_MKDTEMP 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the `setmode' function. */ +#define HAVE_SETMODE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strcoll' function. */ +#define HAVE_STRCOLL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Is the type time_t defined in ? */ +#define HAVE_TIME_T_IN_TIME_H 1 + +/* Is the type time_t defined in ? */ +#define HAVE_TIME_T_IN_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `utimes' function. */ +#define HAVE_UTIMES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define as const if the declaration of iconv() needs const. */ +#define ICONV_CONST + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "binutils" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "binutils" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "binutils 2.34" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "binutils" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +#define STRING_WITH_STRINGS 1 + +/* Configured target name. */ +#define TARGET "aarch64_be--netbsd" + +/* Define to 1 if user symbol names have a leading underscore, 0 if not. */ +#define TARGET_PREPENDS_UNDERSCORE 0 + +/* Use b modifier when opening binary files? */ +/* #undef USE_BINARY_FOPEN */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "2.34" + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/aarch64eb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..8d338db83 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/common/arch/aarch64eb/defs.mk @@ -0,0 +1,40 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_VERSION=2.34 +G_DEFS=-DHAVE_CONFIG_H +G_INCLUDES= +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_TEXINFOS=binutils.texi +G_PKGVERSION=(NetBSD Binutils nb1) +G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} +G_size_OBJECTS=size.o bucomm.o version.o filemode.o +G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la +G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o +G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o +G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o +G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o +G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la +G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o +G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o +G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o +G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/alpha/config.h b/external/gpl3/binutils/usr.bin/common/arch/alpha/config.h index b6959eeee..0b3122eba 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/alpha/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/alpha/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/alpha/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/alpha/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/alpha/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/alpha/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/arm/config.h b/external/gpl3/binutils/usr.bin/common/arch/arm/config.h index 1bd28988a..a458d0cb1 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/arm/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/arm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/arm/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/arm/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/arm/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/arm/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/armeb/config.h b/external/gpl3/binutils/usr.bin/common/arch/armeb/config.h index 05a9dca2d..95cd98a2e 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/armeb/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/armeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/armeb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/armeb/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/armeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/armeb/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/coldfire/config.h b/external/gpl3/binutils/usr.bin/common/arch/coldfire/config.h index 1735e8d6a..f6f9b2776 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/coldfire/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/coldfire/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -68,6 +71,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -106,6 +113,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -172,11 +182,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +199,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,7 +265,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/coldfire/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/coldfire/defs.mk index e7616a664..9408644dd 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/coldfire/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/coldfire/defs.mk @@ -1,11 +1,11 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.26.1 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) @@ -34,3 +34,7 @@ G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/earm/config.h b/external/gpl3/binutils/usr.bin/common/arch/earm/config.h index 05c1edee3..4e0cd9eac 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earm/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/earm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -39,6 +42,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -70,6 +77,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -90,6 +101,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -104,6 +118,9 @@ #define HAVE_LC_MESSAGES 1 #endif /* !defined(__minix) */ +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 @@ -112,6 +129,9 @@ #define HAVE_LOCALE_H 1 #endif /* !defined(__minix) */ +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -124,6 +144,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -182,11 +205,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -199,19 +222,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -259,12 +288,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -280,3 +314,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/earm/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/earm/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earm/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/earm/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/earmeb/config.h b/external/gpl3/binutils/usr.bin/common/arch/earmeb/config.h index 40030d990..650da8787 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earmeb/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/earmeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/earmeb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/earmeb/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earmeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/earmeb/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/earmhf/config.h b/external/gpl3/binutils/usr.bin/common/arch/earmhf/config.h index ee219d291..f8add3d8b 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earmhf/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/earmhf/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/earmhf/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/earmhf/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earmhf/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/earmhf/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/config.h b/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/config.h index f4ec757a7..9077118ac 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/earmhfeb/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/hppa/config.h b/external/gpl3/binutils/usr.bin/common/arch/hppa/config.h index ab7bf2881..5ce4e46c7 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/hppa/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/hppa/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/hppa/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/hppa/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/hppa/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/hppa/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/i386/config.h b/external/gpl3/binutils/usr.bin/common/arch/i386/config.h index 7f73f04e0..820fd4536 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/i386/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/i386/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -39,6 +42,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -70,6 +77,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -90,6 +101,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -104,6 +118,9 @@ #define HAVE_LC_MESSAGES 1 #endif /* !defined(__minix) */ +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 @@ -112,6 +129,9 @@ #define HAVE_LOCALE_H 1 #endif /* !defined(__minix) */ +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -124,6 +144,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -182,11 +205,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -199,19 +222,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -259,12 +288,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -280,3 +314,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/i386/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/i386/defs.mk index e7616a664..6a244f9c7 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/i386/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/i386/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/ia64/config.h b/external/gpl3/binutils/usr.bin/common/arch/ia64/config.h index 6ee278610..efe9cffbb 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/ia64/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/ia64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,8 +138,11 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ -/* #undef HAVE_SBRK */ +#define HAVE_SBRK 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/ia64/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/ia64/defs.mk index 81b76b45f..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/ia64/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/ia64/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/m68000/config.h b/external/gpl3/binutils/usr.bin/common/arch/m68000/config.h index 79d185926..91835cef0 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/m68000/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/m68000/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/m68000/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/m68000/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/m68000/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/m68000/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/m68k/config.h b/external/gpl3/binutils/usr.bin/common/arch/m68k/config.h index d75e89454..cd3993d7f 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/m68k/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/m68k/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/m68k/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/m68k/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/m68k/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/m68k/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/mips64eb/config.h b/external/gpl3/binutils/usr.bin/common/arch/mips64eb/config.h index f05082116..4d950e57c 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mips64eb/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/mips64eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/mips64eb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/mips64eb/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mips64eb/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/mips64eb/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/mips64el/config.h b/external/gpl3/binutils/usr.bin/common/arch/mips64el/config.h index 24dbf4223..9e55377dd 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mips64el/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/mips64el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/mips64el/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/mips64el/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mips64el/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/mips64el/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/mipseb/config.h b/external/gpl3/binutils/usr.bin/common/arch/mipseb/config.h index e7073bf87..b6d94a3ab 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mipseb/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/mipseb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/mipseb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/mipseb/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mipseb/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/mipseb/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/mipsel/config.h b/external/gpl3/binutils/usr.bin/common/arch/mipsel/config.h index 8ee2006fb..4915a530f 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mipsel/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/mipsel/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/mipsel/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/mipsel/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/mipsel/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/mipsel/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/or1k/config.h b/external/gpl3/binutils/usr.bin/common/arch/or1k/config.h index 4ea901cd9..3c55b0264 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/or1k/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/or1k/config.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -68,6 +71,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -106,6 +113,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -172,11 +182,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +199,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -218,7 +234,7 @@ #define STRING_WITH_STRINGS 1 /* Configured target name. */ -#define TARGET "or1k-unknown-netbsd" +#define TARGET "or1k--netbsd" /* Define to 1 if user symbol names have a leading underscore, 0 if not. */ #define TARGET_PREPENDS_UNDERSCORE 0 @@ -249,11 +265,11 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ -/* #undef YYTEXT_POINTER */ +#define YYTEXT_POINTER 1 /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/or1k/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/or1k/defs.mk index 81b76b45f..9408644dd 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/or1k/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/or1k/defs.mk @@ -2,10 +2,10 @@ # Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp # Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.26.1 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) @@ -34,3 +34,7 @@ G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/powerpc/config.h b/external/gpl3/binutils/usr.bin/common/arch/powerpc/config.h index 054e8a8f7..a292eb968 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/powerpc/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/powerpc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/powerpc/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/powerpc/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/powerpc/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/powerpc/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/powerpc64/config.h b/external/gpl3/binutils/usr.bin/common/arch/powerpc64/config.h index 59540dd4f..549e1acf2 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/powerpc64/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/powerpc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/powerpc64/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/powerpc64/defs.mk index d821d1b31..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/powerpc64/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/powerpc64/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/riscv32/config.h b/external/gpl3/binutils/usr.bin/common/arch/riscv32/config.h index b28ac7b06..7887263ca 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/riscv32/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/riscv32/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -218,7 +247,7 @@ #define STRING_WITH_STRINGS 1 /* Configured target name. */ -#define TARGET "riscv32-ucb-netbsd" +#define TARGET "riscv32--netbsd" /* Define to 1 if user symbol names have a leading underscore, 0 if not. */ #define TARGET_PREPENDS_UNDERSCORE 0 @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/riscv32/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/riscv32/defs.mk index 81b76b45f..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/riscv32/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/riscv32/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/riscv64/config.h b/external/gpl3/binutils/usr.bin/common/arch/riscv64/config.h index 4b57db1b8..12c600671 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/riscv64/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/riscv64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -218,7 +247,7 @@ #define STRING_WITH_STRINGS 1 /* Configured target name. */ -#define TARGET "riscv64-ucb-netbsd" +#define TARGET "riscv64--netbsd" /* Define to 1 if user symbol names have a leading underscore, 0 if not. */ #define TARGET_PREPENDS_UNDERSCORE 0 @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/riscv64/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/riscv64/defs.mk index 81b76b45f..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/riscv64/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/riscv64/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/sh3eb/config.h b/external/gpl3/binutils/usr.bin/common/arch/sh3eb/config.h index aa672d4a0..fd6213950 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sh3eb/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/sh3eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/sh3eb/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/sh3eb/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sh3eb/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/sh3eb/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/sh3el/config.h b/external/gpl3/binutils/usr.bin/common/arch/sh3el/config.h index 830aed7b4..186674903 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sh3el/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/sh3el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,8 +195,8 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST const @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/sh3el/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/sh3el/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sh3el/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/sh3el/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/sparc/config.h b/external/gpl3/binutils/usr.bin/common/arch/sparc/config.h index a6b0b5f32..2467b0060 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sparc/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/sparc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/sparc/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/sparc/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sparc/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/sparc/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/sparc64/config.h b/external/gpl3/binutils/usr.bin/common/arch/sparc64/config.h index f6d1424fb..965f8b800 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sparc64/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/sparc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/sparc64/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/sparc64/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/sparc64/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/sparc64/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/vax/config.h b/external/gpl3/binutils/usr.bin/common/arch/vax/config.h index 11520e70c..2e5029bf9 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/vax/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/vax/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/vax/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/vax/defs.mk index e7616a664..8d338db83 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/vax/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/vax/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/common/arch/x86_64/config.h b/external/gpl3/binutils/usr.bin/common/arch/x86_64/config.h index 39d04695a..f59af309b 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/x86_64/config.h +++ b/external/gpl3/binutils/usr.bin/common/arch/x86_64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -23,6 +23,9 @@ /* Should ar and ranlib use -D behavior by default? */ #define DEFAULT_AR_DETERMINISTIC 0 +/* Should strings use -a behavior by default? */ +#define DEFAULT_STRINGS_ALL 1 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -37,6 +40,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `environ', and to 0 if you don't. */ #define HAVE_DECL_ENVIRON 0 @@ -68,6 +75,10 @@ */ #define HAVE_DECL_STPCPY 1 +/* Define to 1 if you have the declaration of `strnlen', and to 0 if you + don't. */ +#define HAVE_DECL_STRNLEN 1 + /* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. */ #define HAVE_DECL_STRSTR 1 @@ -88,6 +99,9 @@ /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Does define struct utimbuf? */ #define HAVE_GOOD_UTIME_H 1 @@ -100,12 +114,18 @@ /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 +/* Define to 1 if debuginfod is enabled. */ +/* #undef HAVE_LIBDEBUGINFOD */ + /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 +/* Define to 1 if the system has the type `long long'. */ +#define HAVE_LONG_LONG 1 + /* Define if mbstate_t exists in wchar.h. */ #define HAVE_MBSTATE_T 1 @@ -118,6 +138,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the `sbrk' function. */ #define HAVE_SBRK 1 @@ -172,11 +195,11 @@ /* Define to 1 if you have the header file. */ #define HAVE_WCHAR_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -189,19 +212,25 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "binutils" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "binutils 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "binutils" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 8 + +/* The size of `long long', as computed by sizeof. */ +#define SIZEOF_LONG_LONG 8 /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -249,12 +278,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -270,3 +304,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/common/arch/x86_64/defs.mk b/external/gpl3/binutils/usr.bin/common/arch/x86_64/defs.mk index e7616a664..6a244f9c7 100644 --- a/external/gpl3/binutils/usr.bin/common/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/usr.bin/common/arch/x86_64/defs.mk @@ -1,36 +1,40 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # -G_VERSION=2.23.2 +G_VERSION=2.34 G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= -G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt -G_man_MANS=addr2line.1 ar.1 dlltool.1 nlmconv.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 +G_PROGRAMS=size objdump ar strings ranlib objcopy addr2line readelf elfedit nm-new strip-new cxxfilt bfdtest1 bfdtest2 +G_man_MANS=addr2line.1 ar.1 dlltool.1 nm.1 objcopy.1 objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 elfedit.1 windres.1 windmc.1 c++filt.1 G_TEXINFOS=binutils.texi G_PKGVERSION=(NetBSD Binutils nb1) G_REPORT_BUGS_TEXI=@uref{http://www.NetBSD.org/support/send-pr.html} G_size_OBJECTS=size.o bucomm.o version.o filemode.o G_size_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o ieee.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o -G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la +G_objdump_OBJECTS=objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o +G_objdump_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la ../opcodes/libopcodes.la ../libctf/libctf.la G_ar_OBJECTS=arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ar_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_strings_OBJECTS=strings.o bucomm.o version.o filemode.o G_strings_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_ranlib_OBJECTS=ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o binemul.o emul_vanilla.o bucomm.o version.o filemode.o G_ranlib_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_objcopy_OBJECTS=objcopy.o not-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_objcopy_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_addr2line_OBJECTS=addr2line.o bucomm.o version.o filemode.o G_addr2line_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_readelf_OBJECTS=readelf.o version.o unwind-ia64.o dwarf.o elfcomm.o -G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a +G_readelf_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../libctf/libctf-nobfd.la G_elfedit_OBJECTS=elfedit.o version.o elfcomm.o G_elfedit_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a G_nm_new_OBJECTS=nm.o bucomm.o version.o filemode.o G_nm_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la -G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +G_strip_new_OBJECTS=objcopy.o is-strip.o rename.o rddbg.o debug.o stabs.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o G_strip_new_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la G_cxxfilt_OBJECTS=cxxfilt.o bucomm.o version.o filemode.o G_cxxfilt_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest1_OBJECTS=bfdtest1.o +G_bfdtest1_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la +G_bfdtest2_OBJECTS=bfdtest2.o +G_bfdtest2_DEPENDENCIES=./../intl/libintl.a ../libiberty/libiberty.a ../bfd/libbfd.la diff --git a/external/gpl3/binutils/usr.bin/elfedit/Makefile b/external/gpl3/binutils/usr.bin/elfedit/Makefile index bcc21f3b7..f1a784cb9 100644 --- a/external/gpl3/binutils/usr.bin/elfedit/Makefile +++ b/external/gpl3/binutils/usr.bin/elfedit/Makefile @@ -1,8 +1,6 @@ -# $NetBSD: Makefile,v 1.1 2011/09/25 04:32:46 christos Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:47 christos Exp $ PROG= elfedit SRCS= elfcomm.c elfedit.c -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/gas/Makefile b/external/gpl3/binutils/usr.bin/gas/Makefile index ed3744c9c..1f9289e9f 100644 --- a/external/gpl3/binutils/usr.bin/gas/Makefile +++ b/external/gpl3/binutils/usr.bin/gas/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.12 2013/10/02 14:35:33 christos Exp $ +# $NetBSD: Makefile,v 1.13 2016/01/26 19:37:47 christos Exp $ -.include - -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils +CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} +CPPFLAGS+= -I${DIST}/gas -I${DIST}/gas/config +CPPFLAGS+= -I${DIST} .include "${.CURDIR}/../common/Makefile.inc" .include "${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" @@ -20,10 +20,6 @@ COPTS.symbols.c = -Wno-stack-protector COPTS.stabs.c = -Wno-stack-protector COPTS.macro.c = -Wno-stack-protector -CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} -CPPFLAGS+= -I${DIST}/gas -I${DIST}/gas/config -CPPFLAGS+= -I${DIST} - PROGDPLIBS+= opcodes ${TOP}/${BFDSUBDIR}/libopcodes PROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd PROGDPLIBS+= iberty ${TOP}/${BFDSUBDIR}/libiberty diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64/config.h b/external/gpl3/binutils/usr.bin/gas/arch/aarch64/config.h index 552fb7009..29acba00c 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/aarch64/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -33,7 +33,7 @@ /* #undef C_ALLOCA */ /* Default architecture. */ -/* #undef DEFAULT_ARCH */ +#define DEFAULT_ARCH "aarch64" /* Default CRIS architecture. */ /* #undef DEFAULT_CRIS_ARCH */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/config.h new file mode 100644 index 000000000..93424eeb1 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/config.h @@ -0,0 +1,421 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Check that config.h is #included before system headers + (this works only for glibc, but that should be enough). */ +#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) +# error config.h must be #included before system headers +#endif +#define __CONFIG_H__ 1 + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* Define if using AIX 5.2 value for C_WEAKEXT. */ +/* #undef AIX_WEAK_SUPPORT */ + +/* assert broken? */ +/* #undef BROKEN_ASSERT */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Compiling cross-assembler? */ +/* #undef CROSS_COMPILE */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Default architecture. */ +#define DEFAULT_ARCH "aarch64" + +/* Default CRIS architecture. */ +/* #undef DEFAULT_CRIS_ARCH */ + +/* Default emulation. */ +#define DEFAULT_EMULATION "" + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + +/* Supported emulations. */ +#define EMULATIONS + +/* Define if you want run-time sanity checks. */ +/* #undef ENABLE_CHECKING */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + +/* Define to 1 if you have the declaration of `free', and to 0 if you don't. + */ +#define HAVE_DECL_FREE 1 + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#define HAVE_DECL_GETENV 1 + +/* Is the prototype for getopt in in the expected format? */ +#define HAVE_DECL_GETOPT 1 + +/* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. + */ +#define HAVE_DECL_MALLOC 1 + +/* Define to 1 if you have the declaration of `mempcpy', and to 0 if you + don't. */ +#define HAVE_DECL_MEMPCPY 0 + +/* Define to 1 if you have the declaration of `realloc', and to 0 if you + don't. */ +#define HAVE_DECL_REALLOC 1 + +/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. + */ +#define HAVE_DECL_STPCPY 1 + +/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. + */ +#define HAVE_DECL_STRSTR 1 + +/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you + don't. */ +#define HAVE_DECL_VSNPRINTF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `remove' function. */ +/* #undef HAVE_REMOVE */ + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + +/* Define if has struct stat.st_mtim.tv_nsec */ +#define HAVE_ST_MTIM_TV_NSEC 1 + +/* Define if has struct stat.st_mtim.tv_sec */ +#define HAVE_ST_MTIM_TV_SEC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define if has struct tm.tm_gmtoff. */ +#define HAVE_TM_GMTOFF 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `unlink' function. */ +#define HAVE_UNLINK 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Using i386 COFF? */ +/* #undef I386COFF */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Default CPU for MIPS targets. */ +/* #undef MIPS_CPU_STRING_DEFAULT */ + +/* Generate 64-bit code by default on MIPS targets. */ +/* #undef MIPS_DEFAULT_64BIT */ + +/* Choose a default ABI for MIPS targets. */ +/* #undef MIPS_DEFAULT_ABI */ + +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + +/* Define if environ is not declared in system header files. */ +#define NEED_DECLARATION_ENVIRON 1 + +/* Define if errno is not declared in system header files. */ +/* #undef NEED_DECLARATION_ERRNO */ + +/* Define if ffs is not declared in system header files. */ +/* #undef NEED_DECLARATION_FFS */ + +/* Define if free is not declared in system header files. */ +/* #undef NEED_DECLARATION_FREE */ + +/* Define if malloc is not declared in system header files. */ +/* #undef NEED_DECLARATION_MALLOC */ + +/* Define if sbrk is not declared in system header files. */ +/* #undef NEED_DECLARATION_SBRK */ + +/* Define if strstr is not declared in system header files. */ +/* #undef NEED_DECLARATION_STRSTR */ + +/* a.out support? */ +/* #undef OBJ_MAYBE_AOUT */ + +/* COFF support? */ +/* #undef OBJ_MAYBE_COFF */ + +/* ECOFF support? */ +/* #undef OBJ_MAYBE_ECOFF */ + +/* ELF support? */ +/* #undef OBJ_MAYBE_ELF */ + +/* generic support? */ +/* #undef OBJ_MAYBE_GENERIC */ + +/* SOM support? */ +/* #undef OBJ_MAYBE_SOM */ + +/* Name of package */ +#define PACKAGE "gas" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "gas" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "gas 2.34" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gas" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.34" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Using strict COFF? */ +/* #undef STRICTCOFF */ + +/* Define if you can safely include both and . */ +#define STRING_WITH_STRINGS 1 + +/* Target alias. */ +#define TARGET_ALIAS "aarch64_be--netbsd" + +/* Define as 1 if big endian. */ +#define TARGET_BYTES_BIG_ENDIAN 1 + +/* Canonical target. */ +#define TARGET_CANONICAL "aarch64_be--netbsd" + +/* Target CPU. */ +#define TARGET_CPU "aarch64_be" + +/* Target OS. */ +#define TARGET_OS "netbsd" + +/* Define if default target is PowerPC Solaris. */ +/* #undef TARGET_SOLARIS_COMMENT */ + +/* Target vendor. */ +#define TARGET_VENDOR "" + +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + +/* Use b modifier when opening binary files? */ +/* #undef USE_BINARY_FOPEN */ + +/* Use emulation support? */ +/* #undef USE_EMULATIONS */ + +/* Allow use of E_MIPS_ABI_O32 on MIPS targets. */ +/* #undef USE_E_MIPS_ABI_O32 */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Using cgen code? */ +/* #undef USING_CGEN */ + +/* Version number of package */ +#define VERSION "2.34" + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# define WORDS_BIGENDIAN 1 +# endif +#endif + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/defs.mk b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..852f95d78 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/defs.mk @@ -0,0 +1,8 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# +G_DEFS=-DHAVE_CONFIG_H +G_INCLUDES= +G_OBJS=app.o as.o atof-generic.o compress-debug.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o ehopt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o remap.o sb.o stabs.o subsegs.o symbols.o write.o +G_OBJS+=tc-aarch64.o obj-elf.o atof-ieee.o diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/itbl-cpu.h b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/itbl-cpu.h new file mode 100644 index 000000000..84fcad67f --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/itbl-cpu.h @@ -0,0 +1,5 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ + +#include "itbl-aarch64.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/obj-format.h b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/obj-format.h new file mode 100644 index 000000000..268cdeaad --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/obj-format.h @@ -0,0 +1,5 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ + +#include "obj-elf.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/targ-cpu.h b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/targ-cpu.h new file mode 100644 index 000000000..ce40ad560 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/targ-cpu.h @@ -0,0 +1,5 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ + +#include "tc-aarch64.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/targ-env.h new file mode 100644 index 000000000..146d9553f --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gas/arch/aarch64eb/targ-env.h @@ -0,0 +1,5 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ + +#include "te-nbsd.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/alpha/config.h b/external/gpl3/binutils/usr.bin/gas/arch/alpha/config.h index d403b8919..97c01f650 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/alpha/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/alpha/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/arm/config.h b/external/gpl3/binutils/usr.bin/gas/arch/arm/config.h index d22a9f41c..07974fa48 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/arm/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/arm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/armeb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/armeb/config.h index 3243c45ca..b4b3945d8 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/armeb/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/armeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -336,7 +382,7 @@ # endif #else # ifndef WORDS_BIGENDIAN -/* # undef WORDS_BIGENDIAN */ +# define WORDS_BIGENDIAN 1 # endif #endif @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/coldfire/config.h b/external/gpl3/binutils/usr.bin/gas/arch/coldfire/config.h index 67858813f..cc40b83a8 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/coldfire/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/coldfire/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,11 +41,17 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + /* Supported emulations. */ #define EMULATIONS /* Define if you want run-time sanity checks. */ -/* #undef ENABLE_CHECKING */ +#define ENABLE_CHECKING 1 /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -58,6 +64,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -159,8 +169,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -184,6 +194,24 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -233,19 +261,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* Define if defaulting to ELF on SCO 5. */ /* #undef SCO_ELF */ @@ -326,7 +354,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earm/config.h b/external/gpl3/binutils/usr.bin/gas/arch/earm/config.h index a410b4a8a..91e3fa1cb 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earm/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -60,6 +84,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -143,6 +171,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -167,8 +198,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -177,12 +208,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -192,6 +217,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -216,9 +268,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -241,22 +290,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -293,12 +339,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "elf32" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -334,7 +380,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -352,6 +398,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -373,3 +424,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earm/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/earm/targ-env.h index 4c7d0fcc2..ad528b87e 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earm/targ-env.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earm/targ-env.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ #include "te-armnbsdeabi.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earmeb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/earmeb/config.h index 544d8c1e9..948b75668 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earmeb/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earmeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earmeb/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/earmeb/targ-env.h index 4c7d0fcc2..ad528b87e 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earmeb/targ-env.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earmeb/targ-env.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ #include "te-armnbsdeabi.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earmhf/config.h b/external/gpl3/binutils/usr.bin/gas/arch/earmhf/config.h index 1672cb51d..c81c56afa 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earmhf/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earmhf/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earmhf/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/earmhf/targ-env.h index 75045d5bc..5ca71edad 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earmhf/targ-env.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earmhf/targ-env.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ #include "te-armnbsdeabihf.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/config.h index 344f9f443..336408bad 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/targ-env.h index 75045d5bc..5ca71edad 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/targ-env.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/earmhfeb/targ-env.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ #include "te-armnbsdeabihf.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/hppa/config.h b/external/gpl3/binutils/usr.bin/gas/arch/hppa/config.h index 8a9678ebd..2b29c0a9a 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/hppa/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/hppa/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/i386/config.h b/external/gpl3/binutils/usr.bin/gas/arch/i386/config.h index 6c56b1d0c..715259270 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/i386/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/i386/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "i386elf" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS &i386elf, @@ -60,6 +84,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -143,6 +171,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -167,8 +198,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -177,12 +208,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -192,6 +217,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -216,9 +268,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -241,22 +290,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -293,12 +339,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "elf32" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -334,7 +380,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -352,6 +398,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -373,3 +424,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/ia64/config.h b/external/gpl3/binutils/usr.bin/gas/arch/ia64/config.h index e6594c987..cc4d59737 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/ia64/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/ia64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -118,7 +146,7 @@ /* #undef HAVE_REMOVE */ /* Define to 1 if you have the `sbrk' function. */ -/* #undef HAVE_SBRK */ +#define HAVE_SBRK 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -200,7 +252,7 @@ /* #undef NEED_DECLARATION_MALLOC */ /* Define if sbrk is not declared in system header files. */ -#define NEED_DECLARATION_SBRK 1 +/* #undef NEED_DECLARATION_SBRK */ /* Define if strstr is not declared in system header files. */ /* #undef NEED_DECLARATION_STRSTR */ @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/m68000/config.h b/external/gpl3/binutils/usr.bin/gas/arch/m68000/config.h index b1c412156..3dd07cb09 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/m68000/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/m68000/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/m68k/config.h b/external/gpl3/binutils/usr.bin/gas/arch/m68k/config.h index 6a8f3327c..eddab2953 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/m68k/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/m68k/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/mips64eb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/mips64eb/config.h index a1ab58e31..1a1ed13b0 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/mips64eb/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/mips64eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "mipsbelf" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS &mipsbelf, &mipslelf, &mipself, @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ #define MIPS_CPU_STRING_DEFAULT "from-abi" @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ #define MIPS_DEFAULT_ABI NO_ABI +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/mips64el/config.h b/external/gpl3/binutils/usr.bin/gas/arch/mips64el/config.h index 9b9412a55..67759b8e1 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/mips64el/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/mips64el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "mipslelf" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS &mipslelf, &mipsbelf, &mipself, @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ #define MIPS_CPU_STRING_DEFAULT "from-abi" @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ #define MIPS_DEFAULT_ABI NO_ABI +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/mipseb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/mipseb/config.h index 36d02d015..5f891b790 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/mipseb/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/mipseb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "mipsbelf" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS &mipsbelf, &mipslelf, &mipself, @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ #define MIPS_CPU_STRING_DEFAULT "from-abi" @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ #define MIPS_DEFAULT_ABI NO_ABI +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/mipsel/config.h b/external/gpl3/binutils/usr.bin/gas/arch/mipsel/config.h index fb7e76dcc..5acc14b6d 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/mipsel/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/mipsel/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "mipslelf" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS &mipslelf, &mipsbelf, &mipself, @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ #define MIPS_CPU_STRING_DEFAULT "from-abi" @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ #define MIPS_DEFAULT_ABI NO_ABI +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/or1k/config.h b/external/gpl3/binutils/usr.bin/gas/arch/or1k/config.h index c132ea08e..37d217fd5 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/or1k/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/or1k/config.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,11 +41,17 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + /* Supported emulations. */ #define EMULATIONS /* Define if you want run-time sanity checks. */ -/* #undef ENABLE_CHECKING */ +#define ENABLE_CHECKING 1 /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -58,6 +64,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -159,8 +169,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -184,6 +194,24 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -233,19 +261,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* Define if defaulting to ELF on SCO 5. */ /* #undef SCO_ELF */ @@ -274,7 +302,7 @@ #define TARGET_BYTES_BIG_ENDIAN 1 /* Canonical target. */ -#define TARGET_CANONICAL "or1k-unknown-netbsd" +#define TARGET_CANONICAL "or1k--netbsd" /* Target CPU. */ #define TARGET_CPU "or1k" @@ -289,7 +317,7 @@ /* #undef TARGET_SYMBIAN */ /* Target vendor. */ -#define TARGET_VENDOR "unknown" +#define TARGET_VENDOR "" /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +354,7 @@ #define USING_CGEN 1 /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -342,7 +370,7 @@ /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ -/* #undef YYTEXT_POINTER */ +#define YYTEXT_POINTER 1 /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/powerpc/config.h b/external/gpl3/binutils/usr.bin/gas/arch/powerpc/config.h index e0e079099..70cb6ec8e 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/powerpc/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/powerpc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/powerpc64/config.h b/external/gpl3/binutils/usr.bin/gas/arch/powerpc64/config.h index c02c44e25..2b6161192 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/powerpc64/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/powerpc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/riscv32/config.h b/external/gpl3/binutils/usr.bin/gas/arch/riscv32/config.h index 9f67f3b1f..d322effec 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/riscv32/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/riscv32/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -33,7 +33,7 @@ /* #undef C_ALLOCA */ /* Default architecture. */ -/* #undef DEFAULT_ARCH */ +#define DEFAULT_ARCH "riscv32" /* Default CRIS architecture. */ /* #undef DEFAULT_CRIS_ARCH */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -274,7 +320,7 @@ #define TARGET_BYTES_BIG_ENDIAN 0 /* Canonical target. */ -#define TARGET_CANONICAL "riscv32-ucb-netbsd" +#define TARGET_CANONICAL "riscv32--netbsd" /* Target CPU. */ #define TARGET_CPU "riscv32" @@ -285,11 +331,11 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ -#define TARGET_VENDOR "ucb" +#define TARGET_VENDOR "" + +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/riscv32/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/riscv32/targ-env.h index 146d9553f..b64fbccf0 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/riscv32/targ-env.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/riscv32/targ-env.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#include "te-nbsd.h" +#include "te-generic.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/riscv64/config.h b/external/gpl3/binutils/usr.bin/gas/arch/riscv64/config.h index 25c2e1fd8..83c8349fa 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/riscv64/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/riscv64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -33,7 +33,7 @@ /* #undef C_ALLOCA */ /* Default architecture. */ -/* #undef DEFAULT_ARCH */ +#define DEFAULT_ARCH "riscv64" /* Default CRIS architecture. */ /* #undef DEFAULT_CRIS_ARCH */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -274,7 +320,7 @@ #define TARGET_BYTES_BIG_ENDIAN 0 /* Canonical target. */ -#define TARGET_CANONICAL "riscv64-ucb-netbsd" +#define TARGET_CANONICAL "riscv64--netbsd" /* Target CPU. */ #define TARGET_CPU "riscv64" @@ -285,11 +331,11 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ -#define TARGET_VENDOR "ucb" +#define TARGET_VENDOR "" + +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/riscv64/targ-env.h b/external/gpl3/binutils/usr.bin/gas/arch/riscv64/targ-env.h index 146d9553f..b64fbccf0 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/riscv64/targ-env.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/riscv64/targ-env.h @@ -1,5 +1,5 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ -#include "te-nbsd.h" +#include "te-generic.h" diff --git a/external/gpl3/binutils/usr.bin/gas/arch/sh3eb/config.h b/external/gpl3/binutils/usr.bin/gas/arch/sh3eb/config.h index 69e3df479..cf2864ef4 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/sh3eb/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/sh3eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/sh3el/config.h b/external/gpl3/binutils/usr.bin/gas/arch/sh3el/config.h index bd6da3f3f..bcd0d8d57 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/sh3el/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/sh3el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/sparc/config.h b/external/gpl3/binutils/usr.bin/gas/arch/sparc/config.h index 3daa7e81e..26ac02053 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/sparc/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/sparc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/sparc64/config.h b/external/gpl3/binutils/usr.bin/gas/arch/sparc64/config.h index 882509fe6..35c82cea8 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/sparc64/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/sparc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/vax/config.h b/external/gpl3/binutils/usr.bin/gas/arch/vax/config.h index 7d1a911bb..22c9eb694 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/vax/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/vax/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/x86_64/config.h b/external/gpl3/binutils/usr.bin/gas/arch/x86_64/config.h index 86ca8b959..e943c2ac4 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/x86_64/config.h +++ b/external/gpl3/binutils/usr.bin/gas/arch/x86_64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -41,6 +41,30 @@ /* Default emulation. */ #define DEFAULT_EMULATION "i386elf" +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to generate GNU Build attribute notes by default, + if none are contained in the input. */ +#define DEFAULT_GENERATE_BUILD_NOTES 0 + +/* Define to 1 if you want to generate ELF common symbols with the STT_COMMON + type by default. */ +#define DEFAULT_GENERATE_ELF_STT_COMMON 0 + +/* Define to 1 if you want to generate x86 relax relocations by default. */ +#define DEFAULT_GENERATE_X86_RELAX_RELOCATIONS 1 + +/* Define to 1 if you want to fix Loongson3 LLSC Errata by default. */ +#define DEFAULT_MIPS_FIX_LOONGSON3_LLSC 0 + +/* Define to 1 if you want to generate RISC-V arch attribute by default. */ +#define DEFAULT_RISCV_ATTR 0 + +/* Define to 1 if you want to generate GNU x86 used ISA and feature properties + by default. */ +#define DEFAULT_X86_USED_NOTE 0 + /* Supported emulations. */ #define EMULATIONS &i386elf, @@ -58,6 +82,10 @@ */ /* #undef HAVE_ALLOCA_H */ +/* Define to 1 if you have the declaration of `asprintf', and to 0 if you + don't. */ +#define HAVE_DECL_ASPRINTF 1 + /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #define HAVE_DECL_FREE 1 @@ -135,6 +163,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 +/* Define to 1 if you have the `strsignal' function. */ +#define HAVE_STRSIGNAL 1 + /* Define if has struct stat.st_mtim.tv_nsec */ #define HAVE_ST_MTIM_TV_NSEC 1 @@ -159,8 +190,8 @@ /* Define to 1 if you have the `unlink' function. */ #define HAVE_UNLINK 1 -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ /* Using i386 COFF? */ /* #undef I386COFF */ @@ -169,12 +200,6 @@ */ #define LT_OBJDIR ".libs/" -/* Using m68k COFF? */ -/* #undef M68KCOFF */ - -/* Using m88k COFF? */ -/* #undef M88KCOFF */ - /* Default CPU for MIPS targets. */ /* #undef MIPS_CPU_STRING_DEFAULT */ @@ -184,6 +209,33 @@ /* Choose a default ABI for MIPS targets. */ /* #undef MIPS_DEFAULT_ABI */ +/* Define value for nds32_arch_name */ +/* #undef NDS32_DEFAULT_ARCH_NAME */ + +/* Define default value for nds32_audio_ext */ +/* #undef NDS32_DEFAULT_AUDIO_EXT */ + +/* Define default value for nds32_dsp_ext */ +/* #undef NDS32_DEFAULT_DSP_EXT */ + +/* Define default value for nds32_dx_regs */ +/* #undef NDS32_DEFAULT_DX_REGS */ + +/* Define default value for nds32_perf_ext */ +/* #undef NDS32_DEFAULT_PERF_EXT */ + +/* Define default value for nds32_perf_ext2 */ +/* #undef NDS32_DEFAULT_PERF_EXT2 */ + +/* Define default value for nds32_string_ext */ +/* #undef NDS32_DEFAULT_STRING_EXT */ + +/* Define default value for nds32_zol_ext */ +/* #undef NDS32_DEFAULT_ZOL_EXT */ + +/* Define default value for nds32_linux_toolchain */ +/* #undef NDS32_LINUX_TOOLCHAIN */ + /* Define if environ is not declared in system header files. */ #define NEED_DECLARATION_ENVIRON 1 @@ -208,9 +260,6 @@ /* a.out support? */ /* #undef OBJ_MAYBE_AOUT */ -/* b.out support? */ -/* #undef OBJ_MAYBE_BOUT */ - /* COFF support? */ /* #undef OBJ_MAYBE_COFF */ @@ -233,22 +282,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gas" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gas 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gas" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" - -/* Define if defaulting to ELF on SCO 5. */ -/* #undef SCO_ELF */ +#define PACKAGE_VERSION "2.34" /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be @@ -285,12 +331,12 @@ /* Define if default target is PowerPC Solaris. */ /* #undef TARGET_SOLARIS_COMMENT */ -/* Define if target is Symbian OS. */ -/* #undef TARGET_SYMBIAN */ - /* Target vendor. */ #define TARGET_VENDOR "" +/* Target specific CPU. */ +/* #undef TARGET_WITH_CPU */ + /* Use b modifier when opening binary files? */ /* #undef USE_BINARY_FOPEN */ @@ -326,7 +372,7 @@ /* #undef USING_CGEN */ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -344,6 +390,11 @@ `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -365,3 +416,6 @@ #ifndef __cplusplus /* #undef inline */ #endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/external/gpl3/binutils/usr.bin/gas/arch/x86_64/defs.mk b/external/gpl3/binutils/usr.bin/gas/arch/x86_64/defs.mk index e8312c65f..4020a0fbb 100644 --- a/external/gpl3/binutils/usr.bin/gas/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gas/arch/x86_64/defs.mk @@ -1,6 +1,6 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.7 2009/11/09 13:50:41 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.10 2018/11/07 01:14:19 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_INCLUDES= diff --git a/external/gpl3/binutils/usr.bin/gprof/Makefile b/external/gpl3/binutils/usr.bin/gprof/Makefile index af5eb38da..97ae82102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/Makefile +++ b/external/gpl3/binutils/usr.bin/gprof/Makefile @@ -1,15 +1,12 @@ -# $NetBSD: Makefile,v 1.8 2013/08/05 00:08:58 matt Exp $ +# $NetBSD: Makefile,v 1.9 2016/01/26 19:37:48 christos Exp $ -.include - -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils +CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} .include "${.CURDIR}/../common/Makefile.inc" .include "${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" PROG= gprof SRCS= ${G_gprof_OBJECTS:.o=.c} -CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} PROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd PROGDPLIBS+= iberty ${TOP}/${BFDSUBDIR}/libiberty @@ -29,6 +26,6 @@ gprof.info: bfdver.texi LDADD+= -lintl -lz DPADD+= ${LIBINTL} ${LIBZ} .else -LDADD+= -lz -DPADD+= ${LIBZ} +LDADD+= -lz +DPADD+= ${LIBZ} .endif # !defined(__MINIX) diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/defs.mk index 58ce31e94..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/gconfig.h index 80e69bb8c..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/aarch64eb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..63d0f738a --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64eb/defs.mk @@ -0,0 +1,8 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_DEFS=-DHAVE_CONFIG_H +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_INCLUDES= +G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/aarch64eb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64eb/gconfig.h new file mode 100644 index 000000000..4e211a102 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/gprof/arch/aarch64eb/gconfig.h @@ -0,0 +1,126 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* gconfig.h. Generated from gconfig.in by configure. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Is the prototype for getopt in in the expected format? */ +#define HAVE_DECL_GETOPT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `setmode' function. */ +#define HAVE_SETMODE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_GMON_OUT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "gprof" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "gprof" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "gprof 2.34" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gprof" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.34" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/alpha/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/alpha/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/alpha/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/alpha/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/alpha/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/alpha/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/alpha/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/alpha/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/arm/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/arm/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/arm/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/arm/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/arm/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/arm/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/arm/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/arm/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/armeb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/armeb/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/armeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/armeb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/armeb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/armeb/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/armeb/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/armeb/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/defs.mk index 8dbddf1d5..bfb445db1 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/gconfig.h index 5711c7e4a..421c82382 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/coldfire/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earm/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/earm/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earm/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earm/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earm/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/earm/gconfig.h index 55daccca9..56e549bb4 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earm/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earm/gconfig.h @@ -1,13 +1,13 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ +#if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ -#if !defined(__minix) #define ENABLE_NLS 1 #endif /* !defined(__minix) */ @@ -50,6 +50,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -61,19 +64,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -101,7 +104,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earmeb/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earmhf/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/earmhfeb/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/hppa/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/hppa/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/hppa/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/hppa/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/hppa/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/hppa/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/hppa/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/hppa/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/i386/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/i386/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/i386/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/i386/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/i386/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/i386/gconfig.h index 6277ffc5f..57b700b5f 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/i386/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/i386/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native @@ -50,6 +50,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -61,19 +64,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -101,7 +104,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/ia64/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/ia64/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/ia64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/ia64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/ia64/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/ia64/gconfig.h index 30dc3f3fd..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/ia64/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/ia64/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/m68000/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/m68000/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/m68000/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/m68000/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/m68000/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/m68000/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/m68000/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/m68000/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/m68k/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/m68k/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/m68k/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/m68k/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/m68k/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/m68k/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/m68k/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/m68k/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mips64eb/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mips64el/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mipseb/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/mipsel/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/or1k/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/or1k/defs.mk index a9f9a1485..bfb445db1 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/or1k/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/or1k/defs.mk @@ -3,6 +3,6 @@ # Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/or1k/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/or1k/gconfig.h index 30dc3f3fd..421c82382 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/or1k/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/or1k/gconfig.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/gconfig.h index 3d5ff3420..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/powerpc64/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/defs.mk index a9f9a1485..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/gconfig.h index 30dc3f3fd..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/riscv32/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/defs.mk index a9f9a1485..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/gconfig.h index 30dc3f3fd..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/riscv64/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sh3eb/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sh3el/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sparc/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/sparc/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sparc/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sparc/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sparc/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/sparc/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sparc/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sparc/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/sparc64/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/vax/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/vax/defs.mk index 8dbddf1d5..61b178395 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/vax/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/vax/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/vax/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/vax/gconfig.h index 5711c7e4a..4e211a102 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/vax/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/vax/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/defs.mk b/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/defs.mk index 01302e964..9cda8ec55 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/defs.mk @@ -1,8 +1,8 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.7 2009/11/09 13:50:41 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H -G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o tahoe.o sparc.o mips.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o +G_gprof_OBJECTS=basic_blocks.o call_graph.o cg_arcs.o cg_dfn.o cg_print.o corefile.o gmon_io.o gprof.o hertz.o hist.o source.o search_list.o symtab.o sym_ids.o utils.o i386.o alpha.o vax.o sparc.o mips.o aarch64.o flat_bl.o bsd_callg_bl.o fsf_callg_bl.o G_INCLUDES= G_TEXINFOS=gprof.texi diff --git a/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/gconfig.h b/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/gconfig.h index 5711c7e4a..b61010edb 100644 --- a/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/gconfig.h +++ b/external/gpl3/binutils/usr.bin/gprof/arch/x86_64/gconfig.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* gconfig.h. Generated from gconfig.in by configure. */ -/* gconfig.in. Generated from configure.in by autoheader. */ +/* gconfig.in. Generated from configure.ac by autoheader. */ /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -48,6 +48,9 @@ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -59,19 +62,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "gprof" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "gprof 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "gprof" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -99,7 +102,12 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/Makefile b/external/gpl3/binutils/usr.bin/ld/Makefile index b8de27a51..2816f0226 100644 --- a/external/gpl3/binutils/usr.bin/ld/Makefile +++ b/external/gpl3/binutils/usr.bin/ld/Makefile @@ -1,8 +1,22 @@ -# $NetBSD: Makefile,v 1.21 2013/10/03 23:42:38 mrg Exp $ +# $NetBSD: Makefile,v 1.33 2020/04/04 01:34:30 christos Exp $ -.include +CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \ + -I${DIST}/ld \ + -DDEFAULT_EMULATION=\"${G_EMUL}\" \ + -DSCRIPTDIR=\"${SCRIPTSDIR}\" \ + -DTARGET=\"${G_target_alias}\" \ + -DBINDIR=\"/usr/bin\" \ + -DTOOLBINDIR=\"/usr/bin\" \ + -DENABLE_PLUGINS \ + -DELF_LIST_OPTIONS=TRUE \ + -DELF_SHLIB_LIST_OPTIONS=TRUE \ + -DELF_PLT_UNWIND_LIST_OPTIONS=TRUE -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils +.if !defined(__MINIX) +CPPFLAGS+= \ + -DTARGET_SYSTEM_ROOT=\"/usr/${G_target_alias}/sys-root\" \ + -DTARGET_SYSTEM_ROOT_RELOCATABLE +.endif # !defined(__MINIX) .include "${.CURDIR}/../common/Makefile.inc" .include "${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH}/defs.mk" @@ -11,23 +25,10 @@ SCRIPTSDIR= /usr/libdata PROG= ld SRCS= ${G_OFILES:.o=.c} -CPPFLAGS+= -I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \ - -I${DIST}/ld \ - -DDEFAULT_EMULATION=\"${G_EMUL}\" \ - -DSCRIPTDIR=\"${SCRIPTSDIR}\" \ - -DTARGET=\"${G_target_alias}\" \ - -DBINDIR=\"/usr/bin\" \ - -DTOOLBINDIR=\"/usr/bin\" \ - -DENABLE_PLUGINS - -.if defined(__MINIX) -CPPFLAGS+= \ - -DTARGET_SYSTEM_ROOT=\"/usr/${G_target_alias}/sys-root\" \ - -DTARGET_SYSTEM_ROOT_RELOCATABLE -.endif # !defined(__MINIX COPTS.ldgram.c = -Wno-stack-protector +PROGDPLIBS+= gnuctf ${TOP}/${BFDSUBDIR}/libgnuctf PROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd PROGDPLIBS+= iberty ${TOP}/${BFDSUBDIR}/libiberty @@ -69,52 +70,28 @@ ${PROG}.info: configdoc.texi bfdver.texi DPSRCS+= .depend.${f} e${f}.c CLEANFILES+= .depend.${f} e${f}.c -# XXX super hack -. if (${BINUTILS_MACHINE_ARCH} == "x86_64" && \ - ("${f}" == "elf_i386" || "${f}" == "i386nbsd")) -EMUL_LIB_PATH.${f}=/usr/lib/i386 -. elif (${BINUTILS_MACHINE_ARCH} == "sparc64" && \ - ("${f}" == "elf32_sparc" || "${f}" == "sparcnbsd")) -EMUL_LIB_PATH.${f}=/usr/lib/sparc -. elif ${BINUTILS_MACHINE_ARCH} == "mips64el" -. if "${f}" == "elf32ltsmip" || "${f}" == "elf32btsmip" -EMUL_LIB_PATH.${f}:=/usr/lib/o32 -. elif "${f}" == "elf64ltsmip" || "${f}" == "elf64btsmip" -EMUL_LIB_PATH.${f}:=/usr/lib/64 -. else -EMUL_LIB_PATH.${f}=/usr/lib -. endif -. else -EMUL_LIB_PATH.${f}=/usr/lib -. endif - -#GENSCRIPTS = LIB_PATH='${LIB_PATH}' $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @ta rget_alias@ "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ - e${f}.c: ${DIST}/ld/genscripts.sh ${.CURDIR}/Makefile stringify.sed ${_MKTARGET_CREATE} unset MACHINE || true; \ - LIB_PATH=${EMUL_LIB_PATH.${f}} NATIVE=yes \ - ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} "/usr" "/usr/bin" \ + NATIVE=yes ${HOST_SH} ${DIST}/ld/genscripts.sh ${DIST}/ld \ + ${LIBDIR} "/usr" "/usr/bin" \ ${G_target_alias} ${G_target_alias} ${G_target_alias} \ - ${G_EMUL} ${LIBDIR} yes ${G_enable_initfini_array} ${f} "${G_target_alias}" - -.if ${BINUTILS_MACHINE_ARCH} == "x86_64" \ - || ${BINUTILS_MACHINE_ARCH} == "sparc64" \ - || !empty(BINUTILS_MACHINE_ARCH:Mmips64*) -FILES+= ${f}.x ${f}.xbn ${f}.xn ${f}.xr ${f}.xu - -# XXX hack to find out if .xs/.xc exists - slow! -HAS_XS!= grep '^GENERATE_SHLIB_SCRIPT' ${DIST}/ld/emulparams/${f}.sh || echo -# XXX -#HAS_XC!= grep '^GENERATE_COMBRELOC_SCRIPT' ${DIST}/ld/emulparams/${f}.sh || echo -.if !empty(HAS_XS) -FILES+= ${f}.xc ${f}.xd ${f}.xdc ${f}.xdw ${f}.xs ${f}.xsc ${f}.xsw ${f}.xw -# only do this if we don't have GENERATE_SHLIB_SCRIPT -.elif !empty(BINUTILS_MACHINE_ARCH:Mmips64*) -FILES+= ${f}.xc ${f}.xs ${f}.xsc ${f}.xsw ${f}.xw -.endif -.endif # x64_64 || sparc64 || mips64 + "" "" ${G_EMUL} ${LIBDIR} yes ${G_enable_initfini_array} \ + ${f} "${G_target_alias}" +. if ${BINUTILS_MACHINE_ARCH} == "x86_64" || \ + ${BINUTILS_MACHINE_ARCH} == "sparc64" || \ + ${BINUTILS_MACHINE_ARCH} == "riscv64" || \ + !empty(BINUTILS_MACHINE_ARCH:Maarch64*) || \ + !empty(BINUTILS_MACHINE_ARCH:Mearm*) || \ + !empty(BINUTILS_MACHINE_ARCH:Marm*) || \ + !empty(BINUTILS_MACHINE_ARCH:Mmips64*) +. for e in x xbn xc xd xdc xdw xn xr xs xsc xsw xu xw +. if exists(ldscripts/${f}.${e}) +FILES+= ${f}.${e} +. endif +. endfor +. endif .endfor .include diff --git a/external/gpl3/binutils/usr.bin/ld/arch/aarch64/config.h b/external/gpl3/binutils/usr.bin/ld/arch/aarch64/config.h index 88e1b2ad0..dadc26068 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/aarch64/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/aarch64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/aarch64/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/aarch64/defs.mk index 2104be991..c147d8e41 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/aarch64/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/aarch64/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=aarch64nbsd -G_EMULATION_OFILES=eaarch64nbsd.o eaarch64nbsdb.o eaarch64elf.o eaarch64elfb.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf.o earmelfb.o +G_EMULATION_OFILES=eaarch64nbsd.o eaarch64nbsdb.o eaarch64elf.o eaarch64elfb.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmelfb.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eaarch64nbsd.o eaarch64nbsdb.o eaarch64elf.o eaarch64elfb.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf.o earmelfb.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eaarch64nbsd.o eaarch64nbsdb.o eaarch64elf.o eaarch64elfb.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmelfb.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=aarch64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/aarch64/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/aarch64/ldemul-list.h index 4768a5f0b..6fb7ce6da 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/aarch64/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/aarch64/ldemul-list.h @@ -1,14 +1,18 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_aarch64nbsd_emulation; extern ld_emulation_xfer_type ld_aarch64nbsdb_emulation; extern ld_emulation_xfer_type ld_aarch64elf_emulation; extern ld_emulation_xfer_type ld_aarch64elfb_emulation; +extern ld_emulation_xfer_type ld_armelf_nbsd_eabihf_emulation; +extern ld_emulation_xfer_type ld_armelfb_nbsd_eabihf_emulation; extern ld_emulation_xfer_type ld_armelf_nbsd_eabi_emulation; extern ld_emulation_xfer_type ld_armelfb_nbsd_eabi_emulation; +extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; +extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_emulation; extern ld_emulation_xfer_type ld_armelfb_emulation; @@ -17,8 +21,12 @@ extern ld_emulation_xfer_type ld_armelfb_emulation; &ld_aarch64nbsdb_emulation, \ &ld_aarch64elf_emulation, \ &ld_aarch64elfb_emulation, \ + &ld_armelf_nbsd_eabihf_emulation, \ + &ld_armelfb_nbsd_eabihf_emulation, \ &ld_armelf_nbsd_eabi_emulation, \ &ld_armelfb_nbsd_eabi_emulation, \ + &ld_armelf_nbsd_emulation, \ + &ld_armelfb_nbsd_emulation, \ &ld_armelf_emulation, \ &ld_armelfb_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/config.h new file mode 100644 index 000000000..dadc26068 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/config.h @@ -0,0 +1,261 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ + +/* config.h. Generated from config.in by configure. */ +/* config.in. Generated from configure.ac by autoheader. */ + +/* Check that config.h is #included before system headers + (this works only for glibc, but that should be enough). */ +#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__) +# error config.h must be #included before system headers +#endif +#define __CONFIG_H__ 1 + +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#define ENABLE_NLS 1 + +/* Additional extension a shared object might have. */ +/* #undef EXTRA_SHLIB_EXTENSION */ + +/* Define to choose default GOT handling scheme */ +#define GOT_HANDLING_DEFAULT GOT_HANDLING_TARGET_DEFAULT + +/* Define to 1 if you have the `close' function. */ +#define HAVE_CLOSE 1 + +/* Define to 1 if you have the declaration of `environ', and to 0 if you + don't. */ +#define HAVE_DECL_ENVIRON 0 + +/* Define to 1 if you have the declaration of `free', and to 0 if you don't. + */ +#define HAVE_DECL_FREE 1 + +/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't. + */ +#define HAVE_DECL_GETENV 1 + +/* Is the prototype for getopt in in the expected format? */ +#define HAVE_DECL_GETOPT 1 + +/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't. + */ +#define HAVE_DECL_SBRK 1 + +/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't. + */ +#define HAVE_DECL_STRSTR 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#define HAVE_DIRENT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ELF_HINTS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define to 1 if you have the `glob' function. */ +#define HAVE_GLOB 1 + +/* Define .init_array/.fini_array sections are available and working. */ +/* #undef HAVE_INITFINI_ARRAY */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define if your file defines LC_MESSAGES. */ +#define HAVE_LC_MESSAGES 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the `lseek' function. */ +#define HAVE_LSEEK 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mkstemp' function. */ +#define HAVE_MKSTEMP 1 + +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +/* #undef HAVE_NDIR_H */ + +/* Define to 1 if you have the `open' function. */ +#define HAVE_OPEN 1 + +/* Define to 1 if you have the `realpath' function. */ +#define HAVE_REALPATH 1 + +/* Define to 1 if you have the `sbrk' function. */ +#define HAVE_SBRK 1 + +/* Define to 1 if you have the `setlocale' function. */ +#define HAVE_SETLOCALE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_DIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_FILE_H 1 + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +/* #undef HAVE_SYS_NDIR_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `waitpid' function. */ +#define HAVE_WAITPID 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "ld" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "ld" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "ld 2.34" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "ld" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "2.34" + +/* The size of `void *', as computed by sizeof. */ +#define SIZEOF_VOID_P 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define if you can safely include both and . */ +#define STRING_WITH_STRINGS 1 + +/* Use b modifier when opening binary files? */ +/* #undef USE_BINARY_FOPEN */ + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif + + +/* Version number of package */ +#define VERSION "2.34" + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#define YYTEXT_POINTER 1 + +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to 1 if on MINIX. */ +/* #undef _MINIX */ + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +/* #undef _POSIX_1_SOURCE */ + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +/* #undef _POSIX_SOURCE */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/defs.mk new file mode 100644 index 000000000..21d58cc0a --- /dev/null +++ b/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/defs.mk @@ -0,0 +1,13 @@ +# This file is automatically generated. DO NOT EDIT! +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp +# +G_DEFS=-DHAVE_CONFIG_H +G_EMUL=aarch64nbsdb +G_EMULATION_OFILES=eaarch64nbsdb.o eaarch64nbsd.o eaarch64elfb.o eaarch64elf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabi.o earmelf_nbsd_eabi.o earmelfb_nbsd.o earmelf_nbsd.o earmelf.o earmelfb.o +G_INCLUDES= +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eaarch64nbsdb.o eaarch64nbsd.o eaarch64elfb.o eaarch64elf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabi.o earmelf_nbsd_eabi.o earmelfb_nbsd.o earmelf_nbsd.o earmelf.o earmelfb.o ldelf.o ldelfgen.o ldbuildid.o +G_STRINGIFY=astring.sed +G_TEXINFOS=ld.texi +G_target_alias=aarch64_be--netbsd +G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/ldemul-list.h new file mode 100644 index 000000000..23fdea6f2 --- /dev/null +++ b/external/gpl3/binutils/usr.bin/ld/arch/aarch64eb/ldemul-list.h @@ -0,0 +1,32 @@ +/* This file is automatically generated. DO NOT EDIT! */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ + +/* This file is automatically generated. DO NOT EDIT! */ +extern ld_emulation_xfer_type ld_aarch64nbsdb_emulation; +extern ld_emulation_xfer_type ld_aarch64nbsd_emulation; +extern ld_emulation_xfer_type ld_aarch64elfb_emulation; +extern ld_emulation_xfer_type ld_aarch64elf_emulation; +extern ld_emulation_xfer_type ld_armelfb_nbsd_eabihf_emulation; +extern ld_emulation_xfer_type ld_armelf_nbsd_eabihf_emulation; +extern ld_emulation_xfer_type ld_armelfb_nbsd_eabi_emulation; +extern ld_emulation_xfer_type ld_armelf_nbsd_eabi_emulation; +extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; +extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; +extern ld_emulation_xfer_type ld_armelf_emulation; +extern ld_emulation_xfer_type ld_armelfb_emulation; + +#define EMULATION_LIST \ + &ld_aarch64nbsdb_emulation, \ + &ld_aarch64nbsd_emulation, \ + &ld_aarch64elfb_emulation, \ + &ld_aarch64elf_emulation, \ + &ld_armelfb_nbsd_eabihf_emulation, \ + &ld_armelf_nbsd_eabihf_emulation, \ + &ld_armelfb_nbsd_eabi_emulation, \ + &ld_armelf_nbsd_eabi_emulation, \ + &ld_armelfb_nbsd_emulation, \ + &ld_armelf_nbsd_emulation, \ + &ld_armelf_emulation, \ + &ld_armelfb_emulation, \ + 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/alpha/config.h b/external/gpl3/binutils/usr.bin/ld/arch/alpha/config.h index 990aa389f..dadc26068 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/alpha/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/alpha/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/alpha/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/alpha/defs.mk index ee4c98b04..660bf03bf 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/alpha/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/alpha/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf64alpha_nbsd G_EMULATION_OFILES=eelf64alpha_nbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64alpha_nbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64alpha_nbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=alpha--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/arm/config.h b/external/gpl3/binutils/usr.bin/ld/arch/arm/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/arm/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/arm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/arm/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/arm/defs.mk index b28f75c27..0493a02d0 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/arm/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/arm/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=armelf_nbsd -G_EMULATION_OFILES=earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_EMULATION_OFILES=earmelf_nbsd.o earmelfb_nbsd.o earmelf.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=arm--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/arm/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/arm/ldemul-list.h index fb8cee96c..d4c8d52de 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/arm/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/arm/ldemul-list.h @@ -1,15 +1,14 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.9 2003/02/07 01:52:54 lukem Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_emulation; -extern ld_emulation_xfer_type ld_armnbsd_emulation; #define EMULATION_LIST \ &ld_armelf_nbsd_emulation, \ &ld_armelfb_nbsd_emulation, \ &ld_armelf_emulation, \ - &ld_armnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/armeb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/armeb/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/armeb/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/armeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/armeb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/armeb/defs.mk index a6edf9ccd..860bb0935 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/armeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/armeb/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=armelfb_nbsd -G_EMULATION_OFILES=earmelfb_nbsd.o earmelf_nbsd.o earmelf.o earmnbsd.o +G_EMULATION_OFILES=earmelfb_nbsd.o earmelf_nbsd.o earmelf.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelfb_nbsd.o earmelf_nbsd.o earmelf.o earmnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelfb_nbsd.o earmelf_nbsd.o earmelf.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=armeb--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/armeb/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/armeb/ldemul-list.h index 7c12fc0a7..8bade41da 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/armeb/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/armeb/ldemul-list.h @@ -1,15 +1,14 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.12 2003/03/05 06:17:17 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_emulation; -extern ld_emulation_xfer_type ld_armnbsd_emulation; #define EMULATION_LIST \ &ld_armelfb_nbsd_emulation, \ &ld_armelf_nbsd_emulation, \ &ld_armelf_emulation, \ - &ld_armnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/coldfire/config.h b/external/gpl3/binutils/usr.bin/ld/arch/coldfire/config.h index ef2d2cafa..9401e9350 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/coldfire/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/coldfire/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,9 @@ #endif #define __CONFIG_H__ 1 +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +55,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +94,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +156,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +167,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,7 +216,7 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/coldfire/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/coldfire/defs.mk index 015c2b085..e5dd7898e 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/coldfire/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/coldfire/defs.mk @@ -1,12 +1,12 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp +# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=m68kelfnbsd G_EMULATION_OFILES=em68kelfnbsd.o em68knbsd.o em68k4knbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o em68kelfnbsd.o em68knbsd.o em68k4knbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o em68kelfnbsd.o em68knbsd.o em68k4knbsd.o ldbuildid.o G_STRINGIFY=astring.sed G_TEXINFOS=ld.texinfo G_target_alias=m5407--netbsdelf diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earm/config.h b/external/gpl3/binutils/usr.bin/ld/arch/earm/config.h index 6a48bb2c2..7d0478952 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earm/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earm/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -54,24 +74,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -103,6 +117,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -164,9 +181,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -178,19 +192,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -227,12 +241,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earm/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/earm/defs.mk index 49faa4f09..b8983b0f3 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earm/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/earm/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=armelf_minix G_EMULATION_OFILES=earmelf_minix.o earmelf.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelf_minix.o earmelf.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelf_minix.o earmelf.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=arm-elf32-minix G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earm/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/earm/ldemul-list.h index 2ace838de..2bcaf7f8f 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earm/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earm/ldemul-list.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_armelf_minix_emulation; diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmeb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/earmeb/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmeb/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmeb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/earmeb/defs.mk index 655bd2b05..dfefc6f6b 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmeb/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=armelfb_nbsd_eabi -G_EMULATION_OFILES=earmelfb_nbsd_eabi.o earmelf_nbsd_eabi.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_EMULATION_OFILES=earmelfb_nbsd_eabi.o earmelf_nbsd_eabi.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelfb_nbsd_eabi.o earmelf_nbsd_eabi.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelfb_nbsd_eabi.o earmelf_nbsd_eabi.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=armeb--netbsdelf-eabi G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmeb/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/earmeb/ldemul-list.h index cf6e53ab1..e5a0cb80d 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmeb/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmeb/ldemul-list.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_armelfb_nbsd_eabi_emulation; @@ -10,7 +10,6 @@ extern ld_emulation_xfer_type ld_armelfb_nbsd_eabihf_emulation; extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_emulation; -extern ld_emulation_xfer_type ld_armnbsd_emulation; #define EMULATION_LIST \ &ld_armelfb_nbsd_eabi_emulation, \ @@ -20,5 +19,4 @@ extern ld_emulation_xfer_type ld_armnbsd_emulation; &ld_armelf_nbsd_emulation, \ &ld_armelfb_nbsd_emulation, \ &ld_armelf_emulation, \ - &ld_armnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmhf/config.h b/external/gpl3/binutils/usr.bin/ld/arch/earmhf/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmhf/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmhf/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmhf/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/earmhf/defs.mk index bd4f286a3..7fbc9d76a 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmhf/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmhf/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=armelf_nbsd_eabihf -G_EMULATION_OFILES=earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_EMULATION_OFILES=earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelf_nbsd_eabihf.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=arm--netbsdelf-eabihf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmhf/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/earmhf/ldemul-list.h index 58a9a399a..03db5c8d0 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmhf/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmhf/ldemul-list.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_armelf_nbsd_eabihf_emulation; @@ -10,7 +10,6 @@ extern ld_emulation_xfer_type ld_armelfb_nbsd_eabi_emulation; extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_emulation; -extern ld_emulation_xfer_type ld_armnbsd_emulation; #define EMULATION_LIST \ &ld_armelf_nbsd_eabihf_emulation, \ @@ -20,5 +19,4 @@ extern ld_emulation_xfer_type ld_armnbsd_emulation; &ld_armelf_nbsd_emulation, \ &ld_armelfb_nbsd_emulation, \ &ld_armelf_emulation, \ - &ld_armnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/defs.mk index 84fddbc0a..18c104e63 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=armelfb_nbsd_eabihf -G_EMULATION_OFILES=earmelfb_nbsd_eabihf.o earmelf_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_EMULATION_OFILES=earmelfb_nbsd_eabihf.o earmelf_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o earmnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o earmelfb_nbsd_eabihf.o earmelf_nbsd_eabihf.o earmelf_nbsd_eabi.o earmelfb_nbsd_eabi.o earmelf_nbsd.o earmelfb_nbsd.o earmelf.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=armeb--netbsdelf-eabihf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/ldemul-list.h index aa56de707..73c057ec1 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/earmhfeb/ldemul-list.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.10 2013/10/20 16:00:20 skrll Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_armelfb_nbsd_eabihf_emulation; @@ -10,7 +10,6 @@ extern ld_emulation_xfer_type ld_armelfb_nbsd_eabi_emulation; extern ld_emulation_xfer_type ld_armelf_nbsd_emulation; extern ld_emulation_xfer_type ld_armelfb_nbsd_emulation; extern ld_emulation_xfer_type ld_armelf_emulation; -extern ld_emulation_xfer_type ld_armnbsd_emulation; #define EMULATION_LIST \ &ld_armelfb_nbsd_eabihf_emulation, \ @@ -20,5 +19,4 @@ extern ld_emulation_xfer_type ld_armnbsd_emulation; &ld_armelf_nbsd_emulation, \ &ld_armelfb_nbsd_emulation, \ &ld_armelf_emulation, \ - &ld_armnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/hppa/config.h b/external/gpl3/binutils/usr.bin/ld/arch/hppa/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/hppa/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/hppa/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/hppa/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/hppa/defs.mk index 320a77981..269d0aa12 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/hppa/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/hppa/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=hppanbsd G_EMULATION_OFILES=ehppanbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ehppanbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o ehppanbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=hppa--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/i386/config.h b/external/gpl3/binutils/usr.bin/ld/arch/i386/config.h index 6a48bb2c2..6a12ef906 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/i386/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/i386/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + #if !defined(__minix) /* Define to 1 if translation of program messages to the user's native language is requested. */ @@ -54,24 +74,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -103,6 +117,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -164,9 +181,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -178,19 +192,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -227,12 +241,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/i386/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/i386/defs.mk index d46b576cc..26618e6bd 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/i386/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/i386/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf_i386_minix G_EMULATION_OFILES=eelf_i386_minix.o eelf_i386.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_i386_minix.o eelf_i386.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_i386_minix.o eelf_i386.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=i586-elf32-minix G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/i386/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/i386/ldemul-list.h index 05aee3d23..c8aebbc43 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/i386/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/i386/ldemul-list.h @@ -1,5 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.9 2003/02/07 01:52:54 lukem Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf_i386_minix_emulation; diff --git a/external/gpl3/binutils/usr.bin/ld/arch/ia64/config.h b/external/gpl3/binutils/usr.bin/ld/arch/ia64/config.h index 9b11ef201..dadc26068 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/ia64/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/ia64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -107,7 +124,7 @@ #define HAVE_REALPATH 1 /* Define to 1 if you have the `sbrk' function. */ -/* #undef HAVE_SBRK */ +#define HAVE_SBRK 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/ia64/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/ia64/defs.mk index 983ef59e5..e48a70e04 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/ia64/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/ia64/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf64_ia64 G_EMULATION_OFILES=eelf64_ia64.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64_ia64.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64_ia64.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=ia64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/m68000/config.h b/external/gpl3/binutils/usr.bin/ld/arch/m68000/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/m68000/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/m68000/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/m68000/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/m68000/defs.mk index 632db378d..cbaec4289 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/m68000/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/m68000/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=m68kelfnbsd -G_EMULATION_OFILES=em68kelfnbsd.o em68knbsd.o em68k4knbsd.o +G_EMULATION_OFILES=em68kelfnbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o em68kelfnbsd.o em68knbsd.o em68k4knbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o em68kelfnbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=m68010--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/m68000/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/m68000/ldemul-list.h index 0b6658f42..a5958c2c1 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/m68000/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/m68000/ldemul-list.h @@ -1,13 +1,10 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.9 2003/02/07 01:52:54 lukem Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_m68kelfnbsd_emulation; -extern ld_emulation_xfer_type ld_m68knbsd_emulation; -extern ld_emulation_xfer_type ld_m68k4knbsd_emulation; #define EMULATION_LIST \ &ld_m68kelfnbsd_emulation, \ - &ld_m68knbsd_emulation, \ - &ld_m68k4knbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/m68k/config.h b/external/gpl3/binutils/usr.bin/ld/arch/m68k/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/m68k/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/m68k/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/m68k/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/m68k/defs.mk index 1a852a572..bd6b8e68f 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/m68k/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/m68k/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=m68kelfnbsd -G_EMULATION_OFILES=em68kelfnbsd.o em68knbsd.o em68k4knbsd.o +G_EMULATION_OFILES=em68kelfnbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o em68kelfnbsd.o em68knbsd.o em68k4knbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o em68kelfnbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=m68k--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/m68k/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/m68k/ldemul-list.h index 0b6658f42..a5958c2c1 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/m68k/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/m68k/ldemul-list.h @@ -1,13 +1,10 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.9 2003/02/07 01:52:54 lukem Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_m68kelfnbsd_emulation; -extern ld_emulation_xfer_type ld_m68knbsd_emulation; -extern ld_emulation_xfer_type ld_m68k4knbsd_emulation; #define EMULATION_LIST \ &ld_m68kelfnbsd_emulation, \ - &ld_m68knbsd_emulation, \ - &ld_m68k4knbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/defs.mk index 7844c7154..909fd423c 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32btsmipn32 G_EMULATION_OFILES=eelf32btsmipn32.o eelf64ltsmip.o eelf64btsmip.o eelf32btsmip.o eelf32ltsmipn32.o eelf32ltsmip.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32btsmipn32.o eelf64ltsmip.o eelf64btsmip.o eelf32btsmip.o eelf32ltsmipn32.o eelf32ltsmip.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32btsmipn32.o eelf64ltsmip.o eelf64btsmip.o eelf32btsmip.o eelf32ltsmipn32.o eelf32ltsmip.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=mips64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/ldemul-list.h index e6b21739e..44d7bad49 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/ldemul-list.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.7 2009/11/09 13:50:41 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf32btsmipn32_emulation; diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mips64el/config.h b/external/gpl3/binutils/usr.bin/ld/arch/mips64el/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mips64el/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/mips64el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mips64el/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/mips64el/defs.mk index 08d167f52..3384d31c8 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mips64el/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/mips64el/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32ltsmipn32 G_EMULATION_OFILES=eelf32ltsmipn32.o eelf64btsmip.o eelf64ltsmip.o eelf32ltsmip.o eelf32btsmipn32.o eelf32btsmip.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32ltsmipn32.o eelf64btsmip.o eelf64ltsmip.o eelf32ltsmip.o eelf32btsmipn32.o eelf32btsmip.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32ltsmipn32.o eelf64btsmip.o eelf64ltsmip.o eelf32ltsmip.o eelf32btsmipn32.o eelf32btsmip.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=mips64el--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mips64el/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/mips64el/ldemul-list.h index 15f86522b..3a4734435 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mips64el/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/mips64el/ldemul-list.h @@ -1,6 +1,6 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.7 2009/11/09 13:50:41 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf32ltsmipn32_emulation; diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mipseb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/mipseb/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mipseb/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/mipseb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mipseb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/mipseb/defs.mk index 979748a42..3e7298fb8 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mipseb/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/mipseb/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32btsmip G_EMULATION_OFILES=eelf32btsmip.o eelf32ltsmip.o eelf64btsmip.o eelf64ltsmip.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32btsmip.o eelf32ltsmip.o eelf64btsmip.o eelf64ltsmip.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32btsmip.o eelf32ltsmip.o eelf64btsmip.o eelf64ltsmip.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=mipseb--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mipsel/config.h b/external/gpl3/binutils/usr.bin/ld/arch/mipsel/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mipsel/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/mipsel/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/mipsel/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/mipsel/defs.mk index 35df556d3..feee3ab4f 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/mipsel/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/mipsel/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32ltsmip G_EMULATION_OFILES=eelf32ltsmip.o eelf32btsmip.o eelf64ltsmip.o eelf64btsmip.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32ltsmip.o eelf32btsmip.o eelf64ltsmip.o eelf64btsmip.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32ltsmip.o eelf32btsmip.o eelf64ltsmip.o eelf64btsmip.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=mipsel--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/or1k/config.h b/external/gpl3/binutils/usr.bin/ld/arch/or1k/config.h index f2409bbb7..9401e9350 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/or1k/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/or1k/config.h @@ -3,7 +3,7 @@ /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,9 @@ #endif #define __CONFIG_H__ 1 +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +55,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +94,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +156,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +167,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.26.1" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.26.1" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,11 +216,11 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.26.1" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ -/* #undef YYTEXT_POINTER */ +#define YYTEXT_POINTER 1 /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/or1k/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/or1k/defs.mk index 750d62a69..b95ac1a76 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/or1k/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/or1k/defs.mk @@ -6,7 +6,7 @@ G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32or1k_nbsd G_EMULATION_OFILES=eelf32or1k_nbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32or1k_nbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32or1k_nbsd.o ldbuildid.o G_STRINGIFY=astring.sed G_TEXINFOS=ld.texinfo G_target_alias=or1k--netbsd diff --git a/external/gpl3/binutils/usr.bin/ld/arch/powerpc/config.h b/external/gpl3/binutils/usr.bin/ld/arch/powerpc/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/powerpc/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/powerpc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/powerpc/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/powerpc/defs.mk index eea4facaa..7f84f349b 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/powerpc/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/powerpc/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32ppc_nbsd G_EMULATION_OFILES=eelf32ppc_nbsd.o eelf32ppc.o eelf32ppcsim.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32ppc_nbsd.o eelf32ppc.o eelf32ppcsim.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32ppc_nbsd.o eelf32ppc.o eelf32ppcsim.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=powerpc--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/config.h b/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/config.h index b69a0a88a..dadc26068 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/defs.mk index 355130d5a..f57d2dca7 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf64ppc -G_EMULATION_OFILES=eelf64ppc.o eelf32ppc.o eelf32ppclinux.o eelf32ppcsim.o +G_EMULATION_OFILES=eelf64ppc.o eelf32ppc.o eelf32ppc_nbsd.o eelf32ppcsim.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64ppc.o eelf32ppc.o eelf32ppclinux.o eelf32ppcsim.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64ppc.o eelf32ppc.o eelf32ppc_nbsd.o eelf32ppcsim.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=powerpc64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/ldemul-list.h index fec5ec40b..795b681e6 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/powerpc64/ldemul-list.h @@ -1,16 +1,16 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.5 2006/02/02 20:06:04 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.8 2006/05/26 19:17:21 mrg Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf64ppc_emulation; extern ld_emulation_xfer_type ld_elf32ppc_emulation; -extern ld_emulation_xfer_type ld_elf32ppclinux_emulation; +extern ld_emulation_xfer_type ld_elf32ppc_nbsd_emulation; extern ld_emulation_xfer_type ld_elf32ppcsim_emulation; #define EMULATION_LIST \ &ld_elf64ppc_emulation, \ &ld_elf32ppc_emulation, \ - &ld_elf32ppclinux_emulation, \ + &ld_elf32ppc_nbsd_emulation, \ &ld_elf32ppcsim_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/riscv32/config.h b/external/gpl3/binutils/usr.bin/ld/arch/riscv32/config.h index d31a3cad7..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/riscv32/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/riscv32/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/riscv32/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/riscv32/defs.mk index cf31aeb32..705c192b0 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/riscv32/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/riscv32/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32lriscv -G_EMULATION_OFILES=eelf32lriscv.o eelf64lriscv.o +G_EMULATION_OFILES=eelf32lriscv.o eelf32lriscv_ilp32f.o eelf32lriscv_ilp32.o eelf64lriscv.o eelf64lriscv_lp64f.o eelf64lriscv_lp64.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32lriscv.o eelf64lriscv.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32lriscv.o eelf32lriscv_ilp32f.o eelf32lriscv_ilp32.o eelf64lriscv.o eelf64lriscv_lp64f.o eelf64lriscv_lp64.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=riscv32--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/riscv32/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/riscv32/ldemul-list.h index 8eea8251b..041cce57e 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/riscv32/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/riscv32/ldemul-list.h @@ -1,12 +1,20 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf32lriscv_emulation; +extern ld_emulation_xfer_type ld_elf32lriscv_ilp32f_emulation; +extern ld_emulation_xfer_type ld_elf32lriscv_ilp32_emulation; extern ld_emulation_xfer_type ld_elf64lriscv_emulation; +extern ld_emulation_xfer_type ld_elf64lriscv_lp64f_emulation; +extern ld_emulation_xfer_type ld_elf64lriscv_lp64_emulation; #define EMULATION_LIST \ &ld_elf32lriscv_emulation, \ + &ld_elf32lriscv_ilp32f_emulation, \ + &ld_elf32lriscv_ilp32_emulation, \ &ld_elf64lriscv_emulation, \ + &ld_elf64lriscv_lp64f_emulation, \ + &ld_elf64lriscv_lp64_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/riscv64/config.h b/external/gpl3/binutils/usr.bin/ld/arch/riscv64/config.h index 1b082f1f8..dadc26068 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/riscv64/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/riscv64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk index 2789e9ca9..914987447 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/riscv64/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf64lriscv -G_EMULATION_OFILES=eelf64lriscv.o eelf32lriscv.o +G_EMULATION_OFILES=eelf64lriscv.o eelf64lriscv_lp64f.o eelf64lriscv_lp64.o eelf32lriscv.o eelf32lriscv_ilp32f.o eelf32lriscv_ilp32.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64lriscv.o eelf32lriscv.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64lriscv.o eelf64lriscv_lp64f.o eelf64lriscv_lp64.o eelf32lriscv.o eelf32lriscv_ilp32f.o eelf32lriscv_ilp32.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=riscv64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h index 67de92337..b63ac6963 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/riscv64/ldemul-list.h @@ -1,12 +1,20 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ -/* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf64lriscv_emulation; +extern ld_emulation_xfer_type ld_elf64lriscv_lp64f_emulation; +extern ld_emulation_xfer_type ld_elf64lriscv_lp64_emulation; extern ld_emulation_xfer_type ld_elf32lriscv_emulation; +extern ld_emulation_xfer_type ld_elf32lriscv_ilp32f_emulation; +extern ld_emulation_xfer_type ld_elf32lriscv_ilp32_emulation; #define EMULATION_LIST \ &ld_elf64lriscv_emulation, \ + &ld_elf64lriscv_lp64f_emulation, \ + &ld_elf64lriscv_lp64_emulation, \ &ld_elf32lriscv_emulation, \ + &ld_elf32lriscv_ilp32f_emulation, \ + &ld_elf32lriscv_ilp32_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/config.h b/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/defs.mk index 7de4e4e91..3f29be129 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/sh3eb/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=shelf_nbsd G_EMULATION_OFILES=eshelf_nbsd.o eshlelf_nbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eshelf_nbsd.o eshlelf_nbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eshelf_nbsd.o eshlelf_nbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=sh--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sh3el/config.h b/external/gpl3/binutils/usr.bin/ld/arch/sh3el/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sh3el/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/sh3el/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sh3el/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/sh3el/defs.mk index dce99dcd3..9f564c759 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sh3el/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/sh3el/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=shlelf_nbsd G_EMULATION_OFILES=eshlelf_nbsd.o eshelf_nbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eshlelf_nbsd.o eshelf_nbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eshlelf_nbsd.o eshelf_nbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=shle--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sparc/config.h b/external/gpl3/binutils/usr.bin/ld/arch/sparc/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sparc/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/sparc/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sparc/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/sparc/defs.mk index 04ebd3ffa..bc25230ad 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sparc/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/sparc/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32_sparc -G_EMULATION_OFILES=eelf32_sparc.o esparcnbsd.o +G_EMULATION_OFILES=eelf32_sparc.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32_sparc.o esparcnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32_sparc.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=sparc--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sparc/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/sparc/ldemul-list.h index eaabc9d9e..d6e8ee445 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sparc/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/sparc/ldemul-list.h @@ -1,11 +1,10 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.9 2003/02/07 01:52:54 lukem Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf32_sparc_emulation; -extern ld_emulation_xfer_type ld_sparcnbsd_emulation; #define EMULATION_LIST \ &ld_elf32_sparc_emulation, \ - &ld_sparcnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sparc64/config.h b/external/gpl3/binutils/usr.bin/ld/arch/sparc64/config.h index 990aa389f..dadc26068 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sparc64/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/sparc64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sparc64/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/sparc64/defs.mk index e0b966701..b25e0a75d 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sparc64/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/sparc64/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf64_sparc -G_EMULATION_OFILES=eelf64_sparc.o eelf32_sparc.o esparcnbsd.o +G_EMULATION_OFILES=eelf64_sparc.o eelf32_sparc.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64_sparc.o eelf32_sparc.o esparcnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf64_sparc.o eelf32_sparc.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=sparc64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/sparc64/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/sparc64/ldemul-list.h index 2aaa94680..3a8bc6fb4 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/sparc64/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/sparc64/ldemul-list.h @@ -1,13 +1,12 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative,v 1.9 2003/02/07 01:52:54 lukem Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf64_sparc_emulation; extern ld_emulation_xfer_type ld_elf32_sparc_emulation; -extern ld_emulation_xfer_type ld_sparcnbsd_emulation; #define EMULATION_LIST \ &ld_elf64_sparc_emulation, \ &ld_elf32_sparc_emulation, \ - &ld_sparcnbsd_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/ld/arch/vax/config.h b/external/gpl3/binutils/usr.bin/ld/arch/vax/config.h index ef2d2cafa..d4a6dac28 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/vax/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/vax/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 4 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/vax/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/vax/defs.mk index 25042e206..0cc589830 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/vax/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/vax/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf32vax G_EMULATION_OFILES=eelf32vax.o evaxnbsd.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32vax.o evaxnbsd.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf32vax.o evaxnbsd.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=vax--netbsdelf G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/x86_64/config.h b/external/gpl3/binutils/usr.bin/ld/arch/x86_64/config.h index 990aa389f..e87dfe3e8 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/x86_64/config.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/x86_64/config.h @@ -1,9 +1,9 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* config.h. Generated from config.in by configure. */ -/* config.in. Generated from configure.in by autoheader. */ +/* config.in. Generated from configure.ac by autoheader. */ /* Check that config.h is #included before system headers (this works only for glibc, but that should be enough). */ @@ -12,6 +12,26 @@ #endif #define __CONFIG_H__ 1 +/* Define to 1 if you want to emit gnu hash in the ELF linker by default. */ +#define DEFAULT_EMIT_GNU_HASH 0 + +/* Define to 1 if you want to emit sysv hash in the ELF linker by default. */ +#define DEFAULT_EMIT_SYSV_HASH 1 + +/* Define if you want compressed debug sections by default. */ +/* #undef DEFAULT_FLAG_COMPRESS_DEBUG */ + +/* Define to 1 if you want to enable -z relro in ELF linker by default. */ +#define DEFAULT_LD_Z_RELRO 0 + +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#define DEFAULT_LD_Z_SEPARATE_CODE 0 + +/* Define to 1 if you want to set DT_RUNPATH instead of DT_RPATH by default. + */ +#define DEFAULT_NEW_DTAGS 0 + /* Define to 1 if translation of program messages to the user's native language is requested. */ #define ENABLE_NLS 1 @@ -52,24 +72,18 @@ */ #define HAVE_DIRENT_H 1 -/* Define to 1 if you have the `dlclose' function. */ -#define HAVE_DLCLOSE 1 - /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 -/* Define to 1 if you have the `dlopen' function. */ -#define HAVE_DLOPEN 1 - -/* Define to 1 if you have the `dlsym' function. */ -#define HAVE_DLSYM 1 - /* Define to 1 if you have the header file. */ /* #undef HAVE_ELF_HINTS_H */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 +/* Define to 1 if you have the `getpagesize' function. */ +#define HAVE_GETPAGESIZE 1 + /* Define to 1 if you have the `glob' function. */ #define HAVE_GLOB 1 @@ -97,6 +111,9 @@ /* Define to 1 if you have the `mkstemp' function. */ #define HAVE_MKSTEMP 1 +/* Define to 1 if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + /* Define to 1 if you have the header file, and it defines `DIR'. */ /* #undef HAVE_NDIR_H */ @@ -156,9 +173,6 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_WINDOWS_H */ -/* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #define LT_OBJDIR ".libs/" @@ -170,19 +184,19 @@ #define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#define PACKAGE_NAME "" +#define PACKAGE_NAME "ld" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "" +#define PACKAGE_STRING "ld 2.34" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "" +#define PACKAGE_TARNAME "ld" /* Define to the home page for this package. */ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "" +#define PACKAGE_VERSION "2.34" /* The size of `void *', as computed by sizeof. */ #define SIZEOF_VOID_P 8 @@ -219,12 +233,17 @@ /* Version number of package */ -#define VERSION "2.23.2" +#define VERSION "2.34" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #define YYTEXT_POINTER 1 +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/external/gpl3/binutils/usr.bin/ld/arch/x86_64/defs.mk b/external/gpl3/binutils/usr.bin/ld/arch/x86_64/defs.mk index a4747d7fe..a7a9a0aed 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/x86_64/defs.mk +++ b/external/gpl3/binutils/usr.bin/ld/arch/x86_64/defs.mk @@ -1,13 +1,13 @@ # This file is automatically generated. DO NOT EDIT! -# Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp -# Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp +# Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp +# Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp # G_DEFS=-DHAVE_CONFIG_H G_EMUL=elf_x86_64 -G_EMULATION_OFILES=eelf_x86_64.o eelf_i386.o ei386nbsd.o eelf_l1om.o eelf_k1om.o +G_EMULATION_OFILES=eelf_x86_64.o eelf_i386.o eelf_iamcu.o eelf_l1om.o eelf_k1om.o G_INCLUDES= -G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf_i386.o ei386nbsd.o eelf_l1om.o eelf_k1om.o +G_OFILES=ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf_i386.o eelf_iamcu.o eelf_l1om.o eelf_k1om.o ldelf.o ldelfgen.o ldbuildid.o G_STRINGIFY=astring.sed -G_TEXINFOS=ld.texinfo +G_TEXINFOS=ld.texi G_target_alias=x86_64--netbsd G_enable_initfini_array=no diff --git a/external/gpl3/binutils/usr.bin/ld/arch/x86_64/ldemul-list.h b/external/gpl3/binutils/usr.bin/ld/arch/x86_64/ldemul-list.h index 9ba609da8..dab9d3d15 100644 --- a/external/gpl3/binutils/usr.bin/ld/arch/x86_64/ldemul-list.h +++ b/external/gpl3/binutils/usr.bin/ld/arch/x86_64/ldemul-list.h @@ -1,18 +1,18 @@ /* This file is automatically generated. DO NOT EDIT! */ -/* Generated from: NetBSD: mknative-binutils,v 1.8 2011/09/25 04:00:58 christos Exp */ -/* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */ +/* Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp */ +/* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp */ /* This file is automatically generated. DO NOT EDIT! */ extern ld_emulation_xfer_type ld_elf_x86_64_emulation; extern ld_emulation_xfer_type ld_elf_i386_emulation; -extern ld_emulation_xfer_type ld_i386nbsd_emulation; +extern ld_emulation_xfer_type ld_elf_iamcu_emulation; extern ld_emulation_xfer_type ld_elf_l1om_emulation; extern ld_emulation_xfer_type ld_elf_k1om_emulation; #define EMULATION_LIST \ &ld_elf_x86_64_emulation, \ &ld_elf_i386_emulation, \ - &ld_i386nbsd_emulation, \ + &ld_elf_iamcu_emulation, \ &ld_elf_l1om_emulation, \ &ld_elf_k1om_emulation, \ 0 diff --git a/external/gpl3/binutils/usr.bin/nlmconv/Makefile b/external/gpl3/binutils/usr.bin/nlmconv/Makefile index 6d37ba3d5..2e5b2e0cc 100644 --- a/external/gpl3/binutils/usr.bin/nlmconv/Makefile +++ b/external/gpl3/binutils/usr.bin/nlmconv/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:19 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:48 christos Exp $ PROG= nlmconv -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/nm/Makefile b/external/gpl3/binutils/usr.bin/nm/Makefile index a53847a4e..f6220ff86 100644 --- a/external/gpl3/binutils/usr.bin/nm/Makefile +++ b/external/gpl3/binutils/usr.bin/nm/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:19 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:48 christos Exp $ PROG= nm -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/objcopy/Makefile b/external/gpl3/binutils/usr.bin/objcopy/Makefile index b827d46ce..4eec8d016 100644 --- a/external/gpl3/binutils/usr.bin/objcopy/Makefile +++ b/external/gpl3/binutils/usr.bin/objcopy/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:19 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:48 christos Exp $ PROG= objcopy -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/objdump/Makefile b/external/gpl3/binutils/usr.bin/objdump/Makefile index 3b847a592..e5fb2c647 100644 --- a/external/gpl3/binutils/usr.bin/objdump/Makefile +++ b/external/gpl3/binutils/usr.bin/objdump/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.2 2013/09/29 14:20:37 christos Exp $ +# $NetBSD: Makefile,v 1.5 2020/04/04 01:34:30 christos Exp $ PROG= objdump -.include - CPPFLAGS+=-DOBJDUMP_PRIVATE_VECTORS="" +PROGDPLIBS+= gnuctf ${TOP}/${BFDSUBDIR}/libgnuctf + .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/ranlib/Makefile b/external/gpl3/binutils/usr.bin/ranlib/Makefile index 44c864741..60b43b238 100644 --- a/external/gpl3/binutils/usr.bin/ranlib/Makefile +++ b/external/gpl3/binutils/usr.bin/ranlib/Makefile @@ -1,9 +1,7 @@ -# $NetBSD: Makefile,v 1.2 2011/09/25 04:32:47 christos Exp $ +# $NetBSD: Makefile,v 1.3 2016/01/26 19:37:48 christos Exp $ PROG= ranlib -.include - COPTS.arparse.c = -Wno-stack-protector CPPFLAGS+=-Dbin_dummy_emulation=bin_vanilla_emulation diff --git a/external/gpl3/binutils/usr.bin/readelf/Makefile b/external/gpl3/binutils/usr.bin/readelf/Makefile index 0742b1554..8ef67245c 100644 --- a/external/gpl3/binutils/usr.bin/readelf/Makefile +++ b/external/gpl3/binutils/usr.bin/readelf/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.2 2013/02/14 21:29:36 christos Exp $ +# $NetBSD: Makefile,v 1.5 2020/04/04 01:34:30 christos Exp $ PROG= readelf -.include +PROGDPLIBS+= gnuctf ${TOP}/${BFDSUBDIR}/libgnuctf +PROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/size/Makefile b/external/gpl3/binutils/usr.bin/size/Makefile index f5e713f89..a744adfe8 100644 --- a/external/gpl3/binutils/usr.bin/size/Makefile +++ b/external/gpl3/binutils/usr.bin/size/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:20 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:48 christos Exp $ PROG= size -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/strings/Makefile b/external/gpl3/binutils/usr.bin/strings/Makefile index 35005f717..505eba44e 100644 --- a/external/gpl3/binutils/usr.bin/strings/Makefile +++ b/external/gpl3/binutils/usr.bin/strings/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:20 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:48 christos Exp $ PROG= strings -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.bin/strip/Makefile b/external/gpl3/binutils/usr.bin/strip/Makefile index dfbe55b75..ab68f272d 100644 --- a/external/gpl3/binutils/usr.bin/strip/Makefile +++ b/external/gpl3/binutils/usr.bin/strip/Makefile @@ -1,7 +1,5 @@ -# $NetBSD: Makefile,v 1.1 2009/08/18 20:22:20 skrll Exp $ +# $NetBSD: Makefile,v 1.2 2016/01/26 19:37:48 christos Exp $ PROG= strip -.include - .include "${.CURDIR}/../common/Makefile.prog" diff --git a/external/gpl3/binutils/usr.sbin/Makefile.inc b/external/gpl3/binutils/usr.sbin/Makefile.inc index bd575c5fe..7abebce5b 100644 --- a/external/gpl3/binutils/usr.sbin/Makefile.inc +++ b/external/gpl3/binutils/usr.sbin/Makefile.inc @@ -1,5 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.6 2013/09/29 14:20:37 christos Exp $ +# $NetBSD: Makefile.inc,v 1.7 2016/01/26 19:37:48 christos Exp $ +.include "${.PARSEDIR}/../Makefile.inc" BINDIR?= /usr/sbin WARNS?= 1 diff --git a/external/gpl3/binutils/usr.sbin/dbsym/Makefile b/external/gpl3/binutils/usr.sbin/dbsym/Makefile index cac96f240..11d521fc3 100644 --- a/external/gpl3/binutils/usr.sbin/dbsym/Makefile +++ b/external/gpl3/binutils/usr.sbin/dbsym/Makefile @@ -1,12 +1,10 @@ -# $NetBSD: Makefile,v 1.11 2013/09/29 14:20:38 christos Exp $ +# $NetBSD: Makefile,v 1.12 2016/01/26 19:37:49 christos Exp $ .include .if (defined(HOSTPROG) && \ (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))) || \ ${MKBINUTILS} != "no" -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils -DIST= ${TOP}/dist BFDSUBDIR= lib PROG= dbsym diff --git a/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c b/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c index b508e3231..eacda47ca 100644 --- a/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c +++ b/external/gpl3/binutils/usr.sbin/dbsym/dbsym.c @@ -1,4 +1,4 @@ -/* $NetBSD: dbsym.c,v 1.4 2014/08/17 19:12:59 joerg Exp $ */ +/* $NetBSD: dbsym.c,v 1.6 2017/07/11 21:19:42 joerg Exp $ */ /* * Copyright (c) 2001 Simon Burge (for Wasabi Systems) @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1996 Christopher G. Demetriou.\ Copyright 2001 Simon Burge.\ All rights reserved."); -__RCSID("$NetBSD: dbsym.c,v 1.4 2014/08/17 19:12:59 joerg Exp $"); +__RCSID("$NetBSD: dbsym.c,v 1.6 2017/07/11 21:19:42 joerg Exp $"); #endif /* not lint */ #include @@ -362,8 +362,9 @@ load_symtab(bfd *abfd, int fd, char **symtab, u_int32_t *symtabsize) Elf32_External_Shdr *s32hdr = NULL; Elf64_External_Shdr *s64hdr = NULL; void *shdr; + char *shstrtab = NULL; u_int32_t osymtabsize, sh_offset; - int elftype, e_shnum, i, sh_size; + int elftype, e_shnum, i, sh_size, rv = 1, shstridx; off_t e_shoff; if (lseek(fd, 0, SEEK_SET) < 0) @@ -422,8 +423,19 @@ load_symtab(bfd *abfd, int fd, char **symtab, u_int32_t *symtabsize) if (read(fd, shdr, sh_size) != sh_size) goto out; + shstridx = (ISELF64 + ? bfd_get_16(abfd, e64_hdr.e_shstrndx) + : bfd_get_16(abfd, e32_hdr.e_shstrndx)); + shstrtab = malloc(SH_SIZE(shstridx)); + if (shstrtab == NULL) + goto out; + if (pread(fd, shstrtab, SH_SIZE(shstridx), SH_OFFSET(shstridx)) != + SH_SIZE(shstridx)) + goto out; + for (i = 0; i < e_shnum; i++) { - if (SH_TYPE(i) == SHT_SYMTAB || SH_TYPE(i) == SHT_STRTAB) { + if (SH_TYPE(i) == SHT_SYMTAB || SH_TYPE(i) == SHT_STRTAB || + !strcmp(shstrtab + SH_NAME(i), ".SUNW_ctf")) { osymtabsize = *symtabsize; *symtabsize += roundup(SH_SIZE(i), ISELF64 ? 8 : 4); if ((*symtab = realloc(*symtab, *symtabsize)) == NULL) @@ -467,10 +479,11 @@ load_symtab(bfd *abfd, int fd, char **symtab, u_int32_t *symtabsize) bfd_put_16(abfd, 0, e32_hdr.e_phnum); } memcpy(*symtab, &ehdr, sizeof(ehdr)); + rv = 0; - free(shdr); - return (0); out: + if (shstrtab != NULL) + free(shstrtab); free(shdr); - return (1); + return (rv); } diff --git a/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile b/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile index 74ad5ba65..d9d3a085e 100644 --- a/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile +++ b/external/gpl3/binutils/usr.sbin/mdsetimage/Makefile @@ -1,18 +1,20 @@ -# $NetBSD: Makefile,v 1.10 2013/08/05 00:17:53 matt Exp $ +# $NetBSD: Makefile,v 1.13 2016/09/22 01:53:39 christos Exp $ -.include +.include + +MDSETIMAGE=${NETBSDSRCDIR}/usr.sbin/mdsetimage +.PATH: ${MDSETIMAGE} .if (defined(HOSTPROG) && \ (${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))) || \ ${MKBINUTILS} != "no" -TOP= ${NETBSDSRCDIR}/external/gpl3/binutils -DIST= ${TOP}/dist BFDSUBDIR= lib PROG= mdsetimage +SRCS= mdsetimage.c bin_bfd.c MAN= mdsetimage.8 -CPPFLAGS+= -I${DIST}/bfd -I${DIST}/binutils -I${DIST}/include +CPPFLAGS+= -I${DIST}/bfd -I${DIST}/binutils -I${DIST}/include -I${MDSETIMAGE} .if !defined(HOSTPROG) PROGDPLIBS+= bfd ${TOP}/${BFDSUBDIR}/libbfd diff --git a/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c b/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c new file mode 100644 index 000000000..7d3151888 --- /dev/null +++ b/external/gpl3/binutils/usr.sbin/mdsetimage/bin_bfd.c @@ -0,0 +1,151 @@ +/* $NetBSD: bin_bfd.c,v 1.2 2017/07/25 06:43:03 mrg Exp $ */ + +/* + * Copyright (c) 1996, 2002 Christopher G. Demetriou + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * <> + */ + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#include +__RCSID("$NetBSD: bin_bfd.c,v 1.2 2017/07/25 06:43:03 mrg Exp $"); + +#include +#include +#include +#include +#include +#include "bin.h" + +void * +bin_open(int kfd, const char *kfile, const char *bfdname) +{ + bfd *abfd; + bfd_init(); + if ((abfd = bfd_fdopenr(kfile, bfdname, kfd)) == NULL) { + bfd_perror("open"); + exit(1); + } + if (!bfd_check_format(abfd, bfd_object)) { + bfd_perror("check format"); + exit(1); + } + return abfd; +} + +int +bin_find_md_root(void *bin, const char *mappedkfile, off_t size, + unsigned long text_start, + const char *root_name, const char *size_name, size_t *md_root_offset, + size_t *md_root_size_offset, uint32_t *md_root_size, int verbose) +{ + bfd *abfd = bin; + long i; + long storage_needed; + long number_of_symbols; + asymbol **symbol_table = NULL; + struct symbols { + const char *name; + size_t offset; + } *s, symbols[3]; + + symbols[0].offset = 0; + symbols[1].offset = 0; + symbols[0].name = root_name; + symbols[1].name = size_name; + symbols[2].name = NULL; + + storage_needed = bfd_get_symtab_upper_bound(abfd); + if (storage_needed <= 0) { + warnx("bfd storage needed error"); + return 1; + } + + symbol_table = malloc(storage_needed); + if (symbol_table == NULL) { + warn("symbol table"); + return 1; + } + + number_of_symbols = bfd_canonicalize_symtab(abfd, symbol_table); + if (number_of_symbols <= 0) { + warnx("can't canonicalize symbol table"); + free(symbol_table); + return 1; + } + + for (i = 0; i < number_of_symbols; i++) { + for (s = symbols; s->name != NULL; s++) { + const char *sym = symbol_table[i]->name; + + /* + * match symbol prefix '_' or ''. + */ + if (!strcmp(s->name, sym) || + !strcmp(s->name + 1, sym)) { + s->offset = + (size_t)(symbol_table[i]->section->filepos + + symbol_table[i]->value); + } + } + } + + free(symbol_table); + + for (s = symbols; s->name != NULL; s++) { + if (s->offset == 0) { + warnx("missing offset for `%s'", s->name); + return 1; + } + } + + *md_root_offset = symbols[0].offset; + *md_root_size_offset = symbols[1].offset; + *md_root_size = bfd_get_32(abfd, &mappedkfile[*md_root_size_offset]); + + return 0; +} + +void +bin_put_32(void *bin, off_t size, char *buf) +{ + bfd_put_32((struct bfd *)bin, size, buf); +} + +void +bin_close(void *bin) +{ + bfd_close_all_done((struct bfd *)bin); +} + +const char ** +bin_supported_targets(void) +{ + return bfd_target_list(); +} diff --git a/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8 b/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8 deleted file mode 100644 index f1b101e7b..000000000 --- a/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.8 +++ /dev/null @@ -1,92 +0,0 @@ -.\" $NetBSD: mdsetimage.8,v 1.3 2010/11/07 11:50:23 wiz Exp $ -.\" -.\" Copyright (c) 1996 Christopher G. Demetriou -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.\" <> -.\" -.Dd November 4, 2010 -.Dt MDSETIMAGE 8 -.Os -.Sh NAME -.Nm mdsetimage -.Nd set kernel RAM disk image -.Sh SYNOPSIS -.Nm -.Op Fl svx -.Op Fl b Ar bfdname -.Op Fl I Ar image_symbol -.Op Fl S Ar size_symbol -.Ar kernel -.Ar image -.Sh DESCRIPTION -The -.Nm -command copies the disk image specified by -.Ar image -into the memory disk storage area in -.Ar kernel . -The file system present in -.Ar image -will typically be used by the kernel -as the root file system. -.Pp -To recognize kernel executable format, the -.Fl b -flag specifies BFD name of kernel. -.Pp -The -.Fl I -and -.Fl S -flags specify the symbol names of image and size of memory disk -drivers respectively. -.Pp -If the -.Fl s -flags is given, -.Nm -will write back the actual disk image size back into -.Ar kernel . -.Pp -If the -.Fl v -flag is given, -.Nm -will print out status information as -it is copying the image. -.Pp -If the -.Fl x -flag is given, -.Nm -will extract the disk image from -.Ar kernel -into the file -.Ar image . -This is the opposite of the default behavior. -.Sh SEE ALSO -.Xr md 4 , -.Xr mdconfig 8 diff --git a/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c b/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c deleted file mode 100644 index 15b8664e4..000000000 --- a/external/gpl3/binutils/usr.sbin/mdsetimage/mdsetimage.c +++ /dev/null @@ -1,317 +0,0 @@ -/* $NetBSD: mdsetimage.c,v 1.2 2010/11/06 16:03:23 uebayasi Exp $ */ -/* from: NetBSD: mdsetimage.c,v 1.15 2001/03/21 23:46:48 cgd Exp $ */ - -/* - * Copyright (c) 1996, 2002 Christopher G. Demetriou - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * <> - */ - -#if HAVE_NBTOOL_CONFIG_H -#include "nbtool_config.h" -#endif - -#include -#if !defined(lint) -__COPYRIGHT("@(#) Copyright (c) 1996\ - Christopher G. Demetriou. All rights reserved."); -__RCSID("$NetBSD: mdsetimage.c,v 1.2 2010/11/06 16:03:23 uebayasi Exp $"); -#endif /* not lint */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -struct symbols { - char *name; - size_t offset; -}; -#define X_MD_ROOT_IMAGE 0 -#define X_MD_ROOT_SIZE 1 - -#define CHUNKSIZE (64 * 1024) - -int main(int, char *[]); -static void usage(void) __attribute__((noreturn)); -static int find_md_root(bfd *, struct symbols symbols[]); - -int verbose; -int extract; -int setsize; - -static const char *progname; -#undef setprogname -#define setprogname(x) (void)(progname = (x)) -#undef getprogname -#define getprogname() (progname) - -int -main(int argc, char *argv[]) -{ - int ch, kfd, fsfd, rv; - struct stat ksb, fssb; - size_t md_root_offset, md_root_size_offset; - u_int32_t md_root_size; - const char *kfile, *fsfile; - char *mappedkfile; - char *bfdname = NULL; - bfd *abfd; - ssize_t left_to_copy; - struct symbols md_root_symbols[3] = { { 0 } }; - - md_root_symbols[X_MD_ROOT_IMAGE].name = "_md_root_image"; - md_root_symbols[X_MD_ROOT_SIZE].name = "_md_root_size"; - - setprogname(argv[0]); - - while ((ch = getopt(argc, argv, "I:S:b:svx")) != -1) - switch (ch) { - case 'I': - md_root_symbols[X_MD_ROOT_IMAGE].name = optarg; - break; - case 'S': - md_root_symbols[X_MD_ROOT_SIZE].name = optarg; - break; - case 'b': - bfdname = optarg; - break; - case 's': - setsize = 1; - break; - case 'v': - verbose = 1; - break; - case 'x': - extract = 1; - break; - case '?': - default: - usage(); - } - argc -= optind; - argv += optind; - - if (argc != 2) - usage(); - kfile = argv[0]; - fsfile = argv[1]; - - if (extract) { - if ((kfd = open(kfile, O_RDONLY, 0)) == -1) - err(1, "open %s", kfile); - } else { - if ((kfd = open(kfile, O_RDWR, 0)) == -1) - err(1, "open %s", kfile); - } - - bfd_init(); - if ((abfd = bfd_fdopenr(kfile, bfdname, kfd)) == NULL) { - bfd_perror("open"); - exit(1); - } - if (!bfd_check_format(abfd, bfd_object)) { - bfd_perror("check format"); - exit(1); - } - - if (find_md_root(abfd, md_root_symbols) != 0) - errx(1, "could not find symbols in %s", kfile); - if (verbose) - fprintf(stderr, "got symbols from %s\n", kfile); - - if (fstat(kfd, &ksb) == -1) - err(1, "fstat %s", kfile); - if (ksb.st_size != (size_t)ksb.st_size) - errx(1, "%s too big to map", kfile); - - if ((mappedkfile = mmap(NULL, ksb.st_size, PROT_READ, - MAP_FILE | MAP_PRIVATE, kfd, 0)) == (caddr_t)-1) - err(1, "mmap %s", kfile); - if (verbose) - fprintf(stderr, "mapped %s\n", kfile); - - md_root_offset = md_root_symbols[X_MD_ROOT_IMAGE].offset; - md_root_size_offset = md_root_symbols[X_MD_ROOT_SIZE].offset; - md_root_size = bfd_get_32(abfd, &mappedkfile[md_root_size_offset]); - - munmap(mappedkfile, ksb.st_size); - - if (extract) { - if ((fsfd = open(fsfile, O_WRONLY|O_CREAT, 0777)) == -1) - err(1, "open %s", fsfile); - left_to_copy = md_root_size; - } else { - if ((fsfd = open(fsfile, O_RDONLY, 0)) == -1) - err(1, "open %s", fsfile); - if (fstat(fsfd, &fssb) == -1) - err(1, "fstat %s", fsfile); - if (fssb.st_size != (size_t)fssb.st_size) - errx(1, "fs image is too big"); - if (fssb.st_size > md_root_size) - errx(1, "fs image (%lld bytes) too big for buffer (%lu bytes)", - (long long)fssb.st_size, (unsigned long)md_root_size); - left_to_copy = fssb.st_size; - } - - if (verbose) - fprintf(stderr, "copying image %s %s %s\n", fsfile, - (extract ? "from" : "into"), kfile); - - if (lseek(kfd, md_root_offset, SEEK_SET) != md_root_offset) - err(1, "seek %s", kfile); - while (left_to_copy > 0) { - char buf[CHUNKSIZE]; - ssize_t todo; - int rfd; - int wfd; - const char *rfile; - const char *wfile; - if (extract) { - rfd = kfd; - rfile = kfile; - wfd = fsfd; - wfile = fsfile; - } else { - rfd = fsfd; - rfile = fsfile; - wfd = kfd; - wfile = kfile; - } - - todo = (left_to_copy > CHUNKSIZE) ? CHUNKSIZE : left_to_copy; - if ((rv = read(rfd, buf, todo)) != todo) { - if (rv == -1) - err(1, "read %s", rfile); - else - errx(1, "unexpected EOF reading %s", rfile); - } - if ((rv = write(wfd, buf, todo)) != todo) { - if (rv == -1) - err(1, "write %s", wfile); - else - errx(1, "short write writing %s", wfile); - } - left_to_copy -= todo; - } - if (verbose) - fprintf(stderr, "done copying image\n"); - if (setsize && !extract) { - char buf[sizeof(uint32_t)]; - - if (verbose) - fprintf(stderr, "setting md_root_size to %llu\n", - (unsigned long long) fssb.st_size); - if (lseek(kfd, md_root_size_offset, SEEK_SET) != - md_root_size_offset) - err(1, "seek %s", kfile); - bfd_put_32(abfd, fssb.st_size, buf); - if (write(kfd, buf, sizeof(buf)) != sizeof(buf)) - err(1, "write %s", kfile); - } - - close(fsfd); - close(kfd); - - if (verbose) - fprintf(stderr, "exiting\n"); - - bfd_close_all_done(abfd); - exit(0); -} - -static void -usage(void) -{ - const char **list; - - fprintf(stderr, - "usage: %s [-svx] [-b bfdname] kernel image\n", - getprogname()); - fprintf(stderr, "supported targets:"); - for (list = bfd_target_list(); *list != NULL; list++) - fprintf(stderr, " %s", *list); - fprintf(stderr, "\n"); - exit(1); -} - -static int -find_md_root(bfd *abfd, struct symbols symbols[]) -{ - long i; - long storage_needed; - long number_of_symbols; - asymbol **symbol_table = NULL; - struct symbols *s; - - storage_needed = bfd_get_symtab_upper_bound(abfd); - if (storage_needed <= 0) - return (1); - - symbol_table = (asymbol **)malloc(storage_needed); - if (symbol_table == NULL) - return (1); - - number_of_symbols = bfd_canonicalize_symtab(abfd, symbol_table); - if (number_of_symbols <= 0) { - free(symbol_table); - return (1); - } - - for (i = 0; i < number_of_symbols; i++) { - for (s = symbols; s->name != NULL; s++) { - const char *sym = symbol_table[i]->name; - - /* - * match symbol prefix '_' or ''. - */ - if (!strcmp(s->name, sym) || - !strcmp(s->name + 1, sym)) { - s->offset = - (size_t)(symbol_table[i]->section->filepos - + symbol_table[i]->value); - } - } - } - - free(symbol_table); - - for (s = symbols; s->name != NULL; s++) { - if (s->offset == 0) - return (1); - } - - return (0); -} diff --git a/minix/commands/setup/setup.sh b/minix/commands/setup/setup.sh index 2a7e76fe1..c21514a47 100644 --- a/minix/commands/setup/setup.sh +++ b/minix/commands/setup/setup.sh @@ -73,7 +73,7 @@ check_mbr() read ok if [ "$ok" = Y -o "$ok" = y -o "$ok" = "" ] then - installboot_nbsd -m "$disk" /usr/mdec/mbr >/dev/null + installboot -m "$disk" /usr/mdec/mbr >/dev/null fi fi rm temp_mbr_netbsd @@ -547,7 +547,7 @@ test -n "$keymap" && cp -p "/usr/lib/keymaps/$keymap.map" /mnt/etc/keymap # XXX we have to use "-f" here, because installboot worries about BPB, which # we don't have... -installboot_nbsd -f /dev/$primary /usr/mdec/bootxx_minixfs3 >/dev/null || exit +installboot -f /dev/$primary /usr/mdec/bootxx_minixfs3 >/dev/null || exit # give the install the boot loader cp /usr/mdec/boot_monitor /mnt/ minixdir=/mnt/boot/minix_default diff --git a/minix/commands/updateboot/updateboot.sh b/minix/commands/updateboot/updateboot.sh index 18a7a54f7..07ef71621 100755 --- a/minix/commands/updateboot/updateboot.sh +++ b/minix/commands/updateboot/updateboot.sh @@ -35,6 +35,6 @@ then fi echo "Installing bootxx_minixfs3 into $disk." -installboot_nbsd "$disk" "$MDEC/bootxx_minixfs3" +installboot "$disk" "$MDEC/bootxx_minixfs3" sync diff --git a/releasetools/release.functions b/releasetools/release.functions index 4fa6d39dd..0084a0070 100644 --- a/releasetools/release.functions +++ b/releasetools/release.functions @@ -12,7 +12,7 @@ make_hdimage() # installboot -m needs at least 1KB dd < /dev/zero >tmpimage count=2 partition -fm tmpimage 2 81:$rootsects* 0:0 81:$usrsects - installboot_nbsd -m tmpimage /usr/mdec/mbr + installboot -m tmpimage /usr/mdec/mbr dd < tmpimage > subpart count=1 primsects=`expr 1 + $rootsects + $usrsects` @@ -26,7 +26,7 @@ make_hdimage() dd < /dev/zero count=$padsects } > hdimage partition -m hdimage 81:`expr $primsects + $padsects`* - installboot_nbsd -m hdimage /usr/mdec/mbr + installboot -m hdimage /usr/mdec/mbr } retrieve() diff --git a/releasetools/release.sh b/releasetools/release.sh index 9b3e4b59d..b702b130e 100755 --- a/releasetools/release.sh +++ b/releasetools/release.sh @@ -336,7 +336,7 @@ isosects=`expr $isosects + $isopad` dd if=$TMPDISKUSR bs=$BS count=$USRBLOCKS ) >m mv m $IMG # Make CD partition table -installboot_nbsd -m $IMG /usr/mdec/mbr +installboot -m $IMG /usr/mdec/mbr # Make sure there is no hole..! Otherwise the ISO format is # unreadable. partition -m $IMG 0 81:$isosects 81:$ROOTSECTS 81:$USRSECTS diff --git a/sbin/newfs_udf/Makefile b/sbin/newfs_udf/Makefile index f9ec40c8a..96a6c850f 100644 --- a/sbin/newfs_udf/Makefile +++ b/sbin/newfs_udf/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.5 2014/03/18 18:20:39 riastradh Exp $ +# $NetBSD: Makefile,v 1.7 2020/09/06 07:20:27 mrg Exp $ .include @@ -14,4 +14,9 @@ CPPFLAGS+= -I${MOUNT} -I${KUDF} -I${NETBSDSRCDIR}/sys DPADD+=${LIBUTIL} LDADD+=-lutil +.if !defined(__MINIX) +CWARNFLAGS.clang+= -Wno-error=address-of-packed-member +.endif # !defined(__MINIX) +CWARNFLAGS.gcc+= ${GCC_NO_ADDR_OF_PACKED_MEMBER} + .include diff --git a/sbin/newfs_udf/newfs_udf.c b/sbin/newfs_udf/newfs_udf.c index eaab2b144..94b77f9d6 100644 --- a/sbin/newfs_udf/newfs_udf.c +++ b/sbin/newfs_udf/newfs_udf.c @@ -1,4 +1,4 @@ -/* $NetBSD: newfs_udf.c,v 1.18 2013/08/09 15:11:08 reinoud Exp $ */ +/* $NetBSD: newfs_udf.c,v 1.20 2020/04/05 15:25:40 joerg Exp $ */ /* * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk @@ -72,7 +72,6 @@ int newfs_udf(int argc, char **argv); static void usage(void) __attribute__((__noreturn__)); - /* queue for temporary storage of sectors to be written out */ struct wrsect { uint64_t sectornr; @@ -121,11 +120,13 @@ udf_write_sector(void *sector, uint64_t location) if ((seekpos == NULL) || (seekpos->sectornr != location)) { pos = calloc(1, sizeof(struct wrsect)); if (pos == NULL) - return ENOMEM; + return errno; /* allocate space for copy of sector data */ pos->sector_data = calloc(1, context.sector_size); - if (pos->sector_data == NULL) - return ENOMEM; + if (pos->sector_data == NULL) { + free(pos); + return errno; + } pos->sectornr = location; if (seekpos) { diff --git a/sbin/newfs_udf/newfs_udf.h b/sbin/newfs_udf/newfs_udf.h index 1c21a0b48..2bb021d19 100644 --- a/sbin/newfs_udf/newfs_udf.h +++ b/sbin/newfs_udf/newfs_udf.h @@ -1,3 +1,5 @@ +/* $NetBSD: newfs_udf.h,v 1.7 2020/04/05 15:25:40 joerg Exp $ */ + /* * Copyright (c) 2006, 2008, 2013 Reinoud Zandijk * All rights reserved. @@ -53,8 +55,8 @@ extern float meta_fract; /* shared structure between udf_create.c users */ -struct udf_create_context context; -struct udf_disclayout layout; +extern struct udf_create_context context; +extern struct udf_disclayout layout; /* prototypes */ int udf_write_sector(void *sector, uint64_t location); diff --git a/sbin/newfs_udf/udf_create.c b/sbin/newfs_udf/udf_create.c index ef92874af..81708d166 100644 --- a/sbin/newfs_udf/udf_create.c +++ b/sbin/newfs_udf/udf_create.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $ */ +/* $NetBSD: udf_create.c,v 1.28 2020/05/14 08:34:18 msaitoh Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -30,7 +30,7 @@ #endif #include -__RCSID("$NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $"); +__RCSID("$NetBSD: udf_create.c,v 1.28 2020/05/14 08:34:18 msaitoh Exp $"); #include #include @@ -52,6 +52,9 @@ __RCSID("$NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $"); # endif #endif +struct udf_create_context context; +struct udf_disclayout layout; + /* * NOTE that there is some overlap between this code and the udf kernel fs. * This is intentially though it might better be factored out one day. @@ -339,7 +342,7 @@ udf_calculate_disc_layout(int format_flags, int min_udf, if (format_flags & FORMAT_META) { /* note: all in backing partition space */ layout.meta_file = pos++; - layout.meta_bitmap = pos++;; + layout.meta_bitmap = pos++; layout.meta_mirror = layout.part_size_lba-1; layout.meta_alignment = MAX(blockingnr, sparable_blockingnr); layout.meta_blockingnr = MAX(layout.meta_alignment, 32); @@ -1720,10 +1723,10 @@ udf_extattr_append_internal(union dscrptr *dscr, struct extattr_entry *extattr) struct extfile_entry *efe; struct extattrhdr_desc *extattrhdr; struct impl_extattr_entry *implext; - uint32_t impl_attr_loc, appl_attr_loc, l_ea, a_l, exthdr_len; - uint32_t *l_eap, l_ad; + uint32_t impl_attr_loc, appl_attr_loc, l_ea, l_ad, a_l; uint16_t *spos; uint8_t *bpos, *data; + void *l_eap; if (udf_rw16(dscr->tag.id) == TAGID_FENTRY) { fe = &dscr->fe; @@ -1741,27 +1744,22 @@ udf_extattr_append_internal(union dscrptr *dscr, struct extattr_entry *extattr) /* should have a header! */ extattrhdr = (struct extattrhdr_desc *) data; - l_ea = udf_rw32(*l_eap); + memcpy(&l_ea, l_eap, sizeof(l_ea)); + l_ea = udf_rw32(l_ea); if (l_ea == 0) { -#if !defined(NDEBUG) && defined(__minix) + uint32_t exthdr_len; assert(l_ad == 0); -#else - if (l_ad != 0) { - printf("%s:%d: l_ad != 0\n", __func__, __LINE__); - abort(); - } -#endif /* !defined(NDEBUG) && defined(__minix) */ /* create empty extended attribute header */ - exthdr_len = sizeof(struct extattrhdr_desc); + l_ea = sizeof(struct extattrhdr_desc); + exthdr_len = udf_rw32(l_ea); udf_inittag(&extattrhdr->tag, TAGID_EXTATTR_HDR, /* loc */ 0); - extattrhdr->impl_attr_loc = udf_rw32(exthdr_len); - extattrhdr->appl_attr_loc = udf_rw32(exthdr_len); + extattrhdr->impl_attr_loc = exthdr_len; + extattrhdr->appl_attr_loc = exthdr_len; extattrhdr->tag.desc_crc_len = udf_rw16(8); /* record extended attribute header length */ - l_ea = exthdr_len; - *l_eap = udf_rw32(l_ea); + memcpy(l_eap, &exthdr_len, sizeof(exthdr_len)); } /* extract locations */ @@ -1794,7 +1792,7 @@ udf_extattr_append_internal(union dscrptr *dscr, struct extattr_entry *extattr) assert(appl_attr_loc == l_ea); /* append the attribute at the end of the current space */ - bpos = data + udf_rw32(*l_eap); + bpos = data + l_ea; a_l = udf_rw32(extattr->a_l); /* update impl. attribute locations */ @@ -1809,7 +1807,8 @@ udf_extattr_append_internal(union dscrptr *dscr, struct extattr_entry *extattr) /* copy and advance */ memcpy(bpos, extattr, a_l); l_ea += a_l; - *l_eap = udf_rw32(l_ea); + l_ea = udf_rw32(l_ea); + memcpy(l_eap, &l_ea, sizeof(l_ea)); /* do the `dance` again backwards */ if (context.dscrver != 2) { @@ -2164,10 +2163,6 @@ udf_create_new_rootdir(union dscrptr **dscr) struct long_ad root_icb; int filetype, error; -#if defined(__minix) - /* LSC: -Werror=maybe-uninitialized when compiling with -O3 */ - fe = NULL; -#endif /*defined(__minix) */ memset(&root_icb, 0, sizeof(root_icb)); root_icb.len = udf_rw32(context.sector_size); root_icb.loc.lb_num = udf_rw32(layout.rootdir); diff --git a/share/Makefile b/share/Makefile index ebcab691f..302acc2f3 100644 --- a/share/Makefile +++ b/share/Makefile @@ -1,21 +1,29 @@ -# $NetBSD: Makefile,v 1.33 2014/08/08 09:34:10 apb Exp $ +# $NetBSD: Makefile,v 1.36 2019/05/07 05:02:42 thorpej Exp $ # from @(#)Makefile 8.1 (Berkeley) 6/5/93 # Missing: ms .include -#__MINIX: dict doc examples me \ +#__MINIX: dict examples me \ # tabset tmac wscons xml - .if ${MKSHARE} != "no" || \ make(clean) || make(cleandir) || make(distclean) || make(obj) -SUBDIR= legal man misc mk \ +SUBDIR= installboot legal man misc mk \ terminfo + +#__MINIX: +#.if ${MKGROFF} != "no" +#SUBDIR+=doc +#.endif + .if ${MKNLS} != "no" SUBDIR+=i18n locale nls .endif .endif +#__MINIX: +#SUBDIR.roff+= doc + # Speedup stubs for some subtrees that don't need to run these rules includes-examples includes-man: @true diff --git a/share/installboot/Makefile b/share/installboot/Makefile new file mode 100644 index 000000000..c63c13e61 --- /dev/null +++ b/share/installboot/Makefile @@ -0,0 +1,9 @@ +# $NetBSD: Makefile,v 1.2 2020/06/21 17:15:51 thorpej Exp $ + +.include + +.if ${MKSHARE} != "no" +SUBDIR= evbarm evbmips +.endif + +.include diff --git a/share/installboot/evbarm/Makefile b/share/installboot/evbarm/Makefile new file mode 100644 index 000000000..efb8b8571 --- /dev/null +++ b/share/installboot/evbarm/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2019/05/07 05:02:42 thorpej Exp $ + +NOOBJ= # defined + +.include + +.if ${MKSHARE} != "no" +FILES= boards.plist +FILESDIR= /usr/share/installboot/evbarm +.endif + +.include diff --git a/share/installboot/evbarm/boards.plist b/share/installboot/evbarm/boards.plist new file mode 100644 index 000000000..984eb689c --- /dev/null +++ b/share/installboot/evbarm/boards.plist @@ -0,0 +1,507 @@ + + + + + + terasic,de0-atlas + + description + Terasic DE-0(Atlas) + u-boot-pkg + de0-nanosoc + + + + hardkernel,odroid-c2 + + description + Hardkernel ODROID-C2 + u-boot-pkg + odroid-c2 + + libretech,cc + + description + Libre Computer Board AML-S905X-CC + u-boot-pkg + libretech-cc + + + + hardkernel,odroid-xu3 + + description + Hardkernel Odroid XU3 + u-boot-pkg + odroid-xu3 + + + + pine64,rock64 + + description + Pine64 Rock64 + u-boot-pkg + rock64 + + pine64,rockpro64 + + description + Pine64 RockPro64 + u-boot-pkg + rockpro64 + + pine64,pinebook-pro + + description + Pine64 Pinebook Pro + u-boot-pkg + pinebook-pro + + asus,rk3288-tinker + + description + Rockchip RK3288 Asus Tinker Board + u-boot-pkg + tinker + + + + bananapi,bpi-r2 + + description + Bananapi BPI-R2 + u-boot-pkg + bananapi-r2 + + + + nvidia,jetson-tk1 + + description + NVIDIA Tegra124 Jetson TK1 + u-boot-pkg + jetson-tk1 + + nvidia,p2371-2180 + + description + NVIDIA Jetson TX1 Developer Kit + u-boot-pkg + jetson-tx1 + + nvidia,p2771-0000 + + description + NVIDIA Jetson TX2 Developer Kit + u-boot-pkg + jetson-tx2 + + nvidia,p3450-0000 + + description + NVIDIA Jetson Nano Developer Kit + u-boot-pkg + jetson-nano + + + + ti,omap3-beagle + + description + TI OMAP3 BeagleBoard + u-boot-pkg + beagleboard + + ti,am335x-bone + + description + TI AM335x BeagleBone + u-boot-pkg + beaglebonewhite + + ti,am335x-bone-black + + description + TI AM335x BeagleBone Black + u-boot-pkg + beagleboneblack + + ti,omap4-panda + + description + TI OMAP4 PandaBoard + u-boot-pkg + pandaboard + + ti,omap4-panda-es + + description + TI OMAP4 PandaBoard-ES + u-boot-pkg + pandaboard + + + + + lamobo,lamobo-r1 + + description + Lamobo R1 + u-boot-pkg + lamobo-r1 + + lemaker,bananapi + + description + LeMaker Banana Pi + u-boot-pkg + bananapi + + lemaker,bananapro + + description + LeMaker Banana Pro + u-boot-pkg + bananapro + + sinovoip,bpi-m2-zero + + description + Banana Pi BPI-M2 Zero + u-boot-pkg + bananapi-m2-zero + + sinovoip,bpi-m3 + + description + Banana Pi BPI-M3 + u-boot-pkg + bananapi-m3 + + sinovoip,bpi-p2-zero + + description + Banana Pi BPI-P2 Zero + u-boot-pkg + bananapi-p2-zero + + + cubietech,cubieboard2 + + description + Cubietech Cubieboard2 + u-boot-pkg + cubieboard2 + + cubietech,a80-cubieboard4 + + description + Cubietech Cubieboard4 + u-boot-pkg + cubieboard4 + + cubietech,cubietruck + + description + Cubietech Cubietruck + u-boot-pkg + cubietruck + + cubietech,cubietruck-plus + + description + Cubietech Cubietruck Plus + u-boot-pkg + cubietruck-plus + + + friendlyarm,nanopi-m1 + + description + FriendlyArm NanoPi M1 + u-boot-pkg + nanopi-m1 + + friendlyarm,nanopi-neo + + description + FriendlyARM NanoPi NEO + u-boot-pkg + nanopi-neo + + friendlyarm,nanopi-neo-plus2 + + description + FriendlyARM NanoPi NEO Plus2 + u-boot-pkg + nanopi-neo-plus2 + + friendlyarm,nanopi-neo2 + + description + FriendlyARM NanoPi NEO 2 + u-boot-pkg + nanopi-neo2 + + friendlyarm,nanopi-r1 + + description + FriendlyARM NanoPi R1 + u-boot-pkg + nanopi-r1 + + + libretech,all-h3-cc-h2-plus + + description + Libre Computer Board ALL-H3-CC H2+ + u-boot-pkg + libretech-all-h3-cc-h2-plus + + libretech,all-h3-cc-h3 + + description + Libre Computer Board ALL-H3-CC H3 + u-boot-pkg + libretech-all-h3-cc-h3 + + libretech,all-h3-cc-h5 + + description + Libre Computer Board ALL-H3-CC H5 + u-boot-pkg + libretech-all-h3-cc-h5 + + + merrii,a31-hummingbird + + description + Merrii A31 Hummingbird + u-boot-pkg + hummingbird-a31 + + + nextthing,chip + + description + NextThing C.H.I.P. + u-boot-pkg + chip + + nextthing,pocketchip + + description + NextThing PocketC.H.I.P. + u-boot-pkg + pocketchip + + nextthing,chip-pro + + description + NextThing C.H.I.P. Pro + u-boot-pkg + chip-pro + + + olimex,a10-olinuxino-lime + + description + Olimex A10-OLinuXino-LIME + u-boot-pkg + a10-olinuxino-lime + + olimex,a20-olinuxino-lime2 + + description + Olimex A20-OLinuXino-LIME2 + u-boot-pkg + a20-olinuxino-lime2 + + olimex,a20-olinuxino-lime2-emmc + + description + Olimex A20-OLinuXino-LIME2-eMMC + u-boot-pkg + a20-olinuxino-lime2-emmc + + olimex,a20-olinuxino-micro + + description + Olimex A20-OLinuXino-MICRO + u-boot-pkg + a20-olinuxino-micro-emmc + + olimex,a20-olinuxino-micro-emmc + + description + Olimex A20-OLinuXino-MICRO-eMMC + u-boot-pkg + a20-olinuxino-micro-emmc + + + pine64,pine64-plus + + description + Pine64+ + u-boot-pkg + pine64-plus + + pine64,pine64 + + description + Pine64 + u-boot-pkg + pine64 + + pine64,pinebook + + description + Pinebook + u-boot-pkg + pinebook + + pine64,sopine-baseboard + + description + SoPine with baseboard + u-boot-pkg + sopine-baseboard + + pine64,pine64-lts + + description + Pine64 LTS + + u-boot-pkg + sopine-baseboard + + pine64,pine-h64 + + description + Pine H64 + u-boot-pkg + pine-h64 + + + terasic,de0-atlas + + description + Terasic DE-0(Atlas) + u-boot-pkg + de0-nanosoc + + + xunlong,orangepi-2 + + description + Xunlong Orange Pi 2 + u-boot-pkg + orangepi-2 + + xunlong,orangepi-one + + description + Xunlong Orange Pi One + u-boot-pkg + orangepi-one + + xunlong,orangepi-lite + + description + Xunlong Orange Pi Lite + u-boot-pkg + orangepi-lite + + xunlong,orangepi-lite2 + + description + Xunlong Orange Pi Lite2 + u-boot-pkg + orangepi-lite2 + + xunlong,orangepi-plus2e + + description + Xunlong Orange Pi Plus 2E + u-boot-pkg + orangepi-plus2e + + xunlong,orangepi-zero + + description + Xunlong Orange Pi Zero + u-boot-pkg + orangepi-zero + + xunlong,orangepi-zero-plus + + description + Xunlong Orange Pi Zero Plus + u-boot-pkg + orangepi-zero-plus + + + + digilent,zynq-zybo + + description + Digilent Zybo board + u-boot-pkg + zynq-zybo + + digilent,zynq-zybo-z7 + + description + Digilent Zybo Z7 board + u-boot-pkg + zynq-zybo-z7 + + + diff --git a/share/installboot/evbmips/Makefile b/share/installboot/evbmips/Makefile new file mode 100644 index 000000000..b684bf130 --- /dev/null +++ b/share/installboot/evbmips/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2020/06/22 03:15:48 rin Exp $ + +NOOBJ= # defined + +.include + +.if ${MKSHARE} != "no" +FILES= boards.plist +FILESDIR= /usr/share/installboot/evbmips +.endif + +.include diff --git a/share/installboot/evbmips/boards.plist b/share/installboot/evbmips/boards.plist new file mode 100644 index 000000000..4bff3467b --- /dev/null +++ b/share/installboot/evbmips/boards.plist @@ -0,0 +1,43 @@ + + + + + + img,ci20 + + description + MIPS Creator CI20 + u-boot-pkg + ci20 + + + diff --git a/share/mk/bsd.hostinit.mk b/share/mk/bsd.hostinit.mk new file mode 100644 index 000000000..8428c0c86 --- /dev/null +++ b/share/mk/bsd.hostinit.mk @@ -0,0 +1,13 @@ +# $NetBSD: bsd.hostinit.mk,v 1.1 2018/05/01 19:59:44 christos Exp $ + +.if !defined(_BSD_HOSTINIT_MK_) +_BSD_HOSTINIT_MK_=1 + +NOINFO= # defined +NOLINT= # defined +NOMAN= # defined +MKREPRO=no # Native toolchain might be unable to do it + +.include + +.endif # !defined(_BSD_HOSTINIT_MK_) diff --git a/sys/fs/msdosfs/bootsect.h b/sys/fs/msdosfs/bootsect.h index 92a63093b..8c140c0f2 100644 --- a/sys/fs/msdosfs/bootsect.h +++ b/sys/fs/msdosfs/bootsect.h @@ -1,4 +1,4 @@ -/* $NetBSD: bootsect.h,v 1.5 2012/11/04 17:57:59 jakllsch Exp $ */ +/* $NetBSD: bootsect.h,v 1.6 2016/01/22 22:48:18 dholland Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) @@ -24,13 +24,13 @@ * first sector of a partitioned hard disk. */ struct bootsector33 { - u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + uint8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ int8_t bsOemName[8]; /* OEM name and version */ int8_t bsBPB[19]; /* BIOS parameter block */ int8_t bsDriveNumber; /* drive number (0x80) */ int8_t bsBootCode[479]; /* pad so struct is 512b */ - u_int8_t bsBootSectSig0; - u_int8_t bsBootSectSig1; + uint8_t bsBootSectSig0; + uint8_t bsBootSectSig1; #define BOOTSIG0 0x55 #define BOOTSIG1 0xaa }; @@ -46,25 +46,25 @@ struct extboot { }; struct bootsector50 { - u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + uint8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ int8_t bsOemName[8]; /* OEM name and version */ int8_t bsBPB[25]; /* BIOS parameter block */ int8_t bsExt[26]; /* Bootsector Extension */ int8_t bsBootCode[448]; /* pad so structure is 512b */ - u_int8_t bsBootSectSig0; - u_int8_t bsBootSectSig1; + uint8_t bsBootSectSig0; + uint8_t bsBootSectSig1; #define BOOTSIG0 0x55 #define BOOTSIG1 0xaa }; struct bootsector710 { - u_int8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ + uint8_t bsJump[3]; /* jump inst E9xxxx or EBxx90 */ int8_t bsOEMName[8]; /* OEM name and version */ int8_t bsBPB[53]; /* BIOS parameter block */ int8_t bsExt[26]; /* Bootsector Extension */ int8_t bsBootCode[420]; /* pad so structure is 512b */ - u_int8_t bsBootSectSig0; - u_int8_t bsBootSectSig1; + uint8_t bsBootSectSig0; + uint8_t bsBootSectSig1; #define BOOTSIG0 0x55 #define BOOTSIG1 0xaa }; @@ -76,7 +76,7 @@ struct bootsector710 { */ #if 0 struct bootsec_atari { - u_int8_t bsBranch[2]; /* branch inst if auto-boot */ + uint8_t bsBranch[2]; /* branch inst if auto-boot */ int8_t bsFiller[6]; /* anything or nothing */ int8_t bsSerial[3]; /* serial no. for mediachange */ int8_t bsBPB[19]; /* BIOS parameter block */ diff --git a/sys/fs/msdosfs/bpb.h b/sys/fs/msdosfs/bpb.h index c2937241b..c5d93e20c 100644 --- a/sys/fs/msdosfs/bpb.h +++ b/sys/fs/msdosfs/bpb.h @@ -1,4 +1,4 @@ -/* $NetBSD: bpb.h,v 1.7 2012/11/04 17:57:59 jakllsch Exp $ */ +/* $NetBSD: bpb.h,v 1.8 2016/01/22 22:53:36 dholland Exp $ */ /* * Written by Paul Popelka (paulp@uts.amdahl.com) @@ -23,17 +23,17 @@ * BIOS Parameter Block (BPB) for DOS 3.3 */ struct bpb33 { - u_int16_t bpbBytesPerSec; /* bytes per sector */ - u_int8_t bpbSecPerClust; /* sectors per cluster */ - u_int16_t bpbResSectors; /* number of reserved sectors */ - u_int8_t bpbFATs; /* number of FATs */ - u_int16_t bpbRootDirEnts; /* number of root directory entries */ - u_int16_t bpbSectors; /* total number of sectors */ - u_int8_t bpbMedia; /* media descriptor */ - u_int16_t bpbFATsecs; /* number of sectors per FAT */ - u_int16_t bpbSecPerTrack; /* sectors per track */ - u_int16_t bpbHeads; /* number of heads */ - u_int16_t bpbHiddenSecs; /* number of hidden sectors */ + uint16_t bpbBytesPerSec; /* bytes per sector */ + uint8_t bpbSecPerClust; /* sectors per cluster */ + uint16_t bpbResSectors; /* number of reserved sectors */ + uint8_t bpbFATs; /* number of FATs */ + uint16_t bpbRootDirEnts; /* number of root directory entries */ + uint16_t bpbSectors; /* total number of sectors */ + uint8_t bpbMedia; /* media descriptor */ + uint16_t bpbFATsecs; /* number of sectors per FAT */ + uint16_t bpbSecPerTrack; /* sectors per track */ + uint16_t bpbHeads; /* number of heads */ + uint16_t bpbHiddenSecs; /* number of hidden sectors */ }; /* @@ -41,46 +41,46 @@ struct bpb33 { * and bpbHugeSectors is not in the 3.3 bpb. */ struct bpb50 { - u_int16_t bpbBytesPerSec; /* bytes per sector */ - u_int8_t bpbSecPerClust; /* sectors per cluster */ - u_int16_t bpbResSectors; /* number of reserved sectors */ - u_int8_t bpbFATs; /* number of FATs */ - u_int16_t bpbRootDirEnts; /* number of root directory entries */ - u_int16_t bpbSectors; /* total number of sectors */ - u_int8_t bpbMedia; /* media descriptor */ - u_int16_t bpbFATsecs; /* number of sectors per FAT */ - u_int16_t bpbSecPerTrack; /* sectors per track */ - u_int16_t bpbHeads; /* number of heads */ - u_int32_t bpbHiddenSecs; /* # of hidden sectors */ - u_int32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ + uint16_t bpbBytesPerSec; /* bytes per sector */ + uint8_t bpbSecPerClust; /* sectors per cluster */ + uint16_t bpbResSectors; /* number of reserved sectors */ + uint8_t bpbFATs; /* number of FATs */ + uint16_t bpbRootDirEnts; /* number of root directory entries */ + uint16_t bpbSectors; /* total number of sectors */ + uint8_t bpbMedia; /* media descriptor */ + uint16_t bpbFATsecs; /* number of sectors per FAT */ + uint16_t bpbSecPerTrack; /* sectors per track */ + uint16_t bpbHeads; /* number of heads */ + uint32_t bpbHiddenSecs; /* # of hidden sectors */ + uint32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ }; /* * BPB for DOS 7.10 (FAT32). This one has a few extensions to bpb50. */ struct bpb710 { - u_int16_t bpbBytesPerSec; /* bytes per sector */ - u_int8_t bpbSecPerClust; /* sectors per cluster */ - u_int16_t bpbResSectors; /* number of reserved sectors */ - u_int8_t bpbFATs; /* number of FATs */ - u_int16_t bpbRootDirEnts; /* number of root directory entries */ - u_int16_t bpbSectors; /* total number of sectors */ - u_int8_t bpbMedia; /* media descriptor */ - u_int16_t bpbFATsecs; /* number of sectors per FAT */ - u_int16_t bpbSecPerTrack; /* sectors per track */ - u_int16_t bpbHeads; /* number of heads */ - u_int32_t bpbHiddenSecs; /* # of hidden sectors */ - u_int32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ - u_int32_t bpbBigFATsecs; /* like bpbFATsecs for FAT32 */ - u_int16_t bpbExtFlags; /* extended flags: */ + uint16_t bpbBytesPerSec; /* bytes per sector */ + uint8_t bpbSecPerClust; /* sectors per cluster */ + uint16_t bpbResSectors; /* number of reserved sectors */ + uint8_t bpbFATs; /* number of FATs */ + uint16_t bpbRootDirEnts; /* number of root directory entries */ + uint16_t bpbSectors; /* total number of sectors */ + uint8_t bpbMedia; /* media descriptor */ + uint16_t bpbFATsecs; /* number of sectors per FAT */ + uint16_t bpbSecPerTrack; /* sectors per track */ + uint16_t bpbHeads; /* number of heads */ + uint32_t bpbHiddenSecs; /* # of hidden sectors */ + uint32_t bpbHugeSectors; /* # of sectors if bpbSectors == 0 */ + uint32_t bpbBigFATsecs; /* like bpbFATsecs for FAT32 */ + uint16_t bpbExtFlags; /* extended flags: */ #define FATNUM 0xf /* mask for numbering active FAT */ #define FATMIRROR 0x80 /* FAT is mirrored (like it always was) */ - u_int16_t bpbFSVers; /* filesystem version */ + uint16_t bpbFSVers; /* filesystem version */ #define FSVERS 0 /* currently only 0 is understood */ - u_int32_t bpbRootClust; /* start cluster for root directory */ - u_int16_t bpbFSInfo; /* filesystem info structure sector */ - u_int16_t bpbBackup; /* backup boot sector */ - u_int8_t bpbReserved[12]; /* Reserved for future expansion */ + uint32_t bpbRootClust; /* start cluster for root directory */ + uint16_t bpbFSInfo; /* filesystem info structure sector */ + uint16_t bpbBackup; /* backup boot sector */ + uint8_t bpbReserved[12]; /* Reserved for future expansion */ }; #ifdef atari @@ -90,17 +90,17 @@ struct bpb710 { */ #if 0 struct bpb_a { - u_int16_t bpbBytesPerSec; /* bytes per sector */ - u_int8_t bpbSecPerClust; /* sectors per cluster */ - u_int16_t bpbResSectors; /* number of reserved sectors */ - u_int8_t bpbFATs; /* number of FATs */ - u_int16_t bpbRootDirEnts; /* number of root directory entries */ - u_int16_t bpbSectors; /* total number of sectors */ - u_int8_t bpbUseless1; /* meaningless on GEMDOS FS */ - u_int16_t bpbFATsecs; /* number of sectors per FAT */ - u_int16_t bpbUseless2; /* meaningless for harddisk fs */ - u_int16_t bpbUseless3; /* meaningless for harddisk fs */ - u_int16_t bpbHiddenSecs; /* the TOS-BIOS ignores this */ + uint16_t bpbBytesPerSec; /* bytes per sector */ + uint8_t bpbSecPerClust; /* sectors per cluster */ + uint16_t bpbResSectors; /* number of reserved sectors */ + uint8_t bpbFATs; /* number of FATs */ + uint16_t bpbRootDirEnts; /* number of root directory entries */ + uint16_t bpbSectors; /* total number of sectors */ + uint8_t bpbUseless1; /* meaningless on GEMDOS FS */ + uint16_t bpbFATsecs; /* number of sectors per FAT */ + uint16_t bpbUseless2; /* meaningless for harddisk fs */ + uint16_t bpbUseless3; /* meaningless for harddisk fs */ + uint16_t bpbHiddenSecs; /* the TOS-BIOS ignores this */ }; #endif #endif /* atari */ @@ -159,39 +159,39 @@ struct byte_bpb50 { * BPB for DOS 7.10 (FAT32). This one has a few extensions to bpb50. */ struct byte_bpb710 { - u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ - u_int8_t bpbSecPerClust; /* sectors per cluster */ - u_int8_t bpbResSectors[2]; /* number of reserved sectors */ - u_int8_t bpbFATs; /* number of FATs */ - u_int8_t bpbRootDirEnts[2]; /* number of root directory entries */ - u_int8_t bpbSectors[2]; /* total number of sectors */ - u_int8_t bpbMedia; /* media descriptor */ - u_int8_t bpbFATsecs[2]; /* number of sectors per FAT */ - u_int8_t bpbSecPerTrack[2]; /* sectors per track */ - u_int8_t bpbHeads[2]; /* number of heads */ - u_int8_t bpbHiddenSecs[4]; /* # of hidden sectors */ - u_int8_t bpbHugeSectors[4]; /* # of sectors if bpbSectors == 0 */ - u_int8_t bpbBigFATsecs[4]; /* like bpbFATsecs for FAT32 */ - u_int8_t bpbExtFlags[2]; /* extended flags: */ - u_int8_t bpbFSVers[2]; /* filesystem version */ - u_int8_t bpbRootClust[4]; /* start cluster for root directory */ - u_int8_t bpbFSInfo[2]; /* filesystem info structure sector */ - u_int8_t bpbBackup[2]; /* backup boot sector */ - u_int8_t bpbReserved[12]; /* Reserved for future expansion */ + uint8_t bpbBytesPerSec[2]; /* bytes per sector */ + uint8_t bpbSecPerClust; /* sectors per cluster */ + uint8_t bpbResSectors[2]; /* number of reserved sectors */ + uint8_t bpbFATs; /* number of FATs */ + uint8_t bpbRootDirEnts[2]; /* number of root directory entries */ + uint8_t bpbSectors[2]; /* total number of sectors */ + uint8_t bpbMedia; /* media descriptor */ + uint8_t bpbFATsecs[2]; /* number of sectors per FAT */ + uint8_t bpbSecPerTrack[2]; /* sectors per track */ + uint8_t bpbHeads[2]; /* number of heads */ + uint8_t bpbHiddenSecs[4]; /* # of hidden sectors */ + uint8_t bpbHugeSectors[4]; /* # of sectors if bpbSectors == 0 */ + uint8_t bpbBigFATsecs[4]; /* like bpbFATsecs for FAT32 */ + uint8_t bpbExtFlags[2]; /* extended flags: */ + uint8_t bpbFSVers[2]; /* filesystem version */ + uint8_t bpbRootClust[4]; /* start cluster for root directory */ + uint8_t bpbFSInfo[2]; /* filesystem info structure sector */ + uint8_t bpbBackup[2]; /* backup boot sector */ + uint8_t bpbReserved[12]; /* Reserved for future expansion */ }; /* * FAT32 FSInfo block. */ struct fsinfo { - u_int8_t fsisig1[4]; - u_int8_t fsifill1[480]; - u_int8_t fsisig2[4]; - u_int8_t fsinfree[4]; - u_int8_t fsinxtfree[4]; - u_int8_t fsifill2[12]; - u_int8_t fsisig3[4]; - u_int8_t fsifill3[508]; - u_int8_t fsisig4[4]; + uint8_t fsisig1[4]; + uint8_t fsifill1[480]; + uint8_t fsisig2[4]; + uint8_t fsinfree[4]; + uint8_t fsinxtfree[4]; + uint8_t fsifill2[12]; + uint8_t fsisig3[4]; + uint8_t fsifill3[508]; + uint8_t fsisig4[4]; }; #endif /* _MSDOSFS_BPB_H_ */ diff --git a/sys/fs/msdosfs/denode.h b/sys/fs/msdosfs/denode.h index 57c13dad6..1c64d64d3 100644 --- a/sys/fs/msdosfs/denode.h +++ b/sys/fs/msdosfs/denode.h @@ -1,4 +1,4 @@ -/* $NetBSD: denode.h,v 1.24 2014/07/08 09:21:52 hannken Exp $ */ +/* $NetBSD: denode.h,v 1.25 2017/01/14 17:17:53 maya Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -212,7 +212,8 @@ struct denode { #define DE_INTERNALIZE32(dep, dp) \ ((dep)->de_StartCluster |= getushort((dp)->deHighClust) << 16) #define DE_INTERNALIZE(dep, dp) \ - (memcpy((dep)->de_Name, (dp)->deName, 11), \ + (memcpy((dep)->de_Name, (dp)->deName, 8), \ + memcpy((dep)->de_Name+8, (dp)->deExtension, 3),\ (dep)->de_Attributes = (dp)->deAttributes, \ (dep)->de_CHun = (dp)->deCHundredth, \ (dep)->de_CTime = getushort((dp)->deCTime), \ @@ -229,7 +230,8 @@ struct denode { #define DE_EXTERNALIZE16(dp, dep) \ putushort((dp)->deHighClust, 0) #define DE_EXTERNALIZE(dp, dep) \ - (memcpy((dp)->deName, (dep)->de_Name, 11), \ + (memcpy((dp)->deName, (dep)->de_Name, 8), \ + memcpy((dp)->deExtension, (dep)->de_Name+8, 3),\ (dp)->deAttributes = (dep)->de_Attributes, \ (dp)->deCHundredth = (dep)->de_CHun, \ putushort((dp)->deCTime, (dep)->de_CTime), \ diff --git a/sys/fs/msdosfs/direntry.h b/sys/fs/msdosfs/direntry.h index c3d1b9b78..913e09a63 100644 --- a/sys/fs/msdosfs/direntry.h +++ b/sys/fs/msdosfs/direntry.h @@ -1,4 +1,4 @@ -/* $NetBSD: direntry.h,v 1.7 2013/10/20 00:01:55 christos Exp $ */ +/* $NetBSD: direntry.h,v 1.11 2016/02/01 02:59:33 christos Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -53,12 +53,12 @@ * Structure of a dos directory entry. */ struct direntry { - u_int8_t deName[8]; /* filename, blank filled */ + uint8_t deName[8]; /* filename, blank filled */ #define SLOT_EMPTY 0x00 /* slot has never been used */ #define SLOT_E5 0x05 /* the real value is 0xe5 */ #define SLOT_DELETED 0xe5 /* file in this slot deleted */ - u_int8_t deExtension[3]; /* extension, blank filled */ - u_int8_t deAttributes; /* file attributes */ + uint8_t deExtension[3]; /* extension, blank filled */ + uint8_t deAttributes; /* file attributes */ #define ATTR_NORMAL 0x00 /* normal file */ #define ATTR_READONLY 0x01 /* file is readonly */ #define ATTR_HIDDEN 0x02 /* file is hidden */ @@ -66,16 +66,16 @@ struct direntry { #define ATTR_VOLUME 0x08 /* entry is a volume label */ #define ATTR_DIRECTORY 0x10 /* entry is a directory name */ #define ATTR_ARCHIVE 0x20 /* file is new or modified */ - u_int8_t deReserved; /* reserved */ - u_int8_t deCHundredth; /* hundredth of seconds in CTime */ - u_int8_t deCTime[2]; /* create time */ - u_int8_t deCDate[2]; /* create date */ - u_int8_t deADate[2]; /* access date */ - u_int8_t deHighClust[2]; /* high bytes of cluster number */ - u_int8_t deMTime[2]; /* last update time */ - u_int8_t deMDate[2]; /* last update date */ - u_int8_t deStartCluster[2]; /* starting cluster of file */ - u_int8_t deFileSize[4]; /* size of file in bytes */ + uint8_t deReserved; /* reserved */ + uint8_t deCHundredth; /* hundredth of seconds in CTime */ + uint8_t deCTime[2]; /* create time */ + uint8_t deCDate[2]; /* create date */ + uint8_t deADate[2]; /* access date */ + uint8_t deHighClust[2]; /* high bytes of cluster number */ + uint8_t deMTime[2]; /* last update time */ + uint8_t deMDate[2]; /* last update date */ + uint8_t deStartCluster[2]; /* starting cluster of file */ + uint8_t deFileSize[4]; /* size of file in bytes */ }; static __inline uint8_t @@ -88,17 +88,17 @@ msdos_dirchar(const struct direntry *de, size_t i) { * Structure of a Win95 long name directory entry */ struct winentry { - u_int8_t weCnt; + uint8_t weCnt; #define WIN_LAST 0x40 #define WIN_CNT 0x3f - u_int8_t wePart1[10]; - u_int8_t weAttributes; + uint8_t wePart1[10]; + uint8_t weAttributes; #define ATTR_WIN95 0x0f - u_int8_t weReserved1; - u_int8_t weChksum; - u_int8_t wePart2[12]; - u_int16_t weReserved2; - u_int8_t wePart3[4]; + uint8_t weReserved1; + uint8_t weChksum; + uint8_t wePart2[12]; + uint16_t weReserved2; + uint8_t wePart3[4]; }; #define WIN_CHARS 13 /* Number of chars per winentry */ @@ -128,19 +128,20 @@ struct winentry { #if defined(_KERNEL) || defined(MAKEFS) struct dirent; -void unix2dostime(const struct timespec *tsp, int gmtoff, u_int16_t *ddp, - u_int16_t *dtp, u_int8_t *dhp); -void dos2unixtime(u_int dd, u_int dt, u_int dh, int gmtoff, - struct timespec *tsp); -int dos2unixfn(u_char dn[11], u_char *un, int lower); -int unix2dosfn(const u_char *un, u_char dn[12], int unlen, - u_int gen); -int unix2winfn(const u_char *un, int unlen, struct winentry *wep, - int cnt, int chksum); -int winChkName(const u_char *un, int unlen, struct winentry *wep, - int chksum); -int win2unixfn(struct winentry *wep, struct dirent *dp, int chksum); -u_int8_t winChksum(u_int8_t *name); -int winSlotCnt(const u_char *un, int unlen); +void unix2dostime(const struct timespec *tsp, int gmtoff, uint16_t *ddp, + uint16_t *dtp, uint8_t *dhp); +void dos2unixtime(unsigned int dd, unsigned int dt, unsigned int dh, + int gmtoff, struct timespec *tsp); +int dos2unixfn(unsigned char dn[11], unsigned char *un, int lower); +int unix2dosfn(const unsigned char *un, unsigned char dn[12], int unlen, + unsigned int gen); +int unix2winfn(const unsigned char *un, int unlen, struct winentry *wep, + int cnt, int chksum, int utf8); +int winChkName(const unsigned char *un, int unlen, struct winentry *wep, + int chksum, int utf8); +int win2unixfn(struct winentry *wep, struct dirent *dp, int chksum, + uint16_t *namlen, int utf8); +uint8_t winChksum(uint8_t *name); +int winSlotCnt(const unsigned char *un, int unlen, int utf8); #endif /* _KERNEL || MAKEFS */ #endif /* _MSDOSFS_DIRENTRY_H_ */ diff --git a/sys/fs/msdosfs/files.msdosfs b/sys/fs/msdosfs/files.msdosfs index 0170819ca..24e6c1f34 100644 --- a/sys/fs/msdosfs/files.msdosfs +++ b/sys/fs/msdosfs/files.msdosfs @@ -1,4 +1,4 @@ -# $NetBSD: files.msdosfs,v 1.2 2014/10/11 06:42:18 uebayasi Exp $ +# $NetBSD: files.msdosfs,v 1.3 2016/02/06 10:40:58 mlelstv Exp $ deffs MSDOSFS @@ -9,3 +9,4 @@ file fs/msdosfs/msdosfs_fat.c msdosfs file fs/msdosfs/msdosfs_lookup.c msdosfs file fs/msdosfs/msdosfs_vfsops.c msdosfs file fs/msdosfs/msdosfs_vnops.c msdosfs +file fs/msdosfs/msdosfs_unicode.c msdosfs diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c index ba3ca918f..58a83a025 100644 --- a/sys/fs/msdosfs/msdosfs_conv.c +++ b/sys/fs/msdosfs/msdosfs_conv.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_conv.c,v 1.10 2014/09/01 09:09:47 martin Exp $ */ +/* $NetBSD: msdosfs_conv.c,v 1.17 2016/06/30 09:34:01 nonaka Exp $ */ /*- * Copyright (C) 1995, 1997 Wolfgang Solfrank. @@ -45,20 +45,27 @@ * any damages caused by this software. * * October 1992 + * */ #if HAVE_NBTOOL_CONFIG_H #include "nbtool_config.h" #endif +#ifndef _KERNEL +#include +#define KASSERT(x) assert(x) +#endif + #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.10 2014/09/01 09:09:47 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.17 2016/06/30 09:34:01 nonaka Exp $"); /* * System include files. */ #include #include +#include #ifdef _KERNEL #include #include @@ -78,6 +85,22 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.10 2014/09/01 09:09:47 martin Exp #include #include +static int invalidname(const u_int16_t *, int); + +static int ucs2utf8(const u_int16_t *, u_int8_t *, int); +static int utf8ucs2(const u_int8_t *, int, u_int16_t *); + +static int ucs2utf8str(const u_int16_t *, int, u_int8_t *, int); +static int utf8ucs2str(const u_int8_t *, int, u_int16_t *, int); +static int ucs2char8str(const u_int16_t *, int, u_int8_t *, int); +static int char8ucs2str(const u_int8_t *, int, u_int16_t *, int); + +static void ucs2pad(u_int16_t *, int, int); + +static u_int16_t ucs2fold(u_int16_t); +static int ucs2match(u_int16_t *, u_int16_t *, int n); +static int char8match(u_int16_t *, u_int16_t *, int n); + /* * The number of seconds between Jan 1, 1970 and Jan 1, 1980. In that * interval there were 8 regular years and 2 leap years. @@ -513,24 +536,34 @@ unix2dosfn(const u_char *un, u_char dn[12], int unlen, u_int gen) * i.e. doesn't consist solely of blanks and dots */ int -unix2winfn(const u_char *un, int unlen, struct winentry *wep, int cnt, int chksum) +unix2winfn(const u_char *un, int unlen, struct winentry *wep, int cnt, int chksum, int utf8) { - const u_int8_t *cp; - u_int8_t *wcp; - int i; + u_int16_t wn[WIN_MAXLEN], *p; + int i, len; + const u_char *cp; /* * Drop trailing blanks and dots */ - for (cp = un + unlen; *--cp == ' ' || *cp == '.'; unlen--); + for (cp = un + unlen; unlen > 0; unlen--) + if (*--cp != ' ' && *cp != '.') + break; - un += (cnt - 1) * WIN_CHARS; - unlen -= (cnt - 1) * WIN_CHARS; + /* + * Offset of this entry + */ + i = (cnt - 1) * WIN_CHARS; + + /* + * Translate UNIX name to ucs-2 + */ + len = utf8 ? utf8ucs2str(un, unlen, wn, WIN_MAXLEN) : char8ucs2str(un, unlen, wn, WIN_MAXLEN); + ucs2pad(wn, len, WIN_MAXLEN); /* * Initialize winentry to some useful default */ - for (wcp = (u_int8_t *)wep, i = sizeof(*wep); --i >= 0; *wcp++ = 0xff); + memset(wep, 0xff, sizeof(*wep)); wep->weCnt = cnt; wep->weAttributes = ATTR_WIN95; wep->weReserved1 = 0; @@ -538,33 +571,18 @@ unix2winfn(const u_char *un, int unlen, struct winentry *wep, int cnt, int chksu wep->weReserved2 = 0; /* - * Now convert the filename parts + * Store name segment into directory entry */ - for (wcp = wep->wePart1, i = sizeof(wep->wePart1)/2; --i >= 0;) { - if (--unlen < 0) - goto done; - *wcp++ = *un++; - *wcp++ = 0; - } - for (wcp = wep->wePart2, i = sizeof(wep->wePart2)/2; --i >= 0;) { - if (--unlen < 0) - goto done; - *wcp++ = *un++; - *wcp++ = 0; - } - for (wcp = wep->wePart3, i = sizeof(wep->wePart3)/2; --i >= 0;) { - if (--unlen < 0) - goto done; - *wcp++ = *un++; - *wcp++ = 0; - } - if (!unlen) - wep->weCnt |= WIN_LAST; - return unlen; + p = &wn[i]; + memcpy(wep->wePart1, p, sizeof(wep->wePart1)); + p += sizeof(wep->wePart1) / sizeof(*p); + memcpy(wep->wePart2, p, sizeof(wep->wePart2)); + p += sizeof(wep->wePart2) / sizeof(*p); + memcpy(wep->wePart3, p, sizeof(wep->wePart3)); + + if (len > i + WIN_CHARS) + return 1; -done: - *wcp++ = 0; - *wcp++ = 0; wep->weCnt |= WIN_LAST; return 0; } @@ -574,15 +592,16 @@ done: * Returns the checksum or -1 if no match */ int -winChkName(const u_char *un, int unlen, struct winentry *wep, int chksum) +winChkName(const u_char *un, int unlen, struct winentry *wep, int chksum, int utf8) { - u_int8_t *cp; - int i; + u_int16_t wn[WIN_MAXLEN], *p; + u_int16_t buf[WIN_CHARS]; + int i, len; /* * First compare checksums */ - if (wep->weCnt&WIN_LAST) + if (wep->weCnt & WIN_LAST) chksum = wep->weChksum; else if (chksum != wep->weChksum) chksum = -1; @@ -592,56 +611,35 @@ winChkName(const u_char *un, int unlen, struct winentry *wep, int chksum) /* * Offset of this entry */ - i = ((wep->weCnt&WIN_CNT) - 1) * WIN_CHARS; - un += i; - if ((unlen -= i) < 0) + i = ((wep->weCnt & WIN_CNT) - 1) * WIN_CHARS; + + /* + * Translate UNIX name to ucs-2 + */ + len = utf8 ? utf8ucs2str(un, unlen, wn, WIN_MAXLEN) : char8ucs2str(un, unlen, wn, WIN_MAXLEN); + ucs2pad(wn, len, WIN_MAXLEN); + + if (i >= len + 1) + return -1; + if ((wep->weCnt & WIN_LAST) && (len - i > WIN_CHARS)) return -1; /* - * Ignore redundant winentries (those with only \0\0 on start in them). - * An appearance of such entry is a bug; unknown if in NetBSD msdosfs - * or MS Windows. + * Fetch name segment from directory entry */ - if (unlen == 0) { - if (wep->wePart1[0] == '\0' && wep->wePart1[1] == '\0') - return chksum; - else - return -1; - } - - if ((wep->weCnt&WIN_LAST) && unlen > WIN_CHARS) - return -1; + p = &buf[0]; + memcpy(p, wep->wePart1, sizeof(wep->wePart1)); + p += sizeof(wep->wePart1) / sizeof(*p); + memcpy(p, wep->wePart2, sizeof(wep->wePart2)); + p += sizeof(wep->wePart2) / sizeof(*p); + memcpy(p, wep->wePart3, sizeof(wep->wePart3)); /* - * Compare the name parts + * And compare name segment */ - for (cp = wep->wePart1, i = sizeof(wep->wePart1)/2; --i >= 0;) { - if (--unlen < 0) { - if (!*cp++ && !*cp) - return chksum; - return -1; - } - if (u2l[*cp++] != u2l[*un++] || *cp++) - return -1; - } - for (cp = wep->wePart2, i = sizeof(wep->wePart2)/2; --i >= 0;) { - if (--unlen < 0) { - if (!*cp++ && !*cp) - return chksum; - return -1; - } - if (u2l[*cp++] != u2l[*un++] || *cp++) - return -1; - } - for (cp = wep->wePart3, i = sizeof(wep->wePart3)/2; --i >= 0;) { - if (--unlen < 0) { - if (!*cp++ && !*cp) - return chksum; - return -1; - } - if (u2l[*cp++] != u2l[*un++] || *cp++) - return -1; - } + if (! (utf8 ? ucs2match(&wn[i], buf, WIN_CHARS) : char8match(&wn[i], buf, WIN_CHARS))) + return -1; + return chksum; } @@ -650,110 +648,73 @@ winChkName(const u_char *un, int unlen, struct winentry *wep, int chksum) * Returns the checksum or -1 if impossible */ int -win2unixfn(struct winentry *wep, struct dirent *dp, int chksum) +win2unixfn(struct winentry *wep, struct dirent *dp, int chksum, + uint16_t *namlen, int utf8) { - u_int8_t *cp; - u_int8_t *np, *ep = (u_int8_t *)dp->d_name + WIN_MAXLEN; - int i; + u_int16_t wn[WIN_CHARS], *p; + u_int8_t buf[WIN_CHARS*3]; + int len; - if ((wep->weCnt&WIN_CNT) > howmany(WIN_MAXLEN, WIN_CHARS) - || !(wep->weCnt&WIN_CNT)) + if ((wep->weCnt & WIN_CNT) > howmany(WIN_MAXLEN, WIN_CHARS) + || !(wep->weCnt & WIN_CNT)) return -1; /* * First compare checksums */ - if (wep->weCnt&WIN_LAST) { + if (wep->weCnt & WIN_LAST) { chksum = wep->weChksum; - /* - * This works even though d_namlen is one byte! - */ -#ifdef __NetBSD__ - dp->d_namlen = (wep->weCnt&WIN_CNT) * WIN_CHARS; -#endif + *namlen = 0; } else if (chksum != wep->weChksum) chksum = -1; if (chksum == -1) return -1; /* - * Offset of this entry + * Fetch name segment from directory entry */ - i = ((wep->weCnt&WIN_CNT) - 1) * WIN_CHARS; - np = (u_int8_t *)dp->d_name + i; + p = &wn[0]; + memcpy(p, wep->wePart1, sizeof(wep->wePart1)); + p += sizeof(wep->wePart1) / sizeof(*p); + memcpy(p, wep->wePart2, sizeof(wep->wePart2)); + p += sizeof(wep->wePart2) / sizeof(*p); + memcpy(p, wep->wePart3, sizeof(wep->wePart3)); /* - * Convert the name parts + * Don't allow slashes in UNIX names. Discard that entry. */ - for (cp = wep->wePart1, i = sizeof(wep->wePart1)/2; --i >= 0;) { - switch (*np++ = *cp++) { - case 0: -#ifdef __NetBSD__ - dp->d_namlen -= sizeof(wep->wePart2)/2 - + sizeof(wep->wePart3)/2 + i + 1; -#endif - return chksum; - case '/': - np[-1] = 0; - return -1; - } - /* - * The size comparison should result in the compiler - * optimizing the whole if away - */ - if (WIN_MAXLEN % WIN_CHARS < sizeof(wep->wePart1) / 2 - && np > ep) { - np[-1] = 0; - return -1; - } - if (*cp++) - return -1; - } - for (cp = wep->wePart2, i = sizeof(wep->wePart2)/2; --i >= 0;) { - switch (*np++ = *cp++) { - case 0: -#ifdef __NetBSD__ - dp->d_namlen -= sizeof(wep->wePart3)/2 + i + 1; -#endif - return chksum; - case '/': - np[-1] = 0; - return -1; - } - /* - * The size comparisons should be optimized away - */ - if (WIN_MAXLEN % WIN_CHARS >= sizeof(wep->wePart1) / 2 - && WIN_MAXLEN % WIN_CHARS < (sizeof(wep->wePart1) + sizeof(wep->wePart2)) / 2 - && np > ep) { - np[-1] = 0; - return -1; - } - if (*cp++) - return -1; - } - for (cp = wep->wePart3, i = sizeof(wep->wePart3)/2; --i >= 0;) { - switch (*np++ = *cp++) { - case 0: -#ifdef __NetBSD__ - dp->d_namlen -= i + 1; -#endif - return chksum; - case '/': - np[-1] = 0; - return -1; - } - /* - * See above - */ - if (WIN_MAXLEN % WIN_CHARS >= (sizeof(wep->wePart1) + sizeof(wep->wePart2)) / 2 - && np > ep) { - np[-1] = 0; - return -1; - } - if (*cp++) - return -1; - } + if (invalidname(wn, WIN_CHARS)) + return -1; + + /* + * Translate ucs-2 to UNIX name + */ + len = utf8 ? ucs2utf8str(wn, WIN_CHARS, buf, sizeof(buf)) + : ucs2char8str(wn, WIN_CHARS, buf, sizeof(buf)); + + KASSERT(len >= 0); + KASSERT((size_t)len <= MIN(sizeof(buf), sizeof(dp->d_name)-1)); + + /* + * Prepend name segment to directory entry + * + * This ignores the slot number from the windows entry but + * assumes that segments are read in reverse order. + * + * The UCS-2 name (up to 255 chars) can overflow the UNIX + * directory entry (up to 511 bytes). Trailing characters + * are silently discarded. This could also end in multiple + * files using the same (truncated) name. + */ + *namlen += len; + if (*namlen > sizeof(dp->d_name) - 1) + *namlen = sizeof(dp->d_name) - 1; + + KASSERT(*namlen >= len); + + memmove(&dp->d_name[len], &dp->d_name[0], *namlen - len); + memcpy(dp->d_name, buf, len); + return chksum; } @@ -767,7 +728,7 @@ winChksum(u_int8_t *name) u_int8_t s; for (s = 0, i = 11; --i >= 0; s += *name++) - s = (s << 7)|(s >> 1); + s = (s << 7) | (s >> 1); return s; } @@ -775,12 +736,304 @@ winChksum(u_int8_t *name) * Determine the number of slots necessary for Win95 names */ int -winSlotCnt(const u_char *un, int unlen) +winSlotCnt(const u_char *un, int unlen, int utf8) { - for (un += unlen; unlen > 0; unlen--) - if (*--un != ' ' && *un != '.') + const u_char *cp; + int len; + + /* + * Drop trailing blanks and dots + */ + for (cp = un + unlen; unlen > 0; unlen--) + if (*--cp != ' ' && *cp != '.') break; - if (unlen > WIN_MAXLEN) - return 0; - return howmany(unlen, WIN_CHARS); + + len = utf8 ? utf8ucs2str(un, unlen, NULL, WIN_MAXLEN) : unlen; + + return howmany(len, WIN_CHARS); } + +/* + * Scan windows name for characters that must not + * appear in a UNIX filename + */ +static int +invalidname(const u_int16_t *in, int n) +{ + while (n-- > 0) { + if (*in++ == '/') + return 1; + } + + return 0; +} + +/* + * Convert UCS-2 character into UTF-8 + * return number of output bytes or 0 if output + * buffer is too short + */ +static int +ucs2utf8(const u_int16_t *in, u_int8_t *out, int n) +{ + uint16_t inch = le16toh(in[0]); + + if (inch <= 0x007f) { + if (n < 1) return 0; + if (out) + *out++ = inch; + return 1; + } else if (inch <= 0x07ff) { + if (n < 2) return 0; + if (out) { + *out++ = 0xc0 | (inch >> 6); + *out++ = 0x80 | (inch & 0x3f); + } + return 2; + } else { + if (n < 3) return 0; + if (out) { + *out++ = 0xe0 | (inch >> 12); + *out++ = 0x80 | ((inch >> 6) & 0x3f); + *out++ = 0x80 | (inch & 0x3f); + } + return 3; + } +} + + +/* + * Convert UTF-8 bytes into UCS-2 character + * return number of input bytes, 0 if input + * is too short and -1 if input is invalid + */ +static int +utf8ucs2(const u_int8_t *in, int n, u_int16_t *out) +{ + uint16_t outch; + + if (n < 1) return 0; + + if (in[0] <= 0x7f) { + outch = in[0]; + if (out) + *out = htole16(outch); + return 1; + } else if (in[0] <= 0xdf) { + if (n < 2) return 0; + outch = (in[0] & 0x1f) << 6 | (in[1] & 0x3f); + if (out) + *out = htole16(outch); + return 2; + } else if (in[0] <= 0xef) { + if (n < 3) return 0; + outch = (in[0] & 0x1f) << 12 | (in[1] & 0x3f) << 6 | (in[2] & 0x3f); + if (out) + *out = htole16(outch); + return 3; + } + + return -1; +} + +/* + * Convert UCS-2 string into UTF-8 string + * return total number of output bytes + */ +static int +ucs2utf8str(const u_int16_t *in, int n, u_int8_t *out, int m) +{ + u_int8_t *p; + int outlen; + + p = out; + while (n > 0 && *in != 0) { + outlen = ucs2utf8(in, out ? p : out, m); + if (outlen == 0) + break; + p += outlen; + m -= outlen; + in += 1; + n -= 1; + } + + return p - out; +} + +/* + * Convert UTF8 string into UCS-2 string + * return total number of output chacters + */ +static int +utf8ucs2str(const u_int8_t *in, int n, u_int16_t *out, int m) +{ + u_int16_t *p; + int inlen; + + p = out; + while (n > 0 && *in != 0) { + if (m < 1) + break; + inlen = utf8ucs2(in, n, out ? p : out); + if (inlen <= 0) + break; + in += inlen; + n -= inlen; + p += 1; + m -= 1; + } + + return p - out; +} + +/* + * Convert UCS-2 string into 8bit character string + * return total number of output bytes + */ +static int +ucs2char8str(const u_int16_t *in, int n, u_int8_t *out, int m) +{ + u_int8_t *p; + u_int16_t inch; + + p = out; + while (n > 0 && in[0] != 0) { + if (m < 1) + break; + inch = le16toh(in[0]); + if (inch > 255) + break; + if (p) + p[0] = inch; + p += 1; + m -= 1; + in += 1; + n -= 1; + } + + return p - out; +} + +/* + * Convert 8bit character string into UCS-2 string + * return total number of output chacters + */ +static int +char8ucs2str(const u_int8_t *in, int n, u_int16_t *out, int m) +{ + u_int16_t *p; + + p = out; + while (n > 0 && in[0] != 0) { + if (m < 1) + break; + if (p) + p[0] = htole16(in[0]); + p += 1; + m -= 1; + in += 1; + n -= 1; + } + + return p - out; +} + +static void +ucs2pad(u_int16_t *buf, int len, int size) +{ + + if (len < size-1) + buf[len++] = 0x0000; + while (len < size) + buf[len++] = 0xffff; +} + +/* + * Fold UCS-2 character to uppercase + */ +static u_int16_t +ucs2fold(u_int16_t w) +{ + int low,high,mid; + u_int16_t check; + extern const u_int16_t msdosfs_unicode_foldmap[]; + extern size_t msdosfs_unicode_foldmap_entries; + + w = le16toh(w); + + low = 0; + high = msdosfs_unicode_foldmap_entries / 2; + while (low < high) { + mid = (low + high)/2; + check = msdosfs_unicode_foldmap[2*mid+0]; + + if (w == check) { + w = msdosfs_unicode_foldmap[2*mid+1]; + break; + } + + if (w < check) + high = mid; + else + low = mid+1; + } + + w = le16toh(w); + + return w; +} + +/* + * Compare two UCS-2 strings case-insensitive + * + * uses the Unicode case folding table + */ +static int +ucs2match(u_int16_t *w1, u_int16_t *w2, int n) +{ + u_int16_t u1, u2; + + while (n > 0) { + if (*w1 == 0 || *w2 == 0) + return *w1 == *w2; + u1 = ucs2fold(*w1); + u2 = ucs2fold(*w2); + if (u1 != u2) + return 0; + ++w1; + ++w2; + --n; + } + + return 1; +} + +/* + * Compare two 8bit char conversions case-insensitive + * + * uses the DOS case folding table + */ +static int +char8match(u_int16_t *w1, u_int16_t *w2, int n) +{ + u_int16_t u1, u2; + + while (n > 0) { + u1 = le16toh(*w1); + u2 = le16toh(*w2); + if (u1 == 0 || u2 == 0) + return u1 == u2; + if (u1 > 255 || u2 > 255) + return 0; + u1 = u2l[u1 & 0xff]; + u2 = u2l[u2 & 0xff]; + if (u1 != u2) + return 0; + ++w1; + ++w2; + --n; + } + + return 1; +} + diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 579a4a958..b51f36cfa 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_denode.c,v 1.51 2015/03/28 19:24:05 maxv Exp $ */ +/* $NetBSD: msdosfs_denode.c,v 1.59 2020/04/23 21:47:07 ad Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,12 +48,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.51 2015/03/28 19:24:05 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.59 2020/04/23 21:47:07 ad Exp $"); #include #include #include -#include #include #include #include @@ -74,8 +73,6 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.51 2015/03/28 19:24:05 maxv Exp struct pool msdosfs_denode_pool; -extern int prtactive; - struct fh_key { struct msdosfsmount *fhk_mount; uint32_t fhk_dircluster; @@ -128,6 +125,7 @@ static const struct genfs_ops msdosfs_genfsops = { .gop_alloc = msdosfs_gop_alloc, .gop_write = genfs_gop_write, .gop_markupdate = msdosfs_gop_markupdate, + .gop_putrange = genfs_gop_putrange, }; MALLOC_DECLARE(M_MSDOSFSFAT); @@ -427,7 +425,7 @@ detrunc(struct denode *dep, u_long length, int flags, kauth_cred_t cred) } else { ubc_zerorange(&DETOV(dep)->v_uobj, length, pmp->pm_bpcluster - boff, - UBC_UNMAP_FLAG(DETOV(dep))); + UBC_VNODE_FLAGS(DETOV(dep))); } } @@ -525,7 +523,7 @@ deextend(struct denode *dep, u_long length, kauth_cred_t cred) dep->de_flag |= DE_UPDATE|DE_MODIFIED; ubc_zerorange(&DETOV(dep)->v_uobj, (off_t)osize, (size_t)(round_page(dep->de_FileSize) - osize), - UBC_UNMAP_FLAG(DETOV(dep))); + UBC_VNODE_FLAGS(DETOV(dep))); uvm_vnp_setsize(DETOV(dep), (voff_t)dep->de_FileSize); return (deupdat(dep, 1)); } @@ -533,25 +531,19 @@ deextend(struct denode *dep, u_long length, kauth_cred_t cred) int msdosfs_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; - struct mount *mp = vp->v_mount; struct denode *dep = VTODE(vp); - fstrans_start(mp, FSTRANS_LAZY); + VOP_UNLOCK(vp); + #ifdef MSDOSFS_DEBUG printf("msdosfs_reclaim(): dep %p, file %s, refcnt %ld\n", dep, dep->de_Name, dep->de_refcnt); #endif - if (prtactive && vp->v_usecount > 1) - vprint("msdosfs_reclaim(): pushing active", vp); - /* - * Remove the denode from the vnode cache. - */ - vcache_remove(vp->v_mount, &dep->de_key, sizeof(dep->de_key)); /* * Purge old data structures associated with the denode. */ @@ -570,19 +562,17 @@ msdosfs_reclaim(void *v) vp->v_data = NULL; mutex_exit(vp->v_interlock); pool_put(&msdosfs_denode_pool, dep); - fstrans_done(mp); return (0); } int msdosfs_inactive(void *v) { - struct vop_inactive_args /* { + struct vop_inactive_v2_args /* { struct vnode *a_vp; bool *a_recycle; } */ *ap = v; struct vnode *vp = ap->a_vp; - struct mount *mp = vp->v_mount; struct denode *dep = VTODE(vp); int error = 0; @@ -590,7 +580,6 @@ msdosfs_inactive(void *v) printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]); #endif - fstrans_start(mp, FSTRANS_LAZY); /* * Get rid of denodes related to stale file handles. */ @@ -622,12 +611,11 @@ out: * so that it can be reused immediately. */ #ifdef MSDOSFS_DEBUG - printf("msdosfs_inactive(): v_usecount %d, de_Name[0] %x\n", - vp->v_usecount, dep->de_Name[0]); + printf("msdosfs_inactive(): usecount %d, de_Name[0] %x\n", + vrefcnt(vp), dep->de_Name[0]); #endif *ap->a_recycle = (dep->de_Name[0] == SLOT_DELETED); - VOP_UNLOCK(vp); - fstrans_done(mp); + return (error); } diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index b1beb0d1a..ee93b6bab 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_fat.c,v 1.29 2015/03/28 19:24:05 maxv Exp $ */ +/* $NetBSD: msdosfs_fat.c,v 1.35 2020/09/07 01:35:25 mrg Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -52,7 +52,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.29 2015/03/28 19:24:05 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.35 2020/09/07 01:35:25 mrg Exp $"); /* * kernel include files. @@ -69,6 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.29 2015/03/28 19:24:05 maxv Exp $" #include #include /* to define vattr structure */ #else +#include #include #endif @@ -143,7 +144,7 @@ fatblock(struct msdosfsmount *pmp, u_long ofs, u_long *bnp, u_long *sizep, u_lon u_long bn, size; bn = ofs / pmp->pm_fatblocksize * pmp->pm_fatblocksec; - size = min(pmp->pm_fatblocksec, pmp->pm_FATsecs - bn) + size = uimin(pmp->pm_fatblocksec, pmp->pm_FATsecs - bn) * pmp->pm_BytesPerSec; bn += pmp->pm_fatblk + pmp->pm_curfat * pmp->pm_FATsecs; @@ -227,7 +228,7 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int *sp) if (cnp) *cnp = MSDOSFSROOT; if (sp) - *sp = min(pmp->pm_bpcluster, + *sp = uimin(pmp->pm_bpcluster, dep->de_FileSize - de_cn2off(pmp, findcn)); DPRINTF(("%s(root, bn=%lu, cn=%u)\n", __func__, pmp->pm_rootdirblk + de_cn2bn(pmp, findcn), @@ -273,6 +274,18 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int *sp) */ if (cn >= (CLUST_RSRVD & pmp->pm_fatmask)) goto hiteof; + + /* + * Also stop when cluster is not in the filesystem + */ + if (cn < CLUST_FIRST || cn > pmp->pm_maxcluster) { + DPRINTF(("%s(cn, %lu not in %lu..%lu)\n", __func__, + cn, (u_long)CLUST_FIRST, pmp->pm_maxcluster)); + if (bp) + brelse(bp, 0); + return (EINVAL); + } + byteoffset = FATOFS(pmp, cn); fatblock(pmp, byteoffset, &bn, &bsize, &bo); if (bn != bp_bn) { @@ -383,7 +396,7 @@ fc_purge(struct denode *dep, u_int frcn) void updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn) { - int i; + int i, error; struct buf *bpn; DPRINTF(("%s(pmp %p, bp %p, fatbn %lu)\n", __func__, pmp, bp, fatbn)); @@ -396,7 +409,7 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn) if (pmp->pm_freeclustercount && (pmp->pm_inusemap[cn / N_INUSEBITS] - & (1 << (cn % N_INUSEBITS)))) { + & (1U << (cn % N_INUSEBITS)))) { /* * The cluster indicated in FSInfo isn't free * any longer. Got get a new free one. @@ -448,9 +461,12 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn) bpn = getblk(pmp->pm_devvp, de_bn2kb(pmp, fatbn), bp->b_bcount, 0, 0); memcpy(bpn->b_data, bp->b_data, bp->b_bcount); - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) - bwrite(bpn); - else + if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) { + error = bwrite(bpn); + if (error) + printf("%s: copy FAT %d (error=%d)\n", + __func__, i, error); + } else bdwrite(bpn); } } @@ -458,9 +474,12 @@ updatefats(struct msdosfsmount *pmp, struct buf *bp, u_long fatbn) /* * Write out the first (or current) FAT last. */ - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) - bwrite(bp); - else + if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) { + error = bwrite(bp); + if (error) + printf("%s: write FAT (error=%d)\n", + __func__, error); + } else bdwrite(bp); /* * Maybe update fsinfo sector here? @@ -490,7 +509,7 @@ static inline void usemap_alloc(struct msdosfsmount *pmp, u_long cn) { - pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); pmp->pm_freeclustercount--; } @@ -499,7 +518,7 @@ usemap_free(struct msdosfsmount *pmp, u_long cn) { pmp->pm_freeclustercount++; - pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); + pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS)); } int @@ -722,7 +741,7 @@ chainlength(struct msdosfsmount *pmp, u_long start, u_long count) idx = start / N_INUSEBITS; start %= N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map &= ~((1 << start) - 1); + map &= ~((1U << start) - 1); if (map) { len = ffs(map) - 1 - start; return (len > count ? count : len); @@ -818,7 +837,7 @@ clusteralloc(struct msdosfsmount *pmp, u_long start, u_long count, u_long *retcl for (cn = newst; cn <= pmp->pm_maxcluster;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != (u_int)-1) { cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -835,7 +854,7 @@ clusteralloc(struct msdosfsmount *pmp, u_long start, u_long count, u_long *retcl for (cn = 0; cn < newst;) { idx = cn / N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map |= (1 << (cn % N_INUSEBITS)) - 1; + map |= (1U << (cn % N_INUSEBITS)) - 1; if (map != (u_int)-1) { cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1; if ((l = chainlength(pmp, cn, count)) >= count) @@ -876,6 +895,7 @@ freeclusterchain(struct msdosfsmount *pmp, u_long cluster) u_long bn, bo, bsize, byteoffset; u_long readcn, lbn = -1; + bn = 0; /* XXXgcc */ while (cluster >= CLUST_FIRST && cluster <= pmp->pm_maxcluster) { byteoffset = FATOFS(pmp, cluster); fatblock(pmp, byteoffset, &bn, &bsize, &bo); diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 84705a58b..f92969373 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_lookup.c,v 1.34 2015/03/28 19:24:05 maxv Exp $ */ +/* $NetBSD: msdosfs_lookup.c,v 1.36 2020/04/04 20:49:30 ad Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -52,7 +52,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.34 2015/03/28 19:24:05 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.36 2020/04/04 20:49:30 ad Exp $"); #include @@ -161,6 +161,10 @@ msdosfs_lookup(void *v) return *vpp == NULLVP ? ENOENT: 0; } + /* May need to restart the lookup with an exclusive lock. */ + if (VOP_ISLOCKED(vdp) != LK_EXCLUSIVE) + return ENOLCK; + /* * If they are going after the . or .. entry in the root directory, * they won't find it. DOS filesystems don't have them in the root @@ -187,12 +191,12 @@ msdosfs_lookup(void *v) break; case 2: wincnt = winSlotCnt((const u_char *)cnp->cn_nameptr, - cnp->cn_namelen) + 1; + cnp->cn_namelen, pmp->pm_flags & MSDOSFSMNT_UTF8) + 1; break; case 3: olddos = 0; wincnt = winSlotCnt((const u_char *)cnp->cn_nameptr, - cnp->cn_namelen) + 1; + cnp->cn_namelen, pmp->pm_flags & MSDOSFSMNT_UTF8) + 1; break; } if (pmp->pm_flags & MSDOSFSMNT_SHORTNAME) @@ -282,7 +286,8 @@ msdosfs_lookup(void *v) chksum = winChkName((const u_char *)cnp->cn_nameptr, cnp->cn_namelen, (struct winentry *)dep, - chksum); + chksum, + pmp->pm_flags & MSDOSFSMNT_UTF8); continue; } @@ -652,7 +657,8 @@ createde(struct denode *dep, struct denode *ddep, struct denode **depp, struct c fndoffset -= sizeof(struct direntry); } if (!unix2winfn(un, unlen, (struct winentry *)ndep, - wcnt, chksum)) + wcnt, chksum, + ddep->de_pmp->pm_flags & MSDOSFSMNT_UTF8)) break; } } diff --git a/sys/fs/msdosfs/msdosfs_unicode.c b/sys/fs/msdosfs/msdosfs_unicode.c new file mode 100644 index 000000000..53d9c7da1 --- /dev/null +++ b/sys/fs/msdosfs/msdosfs_unicode.c @@ -0,0 +1,965 @@ +/* $NetBSD: msdosfs_unicode.c,v 1.2 2016/02/06 14:11:58 joerg Exp $ */ + +/* + * Unicode 5.0 case folding derived from + * + * http://www.unicode.org/Public/5.0.0/ucd/CaseFolding.txt + */ + +/* + * Unicode Character Database + * Copyright (c) 1991-2006 Unicode, Inc. + * For terms of use, see http://www.unicode.org/terms_of_use.html + * For documentation, see UCD.html + * + * COPYRIGHT AND PERMISSION NOTICE + * + * Copyright © 1991-2015 Unicode, Inc. All rights reserved. + * Distributed under the Terms of Use in + * http://www.unicode.org/copyright.html. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of the Unicode data files and any associated documentation + * (the "Data Files") or Unicode software and any associated documentation + * (the "Software") to deal in the Data Files or Software + * without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, and/or sell copies of + * the Data Files or Software, and to permit persons to whom the Data Files + * or Software are furnished to do so, provided that + * (a) this copyright and permission notice appear with all copies + * of the Data Files or Software, + * (b) this copyright and permission notice appear in associated + * documentation, and + * (c) there is clear notice in each modified Data File or in the Software + * as well as in the documentation associated with the Data File(s) or + * Software that the data or software has been modified. + * + * THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT OF THIRD PARTY RIGHTS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THE DATA FILES OR SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder + * shall not be used in advertising or otherwise to promote the sale, + * use or other dealings in these Data Files or Software without prior + * written authorization of the copyright holder. + * + */ + +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + +#include +#include + +/* + * Unicode case folding for codes 0x0000..0xffff + * + * common case folding + simple case folding only + */ +const u_int16_t +msdosfs_unicode_foldmap[] = { + 0x0041, 0x0061, /* LATIN CAPITAL LETTER A */ + 0x0042, 0x0062, /* LATIN CAPITAL LETTER B */ + 0x0043, 0x0063, /* LATIN CAPITAL LETTER C */ + 0x0044, 0x0064, /* LATIN CAPITAL LETTER D */ + 0x0045, 0x0065, /* LATIN CAPITAL LETTER E */ + 0x0046, 0x0066, /* LATIN CAPITAL LETTER F */ + 0x0047, 0x0067, /* LATIN CAPITAL LETTER G */ + 0x0048, 0x0068, /* LATIN CAPITAL LETTER H */ + 0x0049, 0x0069, /* LATIN CAPITAL LETTER I */ + 0x004A, 0x006A, /* LATIN CAPITAL LETTER J */ + 0x004B, 0x006B, /* LATIN CAPITAL LETTER K */ + 0x004C, 0x006C, /* LATIN CAPITAL LETTER L */ + 0x004D, 0x006D, /* LATIN CAPITAL LETTER M */ + 0x004E, 0x006E, /* LATIN CAPITAL LETTER N */ + 0x004F, 0x006F, /* LATIN CAPITAL LETTER O */ + 0x0050, 0x0070, /* LATIN CAPITAL LETTER P */ + 0x0051, 0x0071, /* LATIN CAPITAL LETTER Q */ + 0x0052, 0x0072, /* LATIN CAPITAL LETTER R */ + 0x0053, 0x0073, /* LATIN CAPITAL LETTER S */ + 0x0054, 0x0074, /* LATIN CAPITAL LETTER T */ + 0x0055, 0x0075, /* LATIN CAPITAL LETTER U */ + 0x0056, 0x0076, /* LATIN CAPITAL LETTER V */ + 0x0057, 0x0077, /* LATIN CAPITAL LETTER W */ + 0x0058, 0x0078, /* LATIN CAPITAL LETTER X */ + 0x0059, 0x0079, /* LATIN CAPITAL LETTER Y */ + 0x005A, 0x007A, /* LATIN CAPITAL LETTER Z */ + 0x00B5, 0x03BC, /* MICRO SIGN */ + 0x00C0, 0x00E0, /* LATIN CAPITAL LETTER A WITH GRAVE */ + 0x00C1, 0x00E1, /* LATIN CAPITAL LETTER A WITH ACUTE */ + 0x00C2, 0x00E2, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ + 0x00C3, 0x00E3, /* LATIN CAPITAL LETTER A WITH TILDE */ + 0x00C4, 0x00E4, /* LATIN CAPITAL LETTER A WITH DIAERESIS */ + 0x00C5, 0x00E5, /* LATIN CAPITAL LETTER A WITH RING ABOVE */ + 0x00C6, 0x00E6, /* LATIN CAPITAL LETTER AE */ + 0x00C7, 0x00E7, /* LATIN CAPITAL LETTER C WITH CEDILLA */ + 0x00C8, 0x00E8, /* LATIN CAPITAL LETTER E WITH GRAVE */ + 0x00C9, 0x00E9, /* LATIN CAPITAL LETTER E WITH ACUTE */ + 0x00CA, 0x00EA, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ + 0x00CB, 0x00EB, /* LATIN CAPITAL LETTER E WITH DIAERESIS */ + 0x00CC, 0x00EC, /* LATIN CAPITAL LETTER I WITH GRAVE */ + 0x00CD, 0x00ED, /* LATIN CAPITAL LETTER I WITH ACUTE */ + 0x00CE, 0x00EE, /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ + 0x00CF, 0x00EF, /* LATIN CAPITAL LETTER I WITH DIAERESIS */ + 0x00D0, 0x00F0, /* LATIN CAPITAL LETTER ETH */ + 0x00D1, 0x00F1, /* LATIN CAPITAL LETTER N WITH TILDE */ + 0x00D2, 0x00F2, /* LATIN CAPITAL LETTER O WITH GRAVE */ + 0x00D3, 0x00F3, /* LATIN CAPITAL LETTER O WITH ACUTE */ + 0x00D4, 0x00F4, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ + 0x00D5, 0x00F5, /* LATIN CAPITAL LETTER O WITH TILDE */ + 0x00D6, 0x00F6, /* LATIN CAPITAL LETTER O WITH DIAERESIS */ + 0x00D8, 0x00F8, /* LATIN CAPITAL LETTER O WITH STROKE */ + 0x00D9, 0x00F9, /* LATIN CAPITAL LETTER U WITH GRAVE */ + 0x00DA, 0x00FA, /* LATIN CAPITAL LETTER U WITH ACUTE */ + 0x00DB, 0x00FB, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ + 0x00DC, 0x00FC, /* LATIN CAPITAL LETTER U WITH DIAERESIS */ + 0x00DD, 0x00FD, /* LATIN CAPITAL LETTER Y WITH ACUTE */ + 0x00DE, 0x00FE, /* LATIN CAPITAL LETTER THORN */ + 0x0100, 0x0101, /* LATIN CAPITAL LETTER A WITH MACRON */ + 0x0102, 0x0103, /* LATIN CAPITAL LETTER A WITH BREVE */ + 0x0104, 0x0105, /* LATIN CAPITAL LETTER A WITH OGONEK */ + 0x0106, 0x0107, /* LATIN CAPITAL LETTER C WITH ACUTE */ + 0x0108, 0x0109, /* LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ + 0x010A, 0x010B, /* LATIN CAPITAL LETTER C WITH DOT ABOVE */ + 0x010C, 0x010D, /* LATIN CAPITAL LETTER C WITH CARON */ + 0x010E, 0x010F, /* LATIN CAPITAL LETTER D WITH CARON */ + 0x0110, 0x0111, /* LATIN CAPITAL LETTER D WITH STROKE */ + 0x0112, 0x0113, /* LATIN CAPITAL LETTER E WITH MACRON */ + 0x0114, 0x0115, /* LATIN CAPITAL LETTER E WITH BREVE */ + 0x0116, 0x0117, /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ + 0x0118, 0x0119, /* LATIN CAPITAL LETTER E WITH OGONEK */ + 0x011A, 0x011B, /* LATIN CAPITAL LETTER E WITH CARON */ + 0x011C, 0x011D, /* LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ + 0x011E, 0x011F, /* LATIN CAPITAL LETTER G WITH BREVE */ + 0x0120, 0x0121, /* LATIN CAPITAL LETTER G WITH DOT ABOVE */ + 0x0122, 0x0123, /* LATIN CAPITAL LETTER G WITH CEDILLA */ + 0x0124, 0x0125, /* LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ + 0x0126, 0x0127, /* LATIN CAPITAL LETTER H WITH STROKE */ + 0x0128, 0x0129, /* LATIN CAPITAL LETTER I WITH TILDE */ + 0x012A, 0x012B, /* LATIN CAPITAL LETTER I WITH MACRON */ + 0x012C, 0x012D, /* LATIN CAPITAL LETTER I WITH BREVE */ + 0x012E, 0x012F, /* LATIN CAPITAL LETTER I WITH OGONEK */ + 0x0132, 0x0133, /* LATIN CAPITAL LIGATURE IJ */ + 0x0134, 0x0135, /* LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ + 0x0136, 0x0137, /* LATIN CAPITAL LETTER K WITH CEDILLA */ + 0x0139, 0x013A, /* LATIN CAPITAL LETTER L WITH ACUTE */ + 0x013B, 0x013C, /* LATIN CAPITAL LETTER L WITH CEDILLA */ + 0x013D, 0x013E, /* LATIN CAPITAL LETTER L WITH CARON */ + 0x013F, 0x0140, /* LATIN CAPITAL LETTER L WITH MIDDLE DOT */ + 0x0141, 0x0142, /* LATIN CAPITAL LETTER L WITH STROKE */ + 0x0143, 0x0144, /* LATIN CAPITAL LETTER N WITH ACUTE */ + 0x0145, 0x0146, /* LATIN CAPITAL LETTER N WITH CEDILLA */ + 0x0147, 0x0148, /* LATIN CAPITAL LETTER N WITH CARON */ + 0x014A, 0x014B, /* LATIN CAPITAL LETTER ENG */ + 0x014C, 0x014D, /* LATIN CAPITAL LETTER O WITH MACRON */ + 0x014E, 0x014F, /* LATIN CAPITAL LETTER O WITH BREVE */ + 0x0150, 0x0151, /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ + 0x0152, 0x0153, /* LATIN CAPITAL LIGATURE OE */ + 0x0154, 0x0155, /* LATIN CAPITAL LETTER R WITH ACUTE */ + 0x0156, 0x0157, /* LATIN CAPITAL LETTER R WITH CEDILLA */ + 0x0158, 0x0159, /* LATIN CAPITAL LETTER R WITH CARON */ + 0x015A, 0x015B, /* LATIN CAPITAL LETTER S WITH ACUTE */ + 0x015C, 0x015D, /* LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ + 0x015E, 0x015F, /* LATIN CAPITAL LETTER S WITH CEDILLA */ + 0x0160, 0x0161, /* LATIN CAPITAL LETTER S WITH CARON */ + 0x0162, 0x0163, /* LATIN CAPITAL LETTER T WITH CEDILLA */ + 0x0164, 0x0165, /* LATIN CAPITAL LETTER T WITH CARON */ + 0x0166, 0x0167, /* LATIN CAPITAL LETTER T WITH STROKE */ + 0x0168, 0x0169, /* LATIN CAPITAL LETTER U WITH TILDE */ + 0x016A, 0x016B, /* LATIN CAPITAL LETTER U WITH MACRON */ + 0x016C, 0x016D, /* LATIN CAPITAL LETTER U WITH BREVE */ + 0x016E, 0x016F, /* LATIN CAPITAL LETTER U WITH RING ABOVE */ + 0x0170, 0x0171, /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ + 0x0172, 0x0173, /* LATIN CAPITAL LETTER U WITH OGONEK */ + 0x0174, 0x0175, /* LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ + 0x0176, 0x0177, /* LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ + 0x0178, 0x00FF, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ + 0x0179, 0x017A, /* LATIN CAPITAL LETTER Z WITH ACUTE */ + 0x017B, 0x017C, /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ + 0x017D, 0x017E, /* LATIN CAPITAL LETTER Z WITH CARON */ + 0x017F, 0x0073, /* LATIN SMALL LETTER LONG S */ + 0x0181, 0x0253, /* LATIN CAPITAL LETTER B WITH HOOK */ + 0x0182, 0x0183, /* LATIN CAPITAL LETTER B WITH TOPBAR */ + 0x0184, 0x0185, /* LATIN CAPITAL LETTER TONE SIX */ + 0x0186, 0x0254, /* LATIN CAPITAL LETTER OPEN O */ + 0x0187, 0x0188, /* LATIN CAPITAL LETTER C WITH HOOK */ + 0x0189, 0x0256, /* LATIN CAPITAL LETTER AFRICAN D */ + 0x018A, 0x0257, /* LATIN CAPITAL LETTER D WITH HOOK */ + 0x018B, 0x018C, /* LATIN CAPITAL LETTER D WITH TOPBAR */ + 0x018E, 0x01DD, /* LATIN CAPITAL LETTER REVERSED E */ + 0x018F, 0x0259, /* LATIN CAPITAL LETTER SCHWA */ + 0x0190, 0x025B, /* LATIN CAPITAL LETTER OPEN E */ + 0x0191, 0x0192, /* LATIN CAPITAL LETTER F WITH HOOK */ + 0x0193, 0x0260, /* LATIN CAPITAL LETTER G WITH HOOK */ + 0x0194, 0x0263, /* LATIN CAPITAL LETTER GAMMA */ + 0x0196, 0x0269, /* LATIN CAPITAL LETTER IOTA */ + 0x0197, 0x0268, /* LATIN CAPITAL LETTER I WITH STROKE */ + 0x0198, 0x0199, /* LATIN CAPITAL LETTER K WITH HOOK */ + 0x019C, 0x026F, /* LATIN CAPITAL LETTER TURNED M */ + 0x019D, 0x0272, /* LATIN CAPITAL LETTER N WITH LEFT HOOK */ + 0x019F, 0x0275, /* LATIN CAPITAL LETTER O WITH MIDDLE TILDE */ + 0x01A0, 0x01A1, /* LATIN CAPITAL LETTER O WITH HORN */ + 0x01A2, 0x01A3, /* LATIN CAPITAL LETTER OI */ + 0x01A4, 0x01A5, /* LATIN CAPITAL LETTER P WITH HOOK */ + 0x01A6, 0x0280, /* LATIN LETTER YR */ + 0x01A7, 0x01A8, /* LATIN CAPITAL LETTER TONE TWO */ + 0x01A9, 0x0283, /* LATIN CAPITAL LETTER ESH */ + 0x01AC, 0x01AD, /* LATIN CAPITAL LETTER T WITH HOOK */ + 0x01AE, 0x0288, /* LATIN CAPITAL LETTER T WITH RETROFLEX HOOK */ + 0x01AF, 0x01B0, /* LATIN CAPITAL LETTER U WITH HORN */ + 0x01B1, 0x028A, /* LATIN CAPITAL LETTER UPSILON */ + 0x01B2, 0x028B, /* LATIN CAPITAL LETTER V WITH HOOK */ + 0x01B3, 0x01B4, /* LATIN CAPITAL LETTER Y WITH HOOK */ + 0x01B5, 0x01B6, /* LATIN CAPITAL LETTER Z WITH STROKE */ + 0x01B7, 0x0292, /* LATIN CAPITAL LETTER EZH */ + 0x01B8, 0x01B9, /* LATIN CAPITAL LETTER EZH REVERSED */ + 0x01BC, 0x01BD, /* LATIN CAPITAL LETTER TONE FIVE */ + 0x01C4, 0x01C6, /* LATIN CAPITAL LETTER DZ WITH CARON */ + 0x01C5, 0x01C6, /* LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON */ + 0x01C7, 0x01C9, /* LATIN CAPITAL LETTER LJ */ + 0x01C8, 0x01C9, /* LATIN CAPITAL LETTER L WITH SMALL LETTER J */ + 0x01CA, 0x01CC, /* LATIN CAPITAL LETTER NJ */ + 0x01CB, 0x01CC, /* LATIN CAPITAL LETTER N WITH SMALL LETTER J */ + 0x01CD, 0x01CE, /* LATIN CAPITAL LETTER A WITH CARON */ + 0x01CF, 0x01D0, /* LATIN CAPITAL LETTER I WITH CARON */ + 0x01D1, 0x01D2, /* LATIN CAPITAL LETTER O WITH CARON */ + 0x01D3, 0x01D4, /* LATIN CAPITAL LETTER U WITH CARON */ + 0x01D5, 0x01D6, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON */ + 0x01D7, 0x01D8, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE */ + 0x01D9, 0x01DA, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON */ + 0x01DB, 0x01DC, /* LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE */ + 0x01DE, 0x01DF, /* LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON */ + 0x01E0, 0x01E1, /* LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON */ + 0x01E2, 0x01E3, /* LATIN CAPITAL LETTER AE WITH MACRON */ + 0x01E4, 0x01E5, /* LATIN CAPITAL LETTER G WITH STROKE */ + 0x01E6, 0x01E7, /* LATIN CAPITAL LETTER G WITH CARON */ + 0x01E8, 0x01E9, /* LATIN CAPITAL LETTER K WITH CARON */ + 0x01EA, 0x01EB, /* LATIN CAPITAL LETTER O WITH OGONEK */ + 0x01EC, 0x01ED, /* LATIN CAPITAL LETTER O WITH OGONEK AND MACRON */ + 0x01EE, 0x01EF, /* LATIN CAPITAL LETTER EZH WITH CARON */ + 0x01F1, 0x01F3, /* LATIN CAPITAL LETTER DZ */ + 0x01F2, 0x01F3, /* LATIN CAPITAL LETTER D WITH SMALL LETTER Z */ + 0x01F4, 0x01F5, /* LATIN CAPITAL LETTER G WITH ACUTE */ + 0x01F6, 0x0195, /* LATIN CAPITAL LETTER HWAIR */ + 0x01F7, 0x01BF, /* LATIN CAPITAL LETTER WYNN */ + 0x01F8, 0x01F9, /* LATIN CAPITAL LETTER N WITH GRAVE */ + 0x01FA, 0x01FB, /* LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE */ + 0x01FC, 0x01FD, /* LATIN CAPITAL LETTER AE WITH ACUTE */ + 0x01FE, 0x01FF, /* LATIN CAPITAL LETTER O WITH STROKE AND ACUTE */ + 0x0200, 0x0201, /* LATIN CAPITAL LETTER A WITH DOUBLE GRAVE */ + 0x0202, 0x0203, /* LATIN CAPITAL LETTER A WITH INVERTED BREVE */ + 0x0204, 0x0205, /* LATIN CAPITAL LETTER E WITH DOUBLE GRAVE */ + 0x0206, 0x0207, /* LATIN CAPITAL LETTER E WITH INVERTED BREVE */ + 0x0208, 0x0209, /* LATIN CAPITAL LETTER I WITH DOUBLE GRAVE */ + 0x020A, 0x020B, /* LATIN CAPITAL LETTER I WITH INVERTED BREVE */ + 0x020C, 0x020D, /* LATIN CAPITAL LETTER O WITH DOUBLE GRAVE */ + 0x020E, 0x020F, /* LATIN CAPITAL LETTER O WITH INVERTED BREVE */ + 0x0210, 0x0211, /* LATIN CAPITAL LETTER R WITH DOUBLE GRAVE */ + 0x0212, 0x0213, /* LATIN CAPITAL LETTER R WITH INVERTED BREVE */ + 0x0214, 0x0215, /* LATIN CAPITAL LETTER U WITH DOUBLE GRAVE */ + 0x0216, 0x0217, /* LATIN CAPITAL LETTER U WITH INVERTED BREVE */ + 0x0218, 0x0219, /* LATIN CAPITAL LETTER S WITH COMMA BELOW */ + 0x021A, 0x021B, /* LATIN CAPITAL LETTER T WITH COMMA BELOW */ + 0x021C, 0x021D, /* LATIN CAPITAL LETTER YOGH */ + 0x021E, 0x021F, /* LATIN CAPITAL LETTER H WITH CARON */ + 0x0220, 0x019E, /* LATIN CAPITAL LETTER N WITH LONG RIGHT LEG */ + 0x0222, 0x0223, /* LATIN CAPITAL LETTER OU */ + 0x0224, 0x0225, /* LATIN CAPITAL LETTER Z WITH HOOK */ + 0x0226, 0x0227, /* LATIN CAPITAL LETTER A WITH DOT ABOVE */ + 0x0228, 0x0229, /* LATIN CAPITAL LETTER E WITH CEDILLA */ + 0x022A, 0x022B, /* LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON */ + 0x022C, 0x022D, /* LATIN CAPITAL LETTER O WITH TILDE AND MACRON */ + 0x022E, 0x022F, /* LATIN CAPITAL LETTER O WITH DOT ABOVE */ + 0x0230, 0x0231, /* LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON */ + 0x0232, 0x0233, /* LATIN CAPITAL LETTER Y WITH MACRON */ + 0x023A, 0x2C65, /* LATIN CAPITAL LETTER A WITH STROKE */ + 0x023B, 0x023C, /* LATIN CAPITAL LETTER C WITH STROKE */ + 0x023D, 0x019A, /* LATIN CAPITAL LETTER L WITH BAR */ + 0x023E, 0x2C66, /* LATIN CAPITAL LETTER T WITH DIAGONAL STROKE */ + 0x0241, 0x0242, /* LATIN CAPITAL LETTER GLOTTAL STOP */ + 0x0243, 0x0180, /* LATIN CAPITAL LETTER B WITH STROKE */ + 0x0244, 0x0289, /* LATIN CAPITAL LETTER U BAR */ + 0x0245, 0x028C, /* LATIN CAPITAL LETTER TURNED V */ + 0x0246, 0x0247, /* LATIN CAPITAL LETTER E WITH STROKE */ + 0x0248, 0x0249, /* LATIN CAPITAL LETTER J WITH STROKE */ + 0x024A, 0x024B, /* LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL */ + 0x024C, 0x024D, /* LATIN CAPITAL LETTER R WITH STROKE */ + 0x024E, 0x024F, /* LATIN CAPITAL LETTER Y WITH STROKE */ + 0x0345, 0x03B9, /* COMBINING GREEK YPOGEGRAMMENI */ + 0x0386, 0x03AC, /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ + 0x0388, 0x03AD, /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ + 0x0389, 0x03AE, /* GREEK CAPITAL LETTER ETA WITH TONOS */ + 0x038A, 0x03AF, /* GREEK CAPITAL LETTER IOTA WITH TONOS */ + 0x038C, 0x03CC, /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ + 0x038E, 0x03CD, /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ + 0x038F, 0x03CE, /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ + 0x0391, 0x03B1, /* GREEK CAPITAL LETTER ALPHA */ + 0x0392, 0x03B2, /* GREEK CAPITAL LETTER BETA */ + 0x0393, 0x03B3, /* GREEK CAPITAL LETTER GAMMA */ + 0x0394, 0x03B4, /* GREEK CAPITAL LETTER DELTA */ + 0x0395, 0x03B5, /* GREEK CAPITAL LETTER EPSILON */ + 0x0396, 0x03B6, /* GREEK CAPITAL LETTER ZETA */ + 0x0397, 0x03B7, /* GREEK CAPITAL LETTER ETA */ + 0x0398, 0x03B8, /* GREEK CAPITAL LETTER THETA */ + 0x0399, 0x03B9, /* GREEK CAPITAL LETTER IOTA */ + 0x039A, 0x03BA, /* GREEK CAPITAL LETTER KAPPA */ + 0x039B, 0x03BB, /* GREEK CAPITAL LETTER LAMDA */ + 0x039C, 0x03BC, /* GREEK CAPITAL LETTER MU */ + 0x039D, 0x03BD, /* GREEK CAPITAL LETTER NU */ + 0x039E, 0x03BE, /* GREEK CAPITAL LETTER XI */ + 0x039F, 0x03BF, /* GREEK CAPITAL LETTER OMICRON */ + 0x03A0, 0x03C0, /* GREEK CAPITAL LETTER PI */ + 0x03A1, 0x03C1, /* GREEK CAPITAL LETTER RHO */ + 0x03A3, 0x03C3, /* GREEK CAPITAL LETTER SIGMA */ + 0x03A4, 0x03C4, /* GREEK CAPITAL LETTER TAU */ + 0x03A5, 0x03C5, /* GREEK CAPITAL LETTER UPSILON */ + 0x03A6, 0x03C6, /* GREEK CAPITAL LETTER PHI */ + 0x03A7, 0x03C7, /* GREEK CAPITAL LETTER CHI */ + 0x03A8, 0x03C8, /* GREEK CAPITAL LETTER PSI */ + 0x03A9, 0x03C9, /* GREEK CAPITAL LETTER OMEGA */ + 0x03AA, 0x03CA, /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ + 0x03AB, 0x03CB, /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ + 0x03C2, 0x03C3, /* GREEK SMALL LETTER FINAL SIGMA */ + 0x03D0, 0x03B2, /* GREEK BETA SYMBOL */ + 0x03D1, 0x03B8, /* GREEK THETA SYMBOL */ + 0x03D5, 0x03C6, /* GREEK PHI SYMBOL */ + 0x03D6, 0x03C0, /* GREEK PI SYMBOL */ + 0x03D8, 0x03D9, /* GREEK LETTER ARCHAIC KOPPA */ + 0x03DA, 0x03DB, /* GREEK LETTER STIGMA */ + 0x03DC, 0x03DD, /* GREEK LETTER DIGAMMA */ + 0x03DE, 0x03DF, /* GREEK LETTER KOPPA */ + 0x03E0, 0x03E1, /* GREEK LETTER SAMPI */ + 0x03E2, 0x03E3, /* COPTIC CAPITAL LETTER SHEI */ + 0x03E4, 0x03E5, /* COPTIC CAPITAL LETTER FEI */ + 0x03E6, 0x03E7, /* COPTIC CAPITAL LETTER KHEI */ + 0x03E8, 0x03E9, /* COPTIC CAPITAL LETTER HORI */ + 0x03EA, 0x03EB, /* COPTIC CAPITAL LETTER GANGIA */ + 0x03EC, 0x03ED, /* COPTIC CAPITAL LETTER SHIMA */ + 0x03EE, 0x03EF, /* COPTIC CAPITAL LETTER DEI */ + 0x03F0, 0x03BA, /* GREEK KAPPA SYMBOL */ + 0x03F1, 0x03C1, /* GREEK RHO SYMBOL */ + 0x03F4, 0x03B8, /* GREEK CAPITAL THETA SYMBOL */ + 0x03F5, 0x03B5, /* GREEK LUNATE EPSILON SYMBOL */ + 0x03F7, 0x03F8, /* GREEK CAPITAL LETTER SHO */ + 0x03F9, 0x03F2, /* GREEK CAPITAL LUNATE SIGMA SYMBOL */ + 0x03FA, 0x03FB, /* GREEK CAPITAL LETTER SAN */ + 0x03FD, 0x037B, /* GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL */ + 0x03FE, 0x037C, /* GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL */ + 0x03FF, 0x037D, /* GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL */ + 0x0400, 0x0450, /* CYRILLIC CAPITAL LETTER IE WITH GRAVE */ + 0x0401, 0x0451, /* CYRILLIC CAPITAL LETTER IO */ + 0x0402, 0x0452, /* CYRILLIC CAPITAL LETTER DJE */ + 0x0403, 0x0453, /* CYRILLIC CAPITAL LETTER GJE */ + 0x0404, 0x0454, /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ + 0x0405, 0x0455, /* CYRILLIC CAPITAL LETTER DZE */ + 0x0406, 0x0456, /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ + 0x0407, 0x0457, /* CYRILLIC CAPITAL LETTER YI */ + 0x0408, 0x0458, /* CYRILLIC CAPITAL LETTER JE */ + 0x0409, 0x0459, /* CYRILLIC CAPITAL LETTER LJE */ + 0x040A, 0x045A, /* CYRILLIC CAPITAL LETTER NJE */ + 0x040B, 0x045B, /* CYRILLIC CAPITAL LETTER TSHE */ + 0x040C, 0x045C, /* CYRILLIC CAPITAL LETTER KJE */ + 0x040D, 0x045D, /* CYRILLIC CAPITAL LETTER I WITH GRAVE */ + 0x040E, 0x045E, /* CYRILLIC CAPITAL LETTER SHORT U */ + 0x040F, 0x045F, /* CYRILLIC CAPITAL LETTER DZHE */ + 0x0410, 0x0430, /* CYRILLIC CAPITAL LETTER A */ + 0x0411, 0x0431, /* CYRILLIC CAPITAL LETTER BE */ + 0x0412, 0x0432, /* CYRILLIC CAPITAL LETTER VE */ + 0x0413, 0x0433, /* CYRILLIC CAPITAL LETTER GHE */ + 0x0414, 0x0434, /* CYRILLIC CAPITAL LETTER DE */ + 0x0415, 0x0435, /* CYRILLIC CAPITAL LETTER IE */ + 0x0416, 0x0436, /* CYRILLIC CAPITAL LETTER ZHE */ + 0x0417, 0x0437, /* CYRILLIC CAPITAL LETTER ZE */ + 0x0418, 0x0438, /* CYRILLIC CAPITAL LETTER I */ + 0x0419, 0x0439, /* CYRILLIC CAPITAL LETTER SHORT I */ + 0x041A, 0x043A, /* CYRILLIC CAPITAL LETTER KA */ + 0x041B, 0x043B, /* CYRILLIC CAPITAL LETTER EL */ + 0x041C, 0x043C, /* CYRILLIC CAPITAL LETTER EM */ + 0x041D, 0x043D, /* CYRILLIC CAPITAL LETTER EN */ + 0x041E, 0x043E, /* CYRILLIC CAPITAL LETTER O */ + 0x041F, 0x043F, /* CYRILLIC CAPITAL LETTER PE */ + 0x0420, 0x0440, /* CYRILLIC CAPITAL LETTER ER */ + 0x0421, 0x0441, /* CYRILLIC CAPITAL LETTER ES */ + 0x0422, 0x0442, /* CYRILLIC CAPITAL LETTER TE */ + 0x0423, 0x0443, /* CYRILLIC CAPITAL LETTER U */ + 0x0424, 0x0444, /* CYRILLIC CAPITAL LETTER EF */ + 0x0425, 0x0445, /* CYRILLIC CAPITAL LETTER HA */ + 0x0426, 0x0446, /* CYRILLIC CAPITAL LETTER TSE */ + 0x0427, 0x0447, /* CYRILLIC CAPITAL LETTER CHE */ + 0x0428, 0x0448, /* CYRILLIC CAPITAL LETTER SHA */ + 0x0429, 0x0449, /* CYRILLIC CAPITAL LETTER SHCHA */ + 0x042A, 0x044A, /* CYRILLIC CAPITAL LETTER HARD SIGN */ + 0x042B, 0x044B, /* CYRILLIC CAPITAL LETTER YERU */ + 0x042C, 0x044C, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ + 0x042D, 0x044D, /* CYRILLIC CAPITAL LETTER E */ + 0x042E, 0x044E, /* CYRILLIC CAPITAL LETTER YU */ + 0x042F, 0x044F, /* CYRILLIC CAPITAL LETTER YA */ + 0x0460, 0x0461, /* CYRILLIC CAPITAL LETTER OMEGA */ + 0x0462, 0x0463, /* CYRILLIC CAPITAL LETTER YAT */ + 0x0464, 0x0465, /* CYRILLIC CAPITAL LETTER IOTIFIED E */ + 0x0466, 0x0467, /* CYRILLIC CAPITAL LETTER LITTLE YUS */ + 0x0468, 0x0469, /* CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS */ + 0x046A, 0x046B, /* CYRILLIC CAPITAL LETTER BIG YUS */ + 0x046C, 0x046D, /* CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS */ + 0x046E, 0x046F, /* CYRILLIC CAPITAL LETTER KSI */ + 0x0470, 0x0471, /* CYRILLIC CAPITAL LETTER PSI */ + 0x0472, 0x0473, /* CYRILLIC CAPITAL LETTER FITA */ + 0x0474, 0x0475, /* CYRILLIC CAPITAL LETTER IZHITSA */ + 0x0476, 0x0477, /* CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT */ + 0x0478, 0x0479, /* CYRILLIC CAPITAL LETTER UK */ + 0x047A, 0x047B, /* CYRILLIC CAPITAL LETTER ROUND OMEGA */ + 0x047C, 0x047D, /* CYRILLIC CAPITAL LETTER OMEGA WITH TITLO */ + 0x047E, 0x047F, /* CYRILLIC CAPITAL LETTER OT */ + 0x0480, 0x0481, /* CYRILLIC CAPITAL LETTER KOPPA */ + 0x048A, 0x048B, /* CYRILLIC CAPITAL LETTER SHORT I WITH TAIL */ + 0x048C, 0x048D, /* CYRILLIC CAPITAL LETTER SEMISOFT SIGN */ + 0x048E, 0x048F, /* CYRILLIC CAPITAL LETTER ER WITH TICK */ + 0x0490, 0x0491, /* CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ + 0x0492, 0x0493, /* CYRILLIC CAPITAL LETTER GHE WITH STROKE */ + 0x0494, 0x0495, /* CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK */ + 0x0496, 0x0497, /* CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */ + 0x0498, 0x0499, /* CYRILLIC CAPITAL LETTER ZE WITH DESCENDER */ + 0x049A, 0x049B, /* CYRILLIC CAPITAL LETTER KA WITH DESCENDER */ + 0x049C, 0x049D, /* CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */ + 0x049E, 0x049F, /* CYRILLIC CAPITAL LETTER KA WITH STROKE */ + 0x04A0, 0x04A1, /* CYRILLIC CAPITAL LETTER BASHKIR KA */ + 0x04A2, 0x04A3, /* CYRILLIC CAPITAL LETTER EN WITH DESCENDER */ + 0x04A4, 0x04A5, /* CYRILLIC CAPITAL LIGATURE EN GHE */ + 0x04A6, 0x04A7, /* CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK */ + 0x04A8, 0x04A9, /* CYRILLIC CAPITAL LETTER ABKHASIAN HA */ + 0x04AA, 0x04AB, /* CYRILLIC CAPITAL LETTER ES WITH DESCENDER */ + 0x04AC, 0x04AD, /* CYRILLIC CAPITAL LETTER TE WITH DESCENDER */ + 0x04AE, 0x04AF, /* CYRILLIC CAPITAL LETTER STRAIGHT U */ + 0x04B0, 0x04B1, /* CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */ + 0x04B2, 0x04B3, /* CYRILLIC CAPITAL LETTER HA WITH DESCENDER */ + 0x04B4, 0x04B5, /* CYRILLIC CAPITAL LIGATURE TE TSE */ + 0x04B6, 0x04B7, /* CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */ + 0x04B8, 0x04B9, /* CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */ + 0x04BA, 0x04BB, /* CYRILLIC CAPITAL LETTER SHHA */ + 0x04BC, 0x04BD, /* CYRILLIC CAPITAL LETTER ABKHASIAN CHE */ + 0x04BE, 0x04BF, /* CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER */ + 0x04C0, 0x04CF, /* CYRILLIC LETTER PALOCHKA */ + 0x04C1, 0x04C2, /* CYRILLIC CAPITAL LETTER ZHE WITH BREVE */ + 0x04C3, 0x04C4, /* CYRILLIC CAPITAL LETTER KA WITH HOOK */ + 0x04C5, 0x04C6, /* CYRILLIC CAPITAL LETTER EL WITH TAIL */ + 0x04C7, 0x04C8, /* CYRILLIC CAPITAL LETTER EN WITH HOOK */ + 0x04C9, 0x04CA, /* CYRILLIC CAPITAL LETTER EN WITH TAIL */ + 0x04CB, 0x04CC, /* CYRILLIC CAPITAL LETTER KHAKASSIAN CHE */ + 0x04CD, 0x04CE, /* CYRILLIC CAPITAL LETTER EM WITH TAIL */ + 0x04D0, 0x04D1, /* CYRILLIC CAPITAL LETTER A WITH BREVE */ + 0x04D2, 0x04D3, /* CYRILLIC CAPITAL LETTER A WITH DIAERESIS */ + 0x04D4, 0x04D5, /* CYRILLIC CAPITAL LIGATURE A IE */ + 0x04D6, 0x04D7, /* CYRILLIC CAPITAL LETTER IE WITH BREVE */ + 0x04D8, 0x04D9, /* CYRILLIC CAPITAL LETTER SCHWA */ + 0x04DA, 0x04DB, /* CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS */ + 0x04DC, 0x04DD, /* CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS */ + 0x04DE, 0x04DF, /* CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS */ + 0x04E0, 0x04E1, /* CYRILLIC CAPITAL LETTER ABKHASIAN DZE */ + 0x04E2, 0x04E3, /* CYRILLIC CAPITAL LETTER I WITH MACRON */ + 0x04E4, 0x04E5, /* CYRILLIC CAPITAL LETTER I WITH DIAERESIS */ + 0x04E6, 0x04E7, /* CYRILLIC CAPITAL LETTER O WITH DIAERESIS */ + 0x04E8, 0x04E9, /* CYRILLIC CAPITAL LETTER BARRED O */ + 0x04EA, 0x04EB, /* CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS */ + 0x04EC, 0x04ED, /* CYRILLIC CAPITAL LETTER E WITH DIAERESIS */ + 0x04EE, 0x04EF, /* CYRILLIC CAPITAL LETTER U WITH MACRON */ + 0x04F0, 0x04F1, /* CYRILLIC CAPITAL LETTER U WITH DIAERESIS */ + 0x04F2, 0x04F3, /* CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE */ + 0x04F4, 0x04F5, /* CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS */ + 0x04F6, 0x04F7, /* CYRILLIC CAPITAL LETTER GHE WITH DESCENDER */ + 0x04F8, 0x04F9, /* CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS */ + 0x04FA, 0x04FB, /* CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK */ + 0x04FC, 0x04FD, /* CYRILLIC CAPITAL LETTER HA WITH HOOK */ + 0x04FE, 0x04FF, /* CYRILLIC CAPITAL LETTER HA WITH STROKE */ + 0x0500, 0x0501, /* CYRILLIC CAPITAL LETTER KOMI DE */ + 0x0502, 0x0503, /* CYRILLIC CAPITAL LETTER KOMI DJE */ + 0x0504, 0x0505, /* CYRILLIC CAPITAL LETTER KOMI ZJE */ + 0x0506, 0x0507, /* CYRILLIC CAPITAL LETTER KOMI DZJE */ + 0x0508, 0x0509, /* CYRILLIC CAPITAL LETTER KOMI LJE */ + 0x050A, 0x050B, /* CYRILLIC CAPITAL LETTER KOMI NJE */ + 0x050C, 0x050D, /* CYRILLIC CAPITAL LETTER KOMI SJE */ + 0x050E, 0x050F, /* CYRILLIC CAPITAL LETTER KOMI TJE */ + 0x0510, 0x0511, /* CYRILLIC CAPITAL LETTER REVERSED ZE */ + 0x0512, 0x0513, /* CYRILLIC CAPITAL LETTER EL WITH HOOK */ + 0x0531, 0x0561, /* ARMENIAN CAPITAL LETTER AYB */ + 0x0532, 0x0562, /* ARMENIAN CAPITAL LETTER BEN */ + 0x0533, 0x0563, /* ARMENIAN CAPITAL LETTER GIM */ + 0x0534, 0x0564, /* ARMENIAN CAPITAL LETTER DA */ + 0x0535, 0x0565, /* ARMENIAN CAPITAL LETTER ECH */ + 0x0536, 0x0566, /* ARMENIAN CAPITAL LETTER ZA */ + 0x0537, 0x0567, /* ARMENIAN CAPITAL LETTER EH */ + 0x0538, 0x0568, /* ARMENIAN CAPITAL LETTER ET */ + 0x0539, 0x0569, /* ARMENIAN CAPITAL LETTER TO */ + 0x053A, 0x056A, /* ARMENIAN CAPITAL LETTER ZHE */ + 0x053B, 0x056B, /* ARMENIAN CAPITAL LETTER INI */ + 0x053C, 0x056C, /* ARMENIAN CAPITAL LETTER LIWN */ + 0x053D, 0x056D, /* ARMENIAN CAPITAL LETTER XEH */ + 0x053E, 0x056E, /* ARMENIAN CAPITAL LETTER CA */ + 0x053F, 0x056F, /* ARMENIAN CAPITAL LETTER KEN */ + 0x0540, 0x0570, /* ARMENIAN CAPITAL LETTER HO */ + 0x0541, 0x0571, /* ARMENIAN CAPITAL LETTER JA */ + 0x0542, 0x0572, /* ARMENIAN CAPITAL LETTER GHAD */ + 0x0543, 0x0573, /* ARMENIAN CAPITAL LETTER CHEH */ + 0x0544, 0x0574, /* ARMENIAN CAPITAL LETTER MEN */ + 0x0545, 0x0575, /* ARMENIAN CAPITAL LETTER YI */ + 0x0546, 0x0576, /* ARMENIAN CAPITAL LETTER NOW */ + 0x0547, 0x0577, /* ARMENIAN CAPITAL LETTER SHA */ + 0x0548, 0x0578, /* ARMENIAN CAPITAL LETTER VO */ + 0x0549, 0x0579, /* ARMENIAN CAPITAL LETTER CHA */ + 0x054A, 0x057A, /* ARMENIAN CAPITAL LETTER PEH */ + 0x054B, 0x057B, /* ARMENIAN CAPITAL LETTER JHEH */ + 0x054C, 0x057C, /* ARMENIAN CAPITAL LETTER RA */ + 0x054D, 0x057D, /* ARMENIAN CAPITAL LETTER SEH */ + 0x054E, 0x057E, /* ARMENIAN CAPITAL LETTER VEW */ + 0x054F, 0x057F, /* ARMENIAN CAPITAL LETTER TIWN */ + 0x0550, 0x0580, /* ARMENIAN CAPITAL LETTER REH */ + 0x0551, 0x0581, /* ARMENIAN CAPITAL LETTER CO */ + 0x0552, 0x0582, /* ARMENIAN CAPITAL LETTER YIWN */ + 0x0553, 0x0583, /* ARMENIAN CAPITAL LETTER PIWR */ + 0x0554, 0x0584, /* ARMENIAN CAPITAL LETTER KEH */ + 0x0555, 0x0585, /* ARMENIAN CAPITAL LETTER OH */ + 0x0556, 0x0586, /* ARMENIAN CAPITAL LETTER FEH */ + 0x10A0, 0x2D00, /* GEORGIAN CAPITAL LETTER AN */ + 0x10A1, 0x2D01, /* GEORGIAN CAPITAL LETTER BAN */ + 0x10A2, 0x2D02, /* GEORGIAN CAPITAL LETTER GAN */ + 0x10A3, 0x2D03, /* GEORGIAN CAPITAL LETTER DON */ + 0x10A4, 0x2D04, /* GEORGIAN CAPITAL LETTER EN */ + 0x10A5, 0x2D05, /* GEORGIAN CAPITAL LETTER VIN */ + 0x10A6, 0x2D06, /* GEORGIAN CAPITAL LETTER ZEN */ + 0x10A7, 0x2D07, /* GEORGIAN CAPITAL LETTER TAN */ + 0x10A8, 0x2D08, /* GEORGIAN CAPITAL LETTER IN */ + 0x10A9, 0x2D09, /* GEORGIAN CAPITAL LETTER KAN */ + 0x10AA, 0x2D0A, /* GEORGIAN CAPITAL LETTER LAS */ + 0x10AB, 0x2D0B, /* GEORGIAN CAPITAL LETTER MAN */ + 0x10AC, 0x2D0C, /* GEORGIAN CAPITAL LETTER NAR */ + 0x10AD, 0x2D0D, /* GEORGIAN CAPITAL LETTER ON */ + 0x10AE, 0x2D0E, /* GEORGIAN CAPITAL LETTER PAR */ + 0x10AF, 0x2D0F, /* GEORGIAN CAPITAL LETTER ZHAR */ + 0x10B0, 0x2D10, /* GEORGIAN CAPITAL LETTER RAE */ + 0x10B1, 0x2D11, /* GEORGIAN CAPITAL LETTER SAN */ + 0x10B2, 0x2D12, /* GEORGIAN CAPITAL LETTER TAR */ + 0x10B3, 0x2D13, /* GEORGIAN CAPITAL LETTER UN */ + 0x10B4, 0x2D14, /* GEORGIAN CAPITAL LETTER PHAR */ + 0x10B5, 0x2D15, /* GEORGIAN CAPITAL LETTER KHAR */ + 0x10B6, 0x2D16, /* GEORGIAN CAPITAL LETTER GHAN */ + 0x10B7, 0x2D17, /* GEORGIAN CAPITAL LETTER QAR */ + 0x10B8, 0x2D18, /* GEORGIAN CAPITAL LETTER SHIN */ + 0x10B9, 0x2D19, /* GEORGIAN CAPITAL LETTER CHIN */ + 0x10BA, 0x2D1A, /* GEORGIAN CAPITAL LETTER CAN */ + 0x10BB, 0x2D1B, /* GEORGIAN CAPITAL LETTER JIL */ + 0x10BC, 0x2D1C, /* GEORGIAN CAPITAL LETTER CIL */ + 0x10BD, 0x2D1D, /* GEORGIAN CAPITAL LETTER CHAR */ + 0x10BE, 0x2D1E, /* GEORGIAN CAPITAL LETTER XAN */ + 0x10BF, 0x2D1F, /* GEORGIAN CAPITAL LETTER JHAN */ + 0x10C0, 0x2D20, /* GEORGIAN CAPITAL LETTER HAE */ + 0x10C1, 0x2D21, /* GEORGIAN CAPITAL LETTER HE */ + 0x10C2, 0x2D22, /* GEORGIAN CAPITAL LETTER HIE */ + 0x10C3, 0x2D23, /* GEORGIAN CAPITAL LETTER WE */ + 0x10C4, 0x2D24, /* GEORGIAN CAPITAL LETTER HAR */ + 0x10C5, 0x2D25, /* GEORGIAN CAPITAL LETTER HOE */ + 0x1E00, 0x1E01, /* LATIN CAPITAL LETTER A WITH RING BELOW */ + 0x1E02, 0x1E03, /* LATIN CAPITAL LETTER B WITH DOT ABOVE */ + 0x1E04, 0x1E05, /* LATIN CAPITAL LETTER B WITH DOT BELOW */ + 0x1E06, 0x1E07, /* LATIN CAPITAL LETTER B WITH LINE BELOW */ + 0x1E08, 0x1E09, /* LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE */ + 0x1E0A, 0x1E0B, /* LATIN CAPITAL LETTER D WITH DOT ABOVE */ + 0x1E0C, 0x1E0D, /* LATIN CAPITAL LETTER D WITH DOT BELOW */ + 0x1E0E, 0x1E0F, /* LATIN CAPITAL LETTER D WITH LINE BELOW */ + 0x1E10, 0x1E11, /* LATIN CAPITAL LETTER D WITH CEDILLA */ + 0x1E12, 0x1E13, /* LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW */ + 0x1E14, 0x1E15, /* LATIN CAPITAL LETTER E WITH MACRON AND GRAVE */ + 0x1E16, 0x1E17, /* LATIN CAPITAL LETTER E WITH MACRON AND ACUTE */ + 0x1E18, 0x1E19, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW */ + 0x1E1A, 0x1E1B, /* LATIN CAPITAL LETTER E WITH TILDE BELOW */ + 0x1E1C, 0x1E1D, /* LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE */ + 0x1E1E, 0x1E1F, /* LATIN CAPITAL LETTER F WITH DOT ABOVE */ + 0x1E20, 0x1E21, /* LATIN CAPITAL LETTER G WITH MACRON */ + 0x1E22, 0x1E23, /* LATIN CAPITAL LETTER H WITH DOT ABOVE */ + 0x1E24, 0x1E25, /* LATIN CAPITAL LETTER H WITH DOT BELOW */ + 0x1E26, 0x1E27, /* LATIN CAPITAL LETTER H WITH DIAERESIS */ + 0x1E28, 0x1E29, /* LATIN CAPITAL LETTER H WITH CEDILLA */ + 0x1E2A, 0x1E2B, /* LATIN CAPITAL LETTER H WITH BREVE BELOW */ + 0x1E2C, 0x1E2D, /* LATIN CAPITAL LETTER I WITH TILDE BELOW */ + 0x1E2E, 0x1E2F, /* LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE */ + 0x1E30, 0x1E31, /* LATIN CAPITAL LETTER K WITH ACUTE */ + 0x1E32, 0x1E33, /* LATIN CAPITAL LETTER K WITH DOT BELOW */ + 0x1E34, 0x1E35, /* LATIN CAPITAL LETTER K WITH LINE BELOW */ + 0x1E36, 0x1E37, /* LATIN CAPITAL LETTER L WITH DOT BELOW */ + 0x1E38, 0x1E39, /* LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON */ + 0x1E3A, 0x1E3B, /* LATIN CAPITAL LETTER L WITH LINE BELOW */ + 0x1E3C, 0x1E3D, /* LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW */ + 0x1E3E, 0x1E3F, /* LATIN CAPITAL LETTER M WITH ACUTE */ + 0x1E40, 0x1E41, /* LATIN CAPITAL LETTER M WITH DOT ABOVE */ + 0x1E42, 0x1E43, /* LATIN CAPITAL LETTER M WITH DOT BELOW */ + 0x1E44, 0x1E45, /* LATIN CAPITAL LETTER N WITH DOT ABOVE */ + 0x1E46, 0x1E47, /* LATIN CAPITAL LETTER N WITH DOT BELOW */ + 0x1E48, 0x1E49, /* LATIN CAPITAL LETTER N WITH LINE BELOW */ + 0x1E4A, 0x1E4B, /* LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW */ + 0x1E4C, 0x1E4D, /* LATIN CAPITAL LETTER O WITH TILDE AND ACUTE */ + 0x1E4E, 0x1E4F, /* LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS */ + 0x1E50, 0x1E51, /* LATIN CAPITAL LETTER O WITH MACRON AND GRAVE */ + 0x1E52, 0x1E53, /* LATIN CAPITAL LETTER O WITH MACRON AND ACUTE */ + 0x1E54, 0x1E55, /* LATIN CAPITAL LETTER P WITH ACUTE */ + 0x1E56, 0x1E57, /* LATIN CAPITAL LETTER P WITH DOT ABOVE */ + 0x1E58, 0x1E59, /* LATIN CAPITAL LETTER R WITH DOT ABOVE */ + 0x1E5A, 0x1E5B, /* LATIN CAPITAL LETTER R WITH DOT BELOW */ + 0x1E5C, 0x1E5D, /* LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON */ + 0x1E5E, 0x1E5F, /* LATIN CAPITAL LETTER R WITH LINE BELOW */ + 0x1E60, 0x1E61, /* LATIN CAPITAL LETTER S WITH DOT ABOVE */ + 0x1E62, 0x1E63, /* LATIN CAPITAL LETTER S WITH DOT BELOW */ + 0x1E64, 0x1E65, /* LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE */ + 0x1E66, 0x1E67, /* LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE */ + 0x1E68, 0x1E69, /* LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE */ + 0x1E6A, 0x1E6B, /* LATIN CAPITAL LETTER T WITH DOT ABOVE */ + 0x1E6C, 0x1E6D, /* LATIN CAPITAL LETTER T WITH DOT BELOW */ + 0x1E6E, 0x1E6F, /* LATIN CAPITAL LETTER T WITH LINE BELOW */ + 0x1E70, 0x1E71, /* LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW */ + 0x1E72, 0x1E73, /* LATIN CAPITAL LETTER U WITH DIAERESIS BELOW */ + 0x1E74, 0x1E75, /* LATIN CAPITAL LETTER U WITH TILDE BELOW */ + 0x1E76, 0x1E77, /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW */ + 0x1E78, 0x1E79, /* LATIN CAPITAL LETTER U WITH TILDE AND ACUTE */ + 0x1E7A, 0x1E7B, /* LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS */ + 0x1E7C, 0x1E7D, /* LATIN CAPITAL LETTER V WITH TILDE */ + 0x1E7E, 0x1E7F, /* LATIN CAPITAL LETTER V WITH DOT BELOW */ + 0x1E80, 0x1E81, /* LATIN CAPITAL LETTER W WITH GRAVE */ + 0x1E82, 0x1E83, /* LATIN CAPITAL LETTER W WITH ACUTE */ + 0x1E84, 0x1E85, /* LATIN CAPITAL LETTER W WITH DIAERESIS */ + 0x1E86, 0x1E87, /* LATIN CAPITAL LETTER W WITH DOT ABOVE */ + 0x1E88, 0x1E89, /* LATIN CAPITAL LETTER W WITH DOT BELOW */ + 0x1E8A, 0x1E8B, /* LATIN CAPITAL LETTER X WITH DOT ABOVE */ + 0x1E8C, 0x1E8D, /* LATIN CAPITAL LETTER X WITH DIAERESIS */ + 0x1E8E, 0x1E8F, /* LATIN CAPITAL LETTER Y WITH DOT ABOVE */ + 0x1E90, 0x1E91, /* LATIN CAPITAL LETTER Z WITH CIRCUMFLEX */ + 0x1E92, 0x1E93, /* LATIN CAPITAL LETTER Z WITH DOT BELOW */ + 0x1E94, 0x1E95, /* LATIN CAPITAL LETTER Z WITH LINE BELOW */ + 0x1E9B, 0x1E61, /* LATIN SMALL LETTER LONG S WITH DOT ABOVE */ + 0x1EA0, 0x1EA1, /* LATIN CAPITAL LETTER A WITH DOT BELOW */ + 0x1EA2, 0x1EA3, /* LATIN CAPITAL LETTER A WITH HOOK ABOVE */ + 0x1EA4, 0x1EA5, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ + 0x1EA6, 0x1EA7, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ + 0x1EA8, 0x1EA9, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ + 0x1EAA, 0x1EAB, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ + 0x1EAC, 0x1EAD, /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ + 0x1EAE, 0x1EAF, /* LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ + 0x1EB0, 0x1EB1, /* LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ + 0x1EB2, 0x1EB3, /* LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ + 0x1EB4, 0x1EB5, /* LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ + 0x1EB6, 0x1EB7, /* LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ + 0x1EB8, 0x1EB9, /* LATIN CAPITAL LETTER E WITH DOT BELOW */ + 0x1EBA, 0x1EBB, /* LATIN CAPITAL LETTER E WITH HOOK ABOVE */ + 0x1EBC, 0x1EBD, /* LATIN CAPITAL LETTER E WITH TILDE */ + 0x1EBE, 0x1EBF, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ + 0x1EC0, 0x1EC1, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ + 0x1EC2, 0x1EC3, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ + 0x1EC4, 0x1EC5, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ + 0x1EC6, 0x1EC7, /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ + 0x1EC8, 0x1EC9, /* LATIN CAPITAL LETTER I WITH HOOK ABOVE */ + 0x1ECA, 0x1ECB, /* LATIN CAPITAL LETTER I WITH DOT BELOW */ + 0x1ECC, 0x1ECD, /* LATIN CAPITAL LETTER O WITH DOT BELOW */ + 0x1ECE, 0x1ECF, /* LATIN CAPITAL LETTER O WITH HOOK ABOVE */ + 0x1ED0, 0x1ED1, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ + 0x1ED2, 0x1ED3, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ + 0x1ED4, 0x1ED5, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ + 0x1ED6, 0x1ED7, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ + 0x1ED8, 0x1ED9, /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ + 0x1EDA, 0x1EDB, /* LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ + 0x1EDC, 0x1EDD, /* LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ + 0x1EDE, 0x1EDF, /* LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ + 0x1EE0, 0x1EE1, /* LATIN CAPITAL LETTER O WITH HORN AND TILDE */ + 0x1EE2, 0x1EE3, /* LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ + 0x1EE4, 0x1EE5, /* LATIN CAPITAL LETTER U WITH DOT BELOW */ + 0x1EE6, 0x1EE7, /* LATIN CAPITAL LETTER U WITH HOOK ABOVE */ + 0x1EE8, 0x1EE9, /* LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ + 0x1EEA, 0x1EEB, /* LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ + 0x1EEC, 0x1EED, /* LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ + 0x1EEE, 0x1EEF, /* LATIN CAPITAL LETTER U WITH HORN AND TILDE */ + 0x1EF0, 0x1EF1, /* LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ + 0x1EF2, 0x1EF3, /* LATIN CAPITAL LETTER Y WITH GRAVE */ + 0x1EF4, 0x1EF5, /* LATIN CAPITAL LETTER Y WITH DOT BELOW */ + 0x1EF6, 0x1EF7, /* LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ + 0x1EF8, 0x1EF9, /* LATIN CAPITAL LETTER Y WITH TILDE */ + 0x1F08, 0x1F00, /* GREEK CAPITAL LETTER ALPHA WITH PSILI */ + 0x1F09, 0x1F01, /* GREEK CAPITAL LETTER ALPHA WITH DASIA */ + 0x1F0A, 0x1F02, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA */ + 0x1F0B, 0x1F03, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA */ + 0x1F0C, 0x1F04, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA */ + 0x1F0D, 0x1F05, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA */ + 0x1F0E, 0x1F06, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI */ + 0x1F0F, 0x1F07, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI */ + 0x1F18, 0x1F10, /* GREEK CAPITAL LETTER EPSILON WITH PSILI */ + 0x1F19, 0x1F11, /* GREEK CAPITAL LETTER EPSILON WITH DASIA */ + 0x1F1A, 0x1F12, /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA */ + 0x1F1B, 0x1F13, /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA */ + 0x1F1C, 0x1F14, /* GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA */ + 0x1F1D, 0x1F15, /* GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA */ + 0x1F28, 0x1F20, /* GREEK CAPITAL LETTER ETA WITH PSILI */ + 0x1F29, 0x1F21, /* GREEK CAPITAL LETTER ETA WITH DASIA */ + 0x1F2A, 0x1F22, /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA */ + 0x1F2B, 0x1F23, /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA */ + 0x1F2C, 0x1F24, /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA */ + 0x1F2D, 0x1F25, /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA */ + 0x1F2E, 0x1F26, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI */ + 0x1F2F, 0x1F27, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI */ + 0x1F38, 0x1F30, /* GREEK CAPITAL LETTER IOTA WITH PSILI */ + 0x1F39, 0x1F31, /* GREEK CAPITAL LETTER IOTA WITH DASIA */ + 0x1F3A, 0x1F32, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA */ + 0x1F3B, 0x1F33, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA */ + 0x1F3C, 0x1F34, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA */ + 0x1F3D, 0x1F35, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA */ + 0x1F3E, 0x1F36, /* GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI */ + 0x1F3F, 0x1F37, /* GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI */ + 0x1F48, 0x1F40, /* GREEK CAPITAL LETTER OMICRON WITH PSILI */ + 0x1F49, 0x1F41, /* GREEK CAPITAL LETTER OMICRON WITH DASIA */ + 0x1F4A, 0x1F42, /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA */ + 0x1F4B, 0x1F43, /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA */ + 0x1F4C, 0x1F44, /* GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA */ + 0x1F4D, 0x1F45, /* GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA */ + 0x1F59, 0x1F51, /* GREEK CAPITAL LETTER UPSILON WITH DASIA */ + 0x1F5B, 0x1F53, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA */ + 0x1F5D, 0x1F55, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA */ + 0x1F5F, 0x1F57, /* GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI */ + 0x1F68, 0x1F60, /* GREEK CAPITAL LETTER OMEGA WITH PSILI */ + 0x1F69, 0x1F61, /* GREEK CAPITAL LETTER OMEGA WITH DASIA */ + 0x1F6A, 0x1F62, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA */ + 0x1F6B, 0x1F63, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA */ + 0x1F6C, 0x1F64, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA */ + 0x1F6D, 0x1F65, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA */ + 0x1F6E, 0x1F66, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI */ + 0x1F6F, 0x1F67, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI */ + 0x1F88, 0x1F80, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI */ + 0x1F89, 0x1F81, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI */ + 0x1F8A, 0x1F82, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ + 0x1F8B, 0x1F83, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ + 0x1F8C, 0x1F84, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ + 0x1F8D, 0x1F85, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ + 0x1F8E, 0x1F86, /* GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ + 0x1F8F, 0x1F87, /* GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ + 0x1F98, 0x1F90, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI */ + 0x1F99, 0x1F91, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI */ + 0x1F9A, 0x1F92, /* GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ + 0x1F9B, 0x1F93, /* GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ + 0x1F9C, 0x1F94, /* GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ + 0x1F9D, 0x1F95, /* GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ + 0x1F9E, 0x1F96, /* GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ + 0x1F9F, 0x1F97, /* GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ + 0x1FA8, 0x1FA0, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI */ + 0x1FA9, 0x1FA1, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI */ + 0x1FAA, 0x1FA2, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI */ + 0x1FAB, 0x1FA3, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI */ + 0x1FAC, 0x1FA4, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI */ + 0x1FAD, 0x1FA5, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI */ + 0x1FAE, 0x1FA6, /* GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI */ + 0x1FAF, 0x1FA7, /* GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI */ + 0x1FB8, 0x1FB0, /* GREEK CAPITAL LETTER ALPHA WITH VRACHY */ + 0x1FB9, 0x1FB1, /* GREEK CAPITAL LETTER ALPHA WITH MACRON */ + 0x1FBA, 0x1F70, /* GREEK CAPITAL LETTER ALPHA WITH VARIA */ + 0x1FBB, 0x1F71, /* GREEK CAPITAL LETTER ALPHA WITH OXIA */ + 0x1FBC, 0x1FB3, /* GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI */ + 0x1FBE, 0x03B9, /* GREEK PROSGEGRAMMENI */ + 0x1FC8, 0x1F72, /* GREEK CAPITAL LETTER EPSILON WITH VARIA */ + 0x1FC9, 0x1F73, /* GREEK CAPITAL LETTER EPSILON WITH OXIA */ + 0x1FCA, 0x1F74, /* GREEK CAPITAL LETTER ETA WITH VARIA */ + 0x1FCB, 0x1F75, /* GREEK CAPITAL LETTER ETA WITH OXIA */ + 0x1FCC, 0x1FC3, /* GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI */ + 0x1FD8, 0x1FD0, /* GREEK CAPITAL LETTER IOTA WITH VRACHY */ + 0x1FD9, 0x1FD1, /* GREEK CAPITAL LETTER IOTA WITH MACRON */ + 0x1FDA, 0x1F76, /* GREEK CAPITAL LETTER IOTA WITH VARIA */ + 0x1FDB, 0x1F77, /* GREEK CAPITAL LETTER IOTA WITH OXIA */ + 0x1FE8, 0x1FE0, /* GREEK CAPITAL LETTER UPSILON WITH VRACHY */ + 0x1FE9, 0x1FE1, /* GREEK CAPITAL LETTER UPSILON WITH MACRON */ + 0x1FEA, 0x1F7A, /* GREEK CAPITAL LETTER UPSILON WITH VARIA */ + 0x1FEB, 0x1F7B, /* GREEK CAPITAL LETTER UPSILON WITH OXIA */ + 0x1FEC, 0x1FE5, /* GREEK CAPITAL LETTER RHO WITH DASIA */ + 0x1FF8, 0x1F78, /* GREEK CAPITAL LETTER OMICRON WITH VARIA */ + 0x1FF9, 0x1F79, /* GREEK CAPITAL LETTER OMICRON WITH OXIA */ + 0x1FFA, 0x1F7C, /* GREEK CAPITAL LETTER OMEGA WITH VARIA */ + 0x1FFB, 0x1F7D, /* GREEK CAPITAL LETTER OMEGA WITH OXIA */ + 0x1FFC, 0x1FF3, /* GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI */ + 0x2126, 0x03C9, /* OHM SIGN */ + 0x212A, 0x006B, /* KELVIN SIGN */ + 0x212B, 0x00E5, /* ANGSTROM SIGN */ + 0x2132, 0x214E, /* TURNED CAPITAL F */ + 0x2160, 0x2170, /* ROMAN NUMERAL ONE */ + 0x2161, 0x2171, /* ROMAN NUMERAL TWO */ + 0x2162, 0x2172, /* ROMAN NUMERAL THREE */ + 0x2163, 0x2173, /* ROMAN NUMERAL FOUR */ + 0x2164, 0x2174, /* ROMAN NUMERAL FIVE */ + 0x2165, 0x2175, /* ROMAN NUMERAL SIX */ + 0x2166, 0x2176, /* ROMAN NUMERAL SEVEN */ + 0x2167, 0x2177, /* ROMAN NUMERAL EIGHT */ + 0x2168, 0x2178, /* ROMAN NUMERAL NINE */ + 0x2169, 0x2179, /* ROMAN NUMERAL TEN */ + 0x216A, 0x217A, /* ROMAN NUMERAL ELEVEN */ + 0x216B, 0x217B, /* ROMAN NUMERAL TWELVE */ + 0x216C, 0x217C, /* ROMAN NUMERAL FIFTY */ + 0x216D, 0x217D, /* ROMAN NUMERAL ONE HUNDRED */ + 0x216E, 0x217E, /* ROMAN NUMERAL FIVE HUNDRED */ + 0x216F, 0x217F, /* ROMAN NUMERAL ONE THOUSAND */ + 0x2183, 0x2184, /* ROMAN NUMERAL REVERSED ONE HUNDRED */ + 0x24B6, 0x24D0, /* CIRCLED LATIN CAPITAL LETTER A */ + 0x24B7, 0x24D1, /* CIRCLED LATIN CAPITAL LETTER B */ + 0x24B8, 0x24D2, /* CIRCLED LATIN CAPITAL LETTER C */ + 0x24B9, 0x24D3, /* CIRCLED LATIN CAPITAL LETTER D */ + 0x24BA, 0x24D4, /* CIRCLED LATIN CAPITAL LETTER E */ + 0x24BB, 0x24D5, /* CIRCLED LATIN CAPITAL LETTER F */ + 0x24BC, 0x24D6, /* CIRCLED LATIN CAPITAL LETTER G */ + 0x24BD, 0x24D7, /* CIRCLED LATIN CAPITAL LETTER H */ + 0x24BE, 0x24D8, /* CIRCLED LATIN CAPITAL LETTER I */ + 0x24BF, 0x24D9, /* CIRCLED LATIN CAPITAL LETTER J */ + 0x24C0, 0x24DA, /* CIRCLED LATIN CAPITAL LETTER K */ + 0x24C1, 0x24DB, /* CIRCLED LATIN CAPITAL LETTER L */ + 0x24C2, 0x24DC, /* CIRCLED LATIN CAPITAL LETTER M */ + 0x24C3, 0x24DD, /* CIRCLED LATIN CAPITAL LETTER N */ + 0x24C4, 0x24DE, /* CIRCLED LATIN CAPITAL LETTER O */ + 0x24C5, 0x24DF, /* CIRCLED LATIN CAPITAL LETTER P */ + 0x24C6, 0x24E0, /* CIRCLED LATIN CAPITAL LETTER Q */ + 0x24C7, 0x24E1, /* CIRCLED LATIN CAPITAL LETTER R */ + 0x24C8, 0x24E2, /* CIRCLED LATIN CAPITAL LETTER S */ + 0x24C9, 0x24E3, /* CIRCLED LATIN CAPITAL LETTER T */ + 0x24CA, 0x24E4, /* CIRCLED LATIN CAPITAL LETTER U */ + 0x24CB, 0x24E5, /* CIRCLED LATIN CAPITAL LETTER V */ + 0x24CC, 0x24E6, /* CIRCLED LATIN CAPITAL LETTER W */ + 0x24CD, 0x24E7, /* CIRCLED LATIN CAPITAL LETTER X */ + 0x24CE, 0x24E8, /* CIRCLED LATIN CAPITAL LETTER Y */ + 0x24CF, 0x24E9, /* CIRCLED LATIN CAPITAL LETTER Z */ + 0x2C00, 0x2C30, /* GLAGOLITIC CAPITAL LETTER AZU */ + 0x2C01, 0x2C31, /* GLAGOLITIC CAPITAL LETTER BUKY */ + 0x2C02, 0x2C32, /* GLAGOLITIC CAPITAL LETTER VEDE */ + 0x2C03, 0x2C33, /* GLAGOLITIC CAPITAL LETTER GLAGOLI */ + 0x2C04, 0x2C34, /* GLAGOLITIC CAPITAL LETTER DOBRO */ + 0x2C05, 0x2C35, /* GLAGOLITIC CAPITAL LETTER YESTU */ + 0x2C06, 0x2C36, /* GLAGOLITIC CAPITAL LETTER ZHIVETE */ + 0x2C07, 0x2C37, /* GLAGOLITIC CAPITAL LETTER DZELO */ + 0x2C08, 0x2C38, /* GLAGOLITIC CAPITAL LETTER ZEMLJA */ + 0x2C09, 0x2C39, /* GLAGOLITIC CAPITAL LETTER IZHE */ + 0x2C0A, 0x2C3A, /* GLAGOLITIC CAPITAL LETTER INITIAL IZHE */ + 0x2C0B, 0x2C3B, /* GLAGOLITIC CAPITAL LETTER I */ + 0x2C0C, 0x2C3C, /* GLAGOLITIC CAPITAL LETTER DJERVI */ + 0x2C0D, 0x2C3D, /* GLAGOLITIC CAPITAL LETTER KAKO */ + 0x2C0E, 0x2C3E, /* GLAGOLITIC CAPITAL LETTER LJUDIJE */ + 0x2C0F, 0x2C3F, /* GLAGOLITIC CAPITAL LETTER MYSLITE */ + 0x2C10, 0x2C40, /* GLAGOLITIC CAPITAL LETTER NASHI */ + 0x2C11, 0x2C41, /* GLAGOLITIC CAPITAL LETTER ONU */ + 0x2C12, 0x2C42, /* GLAGOLITIC CAPITAL LETTER POKOJI */ + 0x2C13, 0x2C43, /* GLAGOLITIC CAPITAL LETTER RITSI */ + 0x2C14, 0x2C44, /* GLAGOLITIC CAPITAL LETTER SLOVO */ + 0x2C15, 0x2C45, /* GLAGOLITIC CAPITAL LETTER TVRIDO */ + 0x2C16, 0x2C46, /* GLAGOLITIC CAPITAL LETTER UKU */ + 0x2C17, 0x2C47, /* GLAGOLITIC CAPITAL LETTER FRITU */ + 0x2C18, 0x2C48, /* GLAGOLITIC CAPITAL LETTER HERU */ + 0x2C19, 0x2C49, /* GLAGOLITIC CAPITAL LETTER OTU */ + 0x2C1A, 0x2C4A, /* GLAGOLITIC CAPITAL LETTER PE */ + 0x2C1B, 0x2C4B, /* GLAGOLITIC CAPITAL LETTER SHTA */ + 0x2C1C, 0x2C4C, /* GLAGOLITIC CAPITAL LETTER TSI */ + 0x2C1D, 0x2C4D, /* GLAGOLITIC CAPITAL LETTER CHRIVI */ + 0x2C1E, 0x2C4E, /* GLAGOLITIC CAPITAL LETTER SHA */ + 0x2C1F, 0x2C4F, /* GLAGOLITIC CAPITAL LETTER YERU */ + 0x2C20, 0x2C50, /* GLAGOLITIC CAPITAL LETTER YERI */ + 0x2C21, 0x2C51, /* GLAGOLITIC CAPITAL LETTER YATI */ + 0x2C22, 0x2C52, /* GLAGOLITIC CAPITAL LETTER SPIDERY HA */ + 0x2C23, 0x2C53, /* GLAGOLITIC CAPITAL LETTER YU */ + 0x2C24, 0x2C54, /* GLAGOLITIC CAPITAL LETTER SMALL YUS */ + 0x2C25, 0x2C55, /* GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL */ + 0x2C26, 0x2C56, /* GLAGOLITIC CAPITAL LETTER YO */ + 0x2C27, 0x2C57, /* GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS */ + 0x2C28, 0x2C58, /* GLAGOLITIC CAPITAL LETTER BIG YUS */ + 0x2C29, 0x2C59, /* GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS */ + 0x2C2A, 0x2C5A, /* GLAGOLITIC CAPITAL LETTER FITA */ + 0x2C2B, 0x2C5B, /* GLAGOLITIC CAPITAL LETTER IZHITSA */ + 0x2C2C, 0x2C5C, /* GLAGOLITIC CAPITAL LETTER SHTAPIC */ + 0x2C2D, 0x2C5D, /* GLAGOLITIC CAPITAL LETTER TROKUTASTI A */ + 0x2C2E, 0x2C5E, /* GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE */ + 0x2C60, 0x2C61, /* LATIN CAPITAL LETTER L WITH DOUBLE BAR */ + 0x2C62, 0x026B, /* LATIN CAPITAL LETTER L WITH MIDDLE TILDE */ + 0x2C63, 0x1D7D, /* LATIN CAPITAL LETTER P WITH STROKE */ + 0x2C64, 0x027D, /* LATIN CAPITAL LETTER R WITH TAIL */ + 0x2C67, 0x2C68, /* LATIN CAPITAL LETTER H WITH DESCENDER */ + 0x2C69, 0x2C6A, /* LATIN CAPITAL LETTER K WITH DESCENDER */ + 0x2C6B, 0x2C6C, /* LATIN CAPITAL LETTER Z WITH DESCENDER */ + 0x2C75, 0x2C76, /* LATIN CAPITAL LETTER HALF H */ + 0x2C80, 0x2C81, /* COPTIC CAPITAL LETTER ALFA */ + 0x2C82, 0x2C83, /* COPTIC CAPITAL LETTER VIDA */ + 0x2C84, 0x2C85, /* COPTIC CAPITAL LETTER GAMMA */ + 0x2C86, 0x2C87, /* COPTIC CAPITAL LETTER DALDA */ + 0x2C88, 0x2C89, /* COPTIC CAPITAL LETTER EIE */ + 0x2C8A, 0x2C8B, /* COPTIC CAPITAL LETTER SOU */ + 0x2C8C, 0x2C8D, /* COPTIC CAPITAL LETTER ZATA */ + 0x2C8E, 0x2C8F, /* COPTIC CAPITAL LETTER HATE */ + 0x2C90, 0x2C91, /* COPTIC CAPITAL LETTER THETHE */ + 0x2C92, 0x2C93, /* COPTIC CAPITAL LETTER IAUDA */ + 0x2C94, 0x2C95, /* COPTIC CAPITAL LETTER KAPA */ + 0x2C96, 0x2C97, /* COPTIC CAPITAL LETTER LAULA */ + 0x2C98, 0x2C99, /* COPTIC CAPITAL LETTER MI */ + 0x2C9A, 0x2C9B, /* COPTIC CAPITAL LETTER NI */ + 0x2C9C, 0x2C9D, /* COPTIC CAPITAL LETTER KSI */ + 0x2C9E, 0x2C9F, /* COPTIC CAPITAL LETTER O */ + 0x2CA0, 0x2CA1, /* COPTIC CAPITAL LETTER PI */ + 0x2CA2, 0x2CA3, /* COPTIC CAPITAL LETTER RO */ + 0x2CA4, 0x2CA5, /* COPTIC CAPITAL LETTER SIMA */ + 0x2CA6, 0x2CA7, /* COPTIC CAPITAL LETTER TAU */ + 0x2CA8, 0x2CA9, /* COPTIC CAPITAL LETTER UA */ + 0x2CAA, 0x2CAB, /* COPTIC CAPITAL LETTER FI */ + 0x2CAC, 0x2CAD, /* COPTIC CAPITAL LETTER KHI */ + 0x2CAE, 0x2CAF, /* COPTIC CAPITAL LETTER PSI */ + 0x2CB0, 0x2CB1, /* COPTIC CAPITAL LETTER OOU */ + 0x2CB2, 0x2CB3, /* COPTIC CAPITAL LETTER DIALECT-P ALEF */ + 0x2CB4, 0x2CB5, /* COPTIC CAPITAL LETTER OLD COPTIC AIN */ + 0x2CB6, 0x2CB7, /* COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE */ + 0x2CB8, 0x2CB9, /* COPTIC CAPITAL LETTER DIALECT-P KAPA */ + 0x2CBA, 0x2CBB, /* COPTIC CAPITAL LETTER DIALECT-P NI */ + 0x2CBC, 0x2CBD, /* COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI */ + 0x2CBE, 0x2CBF, /* COPTIC CAPITAL LETTER OLD COPTIC OOU */ + 0x2CC0, 0x2CC1, /* COPTIC CAPITAL LETTER SAMPI */ + 0x2CC2, 0x2CC3, /* COPTIC CAPITAL LETTER CROSSED SHEI */ + 0x2CC4, 0x2CC5, /* COPTIC CAPITAL LETTER OLD COPTIC SHEI */ + 0x2CC6, 0x2CC7, /* COPTIC CAPITAL LETTER OLD COPTIC ESH */ + 0x2CC8, 0x2CC9, /* COPTIC CAPITAL LETTER AKHMIMIC KHEI */ + 0x2CCA, 0x2CCB, /* COPTIC CAPITAL LETTER DIALECT-P HORI */ + 0x2CCC, 0x2CCD, /* COPTIC CAPITAL LETTER OLD COPTIC HORI */ + 0x2CCE, 0x2CCF, /* COPTIC CAPITAL LETTER OLD COPTIC HA */ + 0x2CD0, 0x2CD1, /* COPTIC CAPITAL LETTER L-SHAPED HA */ + 0x2CD2, 0x2CD3, /* COPTIC CAPITAL LETTER OLD COPTIC HEI */ + 0x2CD4, 0x2CD5, /* COPTIC CAPITAL LETTER OLD COPTIC HAT */ + 0x2CD6, 0x2CD7, /* COPTIC CAPITAL LETTER OLD COPTIC GANGIA */ + 0x2CD8, 0x2CD9, /* COPTIC CAPITAL LETTER OLD COPTIC DJA */ + 0x2CDA, 0x2CDB, /* COPTIC CAPITAL LETTER OLD COPTIC SHIMA */ + 0x2CDC, 0x2CDD, /* COPTIC CAPITAL LETTER OLD NUBIAN SHIMA */ + 0x2CDE, 0x2CDF, /* COPTIC CAPITAL LETTER OLD NUBIAN NGI */ + 0x2CE0, 0x2CE1, /* COPTIC CAPITAL LETTER OLD NUBIAN NYI */ + 0x2CE2, 0x2CE3, /* COPTIC CAPITAL LETTER OLD NUBIAN WAU */ + 0xFF21, 0xFF41, /* FULLWIDTH LATIN CAPITAL LETTER A */ + 0xFF22, 0xFF42, /* FULLWIDTH LATIN CAPITAL LETTER B */ + 0xFF23, 0xFF43, /* FULLWIDTH LATIN CAPITAL LETTER C */ + 0xFF24, 0xFF44, /* FULLWIDTH LATIN CAPITAL LETTER D */ + 0xFF25, 0xFF45, /* FULLWIDTH LATIN CAPITAL LETTER E */ + 0xFF26, 0xFF46, /* FULLWIDTH LATIN CAPITAL LETTER F */ + 0xFF27, 0xFF47, /* FULLWIDTH LATIN CAPITAL LETTER G */ + 0xFF28, 0xFF48, /* FULLWIDTH LATIN CAPITAL LETTER H */ + 0xFF29, 0xFF49, /* FULLWIDTH LATIN CAPITAL LETTER I */ + 0xFF2A, 0xFF4A, /* FULLWIDTH LATIN CAPITAL LETTER J */ + 0xFF2B, 0xFF4B, /* FULLWIDTH LATIN CAPITAL LETTER K */ + 0xFF2C, 0xFF4C, /* FULLWIDTH LATIN CAPITAL LETTER L */ + 0xFF2D, 0xFF4D, /* FULLWIDTH LATIN CAPITAL LETTER M */ + 0xFF2E, 0xFF4E, /* FULLWIDTH LATIN CAPITAL LETTER N */ + 0xFF2F, 0xFF4F, /* FULLWIDTH LATIN CAPITAL LETTER O */ + 0xFF30, 0xFF50, /* FULLWIDTH LATIN CAPITAL LETTER P */ + 0xFF31, 0xFF51, /* FULLWIDTH LATIN CAPITAL LETTER Q */ + 0xFF32, 0xFF52, /* FULLWIDTH LATIN CAPITAL LETTER R */ + 0xFF33, 0xFF53, /* FULLWIDTH LATIN CAPITAL LETTER S */ + 0xFF34, 0xFF54, /* FULLWIDTH LATIN CAPITAL LETTER T */ + 0xFF35, 0xFF55, /* FULLWIDTH LATIN CAPITAL LETTER U */ + 0xFF36, 0xFF56, /* FULLWIDTH LATIN CAPITAL LETTER V */ + 0xFF37, 0xFF57, /* FULLWIDTH LATIN CAPITAL LETTER W */ + 0xFF38, 0xFF58, /* FULLWIDTH LATIN CAPITAL LETTER X */ + 0xFF39, 0xFF59, /* FULLWIDTH LATIN CAPITAL LETTER Y */ + 0xFF3A, 0xFF5A, /* FULLWIDTH LATIN CAPITAL LETTER Z */ +}; + +size_t msdosfs_unicode_foldmap_entries = __arraycount(msdosfs_unicode_foldmap); diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 981f3c5e2..c48f404e9 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vfsops.c,v 1.118 2015/03/28 19:24:05 maxv Exp $ */ +/* $NetBSD: msdosfs_vfsops.c,v 1.136 2021/02/11 00:15:55 ryoon Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.118 2015/03/28 19:24:05 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.136 2021/02/11 00:15:55 ryoon Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -69,7 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.118 2015/03/28 19:24:05 maxv Ex #include #include #include -#include #include #include #include @@ -107,8 +106,6 @@ MALLOC_JUSTDEFINE(M_MSDOSFSMNT, "MSDOSFS mount", "MSDOS FS mount structure"); MALLOC_JUSTDEFINE(M_MSDOSFSFAT, "MSDOSFS FAT", "MSDOS FS FAT table"); MALLOC_JUSTDEFINE(M_MSDOSFSTMP, "MSDOSFS temp", "MSDOS FS temp. structures"); -static struct sysctllog *msdosfs_sysctl_log; - extern const struct vnodeopv_desc msdosfs_vnodeop_opv_desc; const struct vnodeopv_desc * const msdosfs_vnodeopv_descs[] = { @@ -136,13 +133,28 @@ struct vfsops msdosfs_vfsops = { .vfs_mountroot = msdosfs_mountroot, .vfs_snapshot = (void *)eopnotsupp, .vfs_extattrctl = vfs_stdextattrctl, - .vfs_suspendctl = msdosfs_suspendctl, + .vfs_suspendctl = genfs_suspendctl, .vfs_renamelock_enter = genfs_renamelock_enter, .vfs_renamelock_exit = genfs_renamelock_exit, .vfs_fsync = (void *)eopnotsupp, .vfs_opv_descs = msdosfs_vnodeopv_descs }; +SYSCTL_SETUP(msdosfs_sysctl_setup, "msdosfs sysctl") +{ + sysctl_createv(clog, 0, NULL, NULL, + CTLFLAG_PERMANENT, + CTLTYPE_NODE, "msdosfs", + SYSCTL_DESCR("MS-DOS file system"), + NULL, 0, NULL, 0, + CTL_VFS, 4, CTL_EOL); + /* + * XXX the "4" above could be dynamic, thereby eliminating one + * more instance of the "number to vfs" mapping problem, but + * "4" is the order as taken from sys/mount.h + */ +} + static int msdos_modcmd(modcmd_t cmd, void *arg) { @@ -153,23 +165,11 @@ msdos_modcmd(modcmd_t cmd, void *arg) error = vfs_attach(&msdosfs_vfsops); if (error != 0) break; - sysctl_createv(&msdosfs_sysctl_log, 0, NULL, NULL, - CTLFLAG_PERMANENT, - CTLTYPE_NODE, "msdosfs", - SYSCTL_DESCR("MS-DOS file system"), - NULL, 0, NULL, 0, - CTL_VFS, 4, CTL_EOL); - /* - * XXX the "4" above could be dynamic, thereby eliminating one - * more instance of the "number to vfs" mapping problem, but - * "4" is the order as taken from sys/mount.h - */ break; case MODULE_CMD_FINI: error = vfs_detach(&msdosfs_vfsops); if (error != 0) break; - sysctl_teardown(&msdosfs_sysctl_log); break; default: error = ENOTTY; @@ -210,7 +210,8 @@ update_mp(struct mount *mp, struct msdosfs_args *argp) if (FAT32(pmp)) pmp->pm_flags |= MSDOSFSMNT_LONGNAME; else { - if ((error = msdosfs_root(mp, &rtvp)) != 0) + error = msdosfs_root(mp, LK_EXCLUSIVE, &rtvp); + if (error != 0) return error; pmp->pm_flags |= findwin95(VTODE(rtvp)) ? MSDOSFSMNT_LONGNAME @@ -248,22 +249,22 @@ msdosfs_mountroot(void) args.dirmask = 0777; if ((error = msdosfs_mountfs(rootvp, mp, l, &args)) != 0) { - vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_unbusy(mp); + vfs_rele(mp); return (error); } if ((error = update_mp(mp, &args)) != 0) { (void)msdosfs_unmount(mp, 0); - vfs_unbusy(mp, false, NULL); - vfs_destroy(mp); + vfs_unbusy(mp); + vfs_rele(mp); vrele(rootvp); return (error); } mountlist_append(mp); (void)msdosfs_statvfs(mp, &mp->mnt_stat); - vfs_unbusy(mp, false, NULL); + vfs_unbusy(mp); return (0); } @@ -468,6 +469,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd int ronly, error, BlkPerSec; uint64_t psize; unsigned secsize; + u_long fatbytes, fatblocksecs; /* Flush out any old buffers remaining from a previous use. */ if ((error = vinvalbuf(devvp, V_SAVE, l->l_cred, l, 0, 0)) != 0) @@ -478,10 +480,6 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd bp = NULL; /* both used in error_exit */ pmp = NULL; - error = fstrans_mount(mp); - if (error) - goto error_exit; - error = getdisksize(devvp, &psize, &secsize); if (error) { if (argp->flags & MSDOSFSMNT_GEMDOSFS) @@ -522,6 +520,13 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd b50 = (struct byte_bpb50 *)bsp->bs50.bsBPB; b710 = (struct byte_bpb710 *)bsp->bs710.bsBPB; +#if 0 + /* + * Some FAT partition, for example Raspberry Pi Pico's + * USB mass storage, does not have exptected BOOTSIGs. + * According to FreeBSD's comment, some PC-9800/9821 + * FAT floppy disks have similar problems. + */ if (!(argp->flags & MSDOSFSMNT_GEMDOSFS)) { if (bsp->bs50.bsBootSectSig0 != BOOTSIG0 || bsp->bs50.bsBootSectSig1 != BOOTSIG1) { @@ -532,6 +537,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd goto error_exit; } } +#endif pmp = malloc(sizeof(*pmp), M_MSDOSFSMNT, M_WAITOK|M_ZERO); pmp->pm_mountp = mp; @@ -715,12 +721,40 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd pmp->pm_fatdiv = 1; } } - if (FAT12(pmp)) - pmp->pm_fatblocksize = 3 * pmp->pm_BytesPerSec; - else - pmp->pm_fatblocksize = MAXBSIZE; - pmp->pm_fatblocksec = pmp->pm_fatblocksize / pmp->pm_BytesPerSec; + /* validate cluster count against FAT */ + if ((pmp->pm_maxcluster & pmp->pm_fatmask) != pmp->pm_maxcluster) { + DPRINTF("maxcluster %lu outside of mask %#lx\n", + pmp->pm_maxcluster, pmp->pm_fatmask); + error = EINVAL; + goto error_exit; + } + + /* validate FAT size */ + fatbytes = (pmp->pm_maxcluster+1) * pmp->pm_fatmult / pmp->pm_fatdiv; + fatblocksecs = howmany(fatbytes, pmp->pm_BytesPerSec); + + if (pmp->pm_FATsecs < fatblocksecs) { + DPRINTF("FATsecs %lu < real %lu\n", pmp->pm_FATsecs, + fatblocksecs); + error = EINVAL; + goto error_exit; + } + + if (FAT12(pmp)) { + /* + * limit block size to what is needed to read a FAT block + * to not exceed MAXBSIZE + */ + pmp->pm_fatblocksec = uimin(3, fatblocksecs); + pmp->pm_fatblocksize = pmp->pm_fatblocksec + * pmp->pm_BytesPerSec; + } else { + pmp->pm_fatblocksize = MAXBSIZE; + pmp->pm_fatblocksec = pmp->pm_fatblocksize + / pmp->pm_BytesPerSec; + } + pmp->pm_bnshift = ffs(pmp->pm_BytesPerSec) - 1; /* @@ -842,6 +876,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd mp->mnt_stat.f_fsid = mp->mnt_stat.f_fsidx.__fsid_val[0]; mp->mnt_stat.f_namemax = MSDOSFS_NAMEMAX(pmp); mp->mnt_flag |= MNT_LOCAL; + mp->mnt_iflag |= IMNT_SHRLOOKUP; mp->mnt_dev_bshift = pmp->pm_bnshift; mp->mnt_fs_bshift = pmp->pm_cnshift; @@ -858,7 +893,6 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct lwp *l, struct msd return (0); error_exit: - fstrans_unmount(mp); if (bp) brelse(bp, BC_AGE); if (pmp) { @@ -900,13 +934,10 @@ msdosfs_unmount(struct mount *mp, int mntflags) printf("msdosfs_umount(): just before calling VOP_CLOSE()\n"); printf("flag %08x, usecount %d, writecount %d, holdcnt %d\n", - vp->v_vflag | vp->v_iflag | vp->v_uflag, vp->v_usecount, + vp->v_vflag | vp->v_iflag | vp->v_uflag, vrefcnt(vp), vp->v_writecount, vp->v_holdcnt); printf("mount %p, op %p\n", vp->v_mount, vp->v_op); - printf("freef %p, freeb %p, mount %p\n", - vp->v_freelist.tqe_next, vp->v_freelist.tqe_prev, - vp->v_mount); printf("cleanblkhd %p, dirtyblkhd %p, numoutput %d, type %d\n", vp->v_cleanblkhd.lh_first, vp->v_dirtyblkhd.lh_first, @@ -926,12 +957,11 @@ msdosfs_unmount(struct mount *mp, int mntflags) free(pmp, M_MSDOSFSMNT); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - fstrans_unmount(mp); return (0); } int -msdosfs_root(struct mount *mp, struct vnode **vpp) +msdosfs_root(struct mount *mp, int lktype, struct vnode **vpp) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); int error; @@ -941,7 +971,7 @@ msdosfs_root(struct mount *mp, struct vnode **vpp) #endif if ((error = deget(pmp, MSDOSFSROOT, MSDOSFSROOT_OFS, vpp)) != 0) return error; - error = vn_lock(*vpp, LK_EXCLUSIVE); + error = vn_lock(*vpp, lktype); if (error) { vrele(*vpp); *vpp = NULL; @@ -981,12 +1011,14 @@ msdosfs_sync_selector(void *cl, struct vnode *vp) struct msdosfs_sync_ctx *c = cl; struct denode *dep; + KASSERT(mutex_owned(vp->v_interlock)); + dep = VTODE(vp); if (c->waitfor == MNT_LAZY || vp->v_type == VNON || dep == NULL || (((dep->de_flag & (DE_ACCESS | DE_CREATE | DE_UPDATE | DE_MODIFIED)) == 0) && (LIST_EMPTY(&vp->v_dirtyblkhd) && - UVM_OBJ_IS_CLEAN(&vp->v_uobj)))) + (vp->v_iflag & VI_ONWORKLST) == 0))) return false; return true; } @@ -1011,7 +1043,6 @@ msdosfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) /* update FATs here */ } } - fstrans_start(mp, FSTRANS_SHARED); /* * Write back each (modified) denode. */ @@ -1035,15 +1066,16 @@ msdosfs_sync(struct mount *mp, int waitfor, kauth_cred_t cred) /* * Force stale file system control information to be flushed. */ + vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(pmp->pm_devvp, cred, waitfor == MNT_WAIT ? FSYNC_WAIT : 0, 0, 0)) != 0) allerror = error; - fstrans_done(mp); + VOP_UNLOCK(pmp->pm_devvp); return (allerror); } int -msdosfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) +msdosfs_fhtovp(struct mount *mp, struct fid *fhp, int lktype, struct vnode **vpp) { struct msdosfsmount *pmp = VFSTOMSDOSFS(mp); struct defid defh; @@ -1069,7 +1101,7 @@ msdosfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) *vpp = NULLVP; return error; } - error = vn_lock(*vpp, LK_EXCLUSIVE); + error = vn_lock(*vpp, lktype); if (error) { vrele(*vpp); *vpp = NULLVP; @@ -1104,36 +1136,9 @@ msdosfs_vptofh(struct vnode *vp, struct fid *fhp, size_t *fh_size) } int -msdosfs_vget(struct mount *mp, ino_t ino, +msdosfs_vget(struct mount *mp, ino_t ino, int lktype, struct vnode **vpp) { return (EOPNOTSUPP); } - -int -msdosfs_suspendctl(struct mount *mp, int cmd) -{ - int error; - struct lwp *l = curlwp; - - switch (cmd) { - case SUSPEND_SUSPEND: - if ((error = fstrans_setstate(mp, FSTRANS_SUSPENDING)) != 0) - return error; - error = msdosfs_sync(mp, MNT_WAIT, l->l_proc->p_cred); - if (error == 0) - error = fstrans_setstate(mp, FSTRANS_SUSPENDED); - if (error != 0) { - (void) fstrans_setstate(mp, FSTRANS_NORMAL); - return error; - } - return 0; - - case SUSPEND_RESUME: - return fstrans_setstate(mp, FSTRANS_NORMAL); - - default: - return EINVAL; - } -} diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 64895abfb..a3c3c5750 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vnops.c,v 1.93 2015/04/04 12:34:44 riastradh Exp $ */ +/* $NetBSD: msdosfs_vnops.c,v 1.104 2020/06/27 17:29:18 christos Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.93 2015/04/04 12:34:44 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.104 2020/06/27 17:29:18 christos Exp $"); #include #include @@ -60,7 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.93 2015/04/04 12:34:44 riastradh #include #include #include -#include #include #include #include @@ -120,7 +119,6 @@ msdosfs_create(void *v) printf("msdosfs_create(cnp %p, vap %p\n", cnp, ap->a_vap); #endif - fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED); /* * If this is the root directory and there is no space left we * can't do anything. This is because the root directory can not @@ -153,13 +151,13 @@ msdosfs_create(void *v) DETIMES(&ndirent, NULL, NULL, NULL, pdep->de_pmp->pm_gmtoff); if ((error = createde(&ndirent, pdep, &dep, cnp)) != 0) goto bad; - fstrans_done(ap->a_dvp->v_mount); VN_KNOTE(ap->a_dvp, NOTE_WRITE); *ap->a_vpp = DETOV(dep); + cache_enter(ap->a_dvp, *ap->a_vpp, cnp->cn_nameptr, cnp->cn_namelen, + cnp->cn_flags); return (0); bad: - fstrans_done(ap->a_dvp->v_mount); return (error); } @@ -174,17 +172,15 @@ msdosfs_close(void *v) struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); - fstrans_start(vp->v_mount, FSTRANS_SHARED); mutex_enter(vp->v_interlock); - if (vp->v_usecount > 1) + if (vrefcnt(vp) > 1) DETIMES(dep, NULL, NULL, NULL, dep->de_pmp->pm_gmtoff); mutex_exit(vp->v_interlock); - fstrans_done(vp->v_mount); return (0); } static int -msdosfs_check_possible(struct vnode *vp, struct denode *dep, mode_t mode) +msdosfs_check_possible(struct vnode *vp, struct denode *dep, accmode_t accmode) { /* @@ -192,7 +188,7 @@ msdosfs_check_possible(struct vnode *vp, struct denode *dep, mode_t mode) * unless the file is a socket, fifo, or a block or * character device resident on the file system. */ - if (mode & VWRITE) { + if (accmode & VWRITE) { switch (vp->v_type) { case VDIR: case VLNK: @@ -208,7 +204,7 @@ msdosfs_check_possible(struct vnode *vp, struct denode *dep, mode_t mode) } static int -msdosfs_check_permitted(struct vnode *vp, struct denode *dep, mode_t mode, +msdosfs_check_permitted(struct vnode *vp, struct denode *dep, accmode_t accmode, kauth_cred_t cred) { struct msdosfsmount *pmp = dep->de_pmp; @@ -221,9 +217,9 @@ msdosfs_check_permitted(struct vnode *vp, struct denode *dep, mode_t mode, file_mode &= (vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); - return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(mode, - vp->v_type, file_mode), vp, NULL, genfs_can_access(vp->v_type, - file_mode, pmp->pm_uid, pmp->pm_gid, mode, cred)); + return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(accmode, + vp->v_type, file_mode), vp, NULL, genfs_can_access(vp, cred, + pmp->pm_uid, pmp->pm_gid, file_mode, NULL, accmode)); } int @@ -231,18 +227,18 @@ msdosfs_access(void *v) { struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + accmode_t a_accmode; kauth_cred_t a_cred; } */ *ap = v; struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(vp); int error; - error = msdosfs_check_possible(vp, dep, ap->a_mode); + error = msdosfs_check_possible(vp, dep, ap->a_accmode); if (error) return error; - error = msdosfs_check_permitted(vp, dep, ap->a_mode, ap->a_cred); + error = msdosfs_check_permitted(vp, dep, ap->a_accmode, ap->a_cred); return error; } @@ -262,7 +258,6 @@ msdosfs_getattr(void *v) u_long dirsperblk = pmp->pm_BytesPerSec / sizeof(struct direntry); ino_t fileid; - fstrans_start(ap->a_vp->v_mount, FSTRANS_SHARED); DETIMES(dep, NULL, NULL, NULL, pmp->pm_gmtoff); vap->va_fsid = dep->de_dev; /* @@ -313,7 +308,6 @@ msdosfs_getattr(void *v) vap->va_bytes = (dep->de_FileSize + pmp->pm_crbomask) & ~pmp->pm_crbomask; vap->va_type = ap->a_vp->v_type; - fstrans_done(ap->a_vp->v_mount); return (0); } @@ -361,7 +355,6 @@ msdosfs_setattr(void *v) if (ap->a_vp->v_type == VDIR) return 0; - fstrans_start(vp->v_mount, FSTRANS_SHARED); if (vap->va_size != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) { error = EROFS; @@ -378,8 +371,8 @@ msdosfs_setattr(void *v) goto bad; } error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_TIMES, - ap->a_vp, NULL, genfs_can_chtimes(ap->a_vp, vap->va_vaflags, - pmp->pm_uid, cred)); + ap->a_vp, NULL, genfs_can_chtimes(ap->a_vp, cred, + pmp->pm_uid, vap->va_vaflags)); if (error) goto bad; if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && @@ -402,7 +395,7 @@ msdosfs_setattr(void *v) goto bad; } error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_FLAGS, vp, - NULL, genfs_can_chflags(cred, vp->v_type, pmp->pm_uid, false)); + NULL, genfs_can_chflags(vp, cred, pmp->pm_uid, false)); if (error) goto bad; /* We ignore the read and execute bits. */ @@ -422,7 +415,7 @@ msdosfs_setattr(void *v) goto bad; } error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_FLAGS, vp, - NULL, genfs_can_chflags(cred, vp->v_type, pmp->pm_uid, false)); + NULL, genfs_can_chflags(vp, cred, pmp->pm_uid, false)); if (error) goto bad; if (vap->va_flags & SF_ARCHIVED) @@ -441,7 +434,6 @@ msdosfs_setattr(void *v) } bad: - fstrans_done(vp->v_mount); return error; } @@ -478,7 +470,6 @@ msdosfs_read(void *v) if (uio->uio_offset >= dep->de_FileSize) return (0); - fstrans_start(vp->v_mount, FSTRANS_SHARED); if (vp->v_type == VREG) { const int advice = IO_ADV_DECODE(ap->a_ioflag); @@ -489,7 +480,7 @@ msdosfs_read(void *v) if (bytelen == 0) break; error = ubc_uiomove(&vp->v_uobj, uio, bytelen, advice, - UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp)); + UBC_READ | UBC_PARTIALOK | UBC_VNODE_FLAGS(vp)); if (error) break; } @@ -503,7 +494,6 @@ msdosfs_read(void *v) on = uio->uio_offset & pmp->pm_crbomask; n = MIN(pmp->pm_bpcluster - on, uio->uio_resid); if (uio->uio_offset >= dep->de_FileSize) { - fstrans_done(vp->v_mount); return (0); } /* file size (and hence diff) may be up to 4GB */ @@ -540,7 +530,6 @@ out: error = uerror; } bad: - fstrans_done(vp->v_mount); return (error); } @@ -599,7 +588,6 @@ msdosfs_write(void *v) if (uio->uio_offset + uio->uio_resid > MSDOSFS_FILESIZE_MAX) return (EFBIG); - fstrans_start(vp->v_mount, FSTRANS_SHARED); /* * If the offset we are starting the write at is beyond the end of * the file, then they've done a seek. Unix filesystems allow @@ -608,7 +596,6 @@ msdosfs_write(void *v) */ if (uio->uio_offset > dep->de_FileSize) { if ((error = deextend(dep, uio->uio_offset, cred)) != 0) { - fstrans_done(vp->v_mount); return (error); } } @@ -637,7 +624,7 @@ msdosfs_write(void *v) rem = round_page(dep->de_FileSize) - dep->de_FileSize; if (rem > 0) ubc_zerorange(&vp->v_uobj, (off_t)dep->de_FileSize, - rem, UBC_UNMAP_FLAG(vp)); + rem, UBC_VNODE_FLAGS(vp)); extended = 1; } @@ -646,7 +633,7 @@ msdosfs_write(void *v) bytelen = uio->uio_resid; error = ubc_uiomove(&vp->v_uobj, uio, bytelen, - IO_ADV_DECODE(ioflag), UBC_WRITE | UBC_UNMAP_FLAG(vp)); + IO_ADV_DECODE(ioflag), UBC_WRITE | UBC_VNODE_FLAGS(vp)); if (error) break; @@ -656,7 +643,7 @@ msdosfs_write(void *v) */ if (!async && oldoff >> 16 != uio->uio_offset >> 16) { - mutex_enter(vp->v_interlock); + rw_enter(vp->v_uobj.vmobjlock, RW_WRITER); error = VOP_PUTPAGES(vp, (oldoff >> 16) << 16, (uio->uio_offset >> 16) << 16, PGO_CLEANIT | PGO_LAZY); @@ -666,7 +653,7 @@ msdosfs_write(void *v) /* set final size */ uvm_vnp_setsize(vp, dep->de_FileSize); if (error == 0 && ioflag & IO_SYNC) { - mutex_enter(vp->v_interlock); + rw_enter(vp->v_uobj.vmobjlock, RW_WRITER); error = VOP_PUTPAGES(vp, trunc_page(oldoff), round_page(oldoff + bytelen), PGO_CLEANIT | PGO_SYNCIO); } @@ -685,7 +672,6 @@ errexit: uio->uio_resid = resid; } else if ((ioflag & IO_SYNC) == IO_SYNC) error = deupdat(dep, 1); - fstrans_done(vp->v_mount); KASSERT(vp->v_size == dep->de_FileSize); return (error); } @@ -731,7 +717,7 @@ msdosfs_update(struct vnode *vp, const struct timespec *acc, int msdosfs_remove(void *v) { - struct vop_remove_args /* { + struct vop_remove_v2_args /* { struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; @@ -740,14 +726,13 @@ msdosfs_remove(void *v) struct denode *ddep = VTODE(ap->a_dvp); int error; - fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED); if (ap->a_vp->v_type == VDIR) error = EPERM; else error = removede(ddep, dep); #ifdef MSDOSFS_DEBUG - printf("msdosfs_remove(), dep %p, v_usecount %d\n", - dep, ap->a_vp->v_usecount); + printf("msdosfs_remove(), dep %p, usecount %d\n", + dep, vrefcnt(ap->a_vp)); #endif VN_KNOTE(ap->a_vp, NOTE_DELETE); VN_KNOTE(ap->a_dvp, NOTE_WRITE); @@ -756,8 +741,7 @@ msdosfs_remove(void *v) else vput(ap->a_vp); /* causes msdosfs_inactive() to be called * via vrele() */ - vput(ap->a_dvp); - fstrans_done(ap->a_dvp->v_mount); + return (error); } @@ -832,7 +816,6 @@ msdosfs_rename(void *v) struct vnode *tdvp = ap->a_tdvp; struct vnode *fvp = ap->a_fvp; struct vnode *fdvp = ap->a_fdvp; - struct mount *mp = fdvp->v_mount; struct componentname *tcnp = ap->a_tcnp; struct componentname *fcnp = ap->a_fcnp; struct denode *ip, *xp, *dp, *zp; @@ -910,7 +893,6 @@ abortit: } VN_KNOTE(fdvp, NOTE_WRITE); /* XXXLUKEM/XXX: right place? */ - fstrans_start(mp, FSTRANS_SHARED); /* * When the target exists, both the directory * and target vnodes are returned locked. @@ -997,7 +979,6 @@ abortit: * file/directory. */ if ((error = uniqdosname(VTODE(tdvp), tcnp, toname)) != 0) { - fstrans_done(mp); goto abortit; } @@ -1013,7 +994,6 @@ abortit: VOP_UNLOCK(fdvp); vrele(ap->a_fvp); vrele(tdvp); - fstrans_done(mp); return (error); } if (fvp == NULL) { @@ -1025,7 +1005,6 @@ abortit: vput(fdvp); vrele(ap->a_fvp); vrele(tdvp); - fstrans_done(mp); return 0; } VOP_UNLOCK(fdvp); @@ -1140,7 +1119,6 @@ bad: ip->de_flag &= ~DE_RENAME; vrele(fdvp); vrele(fvp); - fstrans_done(mp); return (error); /* XXX: uuuh */ @@ -1197,7 +1175,6 @@ msdosfs_mkdir(void *v) struct buf *bp; int async = pdep->de_pmp->pm_mountp->mnt_flag & MNT_ASYNC; - fstrans_start(ap->a_dvp->v_mount, FSTRANS_SHARED); /* * If this is the root directory and there is no space left we * can't do anything. This is because the root directory can not @@ -1280,27 +1257,24 @@ msdosfs_mkdir(void *v) goto bad; VN_KNOTE(ap->a_dvp, NOTE_WRITE | NOTE_LINK); *ap->a_vpp = DETOV(dep); - fstrans_done(ap->a_dvp->v_mount); return (0); bad: clusterfree(pmp, newcluster, NULL); bad2: - fstrans_done(ap->a_dvp->v_mount); return (error); } int msdosfs_rmdir(void *v) { - struct vop_rmdir_args /* { + struct vop_rmdir_v2_args /* { struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; - struct mount *mp = dvp->v_mount; struct componentname *cnp = ap->a_cnp; struct denode *ip, *dp; int error; @@ -1311,11 +1285,9 @@ msdosfs_rmdir(void *v) * No rmdir "." please. */ if (dp == ip) { - vrele(dvp); - vput(vp); + vrele(vp); return (EINVAL); } - fstrans_start(mp, FSTRANS_SHARED); /* * Verify the directory is empty (and valid). * (Rmdir ".." won't be valid since @@ -1345,8 +1317,6 @@ msdosfs_rmdir(void *v) */ VN_KNOTE(dvp, NOTE_WRITE | NOTE_LINK); cache_purge(dvp); - vput(dvp); - dvp = NULL; /* * Truncate the directory that is being deleted. */ @@ -1354,10 +1324,7 @@ msdosfs_rmdir(void *v) cache_purge(vp); out: VN_KNOTE(vp, NOTE_DELETE); - if (dvp) - vput(dvp); vput(vp); - fstrans_done(mp); return (error); } @@ -1394,6 +1361,7 @@ msdosfs_readdir(void *v) int ncookies = 0, nc = 0; off_t offset, uio_off; int chksum = -1; + uint16_t namlen; #ifdef MSDOSFS_DEBUG printf("msdosfs_readdir(): vp %p, uio %p, cred %p, eofflagp %p\n", @@ -1423,7 +1391,6 @@ msdosfs_readdir(void *v) uio->uio_resid = count; uio_off = uio->uio_offset; - fstrans_start(ap->a_vp->v_mount, FSTRANS_SHARED); /* Allocate a temporary dirent buffer. */ dirbuf = malloc(sizeof(struct dirent), M_MSDOSFSTMP, M_WAITOK | M_ZERO); @@ -1541,7 +1508,10 @@ msdosfs_readdir(void *v) if (pmp->pm_flags & MSDOSFSMNT_SHORTNAME) continue; chksum = win2unixfn((struct winentry *)dentp, - dirbuf, chksum); + dirbuf, chksum, &namlen, + pmp->pm_flags & MSDOSFSMNT_UTF8); + if (chksum != -1) + dirbuf->d_namlen = namlen; continue; } @@ -1584,6 +1554,7 @@ msdosfs_readdir(void *v) pmp->pm_flags & MSDOSFSMNT_SHORTNAME); else dirbuf->d_name[dirbuf->d_namlen] = 0; + namlen = dirbuf->d_namlen; chksum = -1; dirbuf->d_reclen = _DIRENT_SIZE(dirbuf); if (uio->uio_resid < dirbuf->d_reclen) { @@ -1627,7 +1598,6 @@ out: bad: free(dirbuf, M_MSDOSFSTMP); - fstrans_done(ap->a_vp->v_mount); return (error); } @@ -1795,7 +1765,7 @@ msdosfs_pathconf(void *v) *ap->a_retval = 32; return (0); default: - return (EINVAL); + return genfs_pathconf(ap); } /* NOTREACHED */ } @@ -1814,7 +1784,6 @@ msdosfs_fsync(void *v) int wait; int error; - fstrans_start(vp->v_mount, FSTRANS_LAZY); wait = (ap->a_flags & FSYNC_WAIT) != 0; error = vflushbuf(vp, ap->a_flags); if (error == 0 && (ap->a_flags & FSYNC_DATAONLY) == 0) @@ -1828,7 +1797,6 @@ msdosfs_fsync(void *v) error = VOP_IOCTL(devvp, DIOCCACHESYNC, &l, FWRITE, curlwp->l_cred); } - fstrans_done(vp->v_mount); return (error); } @@ -1879,6 +1847,7 @@ const struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_open_desc, genfs_nullop }, /* open */ { &vop_close_desc, msdosfs_close }, /* close */ { &vop_access_desc, msdosfs_access }, /* access */ + { &vop_accessx_desc, genfs_accessx }, /* accessx */ { &vop_getattr_desc, msdosfs_getattr }, /* getattr */ { &vop_setattr_desc, msdosfs_setattr }, /* setattr */ { &vop_read_desc, msdosfs_read }, /* read */ diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index 8539a11f1..047f1d414 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfsmount.h,v 1.20 2014/07/08 09:21:52 hannken Exp $ */ +/* $NetBSD: msdosfsmount.h,v 1.21 2016/01/30 09:59:27 mlelstv Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -78,11 +78,12 @@ struct msdosfs_args { #define MSDOSFSMNT_NOWIN95 4 /* Completely ignore Win95 entries */ #define MSDOSFSMNT_GEMDOSFS 8 /* This is a GEMDOS-flavour */ #define MSDOSFSMNT_VERSIONED 16 /* Struct is versioned */ +#define MSDOSFSMNT_UTF8 32 /* Use UTF8 filenames */ /* All flags above: */ #define MSDOSFSMNT_MNTOPT \ (MSDOSFSMNT_SHORTNAME|MSDOSFSMNT_LONGNAME|MSDOSFSMNT_NOWIN95 \ - |MSDOSFSMNT_GEMDOSFS|MSDOSFSMNT_VERSIONED) + |MSDOSFSMNT_GEMDOSFS|MSDOSFSMNT_VERSIONED|MSDOSFSMNT_UTF8) #define MSDOSFSMNT_RONLY 0x80000000 /* mounted read-only */ #define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */ @@ -90,7 +91,7 @@ struct msdosfs_args { #define MSDOSFSMNT_BITS "\177\20" \ "b\00shortname\0b\01longname\0b\02nowin95\0b\03gemdosfs\0b\04mntversioned\0" \ - "b\037ronly\0b\036waitonfat\0b\035fatmirror\0" + "b\05utf8\0b\037ronly\0b\036waitonfat\0b\035fatmirror\0" #ifdef _KERNEL #include diff --git a/sys/fs/udf/ecma167-udf.h b/sys/fs/udf/ecma167-udf.h index c52b99de8..09472266c 100644 --- a/sys/fs/udf/ecma167-udf.h +++ b/sys/fs/udf/ecma167-udf.h @@ -1,8 +1,8 @@ -/* $NetBSD: ecma167-udf.h,v 1.14 2011/07/07 17:45:38 reinoud Exp $ */ +/* $NetBSD: ecma167-udf.h,v 1.16 2018/08/09 13:49:30 reinoud Exp $ */ /*- - * Copyright (c) 2003, 2004, 2005, 2006, 2008, 2009 - * Reinoud Zandijk * + * Copyright (c) 2003, 2004, 2005, 2006, 2008, 2009, 2017, 2018 + * Reinoud Zandijk * Copyright (c) 2001, 2002 Scott Long * All rights reserved. * @@ -203,14 +203,14 @@ union icb { /* short/long/ext extent have flags encoded in length */ -#define UDF_EXT_ALLOCATED (0<<30) -#define UDF_EXT_FREED (1<<30) -#define UDF_EXT_ALLOCATED_BUT_NOT_USED (1<<30) -#define UDF_EXT_FREE (2<<30) -#define UDF_EXT_REDIRECT (3<<30) -#define UDF_EXT_FLAGS(len) ((len) & (3<<30)) -#define UDF_EXT_LEN(len) ((len) & ((1<<30)-1)) -#define UDF_EXT_MAXLEN ((1<<30)-1) +#define UDF_EXT_ALLOCATED (0U<<30) +#define UDF_EXT_FREED (1U<<30) +#define UDF_EXT_ALLOCATED_BUT_NOT_USED (1U<<30) +#define UDF_EXT_FREE (2U<<30) +#define UDF_EXT_REDIRECT (3U<<30) +#define UDF_EXT_FLAGS(len) ((len) & (3U<<30)) +#define UDF_EXT_LEN(len) ((len) & ((1U<<30)-1)) +#define UDF_EXT_MAXLEN ((1U<<30)-1) /* Character set spec [1/7.2.1] */ @@ -264,7 +264,10 @@ struct regid { struct icb_tag { uint32_t prev_num_dirs; uint16_t strat_type; - uint8_t strat_param[2]; + union { + uint8_t strat_param[2]; + uint16_t strat_param16; + }; uint16_t max_num_entries; uint8_t reserved; uint8_t file_type; @@ -682,7 +685,10 @@ struct impl_extattr_entry { struct extattr_entry hdr; uint32_t iu_l; struct regid imp_id; - uint8_t data[1]; + union { + uint8_t data[1]; + uint16_t data16; + }; } __packed; @@ -832,4 +838,3 @@ union dscrptr { #endif /* !_FS_UDF_ECMA167_UDF_H_ */ - diff --git a/sys/fs/udf/udf.h b/sys/fs/udf/udf.h index 8b1edb9ee..5b950094a 100644 --- a/sys/fs/udf/udf.h +++ b/sys/fs/udf/udf.h @@ -1,4 +1,4 @@ -/* $NetBSD: udf.h,v 1.50 2015/08/24 08:31:56 hannken Exp $ */ +/* $NetBSD: udf.h,v 1.52 2016/05/24 09:55:57 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -76,7 +76,7 @@ extern int udf_verbose; #define UDF_DEBUG_RESERVE 0x1000000 /* initial value of udf_verbose */ -#define UDF_DEBUGGING 0 +#define UDF_DEBUGGING (0) #ifdef UDF_DEBUG #define DPRINTF(name, arg) { \ @@ -252,6 +252,7 @@ struct udf_strategy { int (*read_logvol_dscr) (struct udf_strat_args *args); int (*write_logvol_dscr) (struct udf_strat_args *args); void (*queuebuf) (struct udf_strat_args *args); + void (*sync_caches) (struct udf_strat_args *args); void (*discstrat_init) (struct udf_strat_args *args); void (*discstrat_finish) (struct udf_strat_args *args); }; @@ -417,11 +418,12 @@ struct udf_node { #define IN_SYNCED 0x0200 /* node is being used by sync */ #define IN_CALLBACK_ULK 0x0400 /* node will be unlocked by callback */ #define IN_NODE_REBUILD 0x0800 /* node is rebuild */ +#define IN_NO_DELETE 0x1000 /* node is not to be deleted */ #define IN_FLAGBITS \ "\10\1IN_ACCESS\2IN_CHANGE\3IN_UPDATE\4IN_MODIFY\5IN_MODIFIED" \ "\6IN_ACCESSED\7IN_RENAME\10IN_DELETED\11IN_LOCKED\12IN_SYNCED" \ - "\13IN_CALLBACK_ULK\14IN_NODE_REBUILD" + "\13IN_CALLBACK_ULK\14IN_NODE_REBUILD\15IN_NO_DELETE" #endif /* !_FS_UDF_UDF_H_ */ diff --git a/sys/fs/udf/udf_allocation.c b/sys/fs/udf/udf_allocation.c index 63a5b895b..d4602c0c8 100644 --- a/sys/fs/udf/udf_allocation.c +++ b/sys/fs/udf/udf_allocation.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_allocation.c,v 1.38 2015/08/24 08:30:17 hannken Exp $ */ +/* $NetBSD: udf_allocation.c,v 1.41 2020/04/23 21:47:08 ad Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.38 2015/08/24 08:30:17 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_allocation.c,v 1.41 2020/04/23 21:47:08 ad Exp $"); #endif /* not lint */ @@ -1001,7 +1001,7 @@ udf_bitmap_check_trunc_free(struct udf_bitmap *bitmap, uint32_t to_trunc) bitval = (1 << bit); if (!(*bpos & bitval)) seq_free = 0; - offset++; to_trunc--; + to_trunc--; bit++; if (bit == 8) { bpos++; @@ -1540,8 +1540,7 @@ udf_trunc_metadatapart(struct udf_mount *ump, uint32_t num_lb) *sizepos = udf_rw32(*sizepos) - to_trunc; /* realloc bitmap for better memory usage */ - new_sbd = realloc(sbd, inf_len, M_UDFVOLD, - M_CANFAIL | M_WAITOK); + new_sbd = realloc(sbd, inf_len, M_UDFVOLD, M_WAITOK); if (new_sbd) { /* update pointers */ ump->metadata_unalloc_dscr = new_sbd; @@ -2679,7 +2678,7 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size) #if 0 /* zero append space in buffer */ ubc_zerorange(&vp->v_uobj, old_size, - new_size - old_size, UBC_UNMAP_FLAG(vp)); + new_size - old_size, UBC_VNODE_FLAGS(vp)); #endif udf_node_sanity_check(udf_node, &new_inflen, &new_lbrec); @@ -2785,7 +2784,7 @@ udf_grow_node(struct udf_node *udf_node, uint64_t new_size) /* TODO zero appened space in buffer! */ /* using ubc_zerorange(&vp->v_uobj, old_size, */ - /* new_size - old_size, UBC_UNMAP_FLAG(vp)); ? */ + /* new_size - old_size, UBC_VNODE_FLAGS(vp)); ? */ } memset(&s_ad, 0, sizeof(struct long_ad)); @@ -2956,7 +2955,7 @@ udf_shrink_node(struct udf_node *udf_node, uint64_t new_size) /* TODO zero appened space in buffer! */ /* using ubc_zerorange(&vp->v_uobj, old_size, */ - /* old_size - new_size, UBC_UNMAP_FLAG(vp)); ? */ + /* old_size - new_size, UBC_VNODE_FLAGS(vp)); ? */ /* set new size for uvm */ uvm_vnp_setsize(vp, new_size); diff --git a/sys/fs/udf/udf_mount.h b/sys/fs/udf/udf_mount.h index bf02be7dd..897b9f90c 100644 --- a/sys/fs/udf/udf_mount.h +++ b/sys/fs/udf/udf_mount.h @@ -1,4 +1,4 @@ -/* $NetBSD: udf_mount.h,v 1.3 2006/02/02 15:52:23 reinoud Exp $ */ +/* $NetBSD: udf_mount.h,v 1.4 2019/10/16 21:52:22 maya Exp $ */ /* * Copyright (c) 2006 Reinoud Zandijk @@ -12,13 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed for the - * NetBSD Project. See http://www.NetBSD.org/ for - * information about NetBSD. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES diff --git a/sys/fs/udf/udf_readwrite.c b/sys/fs/udf/udf_readwrite.c index 57c4ee2d0..2956133bd 100644 --- a/sys/fs/udf/udf_readwrite.c +++ b/sys/fs/udf/udf_readwrite.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_readwrite.c,v 1.11 2011/06/12 03:35:55 rmind Exp $ */ +/* $NetBSD: udf_readwrite.c,v 1.12 2016/05/24 09:55:57 reinoud Exp $ */ /* * Copyright (c) 2007, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_readwrite.c,v 1.11 2011/06/12 03:35:55 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_readwrite.c,v 1.12 2016/05/24 09:55:57 reinoud Exp $"); #endif /* not lint */ @@ -695,6 +695,19 @@ udf_discstrat_queuebuf(struct udf_mount *ump, struct buf *nestbuf) } +void +udf_synchronise_caches(struct udf_mount *ump) +{ + struct udf_strategy *strategy = ump->strategy; + struct udf_strat_args args; + + KASSERT(strategy); + args.ump = ump; + + (strategy->sync_caches)(&args); +} + + void udf_discstrat_init(struct udf_mount *ump) { diff --git a/sys/fs/udf/udf_rename.c b/sys/fs/udf/udf_rename.c index 6f413caf1..a7be766eb 100644 --- a/sys/fs/udf/udf_rename.c +++ b/sys/fs/udf/udf_rename.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_rename.c,v 1.12 2014/11/10 19:44:08 riz Exp $ */ +/* $NetBSD: udf_rename.c,v 1.13 2020/01/17 20:08:08 ad Exp $ */ /* * Copyright (c) 2013 Reinoud Zandijk @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: udf_rename.c,v 1.12 2014/11/10 19:44:08 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_rename.c,v 1.13 2020/01/17 20:08:08 ad Exp $"); #include #include @@ -465,7 +465,7 @@ udf_gro_lookup(struct mount *mp, struct vnode *dvp, return ENOENT; DPRINTF(LOOKUP, ("udf_gro_lookup found '%s'\n", name)); - error = udf_get_node(dir_node->ump, &icb_loc, &res_node); + error = udf_get_node(dir_node->ump, &icb_loc, &res_node, LK_EXCLUSIVE); if (error) return error; *vp_ret = res_node->vnode; @@ -598,7 +598,8 @@ udf_gro_genealogy(struct mount *mp, kauth_cred_t cred, */ DPRINTF(NODE, ("\tgetting the parent node\n")); VOP_UNLOCK(vp); - error = udf_get_node(ump, &parent_loc, &parent_node); + error = udf_get_node(ump, &parent_loc, &parent_node, + LK_EXCLUSIVE); vrele(vp); if (error) return error; diff --git a/sys/fs/udf/udf_strat_bootstrap.c b/sys/fs/udf/udf_strat_bootstrap.c index 0fcbf8fbb..f4990a135 100644 --- a/sys/fs/udf/udf_strat_bootstrap.c +++ b/sys/fs/udf/udf_strat_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_bootstrap.c,v 1.4 2014/11/10 18:46:33 maxv Exp $ */ +/* $NetBSD: udf_strat_bootstrap.c,v 1.5 2016/05/24 09:55:57 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_bootstrap.c,v 1.4 2014/11/10 18:46:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_bootstrap.c,v 1.5 2016/05/24 09:55:57 reinoud Exp $"); #endif /* not lint */ @@ -115,6 +115,14 @@ udf_queuebuf_bootstrap(struct udf_strat_args *args) VOP_STRATEGY(ump->devvp, buf); } + +static void +udf_sync_caches_bootstrap(struct udf_strat_args *args) +{ + /* empty */ +} + + static void udf_discstrat_init_bootstrap(struct udf_strat_args *args) { @@ -137,6 +145,7 @@ struct udf_strategy udf_strat_bootstrap = udf_read_logvol_dscr_bootstrap, udf_write_logvol_dscr_bootstrap, udf_queuebuf_bootstrap, + udf_sync_caches_bootstrap, udf_discstrat_init_bootstrap, udf_discstrat_finish_bootstrap }; diff --git a/sys/fs/udf/udf_strat_direct.c b/sys/fs/udf/udf_strat_direct.c index 251efb727..fa8a90e3a 100644 --- a/sys/fs/udf/udf_strat_direct.c +++ b/sys/fs/udf/udf_strat_direct.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_direct.c,v 1.13 2015/10/06 08:57:34 hannken Exp $ */ +/* $NetBSD: udf_strat_direct.c,v 1.14 2016/05/24 09:55:57 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.13 2015/10/06 08:57:34 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_direct.c,v 1.14 2016/05/24 09:55:57 reinoud Exp $"); #endif /* not lint */ @@ -392,6 +392,15 @@ udf_queue_buf_direct(struct udf_strat_args *args) } +static void +udf_sync_caches_direct(struct udf_strat_args *args) +{ + struct udf_mount *ump = args->ump; + + udf_mmc_synchronise_caches(ump); +} + + static void udf_discstrat_init_direct(struct udf_strat_args *args) { @@ -441,6 +450,7 @@ struct udf_strategy udf_strat_direct = udf_read_nodedscr_direct, udf_write_nodedscr_direct, udf_queue_buf_direct, + udf_sync_caches_direct, udf_discstrat_init_direct, udf_discstrat_finish_direct }; diff --git a/sys/fs/udf/udf_strat_rmw.c b/sys/fs/udf/udf_strat_rmw.c index dddcc829f..84171a582 100644 --- a/sys/fs/udf/udf_strat_rmw.c +++ b/sys/fs/udf/udf_strat_rmw.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_rmw.c,v 1.27 2015/10/06 08:57:34 hannken Exp $ */ +/* $NetBSD: udf_strat_rmw.c,v 1.28 2016/05/24 09:55:57 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.27 2015/10/06 08:57:34 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_rmw.c,v 1.28 2016/05/24 09:55:57 reinoud Exp $"); #endif /* not lint */ @@ -1005,6 +1005,16 @@ udf_queuebuf_rmw(struct udf_strat_args *args) /* --------------------------------------------------------------------- */ +static void +udf_sync_caches_rmw(struct udf_strat_args *args) +{ + struct udf_mount *ump = args->ump; + + udf_mmc_synchronise_caches(ump); +} + +/* --------------------------------------------------------------------- */ + static void udf_shedule_read_callback(struct buf *buf) { @@ -1495,6 +1505,7 @@ struct udf_strategy udf_strat_rmw = udf_read_nodedscr_rmw, udf_write_nodedscr_rmw, udf_queuebuf_rmw, + udf_sync_caches_rmw, udf_discstrat_init_rmw, udf_discstrat_finish_rmw }; diff --git a/sys/fs/udf/udf_strat_sequential.c b/sys/fs/udf/udf_strat_sequential.c index 89a8aee65..aba3f138c 100644 --- a/sys/fs/udf/udf_strat_sequential.c +++ b/sys/fs/udf/udf_strat_sequential.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_strat_sequential.c,v 1.14 2015/10/06 08:57:34 hannken Exp $ */ +/* $NetBSD: udf_strat_sequential.c,v 1.15 2016/05/24 09:55:57 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.14 2015/10/06 08:57:34 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_strat_sequential.c,v 1.15 2016/05/24 09:55:57 reinoud Exp $"); #endif /* not lint */ @@ -86,6 +86,7 @@ struct strat_private { kmutex_t discstrat_mutex; /* disc strategy */ int run_thread; /* thread control */ + int sync_req; /* thread control */ int cur_queue; struct disk_strategy old_strategy_setting; @@ -287,6 +288,30 @@ udf_queuebuf_seq(struct udf_strat_args *args) /* --------------------------------------------------------------------- */ +static void +udf_sync_caches_seq(struct udf_strat_args *args) +{ + struct udf_mount *ump = args->ump; + struct strat_private *priv = PRIV(ump); + + /* we might be called during unmount inadvertedly, be on safe side */ + if (!priv) + return; + + /* signal our thread that there might be something to do */ + priv->sync_req = 1; + cv_signal(&priv->discstrat_cv); + + mutex_enter(&priv->discstrat_mutex); + while (priv->sync_req) { + cv_timedwait(&priv->discstrat_cv, + &priv->discstrat_mutex, hz/8); + } + mutex_exit(&priv->discstrat_mutex); +} + +/* --------------------------------------------------------------------- */ + /* TODO convert to lb_size */ static void udf_VAT_mapping_update(struct udf_mount *ump, struct buf *buf, uint32_t lb_map) @@ -539,7 +564,7 @@ udf_discstrat_thread(void *arg) empty = 1; mutex_enter(&priv->discstrat_mutex); - while (priv->run_thread || !empty) { + while (priv->run_thread || !empty || priv->sync_req) { /* process the current selected queue */ udf_doshedule(ump); empty = (bufq_peek(priv->queues[UDF_SHED_READING]) == NULL); @@ -547,9 +572,16 @@ udf_discstrat_thread(void *arg) empty &= (bufq_peek(priv->queues[UDF_SHED_SEQWRITING]) == NULL); /* wait for more if needed */ - if (empty) + if (empty) { + if (priv->sync_req) { + /* on sync, we need to simulate a read->write transition */ + udf_mmc_synchronise_caches(ump); + priv->cur_queue = UDF_SHED_READING; + priv->sync_req = 0; + } cv_timedwait(&priv->discstrat_cv, &priv->discstrat_mutex, hz/8); + } } mutex_exit(&priv->discstrat_mutex); @@ -621,6 +653,7 @@ udf_discstrat_init_seq(struct udf_strat_args *args) /* create our disk strategy thread */ priv->run_thread = 1; + priv->sync_req = 0; if (kthread_create(PRI_NONE, 0 /* KTHREAD_MPSAFE*/, NULL /* cpu_info*/, udf_discstrat_thread, ump, &priv->queue_lwp, "%s", "udf_rw")) { @@ -673,6 +706,7 @@ struct udf_strategy udf_strat_sequential = udf_read_logvol_dscr_seq, udf_write_logvol_dscr_seq, udf_queuebuf_seq, + udf_sync_caches_seq, udf_discstrat_init_seq, udf_discstrat_finish_seq }; diff --git a/sys/fs/udf/udf_subr.c b/sys/fs/udf/udf_subr.c index 9e2b9f6de..19ad2d7d4 100644 --- a/sys/fs/udf/udf_subr.c +++ b/sys/fs/udf/udf_subr.c @@ -1,9 +1,9 @@ -/* $NetBSD: udf_subr.c,v 1.132 2015/08/24 08:31:56 hannken Exp $ */ +/* $NetBSD: udf_subr.c,v 1.152 2021/01/11 22:02:28 skrll Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -12,7 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. @@ -23,13 +23,13 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * */ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.132 2015/08/24 08:31:56 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_subr.c,v 1.152 2021/01/11 22:02:28 skrll Exp $"); #endif /* not lint */ @@ -319,27 +319,25 @@ udf_setup_writeparams(struct udf_mount *ump) } -int -udf_synchronise_caches(struct udf_mount *ump) +void +udf_mmc_synchronise_caches(struct udf_mount *ump) { struct mmc_op mmc_op; - DPRINTF(CALL, ("udf_synchronise_caches()\n")); + DPRINTF(CALL, ("udf_mcc_synchronise_caches()\n")); if (ump->vfs_mountp->mnt_flag & MNT_RDONLY) - return 0; + return; /* discs are done now */ if (ump->discinfo.mmc_class == MMC_CLASS_DISC) - return 0; + return; memset(&mmc_op, 0, sizeof(struct mmc_op)); mmc_op.operation = MMC_OP_SYNCHRONISECACHE; /* ignore return code */ (void) VOP_IOCTL(ump->devvp, MMCOP, &mmc_op, FKIOCTL, NOCRED); - - return 0; } /* --------------------------------------------------------------------- */ @@ -811,7 +809,7 @@ udf_lock_node(struct udf_node *udf_node, int flag, char const *fname, const int if (ret == EWOULDBLOCK) { DPRINTF(LOCKING, ( "udf_lock_node: udf_node %p would block " "wanted at %s:%d, previously locked at %s:%d\n", - udf_node, fname, lineno, + udf_node, fname, lineno, udf_node->lock_fname, udf_node->lock_lineno)); } } @@ -930,7 +928,7 @@ udf_read_anchors(struct udf_mount *ump) positions[1] = track_end-256; positions[2] = track_end; positions[3] = track_start+512; /* [UDF 2.60/6.11.2] */ - /* XXX shouldn't +512 be prefered above +256 for compat with Roxio CD */ + /* XXX shouldn't +512 be preferred over +256 for compat with Roxio CD */ ok = 0; anchorsp = ump->anchors; @@ -946,7 +944,7 @@ udf_read_anchors(struct udf_mount *ump) /* VATs are only recorded on sequential media, but initialise */ ump->first_possible_vat_location = track_start + 2; - ump->last_possible_vat_location = track_end + last_track.packet_size; + ump->last_possible_vat_location = track_end; return ok; } @@ -984,7 +982,7 @@ udf_get_record_vpart(struct udf_mount *ump, int udf_c_type) } -/* +/* * BUGALERT: some rogue implementations use random physical partition * numbers to break other implementations so lookup the number. */ @@ -1235,7 +1233,7 @@ udf_retrieve_lvint(struct udf_mount *ump) /* are we linking to a new piece? */ if (dscr && lvint->next_extent.len) { - len = udf_rw32(lvint->next_extent.len); + len = udf_rw32(lvint->next_extent.len); lbnum = udf_rw32(lvint->next_extent.loc); if (trace_len >= UDF_LVDINT_SEGMENTS-1) { @@ -1281,7 +1279,7 @@ udf_loose_lvint_history(struct udf_mount *ump) uint32_t out_ext, out_wpos, out_len; uint32_t lb_num; uint32_t len, start; - int ext, minext, extlen, cnt, cpy_len, dscr_type; + int ext, sumext, extlen, cnt, cpy_len, dscr_type; int losing; int error; @@ -1289,18 +1287,29 @@ udf_loose_lvint_history(struct udf_mount *ump) /* search smallest extent */ trace = &ump->lvint_trace[0]; - minext = trace->end - trace->start; + sumext = trace->end - trace->start; for (ext = 1; ext < UDF_LVDINT_SEGMENTS; ext++) { trace = &ump->lvint_trace[ext]; extlen = trace->end - trace->start; if (extlen == 0) break; - minext = MIN(minext, extlen); + sumext += extlen; } - losing = MIN(minext, UDF_LVINT_LOSSAGE); - /* no sense wiping all */ - if (losing == minext) - losing--; + + /* just one element? its not legal but be bug compatible */ + if (sumext == 1) { + /* overwrite the only entry */ + DPRINTF(VOLUMES, ("\tLinux bugcompat overwriting sole entry\n")); + trace = &ump->lvint_trace[0]; + trace->wpos = 0; + return 0; + } + + losing = MIN(sumext, UDF_LVINT_LOSSAGE); + + /* no sense wiping too much */ + if (sumext == UDF_LVINT_LOSSAGE) + losing = UDF_LVINT_LOSSAGE/2; DPRINTF(VOLUMES, ("\tlosing %d entries\n", losing)); @@ -1437,7 +1446,6 @@ udf_writeout_lvint(struct udf_mount *ump, int lvflag) DPRINTF(VOLUMES, ("writing out logvol integrity descriptor\n")); -again: /* get free space in last chunk */ trace = ump->lvint_trace; while (trace->wpos > (trace->end - trace->start)) { @@ -1465,11 +1473,20 @@ again: if (space < 1) { if (lvflag & UDF_APPENDONLY_LVINT) return EROFS; + /* loose history by re-writing extents */ error = udf_loose_lvint_history(ump); if (error) return error; - goto again; + + trace = ump->lvint_trace; + while (trace->wpos > (trace->end - trace->start)) + trace++; + space = (trace->end - trace->start) - trace->wpos; + DPRINTF(VOLUMES, ("new try: write start = %d, end = %d, " + "pos = %d, wpos = %d, " + "space = %d\n", trace->start, trace->end, + trace->pos, trace->wpos, space)); } /* update our integrity descriptor to identify us and timestamp it */ @@ -1573,7 +1590,7 @@ udf_read_physical_partition_spacetables(struct udf_mount *ump) if (partd == NULL) continue; parthdr = &partd->_impl_use.part_hdr; - + len = udf_rw32(parthdr->unalloc_space_table.len); if (len) { printf("UDF mount: space tables not supported\n"); @@ -1632,7 +1649,7 @@ udf_read_physical_partition_spacetables(struct udf_mount *ump) if (partd == NULL) continue; parthdr = &partd->_impl_use.part_hdr; - + len = udf_rw32(parthdr->freed_space_table.len); if (len) { printf("UDF mount: space tables not supported\n"); @@ -1673,6 +1690,14 @@ udf_write_physical_partition_spacetables(struct udf_mount *ump, int waitfor) DPRINTF(VOLUMES, ("Write unalloc. space bitmap %d\n", lb_num + ptov)); dscr = (union dscrptr *) ump->part_unalloc_dscr[phys_part]; + + /* force a sane minimum for descriptors CRC length */ + /* see UDF 2.3.1.2 and 2.3.8.1 */ + KASSERT(udf_rw16(dscr->sbd.tag.id) == TAGID_SPACE_BITMAP); + if (udf_rw16(dscr->sbd.tag.desc_crc_len) == 0) + dscr->sbd.tag.desc_crc_len = udf_rw16(8); + + /* write out space bitmap */ error = udf_write_phys_dscr_sync(ump, NULL, UDF_C_DSCR, (union dscrptr *) dscr, ptov + lb_num, lb_num); @@ -1699,6 +1724,14 @@ udf_write_physical_partition_spacetables(struct udf_mount *ump, int waitfor) DPRINTF(VOLUMES, ("Write freed space bitmap %d\n", lb_num + ptov)); dscr = (union dscrptr *) ump->part_freed_dscr[phys_part]; + + /* force a sane minimum for descriptors CRC length */ + /* see UDF 2.3.1.2 and 2.3.8.1 */ + KASSERT(udf_rw16(dscr->sbd.tag.id) == TAGID_SPACE_BITMAP); + if (udf_rw16(dscr->sbd.tag.desc_crc_len) == 0) + dscr->sbd.tag.desc_crc_len = udf_rw16(8); + + /* write out space bitmap */ error = udf_write_phys_dscr_sync(ump, NULL, UDF_C_DSCR, (union dscrptr *) dscr, ptov + lb_num, lb_num); @@ -1738,7 +1771,7 @@ udf_read_metadata_partition_spacetable(struct udf_mount *ump) "%"PRIu64" bytes\n", inflen)); /* allocate space for bitmap */ - dscr = malloc(inflen, M_UDFVOLD, M_CANFAIL | M_WAITOK); + dscr = malloc(inflen, M_UDFVOLD, M_WAITOK); if (!dscr) return ENOMEM; @@ -1981,7 +2014,7 @@ udf_process_vds(struct udf_mount *ump) { DPRINTF(VOLUMES, ("\t%d -> %d(%d) type %d\n", log_part, raw_phys_part, phys_part, pmap_type)); - + if (phys_part == UDF_PARTITIONS) return EINVAL; if (pmap_type == UDF_VTOP_TYPE_UNKNOWN) @@ -2097,7 +2130,7 @@ udf_process_vds(struct udf_mount *ump) { snprintb(bits, sizeof(bits), UDFONERROR_BITS, ump->lvreadwrite); DPRINTF(VOLUMES, ("\tactions on logvol errors %s\n", bits)); - DPRINTF(VOLUMES, ("\tselected sheduler `%s`\n", + DPRINTF(VOLUMES, ("\tselected sheduler `%s`\n", (ump->strategy == &udf_strat_direct) ? "Direct" : (ump->strategy == &udf_strat_sequential) ? "Sequential" : (ump->strategy == &udf_strat_rmw) ? "RMW" : "UNKNOWN!")); @@ -2281,12 +2314,12 @@ udf_create_parentfid(struct udf_mount *ump, struct fileid_desc *fid, * (a) inside the file's (e)fe in the length of the extended attribute area * before the allocation descriptors/filedata * - * (b) in a file referenced by (e)fe->ext_attr_icb and + * (b) in a file referenced by (e)fe->ext_attr_icb and * * (c) in the e(fe)'s associated stream directory that can hold various * sub-files. In the stream directory a few fixed named subfiles are reserved * for NT/Unix ACL's and OS/2 attributes. - * + * * NOTE: Extended attributes are read randomly but allways written * *atomicaly*. For ACL's this interface is propably different but not known * to me yet. @@ -2554,7 +2587,7 @@ udf_extattr_insert_internal(struct udf_mount *ump, union dscrptr *dscr, /* --------------------------------------------------------------------- */ -static int +static int udf_update_lvid_from_vat_extattr(struct udf_node *vat_node) { struct udf_mount *ump; @@ -2590,7 +2623,7 @@ udf_update_lvid_from_vat_extattr(struct udf_node *vat_node) return error; /* paranoia */ - if (a_l != sizeof(*implext) -1 + udf_rw32(implext->iu_l) + sizeof(lvext)) { + if (a_l != sizeof(*implext) -2 + udf_rw32(implext->iu_l) + sizeof(lvext)) { DPRINTF(VOLUMES, ("VAT LVExtension size doesn't compute\n")); return EINVAL; } @@ -2621,7 +2654,7 @@ udf_update_lvid_from_vat_extattr(struct udf_node *vat_node) } -static int +static int udf_update_vat_extattr_from_lvid(struct udf_node *vat_node) { struct udf_mount *ump; @@ -2706,7 +2739,7 @@ udf_vat_write(struct udf_node *vat_node, uint8_t *blob, int size, uint32_t offse /* realloc */ new_vat_table = realloc(ump->vat_table, ump->vat_table_alloc_len + UDF_VAT_CHUNKSIZE, - M_UDFVOLD, M_WAITOK | M_CANFAIL); + M_UDFVOLD, M_WAITOK); if (!new_vat_table) { printf("udf_vat_write: can't extent VAT, out of mem\n"); return ENOMEM; @@ -2833,7 +2866,6 @@ udf_writeout_vat(struct udf_mount *ump) if (error) printf("udf_writeout_vat: error writing VAT node!\n"); out: - return error; } @@ -2904,8 +2936,7 @@ udf_check_for_vat(struct udf_node *vat_node) ((vat_length + UDF_VAT_CHUNKSIZE-1) / UDF_VAT_CHUNKSIZE) * UDF_VAT_CHUNKSIZE; - vat_table = malloc(vat_table_alloc_len, M_UDFVOLD, - M_CANFAIL | M_WAITOK); + vat_table = malloc(vat_table_alloc_len, M_UDFVOLD, M_WAITOK); if (vat_table == NULL) { printf("allocation of %d bytes failed for VAT\n", vat_table_alloc_len); @@ -2974,7 +3005,7 @@ udf_check_for_vat(struct udf_node *vat_node) lvinfo->min_udf_readver = vat->min_udf_readver; lvinfo->min_udf_writever = vat->min_udf_writever; lvinfo->max_udf_writever = vat->max_udf_writever; - + udf_update_logvolname(ump, vat->logvol_id); } @@ -2995,6 +3026,10 @@ udf_check_for_vat(struct udf_node *vat_node) ump->logvol_integrity->integrity_type = udf_rw32(UDF_INTEGRITY_CLOSED); ump->logvol_integrity->time = *mtime; + /* if we're updating, free old allocated space */ + if (ump->vat_table) + free(ump->vat_table, M_UDFVOLD); + ump->vat_table_len = vat_length; ump->vat_table_alloc_len = vat_table_alloc_len; ump->vat_table = vat_table; @@ -3017,49 +3052,71 @@ out: static int udf_search_vat(struct udf_mount *ump, union udf_pmap *mapping) { - struct udf_node *vat_node; + struct udf_node *vat_node, *accepted_vat_node; struct long_ad icb_loc; - uint32_t early_vat_loc, vat_loc; + uint32_t early_vat_loc, late_vat_loc, vat_loc; int error; /* mapping info not needed */ mapping = mapping; - vat_loc = ump->last_possible_vat_location; - early_vat_loc = vat_loc - 256; /* 8 blocks of 32 sectors */ + DPRINTF(VOLUMES, ("Searching VAT\n")); - DPRINTF(VOLUMES, ("1) last possible %d, early_vat_loc %d \n", - vat_loc, early_vat_loc)); - early_vat_loc = MAX(early_vat_loc, ump->first_possible_vat_location); + /* + * Start reading forward in blocks from the first possible vat + * location. If not found in this block, start again a bit before + * until we get a hit. + */ + late_vat_loc = ump->last_possible_vat_location; + early_vat_loc = MAX(late_vat_loc - 64, ump->first_possible_vat_location); - DPRINTF(VOLUMES, ("2) last possible %d, early_vat_loc %d \n", - vat_loc, early_vat_loc)); - - /* start looking from the end of the range */ + DPRINTF(VOLUMES, ("\tfull range %d to %d\n", early_vat_loc, late_vat_loc)); + accepted_vat_node = NULL; do { - DPRINTF(VOLUMES, ("Checking for VAT at sector %d\n", vat_loc)); - icb_loc.loc.part_num = udf_rw16(UDF_VTOP_RAWPART); - icb_loc.loc.lb_num = udf_rw32(vat_loc); + vat_loc = early_vat_loc; + DPRINTF(VOLUMES, ("\tchecking range %d to %d\n", + early_vat_loc, late_vat_loc)); + do { + DPRINTF(VOLUMES, ("\t\tChecking for VAT at sector %d\n", + vat_loc)); + icb_loc.loc.part_num = udf_rw16(UDF_VTOP_RAWPART); + icb_loc.loc.lb_num = udf_rw32(vat_loc); - error = udf_get_node(ump, &icb_loc, &vat_node); - if (!error) { - error = udf_check_for_vat(vat_node); - DPRINTFIF(VOLUMES, !error, - ("VAT accepted at %d\n", vat_loc)); - if (!error) - break; - } - if (vat_node) { - vput(vat_node->vnode); - vat_node = NULL; - } - vat_loc--; /* walk backwards */ - } while (vat_loc >= early_vat_loc); + error = udf_get_node(ump, &icb_loc, &vat_node, + LK_EXCLUSIVE); + if (!error) { + error = udf_check_for_vat(vat_node); + vat_node->i_flags = 0; /* reset access */ + } + if (!error) { + DPRINTFIF(VOLUMES, !error, + ("VAT candidate accepted at %d\n", + vat_loc)); + if (accepted_vat_node) + vput(accepted_vat_node->vnode); + accepted_vat_node = vat_node; + accepted_vat_node->i_flags |= IN_NO_DELETE; + vat_node = NULL; + } + if (vat_node) + vput(vat_node->vnode); + vat_loc++; /* walk forward */ + } while (vat_loc < late_vat_loc); + if (accepted_vat_node) + break; - /* keep our VAT node around */ - if (vat_node) { - UDF_SET_SYSTEMFILE(vat_node->vnode); - ump->vat_node = vat_node; + early_vat_loc = MAX(early_vat_loc - 64, ump->first_possible_vat_location); + late_vat_loc = MIN(early_vat_loc + 64, ump->last_possible_vat_location); + } while (late_vat_loc > ump->first_possible_vat_location); + + /* keep our last accepted VAT node around */ + if (accepted_vat_node) { + /* revert no delete flag again to avoid potential side effects */ + accepted_vat_node->i_flags &= ~IN_NO_DELETE; + + UDF_SET_SYSTEMFILE(accepted_vat_node->vnode); + ump->vat_node = accepted_vat_node; + return 0; } return error; @@ -3141,7 +3198,8 @@ udf_read_metadata_nodes(struct udf_mount *ump, union udf_pmap *mapping) DPRINTF(VOLUMES, ("Metadata file\n")); icb_loc.loc.lb_num = pmm->meta_file_lbn; - error = udf_get_node(ump, &icb_loc, &ump->metadata_node); + error = udf_get_node(ump, &icb_loc, &ump->metadata_node, + LK_EXCLUSIVE); if (ump->metadata_node) { vp = ump->metadata_node->vnode; UDF_SET_SYSTEMFILE(vp); @@ -3150,7 +3208,8 @@ udf_read_metadata_nodes(struct udf_mount *ump, union udf_pmap *mapping) icb_loc.loc.lb_num = pmm->meta_mirror_file_lbn; if (icb_loc.loc.lb_num != -1) { DPRINTF(VOLUMES, ("Metadata copy file\n")); - error = udf_get_node(ump, &icb_loc, &ump->metadatamirror_node); + error = udf_get_node(ump, &icb_loc, &ump->metadatamirror_node, + LK_EXCLUSIVE); if (ump->metadatamirror_node) { vp = ump->metadatamirror_node->vnode; UDF_SET_SYSTEMFILE(vp); @@ -3160,7 +3219,8 @@ udf_read_metadata_nodes(struct udf_mount *ump, union udf_pmap *mapping) icb_loc.loc.lb_num = pmm->meta_bitmap_file_lbn; if (icb_loc.loc.lb_num != -1) { DPRINTF(VOLUMES, ("Metadata bitmap file\n")); - error = udf_get_node(ump, &icb_loc, &ump->metadatabitmap_node); + error = udf_get_node(ump, &icb_loc, &ump->metadatabitmap_node, + LK_EXCLUSIVE); if (ump->metadatabitmap_node) { vp = ump->metadatabitmap_node->vnode; UDF_SET_SYSTEMFILE(vp); @@ -3341,7 +3401,7 @@ udf_read_rootdirs(struct udf_mount *ump) /* try to read in the rootdir */ dir_loc = &ump->fileset_desc->rootdir_icb; - error = udf_get_node(ump, dir_loc, &rootdir_node); + error = udf_get_node(ump, dir_loc, &rootdir_node, LK_EXCLUSIVE); if (error) return ENOENT; @@ -3354,7 +3414,8 @@ udf_read_rootdirs(struct udf_mount *ump) dir_loc = &ump->fileset_desc->streamdir_icb; if (udf_rw32(dir_loc->len)) { printf("udf_read_rootdirs: streamdir defined "); - error = udf_get_node(ump, dir_loc, &streamdir_node); + error = udf_get_node(ump, dir_loc, &streamdir_node, + LK_EXCLUSIVE); if (error) { printf("but error in streamdir reading\n"); } else { @@ -3674,6 +3735,21 @@ udf_open_logvol(struct udf_mount *ump) /* determine data and metadata tracks again */ error = udf_search_writing_tracks(ump); + + if (ump->lvclose & UDF_WRITE_VAT) { + /* + * we writeout the VAT to get a self-sustained session + * for fsck + */ + DPRINTF(VOLUMES, ("lvclose & UDF_WRITE_VAT\n")); + + /* write out the VAT data and all its descriptors */ + DPRINTF(VOLUMES, ("writeout vat_node\n")); + udf_writeout_vat(ump); + + /* force everything to be synchronized on the device */ + (void) udf_synchronise_caches(ump); + } } /* mark it open */ @@ -3722,15 +3798,6 @@ udf_close_logvol(struct udf_mount *ump, int mntflags) /* write out the VAT data and all its descriptors */ DPRINTF(VOLUMES, ("writeout vat_node\n")); udf_writeout_vat(ump); - (void) vflushbuf(ump->vat_node->vnode, FSYNC_WAIT); - - (void) VOP_FSYNC(ump->vat_node->vnode, - FSCRED, FSYNC_WAIT, 0, 0); - - if (ump->lvclose & UDF_CLOSE_SESSION) { - DPRINTF(VOLUMES, ("udf_close_logvol: closing session " - "as requested\n")); - } /* at least two DVD packets and 3 CD-R packets */ nvats = 32; @@ -3765,6 +3832,9 @@ udf_close_logvol(struct udf_mount *ump, int mntflags) if (!error) nok++; } + /* force everything to be synchronized on the device */ + (void) udf_synchronise_caches(ump); + if (nok < 14) { /* arbitrary; but at least one or two CD frames */ printf("writeout of at least 14 VATs failed\n"); @@ -3776,6 +3846,8 @@ udf_close_logvol(struct udf_mount *ump, int mntflags) /* finish closing of session */ if (ump->lvclose & UDF_CLOSE_SESSION) { + DPRINTF(VOLUMES, ("udf_close_logvol: closing session " + "as requested\n")); error = udf_validate_session_start(ump); if (error) return error; @@ -3995,6 +4067,7 @@ static const struct genfs_ops udf_genfsops = { .gop_alloc = udf_gop_alloc, .gop_write = genfs_gop_write_rwmap, .gop_markupdate = udf_gop_markupdate, + .gop_putrange = genfs_gop_putrange, }; @@ -4046,7 +4119,7 @@ static uint32_t unix_mode_to_udf_perm(mode_t mode) { uint32_t perm; - + perm = ((mode & S_IRWXO) ); perm |= ((mode & S_IRWXG) << 2); perm |= ((mode & S_IRWXU) << 4); @@ -4350,7 +4423,7 @@ udf_getownership(struct udf_node *udf_node, uid_t *uidp, gid_t *gidp) uid = (uid_t)udf_rw32(efe->uid); gid = (gid_t)udf_rw32(efe->gid); } - + /* do the uid/gid translation game */ if (uid == (uid_t) -1) uid = ump->mount_args.anon_uid; @@ -4478,7 +4551,7 @@ udf_dirhash_fill(struct udf_node *dir_node) * */ -int +int udf_lookup_name_in_dir(struct vnode *vp, const char *name, int namelen, struct long_ad *icb_loc, int *found) { @@ -4486,7 +4559,8 @@ udf_lookup_name_in_dir(struct vnode *vp, const char *name, int namelen, struct dirhash *dirh; struct dirhash_entry *dirh_ep; struct fileid_desc *fid; - struct dirent *dirent; + struct dirent *dirent, *s_dirent; + struct charspec osta_charspec; uint64_t diroffset; uint32_t lb_size; int hit, error; @@ -4504,18 +4578,28 @@ udf_lookup_name_in_dir(struct vnode *vp, const char *name, int namelen, dirh = dir_node->dir_hash; /* allocate temporary space for fid */ - lb_size = udf_rw32(dir_node->ump->logical_vol->lb_size); - fid = malloc(lb_size, M_UDFTEMP, M_WAITOK); - dirent = malloc(sizeof(struct dirent), M_UDFTEMP, M_WAITOK); + lb_size = udf_rw32(dir_node->ump->logical_vol->lb_size); + fid = malloc(lb_size, M_UDFTEMP, M_WAITOK); + dirent = malloc(sizeof(struct dirent), M_UDFTEMP, M_WAITOK); + s_dirent = malloc(sizeof(struct dirent), M_UDFTEMP, M_WAITOK); DPRINTF(DIRHASH, ("dirhash_lookup looking for `%*.*s`\n", namelen, namelen, name)); + /* convert given unix name to canonical unix name */ + udf_osta_charset(&osta_charspec); + unix_to_udf_name((char *) fid->data, &fid->l_fi, + name, namelen, &osta_charspec); + udf_to_unix_name(s_dirent->d_name, NAME_MAX, + (char *) fid->data, fid->l_fi, + &osta_charspec); + s_dirent->d_namlen = strlen(s_dirent->d_name); + /* search our dirhash hits */ memset(icb_loc, 0, sizeof(*icb_loc)); dirh_ep = NULL; for (;;) { - hit = dirhash_lookup(dirh, name, namelen, &dirh_ep); + hit = dirhash_lookup(dirh, s_dirent->d_name, s_dirent->d_namlen, &dirh_ep); /* if no hit, abort the search */ if (!hit) break; @@ -4532,16 +4616,7 @@ udf_lookup_name_in_dir(struct vnode *vp, const char *name, int namelen, dirent->d_namlen, dirent->d_namlen, dirent->d_name)); /* see if its our entry */ -#ifdef DIAGNOSTIC - if (dirent->d_namlen != namelen) { - printf("WARNING: dirhash_lookup() returned wrong " - "d_namelen: %d and ought to be %d\n", - dirent->d_namlen, namelen); - printf("\tlooked for `%s' and got `%s'\n", - name, dirent->d_name); - } -#endif - if (strncmp(dirent->d_name, name, namelen) == 0) { + if (strncmp(dirent->d_name, s_dirent->d_name, s_dirent->d_namlen) == 0) { *found = 1; *icb_loc = fid->icb; break; @@ -4549,6 +4624,7 @@ udf_lookup_name_in_dir(struct vnode *vp, const char *name, int namelen, } free(fid, M_UDFTEMP); free(dirent, M_UDFTEMP); + free(s_dirent, M_UDFTEMP); dirhash_put(dir_node->dir_hash); @@ -4718,12 +4794,11 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node, struct dirhash_entry *dirh_ep; struct file_entry *fe = dir_node->fe; struct fileid_desc *fid; - struct dirent *dirent; + struct dirent *dirent, *s_dirent; + struct charspec osta_charspec; uint64_t diroffset; uint32_t lb_size, fidsize; int found, error; - char const *name = cnp->cn_nameptr; - int namelen = cnp->cn_namelen; int hit, refcnt; /* get our dirhash and make sure its read in */ @@ -4740,16 +4815,26 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node, assert(dir_node->efe); } - /* allocate temporary space for fid */ - lb_size = udf_rw32(dir_node->ump->logical_vol->lb_size); - fid = malloc(lb_size, M_UDFTEMP, M_WAITOK); - dirent = malloc(sizeof(struct dirent), M_UDFTEMP, M_WAITOK); + /* allocate temporary space for fid and dirents */ + lb_size = udf_rw32(dir_node->ump->logical_vol->lb_size); + fid = malloc(lb_size, M_UDFTEMP, M_WAITOK); + dirent = malloc(sizeof(struct dirent), M_UDFTEMP, M_WAITOK); + s_dirent = malloc(sizeof(struct dirent), M_UDFTEMP, M_WAITOK); + + /* convert given unix name to canonical unix name */ + udf_osta_charset(&osta_charspec); + unix_to_udf_name((char *) fid->data, &fid->l_fi, + cnp->cn_nameptr, cnp->cn_namelen, &osta_charspec); + udf_to_unix_name(s_dirent->d_name, NAME_MAX, + (char *) fid->data, fid->l_fi, + &osta_charspec); + s_dirent->d_namlen = strlen(s_dirent->d_name); /* search our dirhash hits */ found = 0; dirh_ep = NULL; for (;;) { - hit = dirhash_lookup(dirh, name, namelen, &dirh_ep); + hit = dirhash_lookup(dirh, s_dirent->d_name, s_dirent->d_namlen, &dirh_ep); /* if no hit, abort the search */ if (!hit) break; @@ -4763,8 +4848,8 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node, break; /* see if its our entry */ - KASSERT(dirent->d_namlen == namelen); - if (strncmp(dirent->d_name, name, namelen) == 0) { + KASSERT(dirent->d_namlen == s_dirent->d_namlen); + if (strncmp(dirent->d_name, s_dirent->d_name, s_dirent->d_namlen) == 0) { found = 1; break; } @@ -4788,7 +4873,7 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node, /* write out */ error = vn_rdwr(UIO_WRITE, dir_node->vnode, - fid, fidsize, diroffset, + fid, fidsize, diroffset, UIO_SYSSPACE, IO_ALTSEMANTICS | IO_NODELOCKED, FSCRED, NULL, NULL); if (error) @@ -4845,6 +4930,7 @@ udf_dir_detach(struct udf_mount *ump, struct udf_node *dir_node, error_out: free(fid, M_UDFTEMP); free(dirent, M_UDFTEMP); + free(s_dirent, M_UDFTEMP); dirhash_put(dir_node->dir_hash); @@ -4950,7 +5036,7 @@ udf_dir_update_rootentry(struct udf_mount *ump, struct udf_node *dir_node, /* write out */ error = vn_rdwr(UIO_WRITE, dir_node->vnode, - fid, fidsize, diroffset, + fid, fidsize, diroffset, UIO_SYSSPACE, IO_ALTSEMANTICS | IO_NODELOCKED, FSCRED, NULL, NULL); @@ -5154,7 +5240,7 @@ udf_dir_attach(struct udf_mount *ump, struct udf_node *dir_node, /* writeout FID/update parent directory */ error = vn_rdwr(UIO_WRITE, dvp, - fid, chosen_size, chosen_fid_pos, + fid, chosen_size, chosen_fid_pos, UIO_SYSSPACE, IO_ALTSEMANTICS | IO_NODELOCKED, FSCRED, NULL, NULL); @@ -5336,7 +5422,7 @@ udf_loadvnode(struct mount *mp, struct vnode *vp, /* choose this one */ last_fe_icb_loc = icb_loc; - + /* record and process/update (ext)fentry */ if (dscr_type == TAGID_FENTRY) { if (udf_node->fe) @@ -5544,16 +5630,18 @@ udf_loadvnode(struct mount *mp, struct vnode *vp, int udf_get_node(struct udf_mount *ump, struct long_ad *node_icb_loc, - struct udf_node **udf_noderes) + struct udf_node **udf_noderes, int lktype) { int error; struct vnode *vp; + *udf_noderes = NULL; + error = vcache_get(ump->vfs_mountp, &node_icb_loc->loc, sizeof(node_icb_loc->loc), &vp); if (error) return error; - error = vn_lock(vp, LK_EXCLUSIVE); + error = vn_lock(vp, lktype); if (error) { vrele(vp); return error; @@ -5696,7 +5784,7 @@ udf_dispose_node(struct udf_node *udf_node) int udf_newvnode(struct mount *mp, struct vnode *dvp, struct vnode *vp, - struct vattr *vap, kauth_cred_t cred, + struct vattr *vap, kauth_cred_t cred, void *extra, size_t *key_len, const void **new_key) { union dscrptr *dscr; @@ -5840,7 +5928,7 @@ udf_newvnode(struct mount *mp, struct vnode *dvp, struct vnode *vp, gid = parent_gid; udf_setownership(udf_node, uid, gid); - *key_len = sizeof(udf_node->loc.loc);; + *key_len = sizeof(udf_node->loc.loc); *new_key = &udf_node->loc.loc; return 0; @@ -5855,7 +5943,7 @@ udf_create_node(struct vnode *dvp, struct vnode **vpp, struct vattr *vap, struct udf_mount *ump = dir_node->ump; int error; - error = vcache_new(dvp->v_mount, dvp, vap, cnp->cn_cred, vpp); + error = vcache_new(dvp->v_mount, dvp, vap, cnp->cn_cred, NULL, vpp); if (error) return error; @@ -5880,6 +5968,7 @@ udf_create_node(struct vnode *dvp, struct vnode **vpp, struct vattr *vap, /* adjust file count */ udf_adjust_filecount(udf_node, 1); + cache_enter(dvp, *vpp, cnp->cn_nameptr, cnp->cn_namelen, cnp->cn_flags); return 0; } @@ -5914,6 +6003,9 @@ udf_delete_node(struct udf_node *udf_node) struct long_ad *loc; int extnr, lvint, dummy; + if (udf_node->i_flags & IN_NO_DELETE) + return; + /* paranoia check on integrity; should be open!; we could panic */ lvint = udf_rw32(udf_node->ump->logvol_integrity->integrity_type); if (lvint == UDF_INTEGRITY_CLOSED) @@ -6342,7 +6434,11 @@ udf_sync_pass(struct udf_mount *ump, kauth_cred_t cred, int pass, int *ndirty) static bool udf_sync_selector(void *cl, struct vnode *vp) { - struct udf_node *udf_node = VTOI(vp); + struct udf_node *udf_node; + + KASSERT(mutex_owned(vp->v_interlock)); + + udf_node = VTOI(vp); if (vp->v_vflag & VV_SYSTEM) return false; @@ -6352,7 +6448,7 @@ udf_sync_selector(void *cl, struct vnode *vp) return false; if ((udf_node->i_flags & (IN_ACCESSED | IN_UPDATE | IN_MODIFIED)) == 0) return false; - if (LIST_EMPTY(&vp->v_dirtyblkhd) && UVM_OBJ_IS_CLEAN(&vp->v_uobj)) + if (LIST_EMPTY(&vp->v_dirtyblkhd) && (vp->v_iflag & VI_ONWORKLST) == 0) return false; return true; @@ -6398,7 +6494,7 @@ recount: udf_sync_pass(ump, cred, 3, &ndirty); DPRINTF(SYNC, ("counted num dirty pending blocks %d\n", ndirty)); - + if (ndirty) { /* 1/4 second wait */ kpause("udfsync2", false, hz/4, NULL); @@ -6424,7 +6520,7 @@ recount: /* * Read and write file extent in/from the buffer. * - * The splitup of the extent into seperate request-buffers is to minimise + * The splitup of the extent into separate request-buffers is to minimise * copying around as much as possible. * * block based file reading and writing @@ -6438,21 +6534,26 @@ udf_read_internal(struct udf_node *node, uint8_t *blob) struct extfile_entry *efe = node->efe; uint64_t inflen; uint32_t sector_size; - uint8_t *pos; + uint8_t *srcpos; int icbflags, addr_type; /* get extent and do some paranoia checks */ ump = node->ump; sector_size = ump->discinfo.sector_size; + /* + * XXX there should be real bounds-checking logic here, + * in case ->l_ea or ->inf_len contains nonsense. + */ + if (fe) { inflen = udf_rw64(fe->inf_len); - pos = &fe->data[0] + udf_rw32(fe->l_ea); + srcpos = &fe->data[0] + udf_rw32(fe->l_ea); icbflags = udf_rw16(fe->icbtag.flags); } else { assert(node->efe); inflen = udf_rw64(efe->inf_len); - pos = &efe->data[0] + udf_rw32(efe->l_ea); + srcpos = &efe->data[0] + udf_rw32(efe->l_ea); icbflags = udf_rw16(efe->icbtag.flags); } addr_type = icbflags & UDF_ICB_TAG_FLAGS_ALLOC_MASK; @@ -6462,8 +6563,8 @@ udf_read_internal(struct udf_node *node, uint8_t *blob) assert(inflen < sector_size); /* copy out info */ - memset(blob, 0, sector_size); - memcpy(blob, pos, inflen); + memcpy(blob, srcpos, inflen); + memset(&blob[inflen], 0, sector_size - inflen); return 0; } diff --git a/sys/fs/udf/udf_subr.h b/sys/fs/udf/udf_subr.h index 7146c1353..b17a5890f 100644 --- a/sys/fs/udf/udf_subr.h +++ b/sys/fs/udf/udf_subr.h @@ -1,4 +1,4 @@ -/* $NetBSD: udf_subr.h,v 1.19 2013/07/07 19:49:44 reinoud Exp $ */ +/* $NetBSD: udf_subr.h,v 1.21 2020/01/17 20:08:08 ad Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -40,7 +40,8 @@ int udf_search_tracks(struct udf_mount *ump, struct udf_args *args, int *first_tracknr, int *last_tracknr); int udf_search_writing_tracks(struct udf_mount *ump); int udf_setup_writeparams(struct udf_mount *ump); -int udf_synchronise_caches(struct udf_mount *ump); +void udf_mmc_synchronise_caches(struct udf_mount *ump); +void udf_synchronise_caches(struct udf_mount *ump); /* tags operations */ int udf_fidsize(struct fileid_desc *fid); @@ -131,7 +132,7 @@ uint64_t udf_advance_uniqueid(struct udf_mount *ump); void udf_lock_node(struct udf_node *udf_node, int flag, char const *fname, const int lineno); void udf_unlock_node(struct udf_node *udf_node, int flag); -int udf_get_node(struct udf_mount *ump, struct long_ad *icbloc, struct udf_node **noderes); +int udf_get_node(struct udf_mount *ump, struct long_ad *icbloc, struct udf_node **noderes, int); int udf_writeout_node(struct udf_node *udf_node, int waitfor); int udf_dispose_node(struct udf_node *node); diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 8674b7263..866aed9c7 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_vfsops.c,v 1.71 2015/08/24 08:31:56 hannken Exp $ */ +/* $NetBSD: udf_vfsops.c,v 1.80 2020/04/14 12:47:44 reinoud Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -28,7 +28,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_vfsops.c,v 1.71 2015/08/24 08:31:56 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_vfsops.c,v 1.80 2020/04/14 12:47:44 reinoud Exp $"); #endif /* not lint */ @@ -79,8 +79,6 @@ MALLOC_JUSTDEFINE(M_UDFVOLD, "UDF volspace", "UDF volume space descriptors"); MALLOC_JUSTDEFINE(M_UDFTEMP, "UDF temp", "UDF scrap space"); struct pool udf_node_pool; -static struct sysctllog *udf_sysctl_log; - /* internal functions */ static int udf_mountfs(struct vnode *, struct mount *, struct lwp *, struct udf_args *); @@ -118,7 +116,7 @@ struct vfsops udf_vfsops = { .vfs_mountroot = udf_mountroot, .vfs_snapshot = udf_snapshot, .vfs_extattrctl = vfs_stdextattrctl, - .vfs_suspendctl = (void *)eopnotsupp, + .vfs_suspendctl = genfs_suspendctl, .vfs_renamelock_enter = genfs_renamelock_enter, .vfs_renamelock_exit = genfs_renamelock_exit, .vfs_fsync = (void *)eopnotsupp, @@ -169,10 +167,34 @@ udf_done(void) */ #define UDF_VERBOSE_SYSCTLOPT 1 +/* + * XXX the "24" below could be dynamic, thereby eliminating one + * more instance of the "number to vfs" mapping problem, but + * "24" is the order as taken from sys/mount.h + */ +SYSCTL_SETUP(udf_sysctl_setup, "udf sysctl") +{ + const struct sysctlnode *node; + + sysctl_createv(clog, 0, NULL, &node, + CTLFLAG_PERMANENT, + CTLTYPE_NODE, "udf", + SYSCTL_DESCR("OSTA Universal File System"), + NULL, 0, NULL, 0, + CTL_VFS, 24, CTL_EOL); +#ifdef DEBUG + sysctl_createv(clog, 0, NULL, &node, + CTLFLAG_PERMANENT|CTLFLAG_READWRITE, + CTLTYPE_INT, "verbose", + SYSCTL_DESCR("Bitmask for filesystem debugging"), + NULL, 0, &udf_verbose, 0, + CTL_VFS, 24, UDF_VERBOSE_SYSCTLOPT, CTL_EOL); +#endif +} + static int udf_modcmd(modcmd_t cmd, void *arg) { - const struct sysctlnode *node; int error; switch (cmd) { @@ -180,31 +202,11 @@ udf_modcmd(modcmd_t cmd, void *arg) error = vfs_attach(&udf_vfsops); if (error != 0) break; - /* - * XXX the "24" below could be dynamic, thereby eliminating one - * more instance of the "number to vfs" mapping problem, but - * "24" is the order as taken from sys/mount.h - */ - sysctl_createv(&udf_sysctl_log, 0, NULL, &node, - CTLFLAG_PERMANENT, - CTLTYPE_NODE, "udf", - SYSCTL_DESCR("OSTA Universal File System"), - NULL, 0, NULL, 0, - CTL_VFS, 24, CTL_EOL); -#ifdef DEBUG - sysctl_createv(&udf_sysctl_log, 0, NULL, &node, - CTLFLAG_PERMANENT|CTLFLAG_READWRITE, - CTLTYPE_INT, "verbose", - SYSCTL_DESCR("Bitmask for filesystem debugging"), - NULL, 0, &udf_verbose, 0, - CTL_VFS, 24, UDF_VERBOSE_SYSCTLOPT, CTL_EOL); -#endif break; case MODULE_CMD_FINI: error = vfs_detach(&udf_vfsops); if (error != 0) break; - sysctl_teardown(&udf_sysctl_log); break; default: error = ENOTTY; @@ -277,7 +279,6 @@ static void udf_release_system_nodes(struct mount *mp) { struct udf_mount *ump = VFSTOUDF(mp); - int error; /* if we haven't even got an ump, dont bother */ if (!ump) @@ -294,10 +295,6 @@ udf_release_system_nodes(struct mount *mp) vrele(ump->metadatamirror_node->vnode); if (ump->metadatabitmap_node) vrele(ump->metadatabitmap_node->vnode); - - /* This flush should NOT write anything nor allow any node to remain */ - if ((error = vflush(ump->vfs_mountp, NULLVP, 0)) != 0) - panic("Failure to flush UDF system vnodes\n"); } @@ -361,7 +358,7 @@ udf_mount(struct mount *mp, const char *path, } if (bdevsw_lookup(devvp->v_rdev) == NULL) { vrele(devvp); - return ENXIO; + return ENXIO; } /* @@ -442,12 +439,14 @@ static bool udf_sanity_selector(void *cl, struct vnode *vp) { + KASSERT(mutex_owned(vp->v_interlock)); + vprint("", vp); if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) { printf(" is locked\n"); } - if (vp->v_usecount > 1) - printf(" more than one usecount %d\n", vp->v_usecount); + if (vrefcnt(vp) > 1) + printf(" more than one usecount %d\n", vrefcnt(vp)); return false; } @@ -518,6 +517,10 @@ udf_unmount(struct mount *mp, int mntflags) /* NOTE release system nodes should NOT write anything */ udf_release_system_nodes(mp); + /* This flush should NOT write anything nor allow any node to remain */ + if ((error = vflush(ump->vfs_mountp, NULLVP, 0)) != 0) + panic("Failure to flush UDF system vnodes\n"); + /* finalise disc strategy */ udf_discstrat_finish(ump); @@ -743,7 +746,7 @@ udf_start(struct mount *mp, int flags) /* --------------------------------------------------------------------- */ int -udf_root(struct mount *mp, struct vnode **vpp) +udf_root(struct mount *mp, int lktype, struct vnode **vpp) { struct vnode *vp; struct long_ad *dir_loc; @@ -754,12 +757,13 @@ udf_root(struct mount *mp, struct vnode **vpp) DPRINTF(CALL, ("udf_root called\n")); dir_loc = &ump->fileset_desc->rootdir_icb; - error = udf_get_node(ump, dir_loc, &root_dir); + error = udf_get_node(ump, dir_loc, &root_dir, lktype); + + if (error) + return error; if (!root_dir) error = ENOENT; - if (error) - return error; vp = root_dir->vnode; KASSERT(vp->v_vflag & VV_ROOT); @@ -893,7 +897,7 @@ udf_sync(struct mount *mp, int waitfor, kauth_cred_t cred) * (optional) TODO lookup why some sources state NFSv3 */ int -udf_vget(struct mount *mp, ino_t ino, +udf_vget(struct mount *mp, ino_t ino, int lktype, struct vnode **vpp) { DPRINTF(NOTIMPL, ("udf_vget called\n")); @@ -906,7 +910,7 @@ udf_vget(struct mount *mp, ino_t ino, * Lookup vnode for file handle specified */ int -udf_fhtovp(struct mount *mp, struct fid *fhp, +udf_fhtovp(struct mount *mp, struct fid *fhp, int lktype, struct vnode **vpp) { DPRINTF(NOTIMPL, ("udf_fhtovp called\n")); diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index f6374e16d..545039898 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: udf_vnops.c,v 1.101 2015/04/20 23:03:08 riastradh Exp $ */ +/* $NetBSD: udf_vnops.c,v 1.114 2020/06/27 17:29:18 christos Exp $ */ /* * Copyright (c) 2006, 2008 Reinoud Zandijk @@ -32,7 +32,7 @@ #include #ifndef lint -__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.101 2015/04/20 23:03:08 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.114 2020/06/27 17:29:18 christos Exp $"); #endif /* not lint */ @@ -71,16 +71,13 @@ __KERNEL_RCSID(0, "$NetBSD: udf_vnops.c,v 1.101 2015/04/20 23:03:08 riastradh Ex static int udf_do_readlink(struct udf_node *udf_node, uint64_t filesize, uint8_t *targetbuf, int *length); -/* externs */ -extern int prtactive; - /* implementations of vnode functions; table follows at end */ /* --------------------------------------------------------------------- */ int udf_inactive(void *v) { - struct vop_inactive_args /* { + struct vop_inactive_v2_args /* { struct vnode *a_vp; bool *a_recycle; } */ *ap = v; @@ -92,7 +89,6 @@ udf_inactive(void *v) if (udf_node == NULL) { DPRINTF(NODE, ("udf_inactive: inactive NULL UDF node\n")); - VOP_UNLOCK(vp); return 0; } @@ -115,14 +111,12 @@ udf_inactive(void *v) *ap->a_recycle = false; if ((refcnt == 0) && ((vp->v_vflag & VV_SYSTEM) == 0)) { *ap->a_recycle = true; - VOP_UNLOCK(vp); return 0; } /* write out its node */ if (udf_node->i_flags & (IN_CHANGE | IN_UPDATE | IN_MODIFIED)) udf_update(vp, NULL, NULL, NULL, 0); - VOP_UNLOCK(vp); return 0; } @@ -132,16 +126,16 @@ udf_inactive(void *v) int udf_reclaim(void *v) { - struct vop_reclaim_args /* { + struct vop_reclaim_v2_args /* { struct vnode *a_vp; } */ *ap = v; struct vnode *vp = ap->a_vp; struct udf_node *udf_node = VTOI(vp); int refcnt; + VOP_UNLOCK(vp); + DPRINTF(NODE, ("udf_reclaim called for node %p\n", udf_node)); - if (prtactive && vp->v_usecount > 1) - vprint("udf_reclaim(): pushing active", vp); if (udf_node == NULL) { DPRINTF(NODE, ("udf_reclaim(): null udfnode\n")); @@ -174,9 +168,6 @@ udf_reclaim(void *v) tsleep(&udf_node->outstanding_nodedscr, PRIBIO, "recl wait", hz/8); } - vcache_remove(vp->v_mount, &udf_node->loc.loc, - sizeof(udf_node->loc.loc)); - /* dispose all node knowledge */ udf_dispose_node(udf_node); @@ -257,7 +248,7 @@ udf_read(void *v) /* ubc, here we come, prepare to trap */ error = ubc_uiomove(uobj, uio, len, advice, - UBC_READ | UBC_PARTIALOK | UBC_UNMAP_FLAG(vp)); + UBC_READ | UBC_PARTIALOK | UBC_VNODE_FLAGS(vp)); if (error) break; } @@ -375,7 +366,7 @@ udf_write(void *v) /* ubc, here we come, prepare to trap */ error = ubc_uiomove(uobj, uio, len, advice, - UBC_WRITE | UBC_UNMAP_FLAG(vp)); + UBC_WRITE | UBC_VNODE_FLAGS(vp)); if (error) break; @@ -388,7 +379,7 @@ udf_write(void *v) */ if ((vp->v_type != VDIR) && (old_offset >> 16 != uio->uio_offset >> 16)) { - mutex_enter(vp->v_interlock); + rw_enter(vp->v_uobj.vmobjlock, RW_WRITER); error = VOP_PUTPAGES(vp, (old_offset >> 16) << 16, (uio->uio_offset >> 16) << 16, PGO_CLEANIT | PGO_LAZY); @@ -618,7 +609,7 @@ udf_readdir(void *v) if (uio->uio_resid < _DIRENT_SIZE(dirent)) break; - /* remember the last entry we transfered */ + /* remember the last entry we transferred */ transoffset = diroffset; /* skip deleted entries */ @@ -759,7 +750,8 @@ udf_lookup(void *v) if (error == 0) { DPRINTF(LOOKUP, ("\tfound '..'\n")); /* try to create/reuse the node */ - error = udf_get_node(ump, &icb_loc, &res_node); + error = udf_get_node(ump, &icb_loc, &res_node, + LK_EXCLUSIVE); if (!error) { DPRINTF(LOOKUP, @@ -811,7 +803,7 @@ udf_lookup(void *v) */ /* try to create/reuse the node */ - error = udf_get_node(ump, &icb_loc, &res_node); + error = udf_get_node(ump, &icb_loc, &res_node, LK_EXCLUSIVE); if (error) goto out; @@ -834,7 +826,7 @@ udf_lookup(void *v) udf_getownership(dir_node, &d_uid, &d_gid); error = kauth_authorize_vnode(cnp->cn_cred, KAUTH_VNODE_DELETE, res_node->vnode, - dir_node->vnode, genfs_can_sticky(cnp->cn_cred, + dir_node->vnode, genfs_can_sticky(dvp, cnp->cn_cred, d_uid, d_uid)); if (error) { error = EPERM; @@ -1049,7 +1041,7 @@ udf_chown(struct vnode *vp, uid_t new_uid, gid_t new_gid, /* check permissions */ error = kauth_authorize_vnode(cred, KAUTH_VNODE_CHANGE_OWNERSHIP, - vp, NULL, genfs_can_chown(cred, uid, gid, new_uid, new_gid)); + vp, NULL, genfs_can_chown(vp, cred, uid, gid, new_uid, new_gid)); if (error) return (error); @@ -1086,7 +1078,7 @@ udf_chmod(struct vnode *vp, mode_t mode, kauth_cred_t cred) /* check permissions */ error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_SECURITY, vp, - NULL, genfs_can_chmod(vp->v_type, cred, uid, gid, mode)); + NULL, genfs_can_chmod(vp, cred, uid, gid, mode)); if (error) return (error); @@ -1195,7 +1187,7 @@ udf_chtimes(struct vnode *vp, /* check permissions */ error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_TIMES, vp, - NULL, genfs_can_chtimes(vp, setattrflags, uid, cred)); + NULL, genfs_can_chtimes(vp, cred, uid, setattrflags)); if (error) return (error); @@ -1334,9 +1326,9 @@ udf_pathconf(void *v) #endif *ap->a_retval = bits; return 0; + default: + return genfs_pathconf(ap); } - - return EINVAL; } @@ -1387,15 +1379,15 @@ udf_close(void *v) udf_node = udf_node; /* shut up gcc */ if (!async && (vp->v_type != VDIR)) { - mutex_enter(vp->v_interlock); + rw_enter(vp->v_uobj.vmobjlock, RW_WRITER); error = VOP_PUTPAGES(vp, 0, 0, PGO_CLEANIT); if (error) return error; } mutex_enter(vp->v_interlock); - if (vp->v_usecount > 1) - udf_itimes(udf_node, NULL, NULL, NULL); + if (vrefcnt(vp) > 1) + udf_itimes(udf_node, NULL, NULL, NULL); mutex_exit(vp->v_interlock); return 0; @@ -1445,13 +1437,13 @@ udf_check_possible(struct vnode *vp, struct vattr *vap, mode_t mode) } static int -udf_check_permitted(struct vnode *vp, struct vattr *vap, mode_t mode, +udf_check_permitted(struct vnode *vp, struct vattr *vap, accmode_t accmode, kauth_cred_t cred) { /* ask the generic genfs_can_access to advice on security */ - return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(mode, - vp->v_type, vap->va_mode), vp, NULL, genfs_can_access(vp->v_type, - vap->va_mode, vap->va_uid, vap->va_gid, mode, cred)); + return kauth_authorize_vnode(cred, KAUTH_ACCESS_ACTION(accmode, + vp->v_type, vap->va_mode), vp, NULL, genfs_can_access(vp, cred, + vap->va_uid, vap->va_gid, vap->va_mode, NULL, accmode)); } int @@ -1459,12 +1451,12 @@ udf_access(void *v) { struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + accmode_t a_accmode; kauth_cred_t a_cred; struct proc *a_p; } */ *ap = v; struct vnode *vp = ap->a_vp; - mode_t mode = ap->a_mode; + accmode_t accmode = ap->a_accmode; kauth_cred_t cred = ap->a_cred; /* struct udf_node *udf_node = VTOI(vp); */ struct vattr vap; @@ -1476,11 +1468,11 @@ udf_access(void *v) if (error) return error; - error = udf_check_possible(vp, &vap, mode); + error = udf_check_possible(vp, &vap, accmode); if (error) return error; - error = udf_check_permitted(vp, &vap, mode, cred); + error = udf_check_permitted(vp, &vap, accmode, cred); return error; } @@ -1947,7 +1939,7 @@ udf_readlink(void *v) int udf_remove(void *v) { - struct vop_remove_args /* { + struct vop_remove_v2_args /* { struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; @@ -1978,7 +1970,6 @@ udf_remove(void *v) vrele(vp); else vput(vp); - vput(dvp); return error; } @@ -1988,7 +1979,7 @@ udf_remove(void *v) int udf_rmdir(void *v) { - struct vop_rmdir_args /* { + struct vop_rmdir_v2_args /* { struct vnode *a_dvp; struct vnode *a_vp; struct componentname *a_cnp; @@ -2001,12 +1992,11 @@ udf_rmdir(void *v) struct udf_mount *ump = dir_node->ump; int error, isempty; - DPRINTF(NOTIMPL, ("udf_rmdir '%s' called\n", cnp->cn_nameptr)); + DPRINTF(CALL, ("udf_rmdir '%s' called\n", cnp->cn_nameptr)); /* don't allow '.' to be deleted */ if (dir_node == udf_node) { - vrele(dvp); - vput(vp); + vrele(vp); return EINVAL; } @@ -2023,7 +2013,6 @@ udf_rmdir(void *v) dirhash_put(udf_node->dir_hash); if (!isempty) { - vput(dvp); vput(vp); return ENOTEMPTY; } @@ -2046,8 +2035,7 @@ udf_rmdir(void *v) } DPRINTFIF(NODE, error, ("\tgot error removing dir\n")); - /* unput the nodes and exit */ - vput(dvp); + /* put the node and exit */ vput(vp); return error; @@ -2191,6 +2179,7 @@ const struct vnodeopv_entry_desc udf_vnodeop_entries[] = { { &vop_open_desc, udf_open }, /* open */ { &vop_close_desc, udf_close }, /* close */ { &vop_access_desc, udf_access }, /* access */ + { &vop_accessx_desc, genfs_accessx }, /* accessx */ { &vop_getattr_desc, udf_getattr }, /* getattr */ { &vop_setattr_desc, udf_setattr }, /* setattr */ /* TODO chflags */ { &vop_read_desc, udf_read }, /* read */ diff --git a/tools/binutils/Makefile b/tools/binutils/Makefile index c0b4fa77a..4521cb336 100644 --- a/tools/binutils/Makefile +++ b/tools/binutils/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.24 2014/02/15 13:34:28 tsutsui Exp $ +# $NetBSD: Makefile,v 1.31 2020/04/04 00:47:30 christos Exp $ -.include +.include MODULE= binutils @@ -13,7 +13,7 @@ BRANDING?= \ CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \ --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \ - --disable-werror \ + --disable-werror --disable-initfini-array \ ${BRANDING} .if defined(__MINIX) && ! exists(${GNUHOSTDIST}/gas/m68k-parse.c) @@ -40,29 +40,11 @@ ALL_TARGET+= all-gprof INSTALL_TARGET+=install-gprof .endif -.if defined(__MINIX) && ${HAVE_GOLD:Uyes} != "no" -ALL_TARGET+= all-gold -INSTALL_TARGET+=install-gold - -CONFIGURE_ARGS+= \ - --enable-lto \ - --enable-plugins -# LSC: Here we use the MK variable, as we have to select the right default -# linker. Problem is, when Gold is not seen, USE_BITCODE is forced to -# "no". -.if ${MKBITCODE:Uno} == "yes" -CONFIGURE_ARGS+= \ - --enable-ld=yes \ - --enable-gold=default -.else -CONFIGURE_ARGS+= \ - --enable-ld=default \ - --enable-gold=yes -.endif # ${MKBITCODE:Uno} == "yes" -.endif # defined(__MINIX) .include "${.CURDIR}/../Makefile.gnuhost" -CCADDFLAGS= -I${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ +CCADDFLAGS= -I${GNUHOSTDIST}/include -I${DESTDIR}/usr/include +CCADDFLAGS+= -B${DESTDIR}/usr/lib/ +LDADDFLAGS= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib # Force avoiding possibly non-executable install-sh. CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d" @@ -83,7 +65,8 @@ native-binutils: .native/.configure_done CC=${CC:Q}' '${CCADDFLAGS:Q} \ CXX=${CXX:Q}' '${CCADDFLAGS:Q} \ CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \ - CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \ + CFLAGS= CPPFLAGS= CXXFLAGS= \ + LDFLAGS=${LDADDFLAGS:Q} \ MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \ XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \ LIBS=-lintl \ @@ -93,6 +76,7 @@ native-binutils: .native/.configure_done --build=`${GNUHOSTDIST}/config.guess` \ --host=${MACHINE_GNU_PLATFORM} \ --target=${MACHINE_GNU_PLATFORM} \ + --disable-initfini-array \ ${BRANDING} \ ) PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ diff --git a/tools/binutils/mknative-binutils b/tools/binutils/mknative-binutils index 82b12307e..8bfe00d3f 100755 --- a/tools/binutils/mknative-binutils +++ b/tools/binutils/mknative-binutils @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp $ +# $NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp $ # # Shell script for generating all the constants needed for a native # platform build of src/external/gpl3/binutils @@ -22,7 +22,7 @@ get_libbfd () { { getvars bfd/Makefile \ libbfd_la_DEPENDENCIES libbfd_la_OBJECTS DEFS \ - INCLUDES TDEFAULTS + INCLUDES TDEFAULTS HAVEVECS } | write_mk external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/defs.mk write_c external/gpl3/binutils/lib/libbfd/arch/$MACHINE_ARCH/bfd.h <$_TMPDIR/bfd/bfd.h @@ -49,6 +49,18 @@ get_libopcodes () { } | write_c external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/config.h } +get_libgnuctf () { + mkdir -p $_TOP/external/gpl3/binutils/lib/libgnuctf/arch/$MACHINE_ARCH + + { + getvars libctf/Makefile libctf_la_SOURCES + } | write_mk external/gpl3/binutils/lib/libgnuctf/arch/$MACHINE_ARCH/defs.mk + + { + cat $_TMPDIR/libctf/config.h + } | write_c external/gpl3/binutils/lib/libgnuctf/arch/$MACHINE_ARCH/config.h +} + ##### external/gpl3/binutils/lib/libiberty ##### get_libiberty () { @@ -96,6 +108,7 @@ get_binutils () { DEFS INCLUDES as_new_OBJECTS as_new_LDADD | sed -e s/G_as_new_OBJECTS/G_OBJS/ \ -e s/G_as_new_LDADD=/G_OBJS+=/ \ + -e s@config/@@g \ -e 's/\.\..*a//' | write_mk external/gpl3/binutils/usr.bin/gas/arch/$MACHINE_ARCH/defs.mk @@ -137,6 +150,7 @@ case $1 in all|binutils) # everything (uses "canadian cross" temp environment) get_binutils get_libbfd + get_libgnuctf get_libopcodes get_libiberty exit 0 diff --git a/tools/gmp/Makefile b/tools/gmp/Makefile index b8c9b5d86..ee00c7e48 100644 --- a/tools/gmp/Makefile +++ b/tools/gmp/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2012/04/12 01:05:31 mrg Exp $ +# $NetBSD: Makefile,v 1.3 2016/01/09 01:13:42 christos Exp $ # GNUHOSTDIST= ${.CURDIR}/../../external/lgpl3/gmp/dist @@ -11,7 +11,7 @@ CONFIGURE_ARGS+=--disable-shared # PATH needs special treating since "make" tries to expand $PATH # when variable is used. CONFIGURE_ENV:= ${CONFIGURE_ENV:NPATH=*:NCFLAGS=*:NCXXFLAGS=*} \ - PATH="${TOOLDIR:Q}/bin:$$$$PATH" + PATH="${TOOLDIR:Q}/bin:$$PATH" .if ${HOST_OSTYPE:C/\-.*//} != "Minix" # Force avoiding possibly non-executable install-sh. diff --git a/tools/installboot/Makefile b/tools/installboot/Makefile index dd0e97ca3..f7cad6871 100644 --- a/tools/installboot/Makefile +++ b/tools/installboot/Makefile @@ -1,11 +1,40 @@ -# $NetBSD: Makefile,v 1.11 2011/03/06 18:15:30 bouyer Exp $ +# $NetBSD: Makefile,v 1.13 2020/06/21 17:17:01 thorpej Exp $ + +.include HOSTPROGNAME= ${_TOOL_PREFIX}installboot HOST_SRCDIR= usr.sbin/installboot +LIBPROP_INC= ${.CURDIR}/../../common/include +HOST_CPPFLAGS+= -I${LIBPROP_INC} + HOST_CPPFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/../mips-elf2ecoff HOST_CPPFLAGS+= -I${TOOLDIR}/include/nbinclude +HOST_CPPFLAGS+= -DEVBOARDS_PLIST_BASE=\"${TOOLDIR}\" + +LIBPROP_OBJ!= cd ${.CURDIR}/../libprop && ${PRINTOBJDIR} +LDADD+= -L${LIBPROP_OBJ} -lprop + +SHARE_SRCDIR= ${.CURDIR}/../../share +HOST_SHAREDIR= ${TOOLDIR}/share + +BOARDDB_SRCDIR= ${SHARE_SRCDIR}/installboot +BOARDDB_DSTDIR= ${HOST_SHAREDIR}/installboot + +BOARDDBS= evbarm evbmips + +.for _d in ${BOARDDBS} +install: .PHONY install.${_d}.boards.plist +install.${_d}.boards.plist: .PHONY ${BOARDDB_DSTDIR}/${_d}/boards.plist +${BOARDDB_DSTDIR}/${_d}/boards.plist: ${BOARDDB_SRCDIR}/${_d}/boards.plist + ${_MKTARGET_INSTALL} + ${HOST_INSTALL_DIR} ${HOST_SHAREDIR} + ${HOST_INSTALL_DIR} ${BOARDDB_DSTDIR} + ${HOST_INSTALL_DIR} ${BOARDDB_DSTDIR}/${_d} + ${HOST_INSTALL_FILE} -m ${NONBINMODE} ${.ALLSRC} ${.TARGET} +.endfor + .include "${.CURDIR}/../Makefile.nbincludes" .include "${.CURDIR}/../Makefile.host" diff --git a/tools/make/buildmake.sh.in b/tools/make/buildmake.sh.in index 59e3bfbbf..d9ba0ec50 100755 --- a/tools/make/buildmake.sh.in +++ b/tools/make/buildmake.sh.in @@ -1,23 +1,36 @@ #! /bin/sh -# $NetBSD: buildmake.sh.in,v 1.8 2006/08/26 22:17:48 christos Exp $ +# $NetBSD: buildmake.sh.in,v 1.16 2020/07/26 09:17:24 rillig Exp $ # # buildmake.sh.in - Autoconf-processed shell script for building make(1). # -: ${HOST_CC="@CC@"} -: ${HOST_CFLAGS="@CPPFLAGS@ @CFLAGS@"} -: ${HOST_LDFLAGS="@LDFLAGS@ @LIBS@"} -: ${runcmd=""} +: ${NETBSDSRCDIR:=@srcdir@/../..} +MKSRCDIR=${NETBSDSRCDIR}/usr.bin/make + +_CC="@CC@" + +_CFLAGS="@CPPFLAGS@" +_CFLAGS="${_CFLAGS} -D_PATH_DEFSYSPATH=\"${NETBSDSRCDIR}/share/mk\"" +_CFLAGS="${_CFLAGS} @DEFS@" +_CFLAGS="${_CFLAGS} @CFLAGS@" + +_LDFLAGS="@LDFLAGS@ @LIBS@" docmd () { - echo "$1" - $1 || exit 1 + case "${MAKEVERBOSE:-2}" in + 0) + ;; + 1) + echo " $1 ${2##*/}" ;; + *) + echo "$3" ;; + esac + $3 || exit 1 } -MKSRCDIR=@srcdir@/../../usr.bin/make - -for f in $MKSRCDIR/*.c $MKSRCDIR/lst.lib/*.c; do - docmd "${HOST_CC} ${HOST_CFLAGS} @DEFS@ -c $f" +for f in $MKSRCDIR/*.c; do + docmd "compile " "$f" "${_CC} ${_CFLAGS} -c $f" done -docmd "${HOST_CC} ${HOST_CFLAGS} -o ${_TOOL_PREFIX:-nb}make *.o ${HOST_LDFLAGS}" +docmd " link " "${_TOOL_PREFIX:-nb}make" \ + "${_CC} -o ${_TOOL_PREFIX:-nb}make *.o ${_LDFLAGS}" diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index b08eb1ddb..2c72ca29e 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -1,58 +1,222 @@ -# $NetBSD: Makefile,v 1.58 2015/06/17 17:43:23 christos Exp $ +# $NetBSD: Makefile,v 1.113 2021/02/22 20:45:46 rillig Exp $ # @(#)Makefile 5.2 (Berkeley) 12/28/90 PROG= make -SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \ - make.c metachar.c parse.c str.c suff.c targ.c trace.c var.c util.c -SRCS+= strlist.c +SRCS= arch.c +SRCS+= buf.c +SRCS+= compat.c +SRCS+= cond.c +SRCS+= dir.c +SRCS+= enum.c +SRCS+= for.c +SRCS+= hash.c +SRCS+= job.c +SRCS+= lst.c +SRCS+= main.c +SRCS+= make.c SRCS+= make_malloc.c -SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \ - lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \ - lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \ - lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \ - lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c -SRCS += lstPrev.c +SRCS+= metachar.c +SRCS+= parse.c +SRCS+= str.c +SRCS+= suff.c +SRCS+= targ.c +SRCS+= trace.c +SRCS+= var.c +SRCS+= util.c +HDRS= buf.h +HDRS+= config.h +HDRS+= dir.h +HDRS+= enum.h +HDRS+= hash.h +HDRS+= job.h +HDRS+= lst.h +HDRS+= make.h +HDRS+= make_malloc.h +HDRS+= meta.h +HDRS+= metachar.h +HDRS+= nonints.h +HDRS+= pathnames.h +HDRS+= trace.h -# let people experiment for a bit -USE_META ?= no +# Whether to generate a coverage report after running the tests. +USE_COVERAGE?= no # works only with gcc; clang9 fails to link +.if ${USE_COVERAGE} == "yes" +GCOV?= gcov +COPTS+= --coverage -O0 -ggdb +GCOV_PERL= if (/^File '(?:.*\/)?(\S+)'/) { +GCOV_PERL+= $$file = $$1; $$func = ""; +GCOV_PERL+= } elsif (/^Function '(\S+)'/) { +GCOV_PERL+= $$func = $$1; +GCOV_PERL+= } elsif (/^Lines executed:(\d+\.\d+)% of (\d+)/ && defined($$file)) { +GCOV_PERL+= my ($$percent, $$lines) = ($$1, $$2); +GCOV_PERL+= my $$uncovered = `grep -c '\#\#\#\#\#:' < \$$(basename $$file.gcov)`; +GCOV_PERL+= printf("%7.2f %4d/%4d %s%s\n", +GCOV_PERL+= $$percent, $$uncovered, $$lines, $$file, $$func); +GCOV_PERL+= $$file = undef; +GCOV_PERL+= } +LDADD+= --coverage +.endif +CLEANFILES+= *.gcda *.gcno *.gcov + +# Whether to compile using the Undefined Behavior Sanitizer (GCC, Clang). +USE_UBSAN?= no +.if ${USE_UBSAN} == "yes" +COPTS+= -fsanitize=undefined +LDADD+= -fsanitize=undefined +.endif + +# Whether to compile with GCC 10 from pkgsrc, during development. +USE_GCC10?= no +.if ${USE_GCC10} == "yes" +# CC is set further down in this file +COPTS+= -Wno-attributes # for abs and labs +COPTS.arch.c+= -Wno-error=format-truncation +COPTS.dir.c+= -Wno-error=format-truncation +COPTS.main.c+= -Wno-error=format-truncation +COPTS.meta.c+= -Wno-error=format-truncation +.endif + +# Whether to compile with GCC 9 from pkgsrc, during development. +USE_GCC9?= no +.if ${USE_GCC9} == "yes" +# CC is set further down in this file +COPTS+= -Wno-attributes # for abs and labs +COPTS.arch.c+= -Wno-error=format-truncation +COPTS.dir.c+= -Wno-error=format-truncation +COPTS.main.c+= -Wno-error=format-truncation +COPTS.meta.c+= -Wno-error=format-truncation +.endif + +# Whether to compile with GCC 8 from pkgsrc, during development. +USE_GCC8?= no +.if ${USE_GCC8} == "yes" +# CC is set further down in this file +COPTS+= -Wno-attributes # for abs and labs +COPTS.arch.c+= -Wno-error=format-truncation +COPTS.dir.c+= -Wno-error=format-truncation +COPTS.main.c+= -Wno-error=format-truncation +COPTS.meta.c+= -Wno-error=format-truncation +.endif + +USE_META?= yes .if ${USE_META:tl} != "no" -SRCS+= meta.c -CPPFLAGS+= -DUSE_META -FILEMON_H ?= ${.CURDIR:H:H}/sys/dev/filemon/filemon.h -.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" -COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H} -.endif -.endif -.if defined(__MINIX) -CPPFLAGS+= -DMAKE_MACHINE=\"${MACHINE}\" -DMAKE_MACHINE_ARCH=\"${MACHINE_ARCH}\" -.endif #defined(__MINIX) +SRCS+= meta.c +CPPFLAGS+= -DUSE_META -.PATH: ${.CURDIR}/lst.lib .if !defined(__MINIX) -SUBDIR= PSD.doc -.endif #!defined(__MINIX) -.if make(obj) || make(clean) -SUBDIR+= unit-tests +USE_FILEMON?= ktrace +. if ${USE_FILEMON:tl} != "no" + +.PATH: ${.CURDIR}/filemon +SRCS+= filemon_${USE_FILEMON}.c +CPPFLAGS+= -DUSE_FILEMON +CPPFLAGS+= -DUSE_FILEMON_${USE_FILEMON:tu} + +. if ${USE_FILEMON} == "dev" +FILEMON_H?= /usr/include/dev/filemon/filemon.h +. if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h" +COPTS.filemon_dev.c+= \ + -DHAVE_FILEMON_H -I${FILEMON_H:H} +. endif +. endif +. endif .endif +.endif # !defined(__MINIX) + +SUBDIR.roff+= PSD.doc +.if make(obj) || make(clean) +SUBDIR+= unit-tests +.endif + +LINTFLAGS+= -T # strict bool mode, available since 2021-01-11 + +${SRCS:M*.c:.c=.o}: ${HDRS} +CLEANFILES+= *.o + +COPTS.arch.c+= ${GCC_NO_FORMAT_TRUNCATION} +COPTS.dir.c+= ${GCC_NO_FORMAT_TRUNCATION} +COPTS.job.c+= -Wno-format-nonliteral +COPTS.main.c+= ${GCC_NO_FORMAT_TRUNCATION} ${GCC_NO_STRINGOP_TRUNCATION} +COPTS.meta.c+= ${GCC_NO_FORMAT_TRUNCATION} +COPTS.parse.c+= -Wno-format-nonliteral +COPTS.var.c+= -Wno-format-nonliteral + +CPPFLAGS+= -DMAKE_NATIVE + +.if ${USE_GCC10} == "yes" +GCC10BASE?= /usr/pkg/gcc10 +LATE_CC= ${GCC10BASE}/bin/gcc +GCOV= ${GCC10BASE}/bin/gcov +.endif + +.if ${USE_GCC9} == "yes" +GCC9BASE?= /usr/pkg/gcc9 +LATE_CC= ${GCC9BASE}/bin/gcc +GCOV= ${GCC9BASE}/bin/gcov +.endif + +.if ${USE_GCC8} == "yes" +GCC8BASE?= /usr/pkg/gcc8 +LATE_CC= ${GCC8BASE}/bin/gcc +GCOV= ${GCC8BASE}/bin/gcov +.endif + +.if defined(TOOLDIR) +# This is a native NetBSD build, use libutil rather than the local emalloc etc. +CPPFLAGS+= -DUSE_EMALLOC +LDADD+= -lutil +DPADD+= ${LIBUTIL} +.endif + +COPTS+= -Wdeclaration-after-statement +CWARNFLAGS.gcc+= -Wno-error=clobbered + +# A simple unit-test driver to help catch regressions +TEST_MAKE ?= ${.OBJDIR}/${PROG:T} +test: .MAKE + cd ${.CURDIR}/unit-tests \ + && MAKEFLAGS= ${TEST_MAKE} -r -m / TEST_MAKE=${TEST_MAKE} ${TESTS:DTESTS=${TESTS:Q}} ${.TARGET} +.if ${USE_COVERAGE} == yes + ${MAKE} report-coverage +.endif + +accept sync-mi: .MAKE + cd ${.CURDIR}/unit-tests && ${.MAKE} ${.TARGET} + +retest: + ${.MAKE} -C ${.CURDIR}/unit-tests cleandir +.if ${USE_COVERAGE} == yes + rm -f *.gcov *.gcda +.endif + ${.MAKE} test + +# Just out of curiosity, during development. +.SUFFIXES: .cpre .casm +.c.cpre: + ${COMPILE.c:S,^-c$,-E,} ${COPTS.${.IMPSRC}} ${.IMPSRC} -o ${.TARGET} +.c.casm: + ${COMPILE.c:S,^-c$,-S,} ${COPTS.${.IMPSRC}} ${.IMPSRC} -o ${.TARGET} + +test-coverage: .PHONY + @make -s clean cleandir + @env USE_COVERAGE=yes COPTS="-O0 -ggdb" USER_CPPFLAGS="-DCLEANUP" \ + sh -c 'make -s all -j8 && make -s test' + +report-coverage: .PHONY + @echo 'covered uncovered file' + @${GCOV} ${GCOV_OPTS} *.gcda 2>&1 \ + | perl -ne ${GCOV_PERL:Q} \ + | sort -nr + @sed -i 's,^\([^:]*\): *[0-9]*:,\1: ,' *.gcov .include .include -CPPFLAGS+= -DMAKE_NATIVE -COPTS.var.c += -Wno-cast-qual -COPTS.job.c += -Wno-format-nonliteral -COPTS.parse.c += -Wno-format-nonliteral -COPTS.var.c += -Wno-format-nonliteral - -.ifdef TOOLDIR -# this is a native netbsd build, -# use libutil rather than the local emalloc etc. -CPPFLAGS+= -DUSE_EMALLOC -LDADD+=-lutil -DPADD+=${LIBUTIL} +# For -DCLEANUP and similar feature toggles. +CPPFLAGS+= ${USER_CPPFLAGS} +# For overriding -std=gnu99 or similar options. +CFLAGS+= ${USER_CFLAGS} +.if defined(LATE_CC) +CC= ${LATE_CC} .endif - -# A simple unit-test driver to help catch regressions -accept test: - cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET} diff --git a/usr.bin/make/Makefile.boot b/usr.bin/make/Makefile.boot index f5be09c6a..e62e45e85 100644 --- a/usr.bin/make/Makefile.boot +++ b/usr.bin/make/Makefile.boot @@ -1,45 +1,39 @@ -# $NetBSD: Makefile.boot,v 1.21 2014/02/24 07:23:44 skrll Exp $ +# $NetBSD: Makefile.boot,v 1.23 2020/10/25 13:25:19 rillig Exp $ # -# a very simple makefile... +# A very simple makefile... # # You only want to use this if you aren't running NetBSD. # -# modify MACHINE and MACHINE_ARCH as appropriate for your target architecture +# Modify MACHINE and MACHINE_ARCH as appropriate for your target architecture. +# See config.h and the various #ifdef directives for further configuration. # -CC=gcc -O -g + +PROG= bmake +MACHINE= i386 +MACHINE_ARCH= i386 +CC= gcc +CFLAGS= -O -g +EXTRA_CFLAGS= +EXTRA_LIBS= + +OBJS= arch.o buf.o compat.o cond.o dir.o enum.o for.o hash.o \ + job.o lst.o main.o make.o make_malloc.o metachar.o parse.o \ + str.o suff.o targ.o trace.o var.o util.o .c.o: - ${CC} ${CFLAGS} -c $< -o $@ + ${CC} ${CPPFLAGS} ${CFLAGS} ${EXTRA_CFLAGS} -c $< -o $@ -MACHINE=i386 -MACHINE_ARCH=i386 -# tested on HP-UX 10.20 -#MAKE_MACHINE=hppa -#MAKE_MACHINE_ARCH=hppa -CFLAGS= -DTARGET_MACHINE=\"${MACHINE}\" \ +CPPFLAGS= \ + -DTARGET_MACHINE=\"${MACHINE}\" \ -DTARGET_MACHINE_ARCH=\"${MACHINE_ARCH}\" \ -DMAKE_MACHINE=\"${MACHINE}\" -LIBS= -OBJ=arch.o buf.o compat.o cond.o dir.o for.o hash.o job.o main.o make.o \ - make_malloc.o parse.o str.o strlist.o suff.o targ.o trace.o var.o util.o - -LIBOBJ= lst.lib/lstAppend.o lst.lib/lstAtEnd.o lst.lib/lstAtFront.o \ - lst.lib/lstClose.o lst.lib/lstConcat.o lst.lib/lstDatum.o \ - lst.lib/lstDeQueue.o lst.lib/lstDestroy.o lst.lib/lstDupl.o \ - lst.lib/lstEnQueue.o lst.lib/lstFind.o lst.lib/lstFindFrom.o \ - lst.lib/lstFirst.o lst.lib/lstForEach.o lst.lib/lstForEachFrom.o \ - lst.lib/lstInit.o lst.lib/lstInsert.o lst.lib/lstIsAtEnd.o \ - lst.lib/lstIsEmpty.o lst.lib/lstLast.o lst.lib/lstMember.o \ - lst.lib/lstNext.o lst.lib/lstOpen.o lst.lib/lstRemove.o \ - lst.lib/lstReplace.o lst.lib/lstSucc.o lst.lib/lstPrev.o - -bmake: ${OBJ} ${LIBOBJ} -# @echo 'make of make and make.0 started.' - ${CC} ${CFLAGS} ${OBJ} ${LIBOBJ} -o bmake ${LIBS} +${PROG}: ${OBJS} +# @echo 'make of ${PROG} and make.0 started.' + ${CC} ${CFLAGS} ${OBJS} -o $@ ${EXTRA_LIBS} @ls -l $@ # nroff -h -man make.1 > make.0 -# @echo 'make of make and make.0 completed.' +# @echo 'make of ${PROG} and make.0 completed.' clean: - rm -f ${OBJ} ${LIBOBJ} ${PORTOBJ} bmake + rm -f ${OBJS} ${PROG} diff --git a/usr.bin/make/PSD.doc/tutorial.ms b/usr.bin/make/PSD.doc/tutorial.ms index d5c8a7d54..da17f950f 100644 --- a/usr.bin/make/PSD.doc/tutorial.ms +++ b/usr.bin/make/PSD.doc/tutorial.ms @@ -1,4 +1,4 @@ -.\" $NetBSD: tutorial.ms,v 1.12 2014/09/30 21:33:14 christos Exp $ +.\" $NetBSD: tutorial.ms,v 1.14 2020/12/18 15:47:34 rillig Exp $ .\" Copyright (c) 1988, 1989, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -117,6 +117,15 @@ .de No .br .ne 0.5i +.ie n \{\ +.nr g3 \w'NOTE ' +.po -\\n(g3u +.br +NOTE +.br +.po +\\n(g3u +.\} +.el \{\ .po -0.5i .br .mk @@ -148,12 +157,14 @@ .rt .ft \\n(g3 .ps \\n(g4 +.\} .. .de Bp .ie !\\n(.$ .IP \(bu 2 .el .IP "\&" 2 .. -.po +.3i +.ie n .po +\w'NOTE 'u +.el .po +.3i .TL PMake \*- A Tutorial .AU @@ -1907,15 +1918,15 @@ Suff_FindDeps (jive.c) applying .l -> .c to "jive.l" Suff_FindDeps (jive.l) Examining jive.l...modified 17:16:01 Oct 4, 1987...up-to-date -Examining jive.c...non-existent...out-of-date +Examining jive.c...nonexistent...out-of-date --- jive.c --- lex jive.l \&.\|.\|. meaningless lex output deleted .\|.\|. mv lex.yy.c jive.c -Examining jive.o...non-existent...out-of-date +Examining jive.o...nonexistent...out-of-date --- jive.o --- cc -c jive.c -Examining jive.out...non-existent...out-of-date +Examining jive.out...nonexistent...out-of-date --- jive.out --- cc -o jive.out jive.o .DE @@ -2860,7 +2871,7 @@ current directory. While people have suggested that PMake should read the directories each time, my experience suggests that the caching seldom causes problems. In addition, not caching the directories slows things down enormously because of PMake's attempts to apply transformation -rules through non-existent files \*- the number of extra file-system +rules through nonexistent files \*- the number of extra file-system searches is truly staggering, especially if many files without suffixes are used and the null suffix isn't changed from .CW .out . diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 78f3601ce..2a628e9f1 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $ */ +/* $NetBSD: arch.c,v 1.198 2021/03/15 12:15:03 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,1288 +68,1021 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; -#else -__RCSID("$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * arch.c -- - * Functions to manipulate libraries, archives and their members. +/* + * Manipulate libraries, archives and their members. * - * Once again, cacheing/hashing comes into play in the manipulation - * of archives. The first time an archive is referenced, all of its members' - * headers are read and hashed and the archive closed again. All hashed - * archives are kept on a list which is searched each time an archive member - * is referenced. + * The first time an archive is referenced, all of its members' headers are + * read and cached and the archive closed again. All cached archives are kept + * on a list which is searched each time an archive member is referenced. * * The interface to this module is: - * Arch_ParseArchive Given an archive specification, return a list - * of GNode's, one for each member in the spec. - * FAILURE is returned if the specification is - * invalid for some reason. * - * Arch_Touch Alter the modification time of the archive - * member described by the given node to be - * the current time. + * Arch_Init Initialize this module. * - * Arch_TouchLib Update the modification time of the library - * described by the given node. This is special - * because it also updates the modification time - * of the library's table of contents. + * Arch_End Clean up this module. * - * Arch_MTime Find the modification time of a member of - * an archive *in the archive*. The time is also - * placed in the member's GNode. Returns the - * modification time. + * Arch_ParseArchive + * Parse an archive specification such as + * "archive.a(member1 member2)". * - * Arch_MemTime Find the modification time of a member of - * an archive. Called when the member doesn't - * already exist. Looks in the archive for the - * modification time. Returns the modification - * time. + * Arch_Touch Alter the modification time of the archive + * member described by the given node to be + * the time when make was started. * - * Arch_FindLib Search for a library along a path. The - * library name in the GNode should be in - * -l format. + * Arch_TouchLib Update the modification time of the library + * described by the given node. This is special + * because it also updates the modification time + * of the library's table of contents. * - * Arch_LibOODate Special function to decide if a library node - * is out-of-date. + * Arch_UpdateMTime + * Find the modification time of a member of + * an archive *in the archive* and place it in the + * member's GNode. * - * Arch_Init Initialize this module. + * Arch_UpdateMemberMTime + * Find the modification time of a member of + * an archive. Called when the member doesn't + * already exist. Looks in the archive for the + * modification time. Returns the modification + * time. * - * Arch_End Cleanup this module. + * Arch_FindLib Search for a library along a path. The + * library name in the GNode should be in + * -l format. + * + * Arch_LibOODate Decide if a library node is out-of-date. */ -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include -#include "make.h" -#include "hash.h" -#include "dir.h" -#include "config.h" +#include "make.h" +#include "dir.h" +#include "config.h" -#ifdef TARGET_MACHINE -#undef MAKE_MACHINE -#define MAKE_MACHINE TARGET_MACHINE -#endif -#ifdef TARGET_MACHINE_ARCH -#undef MAKE_MACHINE_ARCH -#define MAKE_MACHINE_ARCH TARGET_MACHINE_ARCH -#endif +/* "@(#)arch.c 8.2 (Berkeley) 1/2/94" */ +MAKE_RCSID("$NetBSD: arch.c,v 1.198 2021/03/15 12:15:03 rillig Exp $"); -static Lst archives; /* Lst of archives we've already examined */ +typedef struct List ArchList; +typedef struct ListNode ArchListNode; + +static ArchList archives; /* The archives we've already examined */ typedef struct Arch { - char *name; /* Name of archive */ - Hash_Table members; /* All the members of the archive described - * by key/value pairs */ - char *fnametab; /* Extended name table strings */ - size_t fnamesize; /* Size of the string table */ + char *name; /* Name of archive */ + HashTable members; /* All the members of the archive described + * by key/value pairs */ + char *fnametab; /* Extended name table strings */ + size_t fnamesize; /* Size of the string table */ } Arch; -static int ArchFindArchive(const void *, const void *); -#ifdef CLEANUP -static void ArchFree(void *); -#endif -static struct ar_hdr *ArchStatMember(char *, char *, Boolean); -static FILE *ArchFindMember(char *, char *, struct ar_hdr *, const char *); +static FILE *ArchFindMember(const char *, const char *, + struct ar_hdr *, const char *); #if defined(__svr4__) || defined(__SVR4) || defined(__ELF__) #define SVR4ARCHIVES static int ArchSVR4Entry(Arch *, char *, size_t, FILE *); #endif #ifdef CLEANUP -/*- - *----------------------------------------------------------------------- - * ArchFree -- - * Free memory used by an archive - * - * Results: - * None. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ static void ArchFree(void *ap) { - Arch *a = (Arch *)ap; - Hash_Search search; - Hash_Entry *entry; + Arch *a = ap; + HashIter hi; - /* Free memory from hash entries */ - for (entry = Hash_EnumFirst(&a->members, &search); - entry != NULL; - entry = Hash_EnumNext(&search)) - free(Hash_GetValue(entry)); + /* Free memory from hash entries */ + HashIter_Init(&hi, &a->members); + while (HashIter_Next(&hi) != NULL) + free(hi.entry->value); - free(a->name); - if (a->fnametab) + free(a->name); free(a->fnametab); - Hash_DeleteTable(&a->members); - free(a); + HashTable_Done(&a->members); + free(a); } #endif - -/*- - *----------------------------------------------------------------------- - * Arch_ParseArchive -- - * Parse the archive specification in the given line and find/create - * the nodes for the specified archive members, placing their nodes - * on the given list. +/* + * Parse an archive specification such as "archive.a(member1 member2.${EXT})", + * adding nodes for the expanded members to gns. Nodes are created as + * necessary. * * Input: - * linePtr Pointer to start of specification - * nodeLst Lst on which to place the nodes - * ctxt Context in which to expand variables + * pp The start of the specification. + * gns The list on which to place the nodes. + * scope The scope in which to expand variables. * - * Results: - * SUCCESS if it was a valid specification. The linePtr is updated - * to point to the first non-space after the archive spec. The - * nodes for the members are placed on the given list. - * - * Side Effects: - * Some nodes may be created. The given list is extended. - * - *----------------------------------------------------------------------- + * Output: + * return TRUE if it was a valid specification. + * *pp Points to the first non-space after the archive spec. */ -ReturnStatus -Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt) +Boolean +Arch_ParseArchive(char **pp, GNodeList *gns, GNode *scope) { - char *cp; /* Pointer into line */ - GNode *gn; /* New node */ - char *libName; /* Library-part of specification */ - char *memName; /* Member-part of specification */ - char *nameBuf; /* temporary place for node name */ - char saveChar; /* Ending delimiter of member-name */ - Boolean subLibName; /* TRUE if libName should have/had - * variable substitution performed on it */ + char *cp; /* Pointer into line */ + GNode *gn; /* New node */ + MFStr libName; /* Library-part of specification */ + char *memName; /* Member-part of specification */ + char saveChar; /* Ending delimiter of member-name */ + Boolean expandLibName; /* Whether the parsed libName contains + * variable expressions that need to be + * expanded */ - libName = *linePtr; + libName = MFStr_InitRefer(*pp); + expandLibName = FALSE; - subLibName = FALSE; + for (cp = libName.str; *cp != '(' && *cp != '\0';) { + if (*cp == '$') { + /* Expand nested variable expressions. */ + /* XXX: This code can probably be shortened. */ + const char *nested_p = cp; + FStr result; + Boolean isError; - for (cp = libName; *cp != '(' && *cp != '\0'; cp++) { - if (*cp == '$') { - /* - * Variable spec, so call the Var module to parse the puppy - * so we can safely advance beyond it... - */ - int length; - void *freeIt; - char *result; + /* XXX: is expanded twice: once here and once below */ + (void)Var_Parse(&nested_p, scope, + VARE_UNDEFERR, &result); + /* TODO: handle errors */ + isError = result.str == var_Error; + FStr_Done(&result); + if (isError) + return FALSE; - result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); - if (result == var_Error) { - return(FAILURE); - } else { - subLibName = TRUE; - } - - cp += length-1; + expandLibName = TRUE; + cp += nested_p - cp; + } else + cp++; } - } - *cp++ = '\0'; - if (subLibName) { - libName = Var_Subst(NULL, libName, ctxt, TRUE); - } - - - for (;;) { - /* - * First skip to the start of the member's name, mark that - * place and skip to the end of it (either white-space or - * a close paren). - */ - Boolean doSubst = FALSE; /* TRUE if need to substitute in memName */ - - while (*cp != '\0' && *cp != ')' && isspace ((unsigned char)*cp)) { - cp++; + *cp++ = '\0'; + if (expandLibName) { + char *expanded; + (void)Var_Subst(libName.str, scope, VARE_UNDEFERR, &expanded); + /* TODO: handle errors */ + libName = MFStr_InitOwn(expanded); } - memName = cp; - while (*cp != '\0' && *cp != ')' && !isspace ((unsigned char)*cp)) { - if (*cp == '$') { + + + for (;;) { /* - * Variable spec, so call the Var module to parse the puppy - * so we can safely advance beyond it... + * First skip to the start of the member's name, mark that + * place and skip to the end of it (either white-space or + * a close paren). */ - int length; - void *freeIt; - char *result; + Boolean doSubst = FALSE; - result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); - if (result == var_Error) { - return(FAILURE); - } else { - doSubst = TRUE; + pp_skip_whitespace(&cp); + + memName = cp; + while (*cp != '\0' && *cp != ')' && !ch_isspace(*cp)) { + if (*cp == '$') { + /* Expand nested variable expressions. */ + /* XXX: This code can probably be shortened. */ + FStr result; + Boolean isError; + const char *nested_p = cp; + + (void)Var_Parse(&nested_p, scope, + VARE_UNDEFERR, &result); + /* TODO: handle errors */ + isError = result.str == var_Error; + FStr_Done(&result); + + if (isError) + return FALSE; + + doSubst = TRUE; + cp += nested_p - cp; + } else { + cp++; + } } - cp += length; - } else { - cp++; - } - } - - /* - * If the specification ends without a closing parenthesis, - * chances are there's something wrong (like a missing backslash), - * so it's better to return failure than allow such things to happen - */ - if (*cp == '\0') { - printf("No closing parenthesis in archive specification\n"); - return (FAILURE); - } - - /* - * If we didn't move anywhere, we must be done - */ - if (cp == memName) { - break; - } - - saveChar = *cp; - *cp = '\0'; - - /* - * XXX: This should be taken care of intelligently by - * SuffExpandChildren, both for the archive and the member portions. - */ - /* - * If member contains variables, try and substitute for them. - * This will slow down archive specs with dynamic sources, of course, - * since we'll be (non-)substituting them three times, but them's - * the breaks -- we need to do this since SuffExpandChildren calls - * us, otherwise we could assume the thing would be taken care of - * later. - */ - if (doSubst) { - char *buf; - char *sacrifice; - char *oldMemName = memName; - size_t sz; - - memName = Var_Subst(NULL, memName, ctxt, TRUE); - - /* - * Now form an archive spec and recurse to deal with nested - * variables and multi-word variable values.... The results - * are just placed at the end of the nodeLst we're returning. - */ - sz = strlen(memName)+strlen(libName)+3; - buf = sacrifice = bmake_malloc(sz); - - snprintf(buf, sz, "%s(%s)", libName, memName); - - if (strchr(memName, '$') && strcmp(memName, oldMemName) == 0) { /* - * Must contain dynamic sources, so we can't deal with it now. - * Just create an ARCHV node for the thing and let - * SuffExpandChildren handle it... + * If the specification ends without a closing parenthesis, + * chances are there's something wrong (like a missing + * backslash), so it's better to return failure than allow + * such things to happen */ - gn = Targ_FindNode(buf, TARG_CREATE); - - if (gn == NULL) { - free(buf); - return(FAILURE); - } else { - gn->type |= OP_ARCHV; - (void)Lst_AtEnd(nodeLst, gn); + if (*cp == '\0') { + Parse_Error(PARSE_FATAL, + "No closing parenthesis " + "in archive specification"); + return FALSE; } - } else if (Arch_ParseArchive(&sacrifice, nodeLst, ctxt)!=SUCCESS) { + /* - * Error in nested call -- free buffer and return FAILURE - * ourselves. + * If we didn't move anywhere, we must be done */ - free(buf); - return(FAILURE); - } - /* - * Free buffer and continue with our work. - */ - free(buf); - } else if (Dir_HasWildcards(memName)) { - Lst members = Lst_Init(FALSE); - char *member; - size_t sz = MAXPATHLEN, nsz; - nameBuf = bmake_malloc(sz); + if (cp == memName) + break; - Dir_Expand(memName, dirSearchPath, members); - while (!Lst_IsEmpty(members)) { - member = (char *)Lst_DeQueue(members); - nsz = strlen(libName) + strlen(member) + 3; - if (sz > nsz) - nameBuf = bmake_realloc(nameBuf, sz = nsz * 2); + saveChar = *cp; + *cp = '\0'; + + /* + * XXX: This should be taken care of intelligently by + * SuffExpandChildren, both for the archive and the member + * portions. + */ + /* + * If member contains variables, try and substitute for them. + * This will slow down archive specs with dynamic sources, of + * course, since we'll be (non-)substituting them three + * times, but them's the breaks -- we need to do this since + * SuffExpandChildren calls us, otherwise we could assume the + * thing would be taken care of later. + */ + if (doSubst) { + char *fullName; + char *p; + char *unexpandedMemName = memName; + + (void)Var_Subst(memName, scope, VARE_UNDEFERR, + &memName); + /* TODO: handle errors */ + + /* + * Now form an archive spec and recurse to deal with + * nested variables and multi-word variable values. + */ + fullName = str_concat4(libName.str, "(", memName, ")"); + p = fullName; + + if (strchr(memName, '$') != NULL && + strcmp(memName, unexpandedMemName) == 0) { + /* + * Must contain dynamic sources, so we can't + * deal with it now. Just create an ARCHV node + * for the thing and let SuffExpandChildren + * handle it. + */ + gn = Targ_GetNode(fullName); + gn->type |= OP_ARCHV; + Lst_Append(gns, gn); + + } else if (!Arch_ParseArchive(&p, gns, scope)) { + /* Error in nested call. */ + free(fullName); + /* XXX: does unexpandedMemName leak? */ + return FALSE; + } + free(fullName); + /* XXX: does unexpandedMemName leak? */ + + } else if (Dir_HasWildcards(memName)) { + StringList members = LST_INIT; + SearchPath_Expand(&dirSearchPath, memName, &members); + + while (!Lst_IsEmpty(&members)) { + char *member = Lst_Dequeue(&members); + char *fullname = str_concat4(libName.str, "(", + member, ")"); + free(member); + + gn = Targ_GetNode(fullname); + free(fullname); + + gn->type |= OP_ARCHV; + Lst_Append(gns, gn); + } + Lst_Done(&members); - snprintf(nameBuf, sz, "%s(%s)", libName, member); - free(member); - gn = Targ_FindNode(nameBuf, TARG_CREATE); - if (gn == NULL) { - free(nameBuf); - return (FAILURE); } else { - /* - * We've found the node, but have to make sure the rest of - * the world knows it's an archive member, without having - * to constantly check for parentheses, so we type the - * thing with the OP_ARCHV bit before we place it on the - * end of the provided list. - */ - gn->type |= OP_ARCHV; - (void)Lst_AtEnd(nodeLst, gn); + char *fullname = str_concat4(libName.str, "(", memName, + ")"); + gn = Targ_GetNode(fullname); + free(fullname); + + /* + * We've found the node, but have to make sure the + * rest of the world knows it's an archive member, + * without having to constantly check for parentheses, + * so we type the thing with the OP_ARCHV bit before + * we place it on the end of the provided list. + */ + gn->type |= OP_ARCHV; + Lst_Append(gns, gn); } - } - Lst_Destroy(members, NULL); - free(nameBuf); - } else { - size_t sz = strlen(libName) + strlen(memName) + 3; - nameBuf = bmake_malloc(sz); - snprintf(nameBuf, sz, "%s(%s)", libName, memName); - gn = Targ_FindNode(nameBuf, TARG_CREATE); - free(nameBuf); - if (gn == NULL) { - return (FAILURE); - } else { - /* - * We've found the node, but have to make sure the rest of the - * world knows it's an archive member, without having to - * constantly check for parentheses, so we type the thing with - * the OP_ARCHV bit before we place it on the end of the - * provided list. - */ - gn->type |= OP_ARCHV; - (void)Lst_AtEnd(nodeLst, gn); - } - } - if (doSubst) { - free(memName); + if (doSubst) + free(memName); + + *cp = saveChar; } - *cp = saveChar; - } + MFStr_Done(&libName); - /* - * If substituted libName, free it now, since we need it no longer. - */ - if (subLibName) { - free(libName); - } - - /* - * We promised the pointer would be set up at the next non-space, so - * we must advance cp there before setting *linePtr... (note that on - * entrance to the loop, cp is guaranteed to point at a ')') - */ - do { - cp++; - } while (*cp != '\0' && isspace ((unsigned char)*cp)); - - *linePtr = cp; - return (SUCCESS); + cp++; /* skip the ')' */ + /* We promised that pp would be set up at the next non-space. */ + pp_skip_whitespace(&cp); + *pp = cp; + return TRUE; } -/*- - *----------------------------------------------------------------------- - * ArchFindArchive -- - * See if the given archive is the one we are looking for. Called - * From ArchStatMember and ArchFindMember via Lst_Find. - * - * Input: - * ar Current list element - * archName Name we want - * - * Results: - * 0 if it is, non-zero if it isn't. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -static int -ArchFindArchive(const void *ar, const void *archName) -{ - return (strcmp(archName, ((const Arch *)ar)->name)); -} - -/*- - *----------------------------------------------------------------------- - * ArchStatMember -- - * Locate a member of an archive, given the path of the archive and - * the path of the desired member. +/* + * Locate a member of an archive, given the path of the archive and the path + * of the desired member. * * Input: * archive Path to the archive - * member Name of member. If it is a path, only the last - * component is used. - * hash TRUE if archive should be hashed if not already so. + * member Name of member; only its basename is used. + * addToCache TRUE if archive should be cached if not already so. * * Results: - * A pointer to the current struct ar_hdr structure for the member. Note - * That no position is returned, so this is not useful for touching - * archive members. This is mostly because we have no assurances that - * The archive will remain constant after we read all the headers, so - * there's not much point in remembering the position... + * The ar_hdr for the member, or NULL. * - * Side Effects: - * - *----------------------------------------------------------------------- + * See ArchFindMember for an almost identical copy of this code. */ static struct ar_hdr * -ArchStatMember(char *archive, char *member, Boolean hash) +ArchStatMember(const char *archive, const char *member, Boolean addToCache) { -#define AR_MAX_NAME_LEN (sizeof(arh.ar_name)-1) - FILE * arch; /* Stream to archive */ - int size; /* Size of archive member */ - char *cp; /* Useful character pointer */ - char magic[SARMAG]; - LstNode ln; /* Lst member containing archive descriptor */ - Arch *ar; /* Archive descriptor */ - Hash_Entry *he; /* Entry containing member's description */ - struct ar_hdr arh; /* archive-member header for reading archive */ - char memName[MAXPATHLEN+1]; - /* Current member name while hashing. */ +#define AR_MAX_NAME_LEN (sizeof arh.ar_name - 1) + FILE *arch; + size_t size; /* Size of archive member */ + char magic[SARMAG]; + ArchListNode *ln; + Arch *ar; /* Archive descriptor */ + struct ar_hdr arh; /* archive-member header for reading archive */ + char memName[MAXPATHLEN + 1]; + /* Current member name while hashing. */ - /* - * Because of space constraints and similar things, files are archived - * using their final path components, not the entire thing, so we need - * to point 'member' to the final component, if there is one, to make - * the comparisons easier... - */ - cp = strrchr(member, '/'); - if (cp != NULL) { - member = cp + 1; - } - - ln = Lst_Find(archives, archive, ArchFindArchive); - if (ln != NULL) { - ar = (Arch *)Lst_Datum(ln); - - he = Hash_FindEntry(&ar->members, member); - - if (he != NULL) { - return ((struct ar_hdr *)Hash_GetValue(he)); - } else { - /* Try truncated name */ - char copy[AR_MAX_NAME_LEN+1]; - size_t len = strlen(member); - - if (len > AR_MAX_NAME_LEN) { - len = AR_MAX_NAME_LEN; - strncpy(copy, member, AR_MAX_NAME_LEN); - copy[AR_MAX_NAME_LEN] = '\0'; - } - if ((he = Hash_FindEntry(&ar->members, copy)) != NULL) - return ((struct ar_hdr *)Hash_GetValue(he)); - return NULL; - } - } - - if (!hash) { /* - * Caller doesn't want the thing hashed, just use ArchFindMember - * to read the header for the member out and close down the stream - * again. Since the archive is not to be hashed, we assume there's - * no need to allocate extra room for the header we're returning, - * so just declare it static. + * Because of space constraints and similar things, files are archived + * using their basename, not the entire path. */ - static struct ar_hdr sarh; + member = str_basename(member); - arch = ArchFindMember(archive, member, &sarh, "r"); - - if (arch == NULL) { - return NULL; - } else { - fclose(arch); - return (&sarh); + for (ln = archives.first; ln != NULL; ln = ln->next) { + const Arch *a = ln->datum; + if (strcmp(a->name, archive) == 0) + break; } - } - /* - * We don't have this archive on the list yet, so we want to find out - * everything that's in it and cache it so we can get at it quickly. - */ - arch = fopen(archive, "r"); - if (arch == NULL) { - return NULL; - } + if (ln != NULL) { + struct ar_hdr *hdr; - /* - * We use the ARMAG string to make sure this is an archive we - * can handle... - */ - if ((fread(magic, SARMAG, 1, arch) != 1) || - (strncmp(magic, ARMAG, SARMAG) != 0)) { - fclose(arch); - return NULL; - } + ar = ln->datum; + hdr = HashTable_FindValue(&ar->members, member); + if (hdr != NULL) + return hdr; - ar = bmake_malloc(sizeof(Arch)); - ar->name = bmake_strdup(archive); - ar->fnametab = NULL; - ar->fnamesize = 0; - Hash_InitTable(&ar->members, -1); - memName[AR_MAX_NAME_LEN] = '\0'; + { + /* Try truncated name */ + char copy[AR_MAX_NAME_LEN + 1]; + size_t len = strlen(member); - while (fread((char *)&arh, sizeof(struct ar_hdr), 1, arch) == 1) { - if (strncmp( arh.ar_fmag, ARFMAG, sizeof(arh.ar_fmag)) != 0) { - /* - * The header is bogus, so the archive is bad - * and there's no way we can recover... - */ - goto badarch; - } else { - /* - * We need to advance the stream's pointer to the start of the - * next header. Files are padded with newlines to an even-byte - * boundary, so we need to extract the size of the file from the - * 'size' field of the header and round it up during the seek. - */ - arh.ar_size[sizeof(arh.ar_size)-1] = '\0'; - size = (int)strtol(arh.ar_size, NULL, 10); + if (len > AR_MAX_NAME_LEN) { + snprintf(copy, sizeof copy, "%s", member); + hdr = HashTable_FindValue(&ar->members, copy); + } + return hdr; + } + } - (void)strncpy(memName, arh.ar_name, sizeof(arh.ar_name)); - for (cp = &memName[AR_MAX_NAME_LEN]; *cp == ' '; cp--) { - continue; - } - cp[1] = '\0'; + if (!addToCache) { + /* + * Caller doesn't want the thing cached, just use + * ArchFindMember to read the header for the member out and + * close down the stream again. Since the archive is not to be + * cached, we assume there's no need to allocate extra room + * for the header we're returning, so just declare it static. + */ + static struct ar_hdr sarh; + + arch = ArchFindMember(archive, member, &sarh, "r"); + if (arch == NULL) + return NULL; + + fclose(arch); + return &sarh; + } + + /* + * We don't have this archive on the list yet, so we want to find out + * everything that's in it and cache it so we can get at it quickly. + */ + arch = fopen(archive, "r"); + if (arch == NULL) + return NULL; + + /* + * We use the ARMAG string to make sure this is an archive we + * can handle... + */ + if (fread(magic, SARMAG, 1, arch) != 1 || + strncmp(magic, ARMAG, SARMAG) != 0) { + (void)fclose(arch); + return NULL; + } + + ar = bmake_malloc(sizeof *ar); + ar->name = bmake_strdup(archive); + ar->fnametab = NULL; + ar->fnamesize = 0; + HashTable_Init(&ar->members); + memName[AR_MAX_NAME_LEN] = '\0'; + + while (fread(&arh, sizeof arh, 1, arch) == 1) { + char *nameend; + + /* If the header is bogus, there's no way we can recover. */ + if (strncmp(arh.ar_fmag, ARFMAG, sizeof arh.ar_fmag) != 0) + goto badarch; + + /* + * We need to advance the stream's pointer to the start of the + * next header. Files are padded with newlines to an even-byte + * boundary, so we need to extract the size of the file from + * the 'size' field of the header and round it up during the + * seek. + */ + arh.ar_size[sizeof arh.ar_size - 1] = '\0'; + size = (size_t)strtol(arh.ar_size, NULL, 10); + + memcpy(memName, arh.ar_name, sizeof arh.ar_name); + nameend = memName + AR_MAX_NAME_LEN; + while (nameend > memName && *nameend == ' ') + nameend--; + nameend[1] = '\0'; #ifdef SVR4ARCHIVES - /* - * svr4 names are slash terminated. Also svr4 extended AR format. - */ - if (memName[0] == '/') { /* - * svr4 magic mode; handle it + * svr4 names are slash-terminated. + * Also svr4 extended the AR format. */ - switch (ArchSVR4Entry(ar, memName, size, arch)) { - case -1: /* Invalid data */ - goto badarch; - case 0: /* List of files entry */ - continue; - default: /* Got the entry */ - break; + if (memName[0] == '/') { + /* svr4 magic mode; handle it */ + switch (ArchSVR4Entry(ar, memName, size, arch)) { + case -1: /* Invalid data */ + goto badarch; + case 0: /* List of files entry */ + continue; + default: /* Got the entry */ + break; + } + } else { + if (nameend[0] == '/') + nameend[0] = '\0'; } - } - else { - if (cp[0] == '/') - cp[0] = '\0'; - } #endif #ifdef AR_EFMT1 - /* - * BSD 4.4 extended AR format: #1/, with name as the - * first bytes of the file - */ - if (strncmp(memName, AR_EFMT1, sizeof(AR_EFMT1) - 1) == 0 && - isdigit((unsigned char)memName[sizeof(AR_EFMT1) - 1])) { + /* + * BSD 4.4 extended AR format: #1/, with name as the + * first bytes of the file + */ + if (strncmp(memName, AR_EFMT1, sizeof AR_EFMT1 - 1) == 0 && + ch_isdigit(memName[sizeof AR_EFMT1 - 1])) { - unsigned int elen = atoi(&memName[sizeof(AR_EFMT1)-1]); + int elen = atoi(memName + sizeof AR_EFMT1 - 1); - if (elen > MAXPATHLEN) - goto badarch; - if (fread(memName, elen, 1, arch) != 1) - goto badarch; - memName[elen] = '\0'; - fseek(arch, -elen, SEEK_CUR); - if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName); + if ((unsigned int)elen > MAXPATHLEN) + goto badarch; + if (fread(memName, (size_t)elen, 1, arch) != 1) + goto badarch; + memName[elen] = '\0'; + if (fseek(arch, -elen, SEEK_CUR) != 0) + goto badarch; + if (DEBUG(ARCH) || DEBUG(MAKE)) + debug_printf( + "ArchStatMember: " + "Extended format entry for %s\n", + memName); } - } #endif - he = Hash_CreateEntry(&ar->members, memName, NULL); - Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr))); - memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr)); + { + struct ar_hdr *cached_hdr = bmake_malloc( + sizeof *cached_hdr); + memcpy(cached_hdr, &arh, sizeof arh); + HashTable_Set(&ar->members, memName, cached_hdr); + } + + if (fseek(arch, ((long)size + 1) & ~1, SEEK_CUR) != 0) + goto badarch; } - fseek(arch, (size + 1) & ~1, SEEK_CUR); - } - fclose(arch); + fclose(arch); - (void)Lst_AtEnd(archives, ar); + Lst_Append(&archives, ar); - /* - * Now that the archive has been read and cached, we can look into - * the hash table to find the desired member's header. - */ - he = Hash_FindEntry(&ar->members, member); - - if (he != NULL) { - return ((struct ar_hdr *)Hash_GetValue(he)); - } else { - return NULL; - } + /* + * Now that the archive has been read and cached, we can look into + * the addToCache table to find the desired member's header. + */ + return HashTable_FindValue(&ar->members, member); badarch: - fclose(arch); - Hash_DeleteTable(&ar->members); - if (ar->fnametab) + fclose(arch); + HashTable_Done(&ar->members); free(ar->fnametab); - free(ar); - return NULL; + free(ar); + return NULL; } #ifdef SVR4ARCHIVES -/*- - *----------------------------------------------------------------------- - * ArchSVR4Entry -- - * Parse an SVR4 style entry that begins with a slash. - * If it is "//", then load the table of filenames - * If it is "/", then try to substitute the long file name - * from offset of a table previously read. +/* + * Parse an SVR4 style entry that begins with a slash. + * If it is "//", then load the table of filenames. + * If it is "/", then try to substitute the long file name + * from offset of a table previously read. + * If a table is read, the file pointer is moved to the next archive member. * * Results: * -1: Bad data in archive * 0: A table was loaded from the file * 1: Name was successfully substituted from table * 2: Name was not successfully substituted from table - * - * Side Effects: - * If a table is read, the file pointer is moved to the next archive - * member - * - *----------------------------------------------------------------------- */ static int -ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE *arch) +ArchSVR4Entry(Arch *ar, char *inout_name, size_t size, FILE *arch) { #define ARLONGNAMES1 "//" #define ARLONGNAMES2 "/ARFILENAMES" - size_t entry; - char *ptr, *eptr; + size_t entry; + char *ptr, *eptr; - if (strncmp(name, ARLONGNAMES1, sizeof(ARLONGNAMES1) - 1) == 0 || - strncmp(name, ARLONGNAMES2, sizeof(ARLONGNAMES2) - 1) == 0) { + if (strncmp(inout_name, ARLONGNAMES1, sizeof ARLONGNAMES1 - 1) == 0 || + strncmp(inout_name, ARLONGNAMES2, sizeof ARLONGNAMES2 - 1) == 0) { - if (ar->fnametab != NULL) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "Attempted to redefine an SVR4 name table\n"); - } - return -1; + if (ar->fnametab != NULL) { + DEBUG0(ARCH, + "Attempted to redefine an SVR4 name table\n"); + return -1; + } + + /* + * This is a table of archive names, so we build one for + * ourselves + */ + ar->fnametab = bmake_malloc(size); + ar->fnamesize = size; + + if (fread(ar->fnametab, size, 1, arch) != 1) { + DEBUG0(ARCH, "Reading an SVR4 name table failed\n"); + return -1; + } + eptr = ar->fnametab + size; + for (entry = 0, ptr = ar->fnametab; ptr < eptr; ptr++) + if (*ptr == '/') { + entry++; + *ptr = '\0'; + } + DEBUG1(ARCH, "Found svr4 archive name table with %lu entries\n", + (unsigned long)entry); + return 0; } - /* - * This is a table of archive names, so we build one for - * ourselves - */ - ar->fnametab = bmake_malloc(size); - ar->fnamesize = size; + if (inout_name[1] == ' ' || inout_name[1] == '\0') + return 2; - if (fread(ar->fnametab, size, 1, arch) != 1) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "Reading an SVR4 name table failed\n"); - } - return -1; + entry = (size_t)strtol(&inout_name[1], &eptr, 0); + if ((*eptr != ' ' && *eptr != '\0') || eptr == &inout_name[1]) { + DEBUG1(ARCH, "Could not parse SVR4 name %s\n", inout_name); + return 2; } - eptr = ar->fnametab + size; - for (entry = 0, ptr = ar->fnametab; ptr < eptr; ptr++) - switch (*ptr) { - case '/': - entry++; - *ptr = '\0'; - break; - - case '\n': - break; - - default: - break; - } - if (DEBUG(ARCH)) { - fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (u_long)entry); + if (entry >= ar->fnamesize) { + DEBUG2(ARCH, "SVR4 entry offset %s is greater than %lu\n", + inout_name, (unsigned long)ar->fnamesize); + return 2; } - return 0; - } - if (name[1] == ' ' || name[1] == '\0') - return 2; + DEBUG2(ARCH, "Replaced %s with %s\n", inout_name, &ar->fnametab[entry]); - entry = (size_t)strtol(&name[1], &eptr, 0); - if ((*eptr != ' ' && *eptr != '\0') || eptr == &name[1]) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "Could not parse SVR4 name %s\n", name); - } - return 2; - } - if (entry >= ar->fnamesize) { - if (DEBUG(ARCH)) { - fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", - name, (u_long)ar->fnamesize); - } - return 2; - } - - if (DEBUG(ARCH)) { - fprintf(debug_file, "Replaced %s with %s\n", name, &ar->fnametab[entry]); - } - - (void)strncpy(name, &ar->fnametab[entry], MAXPATHLEN); - name[MAXPATHLEN] = '\0'; - return 1; + snprintf(inout_name, MAXPATHLEN + 1, "%s", &ar->fnametab[entry]); + return 1; } #endif -/*- - *----------------------------------------------------------------------- - * ArchFindMember -- - * Locate a member of an archive, given the path of the archive and - * the path of the desired member. If the archive is to be modified, - * the mode should be "r+", if not, it should be "r". +static Boolean +ArchiveMember_HasName(const struct ar_hdr *hdr, + const char *name, size_t namelen) +{ + const size_t ar_name_len = sizeof hdr->ar_name; + const char *ar_name = hdr->ar_name; + + if (strncmp(ar_name, name, namelen) != 0) + return FALSE; + + if (namelen >= ar_name_len) + return namelen == ar_name_len; + + /* hdr->ar_name is space-padded to the right. */ + if (ar_name[namelen] == ' ') + return TRUE; + + /* In archives created by GNU binutils 2.27, the member names end with + * a slash. */ + if (ar_name[namelen] == '/' && + (namelen == ar_name_len || ar_name[namelen + 1] == ' ')) + return TRUE; + + return FALSE; +} + +/* + * Locate a member of an archive, given the path of the archive and the path + * of the desired member. * * Input: * archive Path to the archive * member Name of member. If it is a path, only the last * component is used. - * arhPtr Pointer to header structure to be filled in - * mode The mode for opening the stream + * out_arh Archive header to be filled in + * mode "r" for read-only access, "r+" for read-write access * - * Results: - * An FILE *, opened for reading and writing, positioned at the - * start of the member's struct ar_hdr, or NULL if the member was - * nonexistent. The current struct ar_hdr for member. + * Output: + * return The archive file, positioned at the start of the + * member's struct ar_hdr, or NULL if the member doesn't + * exist. + * *out_arh The current struct ar_hdr for member. * - * Side Effects: - * The passed struct ar_hdr structure is filled in. - * - *----------------------------------------------------------------------- + * See ArchStatMember for an almost identical copy of this code. */ static FILE * -ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr, - const char *mode) +ArchFindMember(const char *archive, const char *member, struct ar_hdr *out_arh, + const char *mode) { - FILE * arch; /* Stream to archive */ - int size; /* Size of archive member */ - char *cp; /* Useful character pointer */ - char magic[SARMAG]; - size_t len, tlen; + FILE *arch; /* Stream to archive */ + int size; /* Size of archive member */ + char magic[SARMAG]; + size_t len; - arch = fopen(archive, mode); - if (arch == NULL) { - return NULL; - } + arch = fopen(archive, mode); + if (arch == NULL) + return NULL; - /* - * We use the ARMAG string to make sure this is an archive we - * can handle... - */ - if ((fread(magic, SARMAG, 1, arch) != 1) || - (strncmp(magic, ARMAG, SARMAG) != 0)) { - fclose(arch); - return NULL; - } + /* + * We use the ARMAG string to make sure this is an archive we + * can handle... + */ + if (fread(magic, SARMAG, 1, arch) != 1 || + strncmp(magic, ARMAG, SARMAG) != 0) { + fclose(arch); + return NULL; + } - /* - * Because of space constraints and similar things, files are archived - * using their final path components, not the entire thing, so we need - * to point 'member' to the final component, if there is one, to make - * the comparisons easier... - */ - cp = strrchr(member, '/'); - if (cp != NULL) { - member = cp + 1; - } - len = tlen = strlen(member); - if (len > sizeof(arhPtr->ar_name)) { - tlen = sizeof(arhPtr->ar_name); - } + /* + * Because of space constraints and similar things, files are archived + * using their basename, not the entire path. + */ + member = str_basename(member); + + len = strlen(member); + + while (fread(out_arh, sizeof *out_arh, 1, arch) == 1) { + + if (strncmp(out_arh->ar_fmag, ARFMAG, + sizeof out_arh->ar_fmag) != 0) { + /* + * The header is bogus, so the archive is bad + * and there's no way we can recover... + */ + fclose(arch); + return NULL; + } + + DEBUG5(ARCH, "Reading archive %s member %.*s mtime %.*s\n", + archive, + (int)sizeof out_arh->ar_name, out_arh->ar_name, + (int)sizeof out_arh->ar_date, out_arh->ar_date); + + if (ArchiveMember_HasName(out_arh, member, len)) { + /* + * To make life easier for callers that want to update + * the archive, we reposition the file at the start of + * the header we just read before we return the + * stream. In a more general situation, it might be + * better to leave the file at the actual member, + * rather than its header, but not here. + */ + if (fseek(arch, -(long)sizeof *out_arh, SEEK_CUR) != + 0) { + fclose(arch); + return NULL; + } + return arch; + } - while (fread((char *)arhPtr, sizeof(struct ar_hdr), 1, arch) == 1) { - if (strncmp(arhPtr->ar_fmag, ARFMAG, sizeof(arhPtr->ar_fmag) ) != 0) { - /* - * The header is bogus, so the archive is bad - * and there's no way we can recover... - */ - fclose(arch); - return NULL; - } else if (strncmp(member, arhPtr->ar_name, tlen) == 0) { - /* - * If the member's name doesn't take up the entire 'name' field, - * we have to be careful of matching prefixes. Names are space- - * padded to the right, so if the character in 'name' at the end - * of the matched string is anything but a space, this isn't the - * member we sought. - */ - if (tlen != sizeof(arhPtr->ar_name) && arhPtr->ar_name[tlen] != ' '){ - goto skip; - } else { - /* - * To make life easier, we reposition the file at the start - * of the header we just read before we return the stream. - * In a more general situation, it might be better to leave - * the file at the actual member, rather than its header, but - * not here... - */ - fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR); - return (arch); - } - } else #ifdef AR_EFMT1 /* * BSD 4.4 extended AR format: #1/, with name as the * first bytes of the file */ - if (strncmp(arhPtr->ar_name, AR_EFMT1, - sizeof(AR_EFMT1) - 1) == 0 && - isdigit((unsigned char)arhPtr->ar_name[sizeof(AR_EFMT1) - 1])) { + if (strncmp(out_arh->ar_name, AR_EFMT1, sizeof AR_EFMT1 - 1) == + 0 && + (ch_isdigit(out_arh->ar_name[sizeof AR_EFMT1 - 1]))) { + int elen = atoi(&out_arh->ar_name[sizeof AR_EFMT1 - 1]); + char ename[MAXPATHLEN + 1]; - unsigned int elen = atoi(&arhPtr->ar_name[sizeof(AR_EFMT1)-1]); - char ename[MAXPATHLEN + 1]; - - if (elen > MAXPATHLEN) { - fclose(arch); - return NULL; + if ((unsigned int)elen > MAXPATHLEN) { + fclose(arch); + return NULL; + } + if (fread(ename, (size_t)elen, 1, arch) != 1) { + fclose(arch); + return NULL; + } + ename[elen] = '\0'; + if (DEBUG(ARCH) || DEBUG(MAKE)) + debug_printf( + "ArchFindMember: " + "Extended format entry for %s\n", + ename); + if (strncmp(ename, member, len) == 0) { + /* Found as extended name */ + if (fseek(arch, + -(long)sizeof(struct ar_hdr) - elen, + SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } + return arch; + } + if (fseek(arch, -elen, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } } - if (fread(ename, elen, 1, arch) != 1) { - fclose(arch); - return NULL; - } - ename[elen] = '\0'; - if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "ArchFind: Extended format entry for %s\n", ename); - } - if (strncmp(ename, member, len) == 0) { - /* Found as extended name */ - fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR); - return (arch); - } - fseek(arch, -elen, SEEK_CUR); - goto skip; - } else #endif - { -skip: - /* - * This isn't the member we're after, so we need to advance the - * stream's pointer to the start of the next header. Files are - * padded with newlines to an even-byte boundary, so we need to - * extract the size of the file from the 'size' field of the - * header and round it up during the seek. - */ - arhPtr->ar_size[sizeof(arhPtr->ar_size)-1] = '\0'; - size = (int)strtol(arhPtr->ar_size, NULL, 10); - fseek(arch, (size + 1) & ~1, SEEK_CUR); - } - } - /* - * We've looked everywhere, but the member is not to be found. Close the - * archive and return NULL -- an error. - */ - fclose(arch); - return NULL; + /* + * This isn't the member we're after, so we need to advance the + * stream's pointer to the start of the next header. Files are + * padded with newlines to an even-byte boundary, so we need to + * extract the size of the file from the 'size' field of the + * header and round it up during the seek. + */ + out_arh->ar_size[sizeof out_arh->ar_size - 1] = '\0'; + size = (int)strtol(out_arh->ar_size, NULL, 10); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } + } + + fclose(arch); + return NULL; } -/*- - *----------------------------------------------------------------------- - * Arch_Touch -- - * Touch a member of an archive. +/* + * Touch a member of an archive, on disk. + * The GNode's modification time is left as-is. + * + * The st_mtime of the entire archive is also changed. + * For a library, it may be required to run ranlib after this. * * Input: * gn Node of member to touch * * Results: * The 'time' field of the member's header is updated. - * - * Side Effects: - * The modification time of the entire archive is also changed. - * For a library, this could necessitate the re-ranlib'ing of the - * whole thing. - * - *----------------------------------------------------------------------- */ void Arch_Touch(GNode *gn) { - FILE * arch; /* Stream open to archive, positioned properly */ - struct ar_hdr arh; /* Current header describing member */ - char *p1, *p2; + FILE *f; + struct ar_hdr arh; - arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1), - Var_Value(MEMBER, gn, &p2), - &arh, "r+"); - if (p1) - free(p1); - if (p2) - free(p2); - snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now); + f = ArchFindMember(GNode_VarArchive(gn), GNode_VarMember(gn), &arh, + "r+"); + if (f == NULL) + return; - if (arch != NULL) { - (void)fwrite((char *)&arh, sizeof(struct ar_hdr), 1, arch); - fclose(arch); - } + snprintf(arh.ar_date, sizeof arh.ar_date, "%-ld", (unsigned long)now); + (void)fwrite(&arh, sizeof arh, 1, f); + fclose(f); /* TODO: handle errors */ } -/*- - *----------------------------------------------------------------------- - * Arch_TouchLib -- - * Given a node which represents a library, touch the thing, making - * sure that the table of contents also is touched. +/* + * Given a node which represents a library, touch the thing, making sure that + * the table of contents is also touched. * - * Input: - * gn The node of the library to touch - * - * Results: - * None. - * - * Side Effects: - * Both the modification time of the library and of the RANLIBMAG - * member are set to 'now'. - * - *----------------------------------------------------------------------- + * Both the modification time of the library and of the RANLIBMAG member are + * set to 'now'. */ +/*ARGSUSED*/ void -#if !defined(RANLIBMAG) Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED) -#else -Arch_TouchLib(GNode *gn) -#endif { #ifdef RANLIBMAG - FILE * arch; /* Stream open to archive */ - struct ar_hdr arh; /* Header describing table of contents */ - struct utimbuf times; /* Times for utime() call */ + FILE *f; + struct ar_hdr arh; /* Header describing table of contents */ + struct utimbuf times; - arch = ArchFindMember(gn->path, UNCONST(RANLIBMAG), &arh, "r+"); - snprintf(arh.ar_date, sizeof(arh.ar_date), "%-12ld", (long) now); + f = ArchFindMember(gn->path, RANLIBMAG, &arh, "r+"); + if (f == NULL) + return; - if (arch != NULL) { - (void)fwrite((char *)&arh, sizeof(struct ar_hdr), 1, arch); - fclose(arch); + snprintf(arh.ar_date, sizeof arh.ar_date, "%-ld", (unsigned long)now); + (void)fwrite(&arh, sizeof arh, 1, f); + fclose(f); /* TODO: handle errors */ times.actime = times.modtime = now; - utime(gn->path, ×); - } + utime(gn->path, ×); /* TODO: handle errors */ #endif } -/*- - *----------------------------------------------------------------------- - * Arch_MTime -- - * Return the modification time of a member of an archive. - * - * Input: - * gn Node describing archive member - * - * Results: - * The modification time(seconds). - * - * Side Effects: - * The mtime field of the given node is filled in with the value - * returned by the function. - * - *----------------------------------------------------------------------- +/* + * Update the mtime of the GNode with the mtime from the archive member on + * disk (or in the cache). */ -time_t -Arch_MTime(GNode *gn) +void +Arch_UpdateMTime(GNode *gn) { - struct ar_hdr *arhPtr; /* Header of desired member */ - time_t modTime; /* Modification time as an integer */ - char *p1, *p2; + struct ar_hdr *arh; - arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1), - Var_Value(MEMBER, gn, &p2), - TRUE); - if (p1) - free(p1); - if (p2) - free(p2); - - if (arhPtr != NULL) { - modTime = (time_t)strtol(arhPtr->ar_date, NULL, 10); - } else { - modTime = 0; - } - - gn->mtime = modTime; - return (modTime); + arh = ArchStatMember(GNode_VarArchive(gn), GNode_VarMember(gn), TRUE); + if (arh != NULL) + gn->mtime = (time_t)strtol(arh->ar_date, NULL, 10); + else + gn->mtime = 0; } -/*- - *----------------------------------------------------------------------- - * Arch_MemMTime -- - * Given a non-existent archive member's node, get its modification - * time from its archived form, if it exists. - * - * Results: - * The modification time. - * - * Side Effects: - * The mtime field is filled in. - * - *----------------------------------------------------------------------- +/* + * Given a nonexistent archive member's node, update gn->mtime from its + * archived form, if it exists. */ -time_t -Arch_MemMTime(GNode *gn) +void +Arch_UpdateMemberMTime(GNode *gn) { - LstNode ln; - GNode *pgn; - char *nameStart, - *nameEnd; + GNodeListNode *ln; - if (Lst_Open(gn->parents) != SUCCESS) { - gn->mtime = 0; - return (0); - } - while ((ln = Lst_Next(gn->parents)) != NULL) { - pgn = (GNode *)Lst_Datum(ln); + for (ln = gn->parents.first; ln != NULL; ln = ln->next) { + GNode *pgn = ln->datum; - if (pgn->type & OP_ARCHV) { - /* - * If the parent is an archive specification and is being made - * and its member's name matches the name of the node we were - * given, record the modification time of the parent in the - * child. We keep searching its parents in case some other - * parent requires this child to exist... - */ - nameStart = strchr(pgn->name, '(') + 1; - nameEnd = strchr(nameStart, ')'); + if (pgn->type & OP_ARCHV) { + /* + * If the parent is an archive specification and is + * being made and its member's name matches the name + * of the node we were given, record the modification + * time of the parent in the child. We keep searching + * its parents in case some other parent requires this + * child to exist. + */ + const char *nameStart = strchr(pgn->name, '(') + 1; + const char *nameEnd = strchr(nameStart, ')'); + size_t nameLen = (size_t)(nameEnd - nameStart); - if ((pgn->flags & REMAKE) && - strncmp(nameStart, gn->name, nameEnd - nameStart) == 0) { - gn->mtime = Arch_MTime(pgn); - } - } else if (pgn->flags & REMAKE) { - /* - * Something which isn't a library depends on the existence of - * this target, so it needs to exist. - */ - gn->mtime = 0; - break; + if ((pgn->flags & REMAKE) && + strncmp(nameStart, gn->name, nameLen) == 0) { + Arch_UpdateMTime(pgn); + gn->mtime = pgn->mtime; + } + } else if (pgn->flags & REMAKE) { + /* + * Something which isn't a library depends on the + * existence of this target, so it needs to exist. + */ + gn->mtime = 0; + break; + } } - } - - Lst_Close(gn->parents); - - return (gn->mtime); } -/*- - *----------------------------------------------------------------------- - * Arch_FindLib -- - * Search for a library along the given search path. +/* + * Search for a library along the given search path. + * + * The node's 'path' field is set to the found path (including the + * actual file name, not -l...). If the system can handle the -L + * flag when linking (or we cannot find the library), we assume that + * the user has placed the .LIBS variable in the final linking + * command (or the linker will know where to find it) and set the + * TARGET variable for this node to be the node's name. Otherwise, + * we set the TARGET variable to be the full path of the library, + * as returned by Dir_FindFile. * * Input: * gn Node of library to find - * path Search path - * - * Results: - * None. - * - * Side Effects: - * The node's 'path' field is set to the found path (including the - * actual file name, not -l...). If the system can handle the -L - * flag when linking (or we cannot find the library), we assume that - * the user has placed the .LIBRARIES variable in the final linking - * command (or the linker will know where to find it) and set the - * TARGET variable for this node to be the node's name. Otherwise, - * we set the TARGET variable to be the full path of the library, - * as returned by Dir_FindFile. - * - *----------------------------------------------------------------------- */ void -Arch_FindLib(GNode *gn, Lst path) +Arch_FindLib(GNode *gn, SearchPath *path) { - char *libName; /* file name for archive */ - size_t sz = strlen(gn->name) + 6 - 2; - - libName = bmake_malloc(sz); - snprintf(libName, sz, "lib%s.a", &gn->name[2]); - - gn->path = Dir_FindFile(libName, path); - - free(libName); + char *libName = str_concat3("lib", gn->name + 2, ".a"); + gn->path = Dir_FindFile(libName, path); + free(libName); #ifdef LIBRARIES - Var_Set(TARGET, gn->name, gn, 0); + Var_Set(gn, TARGET, gn->name); #else - Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn, 0); -#endif /* LIBRARIES */ + Var_Set(gn, TARGET, GNode_Path(gn)); +#endif } -/*- - *----------------------------------------------------------------------- - * Arch_LibOODate -- - * Decide if a node with the OP_LIB attribute is out-of-date. Called - * from Make_OODate to make its life easier. +/* + * Decide if a node with the OP_LIB attribute is out-of-date. Called from + * GNode_IsOODate to make its life easier. + * The library is cached if it hasn't been already. * - * There are several ways for a library to be out-of-date that are - * not available to ordinary files. In addition, there are ways - * that are open to regular files that are not available to - * libraries. A library that is only used as a source is never - * considered out-of-date by itself. This does not preclude the - * library's modification time from making its parent be out-of-date. - * A library will be considered out-of-date for any of these reasons, - * given that it is a target on a dependency line somewhere: - * Its modification time is less than that of one of its - * sources (gn->mtime < gn->cmgn->mtime). - * Its modification time is greater than the time at which the - * make began (i.e. it's been modified in the course - * of the make, probably by archiving). - * The modification time of one of its sources is greater than - * the one of its RANLIBMAG member (i.e. its table of contents - * is out-of-date). We don't compare of the archive time - * vs. TOC time because they can be too close. In my - * opinion we should not bother with the TOC at all since - * this is used by 'ar' rules that affect the data contents - * of the archive, not by ranlib rules, which affect the - * TOC. + * There are several ways for a library to be out-of-date that are + * not available to ordinary files. In addition, there are ways + * that are open to regular files that are not available to + * libraries. * - * Input: - * gn The library's graph node + * A library that is only used as a source is never + * considered out-of-date by itself. This does not preclude the + * library's modification time from making its parent be out-of-date. + * A library will be considered out-of-date for any of these reasons, + * given that it is a target on a dependency line somewhere: * - * Results: - * TRUE if the library is out-of-date. FALSE otherwise. + * Its modification time is less than that of one of its sources + * (gn->mtime < gn->youngestChild->mtime). * - * Side Effects: - * The library will be hashed if it hasn't been already. + * Its modification time is greater than the time at which the make + * began (i.e. it's been modified in the course of the make, probably + * by archiving). * - *----------------------------------------------------------------------- + * The modification time of one of its sources is greater than the one + * of its RANLIBMAG member (i.e. its table of contents is out-of-date). + * We don't compare the archive time vs. TOC time because they can be + * too close. In my opinion we should not bother with the TOC at all + * since this is used by 'ar' rules that affect the data contents of the + * archive, not by ranlib rules, which affect the TOC. */ Boolean Arch_LibOODate(GNode *gn) { - Boolean oodate; + Boolean oodate; - if (gn->type & OP_PHONY) { - oodate = TRUE; - } else if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) { - oodate = FALSE; - } else if ((!Lst_IsEmpty(gn->children) && gn->cmgn == NULL) || - (gn->mtime > now) || - (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime)) { - oodate = TRUE; - } else { -#ifdef RANLIBMAG - struct ar_hdr *arhPtr; /* Header for __.SYMDEF */ - int modTimeTOC; /* The table-of-contents's mod time */ - - arhPtr = ArchStatMember(gn->path, UNCONST(RANLIBMAG), FALSE); - - if (arhPtr != NULL) { - modTimeTOC = (int)strtol(arhPtr->ar_date, NULL, 10); - - if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC)); - } - oodate = (gn->cmgn == NULL || gn->cmgn->mtime > modTimeTOC); + if (gn->type & OP_PHONY) { + oodate = TRUE; + } else if (!GNode_IsTarget(gn) && Lst_IsEmpty(&gn->children)) { + oodate = FALSE; + } else if ((!Lst_IsEmpty(&gn->children) && gn->youngestChild == NULL) || + (gn->mtime > now) || + (gn->youngestChild != NULL && + gn->mtime < gn->youngestChild->mtime)) { + oodate = TRUE; } else { - /* - * A library w/o a table of contents is out-of-date - */ - if (DEBUG(ARCH) || DEBUG(MAKE)) { - fprintf(debug_file, "No t.o.c...."); - } - oodate = TRUE; - } +#ifdef RANLIBMAG + struct ar_hdr *arh; /* Header for __.SYMDEF */ + int modTimeTOC; /* The table-of-contents' mod time */ + + arh = ArchStatMember(gn->path, RANLIBMAG, FALSE); + + if (arh != NULL) { + modTimeTOC = (int)strtol(arh->ar_date, NULL, 10); + + if (DEBUG(ARCH) || DEBUG(MAKE)) + debug_printf("%s modified %s...", + RANLIBMAG, + Targ_FmtTime(modTimeTOC)); + oodate = gn->youngestChild == NULL || + gn->youngestChild->mtime > modTimeTOC; + } else { + /* + * A library without a table of contents is out-of-date. + */ + if (DEBUG(ARCH) || DEBUG(MAKE)) + debug_printf("no toc..."); + oodate = TRUE; + } #else - oodate = FALSE; + oodate = FALSE; #endif - } - return (oodate); + } + return oodate; } -/*- - *----------------------------------------------------------------------- - * Arch_Init -- - * Initialize things for this module. - * - * Results: - * None. - * - * Side Effects: - * The 'archives' list is initialized. - * - *----------------------------------------------------------------------- - */ +/* Initialize the archives module. */ void Arch_Init(void) { - archives = Lst_Init(FALSE); + Lst_Init(&archives); } - - -/*- - *----------------------------------------------------------------------- - * Arch_End -- - * Cleanup things for this module. - * - * Results: - * None. - * - * Side Effects: - * The 'archives' list is freed - * - *----------------------------------------------------------------------- - */ +/* Clean up the archives module. */ void Arch_End(void) { #ifdef CLEANUP - Lst_Destroy(archives, ArchFree); + Lst_DoneCall(&archives, ArchFree); #endif } -/*- - *----------------------------------------------------------------------- - * Arch_IsLib -- - * Check if the node is a library - * - * Results: - * True or False. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -int +Boolean Arch_IsLib(GNode *gn) { - static const char armag[] = "!\n"; - char buf[sizeof(armag)-1]; - int fd; + static const char armag[] = "!\n"; + char buf[sizeof armag - 1]; + int fd; - if ((fd = open(gn->path, O_RDONLY)) == -1) - return FALSE; + if ((fd = open(gn->path, O_RDONLY)) == -1) + return FALSE; + + if (read(fd, buf, sizeof buf) != sizeof buf) { + (void)close(fd); + return FALSE; + } - if (read(fd, buf, sizeof(buf)) != sizeof(buf)) { (void)close(fd); - return FALSE; - } - (void)close(fd); - - return memcmp(buf, armag, sizeof(buf)) == 0; + return memcmp(buf, armag, sizeof buf) == 0; } diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c index ac95c16c1..cef082247 100644 --- a/usr.bin/make/buf.c +++ b/usr.bin/make/buf.c @@ -1,4 +1,4 @@ -/* $NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.c,v 1.51 2021/01/30 21:18:14 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -69,223 +69,152 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: buf.c,v 1.25 2012/04/24 20:26:58 sjg Exp $"); +/* Automatically-expanding null-terminated character buffers. */ + +#include +#include "make.h" + +/* "@(#)buf.c 8.1 (Berkeley) 6/6/93" */ +MAKE_RCSID("$NetBSD: buf.c,v 1.51 2021/01/30 21:18:14 rillig Exp $"); + +/* Make space in the buffer for adding at least 16 more bytes. */ +void +Buf_Expand(Buffer *buf) +{ + buf->cap += buf->cap > 16 ? buf->cap : 16; + buf->data = bmake_realloc(buf->data, buf->cap); +} + +/* Add the bytes to the buffer. */ +void +Buf_AddBytes(Buffer *buf, const char *bytes, size_t bytes_len) +{ + size_t old_len = buf->len; + char *end; + + if (old_len + bytes_len >= buf->cap) { + size_t minIncr = bytes_len + 16; + buf->cap += buf->cap > minIncr ? buf->cap : minIncr; + buf->data = bmake_realloc(buf->data, buf->cap); + } + + end = buf->data + old_len; + buf->len = old_len + bytes_len; + memcpy(end, bytes, bytes_len); + end[bytes_len] = '\0'; +} + +/* Add the bytes between start and end to the buffer. */ +void +Buf_AddBytesBetween(Buffer *buf, const char *start, const char *end) +{ + Buf_AddBytes(buf, start, (size_t)(end - start)); +} + +/* Add the string to the buffer. */ +void +Buf_AddStr(Buffer *buf, const char *str) +{ + Buf_AddBytes(buf, str, strlen(str)); +} + +/* Add the number to the buffer. */ +void +Buf_AddInt(Buffer *buf, int n) +{ + enum { + bits = sizeof(int) * CHAR_BIT, + max_octal_digits = (bits + 2) / 3, + max_decimal_digits = /* at most */ max_octal_digits, + max_sign_chars = 1, + str_size = max_sign_chars + max_decimal_digits + 1 + }; + char str[str_size]; + + size_t len = (size_t)snprintf(str, sizeof str, "%d", n); + Buf_AddBytes(buf, str, len); +} + +/* Mark the buffer as empty, so it can be filled with data again. */ +void +Buf_Empty(Buffer *buf) +{ + buf->len = 0; + buf->data[0] = '\0'; +} + +/* Initialize a buffer. */ +void +Buf_InitSize(Buffer *buf, size_t cap) +{ + buf->cap = cap; + buf->len = 0; + buf->data = bmake_malloc(cap); + buf->data[0] = '\0'; +} + +void +Buf_Init(Buffer *buf) +{ + Buf_InitSize(buf, 256); +} + +/* + * Free the data from the buffer. + * Leave the buffer itself in an indeterminate state. + */ +void +Buf_Done(Buffer *buf) +{ + free(buf->data); + +#ifdef CLEANUP + buf->cap = 0; + buf->len = 0; + buf->data = NULL; #endif -#endif /* not lint */ +} + +/* + * Return the data from the buffer. + * Leave the buffer itself in an indeterminate state. + */ +char * +Buf_DoneData(Buffer *buf) +{ + char *data = buf->data; + +#ifdef CLEANUP + buf->cap = 0; + buf->len = 0; + buf->data = NULL; #endif -/*- - * buf.c -- - * Functions for automatically-expanded buffers. - */ - -#include "make.h" -#include "buf.h" - -#ifndef max -#define max(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#define BUF_DEF_SIZE 256 /* Default buffer size */ - -/*- - *----------------------------------------------------------------------- - * Buf_Expand_1 -- - * Extend buffer for single byte add. - * - *----------------------------------------------------------------------- - */ -void -Buf_Expand_1(Buffer *bp) -{ - bp->size += max(bp->size, 16); - bp->buffer = bmake_realloc(bp->buffer, bp->size); + return data; } -/*- - *----------------------------------------------------------------------- - * Buf_AddBytes -- - * Add a number of bytes to the buffer. - * - * Results: - * None. - * - * Side Effects: - * Guess what? - * - *----------------------------------------------------------------------- - */ -void -Buf_AddBytes(Buffer *bp, int numBytes, const Byte *bytesPtr) -{ - int count = bp->count; - Byte *ptr; - - if (__predict_false(count + numBytes >= bp->size)) { - bp->size += max(bp->size, numBytes + 16); - bp->buffer = bmake_realloc(bp->buffer, bp->size); - } - - ptr = bp->buffer + count; - bp->count = count + numBytes; - ptr[numBytes] = 0; - memcpy(ptr, bytesPtr, numBytes); -} - -/*- - *----------------------------------------------------------------------- - * Buf_GetAll -- - * Get all the available data at once. - * - * Results: - * A pointer to the data and the number of bytes available. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -Byte * -Buf_GetAll(Buffer *bp, int *numBytesPtr) -{ - - if (numBytesPtr != NULL) - *numBytesPtr = bp->count; - - return (bp->buffer); -} - -/*- - *----------------------------------------------------------------------- - * Buf_Empty -- - * Throw away bytes in a buffer. - * - * Results: - * None. - * - * Side Effects: - * The bytes are discarded. - * - *----------------------------------------------------------------------- - */ -void -Buf_Empty(Buffer *bp) -{ - - bp->count = 0; - *bp->buffer = 0; -} - -/*- - *----------------------------------------------------------------------- - * Buf_Init -- - * Initialize a buffer. If no initial size is given, a reasonable - * default is used. - * - * Input: - * size Initial size for the buffer - * - * Results: - * A buffer to be given to other functions in this library. - * - * Side Effects: - * The buffer is created, the space allocated and pointers - * initialized. - * - *----------------------------------------------------------------------- - */ -void -Buf_Init(Buffer *bp, int size) -{ - if (size <= 0) { - size = BUF_DEF_SIZE; - } - bp->size = size; - bp->count = 0; - bp->buffer = bmake_malloc(size); - *bp->buffer = 0; -} - -/*- - *----------------------------------------------------------------------- - * Buf_Destroy -- - * Nuke a buffer and all its resources. - * - * Input: - * buf Buffer to destroy - * freeData TRUE if the data should be destroyed - * - * Results: - * Data buffer, NULL if freed - * - * Side Effects: - * The buffer is freed. - * - *----------------------------------------------------------------------- - */ -Byte * -Buf_Destroy(Buffer *buf, Boolean freeData) -{ - Byte *data; - - data = buf->buffer; - if (freeData) { - free(data); - data = NULL; - } - - buf->size = 0; - buf->count = 0; - buf->buffer = NULL; - - return data; -} - - -/*- - *----------------------------------------------------------------------- - * Buf_DestroyCompact -- - * Nuke a buffer and return its data. - * - * Input: - * buf Buffer to destroy - * - * Results: - * Data buffer - * - * Side Effects: - * If the buffer size is much greater than its content, - * a new buffer will be allocated and the old one freed. - * - *----------------------------------------------------------------------- - */ #ifndef BUF_COMPACT_LIMIT -# define BUF_COMPACT_LIMIT 128 /* worthwhile saving */ +# define BUF_COMPACT_LIMIT 128 /* worthwhile saving */ #endif -Byte * -Buf_DestroyCompact(Buffer *buf) +/* + * Return the data from the buffer. + * Leave the buffer itself in an indeterminate state. + * + * If the buffer size is much greater than its content, + * a new buffer will be allocated and the old one freed. + */ +char * +Buf_DoneDataCompact(Buffer *buf) { #if BUF_COMPACT_LIMIT > 0 - Byte *data; - - if (buf->size - buf->count >= BUF_COMPACT_LIMIT) { - /* We trust realloc to be smart */ - data = bmake_realloc(buf->buffer, buf->count + 1); - if (data) { - data[buf->count] = 0; - Buf_Destroy(buf, FALSE); - return data; + if (buf->cap - buf->len >= BUF_COMPACT_LIMIT) { + /* We trust realloc to be smart */ + char *data = bmake_realloc(buf->data, buf->len + 1); + data[buf->len] = '\0'; /* XXX: unnecessary */ + Buf_DoneData(buf); + return data; } - } #endif - return Buf_Destroy(buf, FALSE); + return Buf_DoneData(buf); } diff --git a/usr.bin/make/buf.h b/usr.bin/make/buf.h index 25be67d79..594e9651d 100644 --- a/usr.bin/make/buf.h +++ b/usr.bin/make/buf.h @@ -1,4 +1,4 @@ -/* $NetBSD: buf.h,v 1.17 2012/04/24 20:26:58 sjg Exp $ */ +/* $NetBSD: buf.h,v 1.42 2021/01/30 21:25:10 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -72,48 +72,50 @@ * from: @(#)buf.h 8.1 (Berkeley) 6/6/93 */ -/*- - * buf.h -- - * Header for users of the buf library. - */ +/* Automatically growing null-terminated buffers of characters. */ -#ifndef _BUF_H -#define _BUF_H +#ifndef MAKE_BUF_H +#define MAKE_BUF_H -typedef char Byte; +#include +/* An automatically growing null-terminated buffer of characters. */ typedef struct Buffer { - int size; /* Current size of the buffer */ - int count; /* Number of bytes in buffer */ - Byte *buffer; /* The buffer itself (zero terminated) */ + size_t cap; /* Allocated size of the buffer, including the '\0' */ + size_t len; /* Number of bytes in buffer, excluding the '\0' */ + char *data; /* The buffer itself (always null-terminated) */ } Buffer; -/* If we aren't on netbsd, __predict_false() might not be defined. */ -#ifndef __predict_false -#define __predict_false(x) (x) -#endif +void Buf_Expand(Buffer *); /* Buf_AddByte adds a single byte to a buffer. */ -#define Buf_AddByte(bp, byte) do { \ - int _count = ++(bp)->count; \ - char *_ptr; \ - if (__predict_false(_count >= (bp)->size)) \ - Buf_Expand_1(bp); \ - _ptr = (bp)->buffer + _count; \ - _ptr[-1] = (byte); \ - _ptr[0] = 0; \ - } while (0) +MAKE_INLINE void +Buf_AddByte(Buffer *buf, char byte) +{ + size_t old_len = buf->len++; + char *end; + if (old_len + 1 >= buf->cap) + Buf_Expand(buf); + end = buf->data + old_len; + end[0] = byte; + end[1] = '\0'; +} -#define BUF_ERROR 256 +MAKE_INLINE Boolean +Buf_EndsWith(const Buffer *buf, char ch) +{ + return buf->len > 0 && buf->data[buf->len - 1] == ch; +} -#define Buf_Size(bp) ((bp)->count) - -void Buf_Expand_1(Buffer *); -void Buf_AddBytes(Buffer *, int, const Byte *); -Byte *Buf_GetAll(Buffer *, int *); +void Buf_AddBytes(Buffer *, const char *, size_t); +void Buf_AddBytesBetween(Buffer *, const char *, const char *); +void Buf_AddStr(Buffer *, const char *); +void Buf_AddInt(Buffer *, int); void Buf_Empty(Buffer *); -void Buf_Init(Buffer *, int); -Byte *Buf_Destroy(Buffer *, Boolean); -Byte *Buf_DestroyCompact(Buffer *); +void Buf_Init(Buffer *); +void Buf_InitSize(Buffer *, size_t); +void Buf_Done(Buffer *); +char *Buf_DoneData(Buffer *); +char *Buf_DoneDataCompact(Buffer *); -#endif /* _BUF_H */ +#endif /* MAKE_BUF_H */ diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index 7eecd5fb2..686acbf22 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos Exp $ */ +/* $NetBSD: compat.c,v 1.224 2021/02/05 05:15:12 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -69,20 +69,7 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; -#else -__RCSID("$NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- +/* * compat.c -- * The routines in this file implement the full-compatibility * mode of PMake. Most of the special functionality of PMake @@ -91,654 +78,682 @@ __RCSID("$NetBSD: compat.c,v 1.100 2015/06/19 14:32:04 christos Exp $"); * - friendly variable substitution. * * Interface: - * Compat_Run Initialize things for this module and recreate - * thems as need creatin' + * Compat_Run Initialize things for this module and recreate + * thems as need creatin' */ -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include +#include +#include -#include "make.h" -#include "hash.h" -#include "dir.h" -#include "job.h" -#include "metachar.h" -#include "pathnames.h" +#include "make.h" +#include "dir.h" +#include "job.h" +#include "metachar.h" +#include "pathnames.h" +/* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ +MAKE_RCSID("$NetBSD: compat.c,v 1.224 2021/02/05 05:15:12 rillig Exp $"); -static GNode *curTarg = NULL; -static GNode *ENDNode; -static void CompatInterrupt(int); +static GNode *curTarg = NULL; +static pid_t compatChild; +static int compatSigno; -/*- - *----------------------------------------------------------------------- - * CompatInterrupt -- - * Interrupt the creation of the current target and remove it if - * it ain't precious. +/* + * CompatDeleteTarget -- delete the file of a failed, interrupted, or + * otherwise duffed target if not inhibited by .PRECIOUS. + */ +static void +CompatDeleteTarget(GNode *gn) +{ + if (gn != NULL && !Targ_Precious(gn)) { + const char *file = GNode_VarTarget(gn); + + if (!opts.noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + } +} + +/* + * Interrupt the creation of the current target and remove it if it ain't + * precious. Then exit. * - * Results: - * None. + * If .INTERRUPT exists, its commands are run first WITH INTERRUPTS IGNORED. * - * Side Effects: - * The target is removed and the process exits. If .INTERRUPT exists, - * its commands are run first WITH INTERRUPTS IGNORED.. - * - *----------------------------------------------------------------------- + * XXX: is .PRECIOUS supposed to inhibit .INTERRUPT? I doubt it, but I've + * left the logic alone for now. - dholland 20160826 */ static void CompatInterrupt(int signo) { - GNode *gn; + CompatDeleteTarget(curTarg); - if ((curTarg != NULL) && !Targ_Precious (curTarg)) { - char *p1; - char *file = Var_Value(TARGET, curTarg, &p1); - - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); + if (curTarg != NULL && !Targ_Precious(curTarg)) { + /* + * Run .INTERRUPT only if hit with interrupt signal + */ + if (signo == SIGINT) { + GNode *gn = Targ_FindNode(".INTERRUPT"); + if (gn != NULL) { + Compat_Make(gn, gn); + } + } } - if (p1) - free(p1); + + if (signo == SIGQUIT) + _exit(signo); /* - * Run .INTERRUPT only if hit with interrupt signal + * If there is a child running, pass the signal on. + * We will exist after it has exited. */ - if (signo == SIGINT) { - gn = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); - if (gn != NULL) { - Compat_Make(gn, gn); - } + compatSigno = signo; + if (compatChild > 0) { + KILLPG(compatChild, signo); + } else { + bmake_signal(signo, SIG_DFL); + kill(myPid, signo); } - - } - if (signo == SIGQUIT) - _exit(signo); - bmake_signal(signo, SIG_DFL); - kill(myPid, signo); } - -/*- - *----------------------------------------------------------------------- - * CompatRunCommand -- - * Execute the next command for a target. If the command returns an - * error, the node's made field is set to ERROR and creation stops. + +static void +DebugFailedTarget(const char *cmd, GNode *gn) +{ + const char *p = cmd; + debug_printf("\n*** Failed target: %s\n*** Failed command: ", + gn->name); + + /* Replace runs of whitespace with a single space, to reduce + * the amount of whitespace for multi-line command lines. */ + while (*p != '\0') { + if (ch_isspace(*p)) { + debug_printf(" "); + cpp_skip_whitespace(&p); + } else { + debug_printf("%c", *p); + p++; + } + } + debug_printf("\n"); +} + +static Boolean +UseShell(const char *cmd MAKE_ATTR_UNUSED) +{ +#if !defined(MAKE_NATIVE) + /* + * In a non-native build, the host environment might be weird enough + * that it's necessary to go through a shell to get the correct + * behaviour. Or perhaps the shell has been replaced with something + * that does extra logging, and that should not be bypassed. + */ + return TRUE; +#else + /* + * Search for meta characters in the command. If there are no meta + * characters, there's no need to execute a shell to execute the + * command. + * + * Additionally variable assignments and empty commands + * go to the shell. Therefore treat '=' and ':' like shell + * meta characters as documented in make(1). + */ + + return needshell(cmd); +#endif +} + +/* + * Execute the next command for a target. If the command returns an error, + * the node's made field is set to ERROR and creation stops. * * Input: * cmdp Command to execute - * gnp Node from which the command came + * gn Node from which the command came + * ln List node that contains the command * * Results: * 0 if the command succeeded, 1 if an error occurred. - * - * Side Effects: - * The node's 'made' field may be set to ERROR. - * - *----------------------------------------------------------------------- */ int -CompatRunCommand(void *cmdp, void *gnp) +Compat_RunCommand(const char *cmdp, GNode *gn, StringListNode *ln) { - char *cmdStart; /* Start of expanded command */ - char *cp, *bp; - Boolean silent, /* Don't print command */ - doIt; /* Execute even if -n */ - volatile Boolean errCheck; /* Check errors */ - int reason; /* Reason for child's death */ - int status; /* Description of child's death */ - pid_t cpid; /* Child actually found */ - pid_t retstat; /* Result of wait */ - LstNode cmdNode; /* Node where current command is located */ - const char ** volatile av; /* Argument vector for thing to exec */ - char ** volatile mav;/* Copy of the argument vector for freeing */ - int argc; /* Number of arguments in av or 0 if not - * dynamically allocated */ - Boolean local; /* TRUE if command should be executed - * locally */ - Boolean useShell; /* TRUE if command should be executed + char *cmdStart; /* Start of expanded command */ + char *bp; + Boolean silent; /* Don't print command */ + Boolean doIt; /* Execute even if -n */ + volatile Boolean errCheck; /* Check errors */ + int reason; /* Reason for child's death */ + int status; /* Description of child's death */ + pid_t cpid; /* Child actually found */ + pid_t retstat; /* Result of wait */ + const char **volatile av; /* Argument vector for thing to exec */ + char **volatile mav; /* Copy of the argument vector for freeing */ + Boolean useShell; /* TRUE if command should be executed * using a shell */ - char * volatile cmd = (char *)cmdp; - GNode *gn = (GNode *)gnp; + const char *volatile cmd = cmdp; - silent = gn->type & OP_SILENT; - errCheck = !(gn->type & OP_IGNORE); - doIt = FALSE; - - cmdNode = Lst_Member(gn->commands, cmd); - cmdStart = Var_Subst(NULL, cmd, gn, FALSE); + silent = (gn->type & OP_SILENT) != 0; + errCheck = !(gn->type & OP_IGNORE); + doIt = FALSE; - /* - * brk_string will return an argv with a NULL in av[0], thus causing - * execvp to choke and die horribly. Besides, how can we execute a null - * command? In any case, we warn the user that the command expanded to - * nothing (is this the right thing to do?). - */ + (void)Var_Subst(cmd, gn, VARE_WANTRES, &cmdStart); + /* TODO: handle errors */ - if (*cmdStart == '\0') { - free(cmdStart); - return(0); - } - cmd = cmdStart; - Lst_Replace(cmdNode, cmdStart); - - if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) { - (void)Lst_AtEnd(ENDNode->commands, cmdStart); - return(0); - } - if (strcmp(cmdStart, "...") == 0) { - gn->type |= OP_SAVE_CMDS; - return(0); - } - - while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) { - switch (*cmd) { - case '@': - silent = DEBUG(LOUD) ? FALSE : TRUE; - break; - case '-': - errCheck = FALSE; - break; - case '+': - doIt = TRUE; - if (!shellName) /* we came here from jobs */ - Shell_Init(); - break; + if (cmdStart[0] == '\0') { + free(cmdStart); + return 0; } - cmd++; - } + cmd = cmdStart; + LstNode_Set(ln, cmdStart); - while (isspace((unsigned char)*cmd)) - cmd++; - - /* - * If we did not end up with a command, just skip it. - */ - if (!*cmd) - return (0); - -#if !defined(MAKE_NATIVE) - /* - * In a non-native build, the host environment might be weird enough - * that it's necessary to go through a shell to get the correct - * behaviour. Or perhaps the shell has been replaced with something - * that does extra logging, and that should not be bypassed. - */ - useShell = TRUE; -#else - /* - * Search for meta characters in the command. If there are no meta - * characters, there's no need to execute a shell to execute the - * command. - * - * Additionally variable assignments and empty commands - * go to the shell. Therefore treat '=' and ':' like shell - * meta characters as documented in make(1). - */ - - useShell = needshell(cmd, FALSE); -#endif - - /* - * Print the command before echoing if we're not supposed to be quiet for - * this one. We also print the command if -n given. - */ - if (!silent || NoExecute(gn)) { - printf("%s\n", cmd); - fflush(stdout); - } - - /* - * If we're not supposed to execute any commands, this is as far as - * we go... - */ - if (!doIt && NoExecute(gn)) { - return (0); - } - if (DEBUG(JOB)) - fprintf(debug_file, "Execute: '%s'\n", cmd); - -again: - if (useShell) { - /* - * We need to pass the command off to the shell, typically - * because the command contains a "meta" character. - */ - static const char *shargv[5]; - int shargc; - - shargc = 0; - shargv[shargc++] = shellPath; - /* - * The following work for any of the builtin shell specs. - */ - if (errCheck && shellErrFlag) { - shargv[shargc++] = shellErrFlag; + if (gn->type & OP_SAVE_CMDS) { + GNode *endNode = Targ_GetEndNode(); + if (gn != endNode) { + /* + * Append the expanded command, to prevent the + * local variables from being interpreted in the + * scope of the .END node. + * + * A probably unintended side effect of this is that + * the expanded command will be expanded again in the + * .END node. Therefore, a literal '$' in these + * commands must be written as '$$$$' instead of the + * usual '$$'. + */ + Lst_Append(&endNode->commands, cmdStart); + return 0; + } } - if (DEBUG(SHELL)) - shargv[shargc++] = "-xc"; - else - shargv[shargc++] = "-c"; - shargv[shargc++] = cmd; - shargv[shargc++] = NULL; - av = shargv; - argc = 0; - bp = NULL; - mav = NULL; - } else { - /* - * No meta-characters, so no need to exec a shell. Break the command - * into words to form an argument vector we can execute. - */ - mav = brk_string(cmd, &argc, TRUE, &bp); - if (mav == NULL) { - useShell = 1; - goto again; + if (strcmp(cmdStart, "...") == 0) { + gn->type |= OP_SAVE_CMDS; + return 0; } - av = (void *)mav; - } - local = TRUE; + for (;;) { + if (*cmd == '@') + silent = !DEBUG(LOUD); + else if (*cmd == '-') + errCheck = FALSE; + else if (*cmd == '+') { + doIt = TRUE; + if (shellName == NULL) /* we came here from jobs */ + Shell_Init(); + } else + break; + cmd++; + } + + while (ch_isspace(*cmd)) + cmd++; + + /* + * If we did not end up with a command, just skip it. + */ + if (cmd[0] == '\0') + return 0; + + useShell = UseShell(cmd); + /* + * Print the command before echoing if we're not supposed to be quiet + * for this one. We also print the command if -n given. + */ + if (!silent || !GNode_ShouldExecute(gn)) { + printf("%s\n", cmd); + fflush(stdout); + } + + /* + * If we're not supposed to execute any commands, this is as far as + * we go... + */ + if (!doIt && !GNode_ShouldExecute(gn)) + return 0; + + DEBUG1(JOB, "Execute: '%s'\n", cmd); + + if (useShell) { + /* + * We need to pass the command off to the shell, typically + * because the command contains a "meta" character. + */ + static const char *shargv[5]; + + /* The following work for any of the builtin shell specs. */ + int shargc = 0; + shargv[shargc++] = shellPath; + if (errCheck && shellErrFlag != NULL) + shargv[shargc++] = shellErrFlag; + shargv[shargc++] = DEBUG(SHELL) ? "-xc" : "-c"; + shargv[shargc++] = cmd; + shargv[shargc] = NULL; + av = shargv; + bp = NULL; + mav = NULL; + } else { + /* + * No meta-characters, so no need to exec a shell. Break the + * command into words to form an argument vector we can + * execute. + */ + Words words = Str_Words(cmd, FALSE); + mav = words.words; + bp = words.freeIt; + av = (void *)mav; + } -#ifdef USE_META - if (useMeta) { - meta_compat_start(); - } -#endif - - /* - * Fork and execute the single command. If the fork fails, we abort. - */ - cpid = vFork(); - if (cpid < 0) { - Fatal("Could not fork"); - } - if (cpid == 0) { - Var_ExportVars(); #ifdef USE_META if (useMeta) { - meta_compat_child(); + meta_compat_start(); } #endif - if (local) - (void)execvp(av[0], (char *const *)UNCONST(av)); - else - (void)execv(av[0], (char *const *)UNCONST(av)); - execError("exec", av[0]); - _exit(1); - } - if (mav) + + Var_ReexportVars(); + + /* + * Fork and execute the single command. If the fork fails, we abort. + */ + compatChild = cpid = vfork(); + if (cpid < 0) { + Fatal("Could not fork"); + } + if (cpid == 0) { +#ifdef USE_META + if (useMeta) { + meta_compat_child(); + } +#endif + (void)execvp(av[0], (char *const *)UNCONST(av)); + execDie("exec", av[0]); + } + free(mav); - if (bp) free(bp); - Lst_Replace(cmdNode, NULL); + + /* XXX: Memory management looks suspicious here. */ + /* XXX: Setting a list item to NULL is unexpected. */ + LstNode_SetNull(ln); #ifdef USE_META - if (useMeta) { - meta_compat_parent(); - } + if (useMeta) { + meta_compat_parent(cpid); + } #endif - /* - * The child is off and running. Now all we can do is wait... - */ - while (1) { - + /* + * The child is off and running. Now all we can do is wait... + */ while ((retstat = wait(&reason)) != cpid) { - if (retstat > 0) - JobReapChild(retstat, reason, FALSE); /* not ours? */ - if (retstat == -1 && errno != EINTR) { - break; - } + if (retstat > 0) + JobReapChild(retstat, reason, FALSE); /* not ours? */ + if (retstat == -1 && errno != EINTR) { + break; + } } - if (retstat > -1) { - if (WIFSTOPPED(reason)) { - status = WSTOPSIG(reason); /* stopped */ - } else if (WIFEXITED(reason)) { - status = WEXITSTATUS(reason); /* exited */ + if (retstat < 0) + Fatal("error in wait: %d: %s", retstat, strerror(errno)); + + if (WIFSTOPPED(reason)) { + status = WSTOPSIG(reason); /* stopped */ + } else if (WIFEXITED(reason)) { + status = WEXITSTATUS(reason); /* exited */ #if defined(USE_META) && defined(USE_FILEMON_ONCE) if (useMeta) { meta_cmd_finish(NULL); } #endif if (status != 0) { - if (DEBUG(ERROR)) { - fprintf(debug_file, "\n*** Failed target: %s\n*** Failed command: ", - gn->name); - for (cp = cmd; *cp; ) { - if (isspace((unsigned char)*cp)) { - fprintf(debug_file, " "); - while (isspace((unsigned char)*cp)) - cp++; - } else { - fprintf(debug_file, "%c", *cp); - cp++; - } - } - fprintf(debug_file, "\n"); - } - printf("*** Error code %d", status); + if (DEBUG(ERROR)) + DebugFailedTarget(cmd, gn); + printf("*** Error code %d", status); } - } else { - status = WTERMSIG(reason); /* signaled */ + } else { + status = WTERMSIG(reason); /* signaled */ printf("*** Signal %d", status); - } + } - if (!WIFEXITED(reason) || (status != 0)) { + if (!WIFEXITED(reason) || status != 0) { if (errCheck) { #ifdef USE_META - if (useMeta) { - meta_job_error(NULL, gn, 0, status); - } + if (useMeta) { + meta_job_error(NULL, gn, FALSE, status); + } #endif - gn->made = ERROR; - if (keepgoing) { - /* - * Abort the current target, but let others - * continue. - */ - printf(" (continuing)\n"); - } + gn->made = ERROR; + if (opts.keepgoing) { + /* + * Abort the current target, + * but let others continue. + */ + printf(" (continuing)\n"); + } else { + printf("\n"); + } + if (deleteOnError) + CompatDeleteTarget(gn); } else { - /* - * Continue executing commands for this target. - * If we return 0, this will happen... - */ - printf(" (ignored)\n"); - status = 0; + /* + * Continue executing commands for this target. + * If we return 0, this will happen... + */ + printf(" (ignored)\n"); + status = 0; } - } - break; - } else { - Fatal("error in wait: %d: %s", retstat, strerror(errno)); - /*NOTREACHED*/ } - } - free(cmdStart); - return (status); + free(cmdStart); + compatChild = 0; + if (compatSigno != 0) { + bmake_signal(compatSigno, SIG_DFL); + kill(myPid, compatSigno); + } + + return status; } - -/*- - *----------------------------------------------------------------------- - * Compat_Make -- - * Make a target. - * - * Input: - * gnp The node to make - * pgnp Parent to abort if necessary - * - * Results: - * 0 - * - * Side Effects: - * If an error is detected and not being ignored, the process exits. - * - *----------------------------------------------------------------------- - */ -int -Compat_Make(void *gnp, void *pgnp) -{ - GNode *gn = (GNode *)gnp; - GNode *pgn = (GNode *)pgnp; - if (!shellName) /* we came here from jobs */ - Shell_Init(); - if (gn->made == UNMADE && (gn == pgn || (pgn->type & OP_MADE) == 0)) { +static void +RunCommands(GNode *gn) +{ + StringListNode *ln; + + for (ln = gn->commands.first; ln != NULL; ln = ln->next) { + const char *cmd = ln->datum; + if (Compat_RunCommand(cmd, gn, ln) != 0) + break; + } +} + +static void +MakeNodes(GNodeList *gnodes, GNode *pgn) +{ + GNodeListNode *ln; + + for (ln = gnodes->first; ln != NULL; ln = ln->next) { + GNode *cohort = ln->datum; + Compat_Make(cohort, pgn); + } +} + +static Boolean +MakeUnmade(GNode *gn, GNode *pgn) +{ + + assert(gn->made == UNMADE); + /* * First mark ourselves to be made, then apply whatever transformations * the suffix module thinks are necessary. Once that's done, we can * descend and make all our children. If any of them has an error - * but the -k flag was given, our 'make' field will be set FALSE again. - * This is our signal to not attempt to do anything but abort our - * parent as well. + * but the -k flag was given, our 'make' field will be set to FALSE + * again. This is our signal to not attempt to do anything but abort + * our parent as well. */ gn->flags |= REMAKE; gn->made = BEINGMADE; - if ((gn->type & OP_MADE) == 0) - Suff_FindDeps(gn); - Lst_ForEach(gn->children, Compat_Make, gn); - if ((gn->flags & REMAKE) == 0) { - gn->made = ABORTED; - pgn->flags &= ~REMAKE; - goto cohorts; + + if (!(gn->type & OP_MADE)) + Suff_FindDeps(gn); + + MakeNodes(&gn->children, gn); + + if (!(gn->flags & REMAKE)) { + gn->made = ABORTED; + pgn->flags &= ~(unsigned)REMAKE; + return FALSE; } - if (Lst_Member(gn->iParents, pgn) != NULL) { - char *p1; - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); - if (p1) - free(p1); - } + if (Lst_FindDatum(&gn->implicitParents, pgn) != NULL) + Var_Set(pgn, IMPSRC, GNode_VarTarget(gn)); /* - * All the children were made ok. Now cmgn->mtime contains the + * All the children were made ok. Now youngestChild->mtime contains the * modification time of the newest child, we need to find out if we * exist and when we were modified last. The criteria for datedness - * are defined by the Make_OODate function. + * are defined by GNode_IsOODate. */ - if (DEBUG(MAKE)) { - fprintf(debug_file, "Examining %s...", gn->name); - } - if (! Make_OODate(gn)) { - gn->made = UPTODATE; - if (DEBUG(MAKE)) { - fprintf(debug_file, "up-to-date.\n"); - } - goto cohorts; - } else if (DEBUG(MAKE)) { - fprintf(debug_file, "out-of-date.\n"); + DEBUG1(MAKE, "Examining %s...", gn->name); + if (!GNode_IsOODate(gn)) { + gn->made = UPTODATE; + DEBUG0(MAKE, "up-to-date.\n"); + return FALSE; } /* * If the user is just seeing if something is out-of-date, exit now * to tell him/her "yes". */ - if (queryFlag) { - exit(1); - } + DEBUG0(MAKE, "out-of-date.\n"); + if (opts.queryFlag) + exit(1); /* - * We need to be re-made. We also have to make sure we've got a $? - * variable. To be nice, we also define the $> variable using - * Make_DoAllVar(). + * We need to be re-made. + * Ensure that $? (.OODATE) and $> (.ALLSRC) are both set. */ Make_DoAllVar(gn); /* * Alter our type to tell if errors should be ignored or things - * should not be printed so CompatRunCommand knows what to do. + * should not be printed so Compat_RunCommand knows what to do. */ - if (Targ_Ignore(gn)) { - gn->type |= OP_IGNORE; - } - if (Targ_Silent(gn)) { - gn->type |= OP_SILENT; - } + if (opts.ignoreErrors) + gn->type |= OP_IGNORE; + if (opts.beSilent) + gn->type |= OP_SILENT; if (Job_CheckCommands(gn, Fatal)) { - /* - * Our commands are ok, but we still have to worry about the -t - * flag... - */ - if (!touchFlag || (gn->type & OP_MAKE)) { - curTarg = gn; + /* + * Our commands are ok, but we still have to worry about + * the -t flag. + */ + if (!opts.touchFlag || (gn->type & OP_MAKE)) { + curTarg = gn; #ifdef USE_META - if (useMeta && !NoExecute(gn)) { - meta_job_start(NULL, gn); - } + if (useMeta && GNode_ShouldExecute(gn)) { + meta_job_start(NULL, gn); + } #endif - Lst_ForEach(gn->commands, CompatRunCommand, gn); - curTarg = NULL; - } else { - Job_Touch(gn, gn->type & OP_SILENT); - } + RunCommands(gn); + curTarg = NULL; + } else { + Job_Touch(gn, (gn->type & OP_SILENT) != 0); + } } else { - gn->made = ERROR; + gn->made = ERROR; } #ifdef USE_META - if (useMeta && !NoExecute(gn)) { - meta_job_finish(NULL); + if (useMeta && GNode_ShouldExecute(gn)) { + if (meta_job_finish(NULL) != 0) + gn->made = ERROR; } #endif if (gn->made != ERROR) { - /* - * If the node was made successfully, mark it so, update - * its modification time and timestamp all its parents. Note - * that for .ZEROTIME targets, the timestamping isn't done. - * This is to keep its state from affecting that of its parent. - */ - gn->made = MADE; - pgn->flags |= Make_Recheck(gn) == 0 ? FORCE : 0; - if (!(gn->type & OP_EXEC)) { - pgn->flags |= CHILDMADE; - Make_TimeStamp(pgn, gn); - } - } else if (keepgoing) { - pgn->flags &= ~REMAKE; + /* + * If the node was made successfully, mark it so, update + * its modification time and timestamp all its parents. + * This is to keep its state from affecting that of its parent. + */ + gn->made = MADE; + if (Make_Recheck(gn) == 0) + pgn->flags |= FORCE; + if (!(gn->type & OP_EXEC)) { + pgn->flags |= CHILDMADE; + GNode_UpdateYoungestChild(pgn, gn); + } + } else if (opts.keepgoing) { + pgn->flags &= ~(unsigned)REMAKE; } else { - PrintOnError(gn, "\n\nStop."); - exit(1); + PrintOnError(gn, "\nStop."); + exit(1); } - } else if (gn->made == ERROR) { - /* - * Already had an error when making this beastie. Tell the parent - * to abort. - */ - pgn->flags &= ~REMAKE; - } else { - if (Lst_Member(gn->iParents, pgn) != NULL) { - char *p1; - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), pgn, 0); - if (p1) - free(p1); + return TRUE; +} + +static void +MakeOther(GNode *gn, GNode *pgn) +{ + + if (Lst_FindDatum(&gn->implicitParents, pgn) != NULL) { + const char *target = GNode_VarTarget(gn); + Var_Set(pgn, IMPSRC, target != NULL ? target : ""); } - switch(gn->made) { - case BEINGMADE: + + switch (gn->made) { + case BEINGMADE: Error("Graph cycles through %s", gn->name); gn->made = ERROR; - pgn->flags &= ~REMAKE; + pgn->flags &= ~(unsigned)REMAKE; break; - case MADE: - if ((gn->type & OP_EXEC) == 0) { - pgn->flags |= CHILDMADE; - Make_TimeStamp(pgn, gn); + case MADE: + if (!(gn->type & OP_EXEC)) { + pgn->flags |= CHILDMADE; + GNode_UpdateYoungestChild(pgn, gn); } break; - case UPTODATE: - if ((gn->type & OP_EXEC) == 0) { - Make_TimeStamp(pgn, gn); - } + case UPTODATE: + if (!(gn->type & OP_EXEC)) + GNode_UpdateYoungestChild(pgn, gn); break; - default: + default: break; } - } - -cohorts: - Lst_ForEach(gn->cohorts, Compat_Make, pgnp); - return (0); } - -/*- - *----------------------------------------------------------------------- - * Compat_Run -- - * Initialize this mode and start making. + +/* + * Make a target. + * + * If an error is detected and not being ignored, the process exits. * * Input: - * targs List of target nodes to re-create + * gn The node to make + * pgn Parent to abort if necessary * - * Results: - * None. - * - * Side Effects: - * Guess what? - * - *----------------------------------------------------------------------- + * Output: + * gn->made + * UPTODATE gn was already up-to-date. + * MADE gn was recreated successfully. + * ERROR An error occurred while gn was being created, + * either due to missing commands or in -k mode. + * ABORTED gn was not remade because one of its + * dependencies could not be made due to errors. */ void -Compat_Run(Lst targs) +Compat_Make(GNode *gn, GNode *pgn) { - GNode *gn = NULL;/* Current root target */ - int errors; /* Number of targets not remade due to errors */ + if (shellName == NULL) /* we came here from jobs */ + Shell_Init(); - if (!shellName) - Shell_Init(); + if (gn->made == UNMADE && (gn == pgn || !(pgn->type & OP_MADE))) { + if (!MakeUnmade(gn, pgn)) + goto cohorts; - if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN) { - bmake_signal(SIGINT, CompatInterrupt); - } - if (bmake_signal(SIGTERM, SIG_IGN) != SIG_IGN) { - bmake_signal(SIGTERM, CompatInterrupt); - } - if (bmake_signal(SIGHUP, SIG_IGN) != SIG_IGN) { - bmake_signal(SIGHUP, CompatInterrupt); - } - if (bmake_signal(SIGQUIT, SIG_IGN) != SIG_IGN) { - bmake_signal(SIGQUIT, CompatInterrupt); - } - - ENDNode = Targ_FindNode(".END", TARG_CREATE); - ENDNode->type = OP_SPECIAL; - /* - * If the user has defined a .BEGIN target, execute the commands attached - * to it. - */ - if (!queryFlag) { - gn = Targ_FindNode(".BEGIN", TARG_NOCREATE); - if (gn != NULL) { - Compat_Make(gn, gn); - if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); - exit(1); - } + /* XXX: Replace with GNode_IsError(gn) */ + } else if (gn->made == ERROR) { + /* + * Already had an error when making this. + * Tell the parent to abort. + */ + pgn->flags &= ~(unsigned)REMAKE; + } else { + MakeOther(gn, pgn); } - } - /* - * Expand .USE nodes right now, because they can modify the structure - * of the tree. - */ - Make_ExpandUse(targs); - - /* - * For each entry in the list of targets to create, call Compat_Make on - * it to create the thing. Compat_Make will leave the 'made' field of gn - * in one of several states: - * UPTODATE gn was already up-to-date - * MADE gn was recreated successfully - * ERROR An error occurred while gn was being created - * ABORTED gn was not remade because one of its inferiors - * could not be made due to errors. - */ - errors = 0; - while (!Lst_IsEmpty (targs)) { - gn = (GNode *)Lst_DeQueue(targs); - Compat_Make(gn, gn); - - if (gn->made == UPTODATE) { - printf("`%s' is up to date.\n", gn->name); - } else if (gn->made == ABORTED) { - printf("`%s' not remade because of errors.\n", gn->name); - errors += 1; - } - } - - /* - * If the user has defined a .END target, run its commands. - */ - if (errors == 0) { - Compat_Make(ENDNode, ENDNode); - if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); - exit(1); - } - } +cohorts: + MakeNodes(&gn->cohorts, pgn); +} + +static void +MakeBeginNode(void) +{ + GNode *gn = Targ_FindNode(".BEGIN"); + if (gn == NULL) + return; + + Compat_Make(gn, gn); + if (GNode_IsError(gn)) { + PrintOnError(gn, "\nStop."); + exit(1); + } +} + +static void +InitSignals(void) +{ + if (bmake_signal(SIGINT, SIG_IGN) != SIG_IGN) + bmake_signal(SIGINT, CompatInterrupt); + if (bmake_signal(SIGTERM, SIG_IGN) != SIG_IGN) + bmake_signal(SIGTERM, CompatInterrupt); + if (bmake_signal(SIGHUP, SIG_IGN) != SIG_IGN) + bmake_signal(SIGHUP, CompatInterrupt); + if (bmake_signal(SIGQUIT, SIG_IGN) != SIG_IGN) + bmake_signal(SIGQUIT, CompatInterrupt); +} + +/* + * Initialize this module and start making. + * + * Input: + * targs The target nodes to re-create + */ +void +Compat_Run(GNodeList *targs) +{ + GNode *errorNode = NULL; + + if (shellName == NULL) + Shell_Init(); + + InitSignals(); + + /* Create the .END node now, to keep the (debug) output of the + * counter.mk test the same as before 2020-09-23. This implementation + * detail probably doesn't matter though. */ + (void)Targ_GetEndNode(); + + if (!opts.queryFlag) + MakeBeginNode(); + + /* + * Expand .USE nodes right now, because they can modify the structure + * of the tree. + */ + Make_ExpandUse(targs); + + while (!Lst_IsEmpty(targs)) { + GNode *gn = Lst_Dequeue(targs); + Compat_Make(gn, gn); + + if (gn->made == UPTODATE) { + printf("`%s' is up to date.\n", gn->name); + } else if (gn->made == ABORTED) { + printf("`%s' not remade because of errors.\n", + gn->name); + } + if (GNode_IsError(gn) && errorNode == NULL) + errorNode = gn; + } + + /* If the user has defined a .END target, run its commands. */ + if (errorNode == NULL) { + GNode *endNode = Targ_GetEndNode(); + Compat_Make(endNode, endNode); + if (GNode_IsError(endNode)) + errorNode = endNode; + } + + if (errorNode != NULL) { + if (DEBUG(GRAPH2)) + Targ_PrintGraph(2); + else if (DEBUG(GRAPH3)) + Targ_PrintGraph(3); + PrintOnError(errorNode, "\nStop."); + exit(1); + } } diff --git a/usr.bin/make/cond.c b/usr.bin/make/cond.c index b05a56cbc..8de220ecb 100644 --- a/usr.bin/make/cond.c +++ b/usr.bin/make/cond.c @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.68 2015/05/05 21:51:09 sjg Exp $ */ +/* $NetBSD: cond.c,v 1.259 2021/03/15 12:15:03 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -69,1366 +69,1294 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.68 2015/05/05 21:51:09 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; -#else -__RCSID("$NetBSD: cond.c,v 1.68 2015/05/05 21:51:09 sjg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * cond.c -- - * Functions to handle conditionals in a makefile. +/* + * Handling of conditionals in a makefile. * * Interface: - * Cond_Eval Evaluate the conditional in the passed line. + * Cond_EvalLine Evaluate the conditional directive, such as + * '.if ', '.elifnmake ', '.else', '.endif'. * + * Cond_EvalCondition + * Evaluate the conditional, which is either the argument + * of one of the .if directives or the condition in a + * ':?then:else' variable modifier. + * + * Cond_save_depth + * Cond_restore_depth + * Save and restore the nesting of the conditions, at + * the start and end of including another makefile, to + * ensure that in each makefile the conditional + * directives are well-balanced. */ -#include -#include /* For strtoul() error checking */ +#include -#include "make.h" -#include "hash.h" -#include "dir.h" -#include "buf.h" +#include "make.h" +#include "dir.h" + +/* "@(#)cond.c 8.2 (Berkeley) 1/2/94" */ +MAKE_RCSID("$NetBSD: cond.c,v 1.259 2021/03/15 12:15:03 rillig Exp $"); /* * The parsing of conditional expressions is based on this grammar: - * E -> F || E - * E -> F - * F -> T && F - * F -> T - * T -> defined(variable) - * T -> make(target) - * T -> exists(file) - * T -> empty(varspec) - * T -> target(name) - * T -> commands(name) - * T -> symbol - * T -> $(varspec) op value - * T -> $(varspec) == "string" - * T -> $(varspec) != "string" - * T -> "string" - * T -> ( E ) - * T -> ! T - * op -> == | != | > | < | >= | <= + * Or -> And '||' Or + * Or -> And + * And -> Term '&&' And + * And -> Term + * Term -> Function '(' Argument ')' + * Term -> Leaf Operator Leaf + * Term -> Leaf + * Term -> '(' Or ')' + * Term -> '!' Term + * Leaf -> "string" + * Leaf -> Number + * Leaf -> VariableExpression + * Leaf -> Symbol + * Operator -> '==' | '!=' | '>' | '<' | '>=' | '<=' * - * 'symbol' is some other symbol to which the default function (condDefProc) - * is applied. + * 'Symbol' is an unquoted string literal to which the default function is + * applied. * - * Tokens are scanned from the 'condExpr' string. The scanner (CondToken) - * will return TOK_AND for '&' and '&&', TOK_OR for '|' and '||', - * TOK_NOT for '!', TOK_LPAREN for '(', TOK_RPAREN for ')' and will evaluate - * the other terminal symbols, using either the default function or the - * function given in the terminal, and return the result as either TOK_TRUE - * or TOK_FALSE. + * The tokens are scanned by CondToken, which returns: + * TOK_AND for '&&' + * TOK_OR for '||' + * TOK_NOT for '!' + * TOK_LPAREN for '(' + * TOK_RPAREN for ')' * - * TOK_FALSE is 0 and TOK_TRUE 1 so we can directly assign C comparisons. - * - * All Non-Terminal functions (CondE, CondF and CondT) return TOK_ERROR on - * error. + * Other terminal symbols are evaluated using either the default function or + * the function given in the terminal, they return either TOK_TRUE or + * TOK_FALSE. */ -typedef enum { - TOK_FALSE = 0, TOK_TRUE = 1, TOK_AND, TOK_OR, TOK_NOT, - TOK_LPAREN, TOK_RPAREN, TOK_EOF, TOK_NONE, TOK_ERROR +typedef enum Token { + TOK_FALSE, TOK_TRUE, TOK_AND, TOK_OR, TOK_NOT, + TOK_LPAREN, TOK_RPAREN, TOK_EOF, TOK_NONE, TOK_ERROR } Token; -/*- - * Structures to handle elegantly the different forms of #if's. The - * last two fields are stored in condInvert and condDefProc, respectively. - */ -static void CondPushBack(Token); -static int CondGetArg(char **, char **, const char *); -static Boolean CondDoDefined(int, const char *); -static int CondStrMatch(const void *, const void *); -static Boolean CondDoMake(int, const char *); -static Boolean CondDoExists(int, const char *); -static Boolean CondDoTarget(int, const char *); -static Boolean CondDoCommands(int, const char *); -static Boolean CondCvtArg(char *, double *); -static Token CondToken(Boolean); -static Token CondT(Boolean); -static Token CondF(Boolean); -static Token CondE(Boolean); -static int do_Cond_EvalExpression(Boolean *); +typedef enum CondResult { + CR_FALSE, CR_TRUE, CR_ERROR +} CondResult; -static const struct If { - const char *form; /* Form of if */ - int formlen; /* Length of form */ - Boolean doNot; /* TRUE if default function should be negated */ - Boolean (*defProc)(int, const char *); /* Default function to apply */ -} ifs[] = { - { "def", 3, FALSE, CondDoDefined }, - { "ndef", 4, TRUE, CondDoDefined }, - { "make", 4, FALSE, CondDoMake }, - { "nmake", 5, TRUE, CondDoMake }, - { "", 0, FALSE, CondDoDefined }, - { NULL, 0, FALSE, NULL } -}; +typedef enum ComparisonOp { + LT, LE, GT, GE, EQ, NE +} ComparisonOp; -static const struct If *if_info; /* Info for current statement */ -static char *condExpr; /* The expression to parse */ -static Token condPushBack=TOK_NONE; /* Single push-back token used in - * parsing */ +typedef struct CondParser { -static unsigned int cond_depth = 0; /* current .if nesting level */ -static unsigned int cond_min_depth = 0; /* depth at makefile open */ + /* + * The plain '.if ${VAR}' evaluates to true if the value of the + * expression has length > 0. The other '.if' variants delegate + * to evalBare instead. + */ + Boolean plain; + + /* The function to apply on unquoted bare words. */ + Boolean (*evalBare)(size_t, const char *); + Boolean negateEvalBare; + + const char *p; /* The remaining condition to parse */ + Token curr; /* Single push-back token used in parsing */ + + /* + * Whether an error message has already been printed for this + * condition. The first available error message is usually the most + * specific one, therefore it makes sense to suppress the standard + * "Malformed conditional" message. + */ + Boolean printedError; +} CondParser; + +static CondResult CondParser_Or(CondParser *par, Boolean); + +static unsigned int cond_depth = 0; /* current .if nesting level */ +static unsigned int cond_min_depth = 0; /* depth at makefile open */ + +static const char *opname[] = { "<", "<=", ">", ">=", "==", "!=" }; /* * Indicate when we should be strict about lhs of comparisons. - * TRUE when Cond_EvalExpression is called from Cond_Eval (.if etc) - * FALSE when Cond_EvalExpression is called from var.c:ApplyModifiers - * since lhs is already expanded and we cannot tell if + * In strict mode, the lhs must be a variable expression or a string literal + * in quotes. In non-strict mode it may also be an unquoted string literal. + * + * TRUE when CondEvalExpression is called from Cond_EvalLine (.if etc) + * FALSE when CondEvalExpression is called from ApplyModifier_IfElse + * since lhs is already expanded, and at that point we cannot tell if * it was a variable reference or not. */ static Boolean lhsStrict; -static int -istoken(const char *str, const char *tok, size_t len) +static Boolean +is_token(const char *str, const char *tok, size_t len) { - return strncmp(str, tok, len) == 0 && !isalpha((unsigned char)str[len]); + return strncmp(str, tok, len) == 0 && !ch_isalpha(str[len]); } -/*- - *----------------------------------------------------------------------- - * CondPushBack -- - * Push back the most recent token read. We only need one level of - * this, so the thing is just stored in 'condPushback'. - * - * Input: - * t Token to push back into the "stream" - * - * Results: - * None. - * - * Side Effects: - * condPushback is overwritten. - * - *----------------------------------------------------------------------- - */ +static Token +ToToken(Boolean cond) +{ + return cond ? TOK_TRUE : TOK_FALSE; +} + +/* Push back the most recent token read. We only need one level of this. */ static void -CondPushBack(Token t) +CondParser_PushBack(CondParser *par, Token t) { - condPushBack = t; + assert(par->curr == TOK_NONE); + assert(t != TOK_NONE); + + par->curr = t; } - -/*- - *----------------------------------------------------------------------- - * CondGetArg -- - * Find the argument of a built-in function. - * - * Input: - * parens TRUE if arg should be bounded by parens - * - * Results: - * The length of the argument and the address of the argument. - * - * Side Effects: - * The pointer is set to point to the closing parenthesis of the - * function call. - * - *----------------------------------------------------------------------- - */ -static int -CondGetArg(char **linePtr, char **argPtr, const char *func) + +static void +CondParser_SkipWhitespace(CondParser *par) { - char *cp; - int argLen; - Buffer buf; - int paren_depth; - char ch; + cpp_skip_whitespace(&par->p); +} - cp = *linePtr; - if (func != NULL) - /* Skip opening '(' - verfied by caller */ - cp++; +/* + * Parse the argument of a built-in function. + * + * Arguments: + * *pp initially points at the '(', + * upon successful return it points right after the ')'. + * + * *out_arg receives the argument as string. + * + * func says whether the argument belongs to an actual function, or + * whether the parsed argument is passed to the default function. + * + * Return the length of the argument, or 0 on error. + */ +static size_t +ParseFuncArg(CondParser *par, const char **pp, Boolean doEval, const char *func, + char **out_arg) +{ + const char *p = *pp; + Buffer argBuf; + int paren_depth; + size_t argLen; - if (*cp == '\0') { - /* - * No arguments whatsoever. Because 'make' and 'defined' aren't really - * "reserved words", we don't print a message. I think this is better - * than hitting the user with a warning message every time s/he uses - * the word 'make' or 'defined' at the beginning of a symbol... - */ - *argPtr = NULL; - return (0); - } + if (func != NULL) + p++; /* Skip opening '(' - verified by caller */ - while (*cp == ' ' || *cp == '\t') { - cp++; - } - - /* - * Create a buffer for the argument and start it out at 16 characters - * long. Why 16? Why not? - */ - Buf_Init(&buf, 16); - - paren_depth = 0; - for (;;) { - ch = *cp; - if (ch == 0 || ch == ' ' || ch == '\t') - break; - if ((ch == '&' || ch == '|') && paren_depth == 0) - break; - if (*cp == '$') { - /* - * Parse the variable spec and install it as part of the argument - * if it's valid. We tell Var_Parse to complain on an undefined - * variable, so we don't do it too. Nor do we return an error, - * though perhaps we should... - */ - char *cp2; - int len; - void *freeIt; - - cp2 = Var_Parse(cp, VAR_CMD, TRUE, &len, &freeIt); - Buf_AddBytes(&buf, strlen(cp2), cp2); - if (freeIt) - free(freeIt); - cp += len; - continue; + if (*p == '\0') { + *out_arg = NULL; /* Missing closing parenthesis: */ + return 0; /* .if defined( */ } - if (ch == '(') - paren_depth++; - else - if (ch == ')' && --paren_depth < 0) - break; - Buf_AddByte(&buf, *cp); - cp++; - } - *argPtr = Buf_GetAll(&buf, &argLen); - Buf_Destroy(&buf, FALSE); + cpp_skip_hspace(&p); - while (*cp == ' ' || *cp == '\t') { - cp++; - } + Buf_InitSize(&argBuf, 16); - if (func != NULL && *cp++ != ')') { - Parse_Error(PARSE_WARNING, "Missing closing parenthesis for %s()", - func); - return (0); - } + paren_depth = 0; + for (;;) { + char ch = *p; + if (ch == '\0' || ch == ' ' || ch == '\t') + break; + if ((ch == '&' || ch == '|') && paren_depth == 0) + break; + if (*p == '$') { + /* + * Parse the variable expression and install it as + * part of the argument if it's valid. We tell + * Var_Parse to complain on an undefined variable, + * (XXX: but Var_Parse ignores that request) + * so we don't need to do it. Nor do we return an + * error, though perhaps we should. + */ + VarEvalFlags eflags = doEval + ? VARE_UNDEFERR + : VARE_PARSE_ONLY; + FStr nestedVal; + (void)Var_Parse(&p, SCOPE_CMDLINE, eflags, &nestedVal); + /* TODO: handle errors */ + Buf_AddStr(&argBuf, nestedVal.str); + FStr_Done(&nestedVal); + continue; + } + if (ch == '(') + paren_depth++; + else if (ch == ')' && --paren_depth < 0) + break; + Buf_AddByte(&argBuf, *p); + p++; + } - *linePtr = cp; - return (argLen); + argLen = argBuf.len; + *out_arg = Buf_DoneData(&argBuf); + + cpp_skip_hspace(&p); + + if (func != NULL && *p++ != ')') { + Parse_Error(PARSE_FATAL, + "Missing closing parenthesis for %s()", func); + par->printedError = TRUE; + return 0; + } + + *pp = p; + return argLen; } - -/*- - *----------------------------------------------------------------------- - * CondDoDefined -- - * Handle the 'defined' function for conditionals. - * - * Results: - * TRUE if the given variable is defined. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ + +/* Test whether the given variable is defined. */ +/*ARGSUSED*/ static Boolean -CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char *arg) +FuncDefined(size_t argLen MAKE_ATTR_UNUSED, const char *arg) { - char *p1; - Boolean result; + FStr value = Var_Value(SCOPE_CMDLINE, arg); + Boolean result = value.str != NULL; + FStr_Done(&value); + return result; +} - if (Var_Value(arg, VAR_CMD, &p1) != NULL) { - result = TRUE; - } else { - result = FALSE; - } - if (p1) - free(p1); - return (result); -} - -/*- - *----------------------------------------------------------------------- - * CondStrMatch -- - * Front-end for Str_Match so it returns 0 on match and non-zero - * on mismatch. Callback function for CondDoMake via Lst_Find - * - * Results: - * 0 if string matches pattern - * - * Side Effects: - * None - * - *----------------------------------------------------------------------- - */ -static int -CondStrMatch(const void *string, const void *pattern) -{ - return(!Str_Match(string, pattern)); -} - -/*- - *----------------------------------------------------------------------- - * CondDoMake -- - * Handle the 'make' function for conditionals. - * - * Results: - * TRUE if the given target is being made. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ +/* See if the given target is being made. */ +/*ARGSUSED*/ static Boolean -CondDoMake(int argLen MAKE_ATTR_UNUSED, const char *arg) +FuncMake(size_t argLen MAKE_ATTR_UNUSED, const char *arg) { - return Lst_Find(create, arg, CondStrMatch) != NULL; -} - -/*- - *----------------------------------------------------------------------- - * CondDoExists -- - * See if the given file exists. - * - * Results: - * TRUE if the file exists and FALSE if it does not. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -static Boolean -CondDoExists(int argLen MAKE_ATTR_UNUSED, const char *arg) -{ - Boolean result; - char *path; + StringListNode *ln; - path = Dir_FindFile(arg, dirSearchPath); - if (DEBUG(COND)) { - fprintf(debug_file, "exists(%s) result is \"%s\"\n", - arg, path ? path : ""); - } - if (path != NULL) { - result = TRUE; + for (ln = opts.create.first; ln != NULL; ln = ln->next) + if (Str_Match(ln->datum, arg)) + return TRUE; + return FALSE; +} + +/* See if the given file exists. */ +/*ARGSUSED*/ +static Boolean +FuncExists(size_t argLen MAKE_ATTR_UNUSED, const char *arg) +{ + Boolean result; + char *path; + + path = Dir_FindFile(arg, &dirSearchPath); + DEBUG2(COND, "exists(%s) result is \"%s\"\n", + arg, path != NULL ? path : ""); + result = path != NULL; free(path); - } else { - result = FALSE; - } - return (result); + return result; } - -/*- - *----------------------------------------------------------------------- - * CondDoTarget -- - * See if the given node exists and is an actual target. + +/* See if the given node exists and is an actual target. */ +/*ARGSUSED*/ +static Boolean +FuncTarget(size_t argLen MAKE_ATTR_UNUSED, const char *arg) +{ + GNode *gn = Targ_FindNode(arg); + return gn != NULL && GNode_IsTarget(gn); +} + +/* + * See if the given node exists and is an actual target with commands + * associated with it. + */ +/*ARGSUSED*/ +static Boolean +FuncCommands(size_t argLen MAKE_ATTR_UNUSED, const char *arg) +{ + GNode *gn = Targ_FindNode(arg); + return gn != NULL && GNode_IsTarget(gn) && !Lst_IsEmpty(&gn->commands); +} + +/* + * Convert the given number into a double. + * We try a base 10 or 16 integer conversion first, if that fails + * then we try a floating point conversion instead. * * Results: - * TRUE if the node exists as a target and FALSE if it does not. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- + * Returns TRUE if the conversion succeeded. + * Sets 'out_value' to the converted number. */ static Boolean -CondDoTarget(int argLen MAKE_ATTR_UNUSED, const char *arg) +TryParseNumber(const char *str, double *out_value) { - GNode *gn; + char *end; + unsigned long ul_val; + double dbl_val; - gn = Targ_FindNode(arg, TARG_NOCREATE); - return (gn != NULL) && !OP_NOP(gn->type); + errno = 0; + if (str[0] == '\0') { /* XXX: why is an empty string a number? */ + *out_value = 0.0; + return TRUE; + } + + ul_val = strtoul(str, &end, str[1] == 'x' ? 16 : 10); + if (*end == '\0' && errno != ERANGE) { + *out_value = str[0] == '-' ? -(double)-ul_val : (double)ul_val; + return TRUE; + } + + if (*end != '\0' && *end != '.' && *end != 'e' && *end != 'E') + return FALSE; /* skip the expensive strtod call */ + dbl_val = strtod(str, &end); + if (*end != '\0') + return FALSE; + + *out_value = dbl_val; + return TRUE; } -/*- - *----------------------------------------------------------------------- - * CondDoCommands -- - * See if the given node exists and is an actual target with commands - * associated with it. +static Boolean +is_separator(char ch) +{ + return ch == '\0' || ch_isspace(ch) || strchr("!=><)", ch) != NULL; +} + +/* + * In a quoted or unquoted string literal or a number, parse a variable + * expression. * - * Results: - * TRUE if the node exists as a target and has commands associated with - * it and FALSE if it does not. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- + * Example: .if x${CENTER}y == "${PREFIX}${SUFFIX}" || 0x${HEX} */ static Boolean -CondDoCommands(int argLen MAKE_ATTR_UNUSED, const char *arg) +CondParser_StringExpr(CondParser *par, const char *start, + Boolean const doEval, Boolean const quoted, + Buffer *buf, FStr *const inout_str) { - GNode *gn; + VarEvalFlags eflags; + const char *nested_p; + Boolean atStart; + VarParseResult parseResult; - gn = Targ_FindNode(arg, TARG_NOCREATE); - return (gn != NULL) && !OP_NOP(gn->type) && !Lst_IsEmpty(gn->commands); -} - -/*- - *----------------------------------------------------------------------- - * CondCvtArg -- - * Convert the given number into a double. - * We try a base 10 or 16 integer conversion first, if that fails - * then we try a floating point conversion instead. - * - * Results: - * Sets 'value' to double value of string. - * Returns 'true' if the convertion suceeded - * - *----------------------------------------------------------------------- - */ -static Boolean -CondCvtArg(char *str, double *value) -{ - char *eptr, ech; - unsigned long l_val; - double d_val; + /* if we are in quotes, an undefined variable is ok */ + eflags = doEval && !quoted ? VARE_UNDEFERR + : doEval ? VARE_WANTRES + : VARE_PARSE_ONLY; - errno = 0; - l_val = strtoul(str, &eptr, str[1] == 'x' ? 16 : 10); - ech = *eptr; - if (ech == 0 && errno != ERANGE) { - d_val = str[0] == '-' ? -(double)-l_val : (double)l_val; - } else { - if (ech != 0 && ech != '.' && ech != 'e' && ech != 'E') - return FALSE; - d_val = strtod(str, &eptr); - if (*eptr) - return FALSE; - } - - *value = d_val; - return TRUE; -} - -/*- - *----------------------------------------------------------------------- - * CondGetString -- - * Get a string from a variable reference or an optionally quoted - * string. This is called for the lhs and rhs of string compares. - * - * Results: - * Sets freeIt if needed, - * Sets quoted if string was quoted, - * Returns NULL on error, - * else returns string - absent any quotes. - * - * Side Effects: - * Moves condExpr to end of this token. - * - * - *----------------------------------------------------------------------- - */ -/* coverity:[+alloc : arg-*2] */ -static char * -CondGetString(Boolean doEval, Boolean *quoted, void **freeIt, Boolean strictLHS) -{ - Buffer buf; - char *cp; - char *str; - int len; - int qt; - char *start; - - Buf_Init(&buf, 0); - str = NULL; - *freeIt = NULL; - *quoted = qt = *condExpr == '"' ? 1 : 0; - if (qt) - condExpr++; - for (start = condExpr; *condExpr && str == NULL; condExpr++) { - switch (*condExpr) { - case '\\': - if (condExpr[1] != '\0') { - condExpr++; - Buf_AddByte(&buf, *condExpr); - } - break; - case '"': - if (qt) { - condExpr++; /* we don't want the quotes */ - goto got_str; - } else - Buf_AddByte(&buf, *condExpr); /* likely? */ - break; - case ')': - case '!': - case '=': - case '>': - case '<': - case ' ': - case '\t': - if (!qt) - goto got_str; - else - Buf_AddByte(&buf, *condExpr); - break; - case '$': - /* if we are in quotes, then an undefined variable is ok */ - str = Var_Parse(condExpr, VAR_CMD, (qt ? 0 : doEval), - &len, freeIt); - if (str == var_Error) { - if (*freeIt) { - free(*freeIt); - *freeIt = NULL; + nested_p = par->p; + atStart = nested_p == start; + parseResult = Var_Parse(&nested_p, SCOPE_CMDLINE, eflags, inout_str); + /* TODO: handle errors */ + if (inout_str->str == var_Error) { + if (parseResult == VPR_ERR) { + /* + * FIXME: Even if an error occurs, there is no + * guarantee that it is reported. + * + * See cond-token-plain.mk $$$$$$$$. + */ + par->printedError = TRUE; } /* - * Even if !doEval, we still report syntax errors, which - * is what getting var_Error back with !doEval means. + * XXX: Can there be any situation in which a returned + * var_Error needs to be freed? */ - str = NULL; - goto cleanup; - } - condExpr += len; - /* - * If the '$' was first char (no quotes), and we are - * followed by space, the operator or end of expression, - * we are done. - */ - if ((condExpr == start + len) && - (*condExpr == '\0' || - isspace((unsigned char) *condExpr) || - strchr("!=><)", *condExpr))) { - goto cleanup; - } - /* - * Nope, we better copy str to buf - */ - for (cp = str; *cp; cp++) { - Buf_AddByte(&buf, *cp); - } - if (*freeIt) { - free(*freeIt); - *freeIt = NULL; - } - str = NULL; /* not finished yet */ - condExpr--; /* don't skip over next char */ - break; - default: - if (strictLHS && !qt && *start != '$' && - !isdigit((unsigned char) *start)) { - /* lhs must be quoted, a variable reference or number */ - if (*freeIt) { - free(*freeIt); - *freeIt = NULL; - } - str = NULL; - goto cleanup; - } - Buf_AddByte(&buf, *condExpr); - break; + FStr_Done(inout_str); + /* + * Even if !doEval, we still report syntax errors, which is + * what getting var_Error back with !doEval means. + */ + *inout_str = FStr_InitRefer(NULL); + return FALSE; } - } - got_str: - str = Buf_GetAll(&buf, NULL); - *freeIt = str; - cleanup: - Buf_Destroy(&buf, FALSE); - return str; + par->p = nested_p; + + /* + * If the '$' started the string literal (which means no quotes), and + * the variable expression is followed by a space, looks like a + * comparison operator or is the end of the expression, we are done. + */ + if (atStart && is_separator(par->p[0])) + return FALSE; + + Buf_AddStr(buf, inout_str->str); + FStr_Done(inout_str); + *inout_str = FStr_InitRefer(NULL); /* not finished yet */ + return TRUE; } - -/*- - *----------------------------------------------------------------------- - * CondToken -- - * Return the next token from the input. + +/* + * Parse a string from a variable reference or an optionally quoted + * string. This is called for the lhs and rhs of string comparisons. * * Results: - * A Token for the next lexical token in the stream. - * - * Side Effects: - * condPushback will be set back to TOK_NONE if it is used. - * - *----------------------------------------------------------------------- + * Returns the string, absent any quotes, or NULL on error. + * Sets out_quoted if the string was quoted. */ -static Token -compare_expression(Boolean doEval) +static void +CondParser_String(CondParser *par, Boolean doEval, Boolean strictLHS, + FStr *out_str, Boolean *out_quoted) { - Token t; - char *lhs; - char *rhs; - char *op; - void *lhsFree; - void *rhsFree; - Boolean lhsQuoted; - Boolean rhsQuoted; - double left, right; + Buffer buf; + FStr str; + Boolean quoted; + const char *start; - t = TOK_ERROR; - rhs = NULL; - lhsFree = rhsFree = FALSE; - lhsQuoted = rhsQuoted = FALSE; - - /* - * Parse the variable spec and skip over it, saving its - * value in lhs. - */ - lhs = CondGetString(doEval, &lhsQuoted, &lhsFree, lhsStrict); - if (!lhs) - goto done; + Buf_Init(&buf); + str = FStr_InitRefer(NULL); + *out_quoted = quoted = par->p[0] == '"'; + start = par->p; + if (quoted) + par->p++; - /* - * Skip whitespace to get to the operator - */ - while (isspace((unsigned char) *condExpr)) - condExpr++; - - /* - * Make sure the operator is a valid one. If it isn't a - * known relational operator, pretend we got a - * != 0 comparison. - */ - op = condExpr; - switch (*condExpr) { - case '!': - case '=': - case '<': - case '>': - if (condExpr[1] == '=') { - condExpr += 2; - } else { - condExpr += 1; - } - break; - default: - if (!doEval) { - t = TOK_FALSE; - goto done; - } - /* For .ifxxx "..." check for non-empty string. */ - if (lhsQuoted) { - t = lhs[0] != 0; - goto done; - } - /* For .ifxxx compare against zero */ - if (CondCvtArg(lhs, &left)) { - t = left != 0.0; - goto done; - } - /* For .if ${...} check for non-empty string (defProc is ifdef). */ - if (if_info->form[0] == 0) { - t = lhs[0] != 0; - goto done; - } - /* Otherwise action default test ... */ - t = if_info->defProc(strlen(lhs), lhs) != if_info->doNot; - goto done; - } - - while (isspace((unsigned char)*condExpr)) - condExpr++; - - if (*condExpr == '\0') { - Parse_Error(PARSE_WARNING, - "Missing right-hand-side of operator"); - goto done; - } - - rhs = CondGetString(doEval, &rhsQuoted, &rhsFree, FALSE); - if (!rhs) - goto done; - - if (rhsQuoted || lhsQuoted) { -do_string_compare: - if (((*op != '!') && (*op != '=')) || (op[1] != '=')) { - Parse_Error(PARSE_WARNING, - "String comparison operator should be either == or !="); - goto done; + while (par->p[0] != '\0' && str.str == NULL) { + switch (par->p[0]) { + case '\\': + par->p++; + if (par->p[0] != '\0') { + Buf_AddByte(&buf, par->p[0]); + par->p++; + } + continue; + case '"': + par->p++; + if (quoted) + goto got_str; /* skip the closing quote */ + Buf_AddByte(&buf, '"'); + continue; + case ')': /* see is_separator */ + case '!': + case '=': + case '>': + case '<': + case ' ': + case '\t': + if (!quoted) + goto got_str; + Buf_AddByte(&buf, par->p[0]); + par->p++; + continue; + case '$': + if (!CondParser_StringExpr(par, + start, doEval, quoted, &buf, &str)) + goto cleanup; + continue; + default: + if (strictLHS && !quoted && *start != '$' && + !ch_isdigit(*start)) { + /* + * The left-hand side must be quoted, + * a variable reference or a number. + */ + str = FStr_InitRefer(NULL); + goto cleanup; + } + Buf_AddByte(&buf, par->p[0]); + par->p++; + continue; + } } - - if (DEBUG(COND)) { - fprintf(debug_file, "lhs = \"%s\", rhs = \"%s\", op = %.2s\n", - lhs, rhs, op); - } - /* - * Null-terminate rhs and perform the comparison. - * t is set to the result. - */ - if (*op == '=') { - t = strcmp(lhs, rhs) == 0; - } else { - t = strcmp(lhs, rhs) != 0; - } - } else { - /* - * rhs is either a float or an integer. Convert both the - * lhs and the rhs to a double and compare the two. - */ - - if (!CondCvtArg(lhs, &left) || !CondCvtArg(rhs, &right)) - goto do_string_compare; - - if (DEBUG(COND)) { - fprintf(debug_file, "left = %f, right = %f, op = %.2s\n", left, - right, op); - } - switch(op[0]) { - case '!': - if (op[1] != '=') { - Parse_Error(PARSE_WARNING, - "Unknown operator"); - goto done; - } - t = (left != right); - break; - case '=': - if (op[1] != '=') { - Parse_Error(PARSE_WARNING, - "Unknown operator"); - goto done; - } - t = (left == right); - break; - case '<': - if (op[1] == '=') { - t = (left <= right); - } else { - t = (left < right); - } - break; - case '>': - if (op[1] == '=') { - t = (left >= right); - } else { - t = (left > right); - } - break; - } - } - -done: - if (lhsFree) - free(lhsFree); - if (rhsFree) - free(rhsFree); - return t; -} - -static int -get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED) -{ - /* - * Use Var_Parse to parse the spec in parens and return - * TOK_TRUE if the resulting string is empty. - */ - int length; - void *freeIt; - char *val; - char *cp = *linePtr; - - /* We do all the work here and return the result as the length */ - *argPtr = NULL; - - val = Var_Parse(cp - 1, VAR_CMD, FALSE, &length, &freeIt); - /* - * Advance *linePtr to beyond the closing ). Note that - * we subtract one because 'length' is calculated from 'cp - 1'. - */ - *linePtr = cp - 1 + length; - - if (val == var_Error) { - free(freeIt); - return -1; - } - - /* A variable is empty when it just contains spaces... 4/15/92, christos */ - while (isspace(*(unsigned char *)val)) - val++; - - /* - * For consistency with the other functions we can't generate the - * true/false here. - */ - length = *val ? 2 : 1; - if (freeIt) - free(freeIt); - return length; +got_str: + str = FStr_InitOwn(buf.data); +cleanup: + Buf_DoneData(&buf); + *out_str = str; } static Boolean -CondDoEmpty(int arglen, const char *arg MAKE_ATTR_UNUSED) +If_Eval(const CondParser *par, const char *arg, size_t arglen) { - return arglen == 1; + Boolean res = par->evalBare(arglen, arg); + return par->negateEvalBare ? !res : res; +} + +/* + * Evaluate a "comparison without operator", such as in ".if ${VAR}" or + * ".if 0". + */ +static Boolean +EvalNotEmpty(CondParser *par, const char *value, Boolean quoted) +{ + double num; + + /* For .ifxxx "...", check for non-empty string. */ + if (quoted) + return value[0] != '\0'; + + /* For .ifxxx , compare against zero */ + if (TryParseNumber(value, &num)) + return num != 0.0; + + /* For .if ${...}, check for non-empty string. This is different from + * the evaluation function from that .if variant, which would test + * whether a variable of the given name were defined. */ + /* XXX: Whitespace should count as empty, just as in ParseEmptyArg. */ + if (par->plain) + return value[0] != '\0'; + + return If_Eval(par, value, strlen(value)); +} + +/* Evaluate a numerical comparison, such as in ".if ${VAR} >= 9". */ +static Boolean +EvalCompareNum(double lhs, ComparisonOp op, double rhs) +{ + DEBUG3(COND, "lhs = %f, rhs = %f, op = %.2s\n", lhs, rhs, opname[op]); + + switch (op) { + case LT: + return lhs < rhs; + case LE: + return lhs <= rhs; + case GT: + return lhs > rhs; + case GE: + return lhs >= rhs; + case NE: + return lhs != rhs; + default: + return lhs == rhs; + } } static Token -compare_function(Boolean doEval) +EvalCompareStr(CondParser *par, const char *lhs, + ComparisonOp op, const char *rhs) { - static const struct fn_def { - const char *fn_name; - int fn_name_len; - int (*fn_getarg)(char **, char **, const char *); - Boolean (*fn_proc)(int, const char *); - } fn_defs[] = { - { "defined", 7, CondGetArg, CondDoDefined }, - { "make", 4, CondGetArg, CondDoMake }, - { "exists", 6, CondGetArg, CondDoExists }, - { "empty", 5, get_mpt_arg, CondDoEmpty }, - { "target", 6, CondGetArg, CondDoTarget }, - { "commands", 8, CondGetArg, CondDoCommands }, - { NULL, 0, NULL, NULL }, - }; - const struct fn_def *fn_def; - Token t; - char *arg = NULL; - int arglen; - char *cp = condExpr; - char *cp1; - - for (fn_def = fn_defs; fn_def->fn_name != NULL; fn_def++) { - if (!istoken(cp, fn_def->fn_name, fn_def->fn_name_len)) - continue; - cp += fn_def->fn_name_len; - /* There can only be whitespace before the '(' */ - while (isspace(*(unsigned char *)cp)) - cp++; - if (*cp != '(') - break; - - arglen = fn_def->fn_getarg(&cp, &arg, fn_def->fn_name); - if (arglen <= 0) { - condExpr = cp; - return arglen < 0 ? TOK_ERROR : TOK_FALSE; + if (op != EQ && op != NE) { + Parse_Error(PARSE_FATAL, + "String comparison operator must be either == or !="); + par->printedError = TRUE; + return TOK_ERROR; } - /* Evaluate the argument using the required function. */ - t = !doEval || fn_def->fn_proc(arglen, arg); - if (arg) - free(arg); - condExpr = cp; + + DEBUG3(COND, "lhs = \"%s\", rhs = \"%s\", op = %.2s\n", + lhs, rhs, opname[op]); + return ToToken((op == EQ) == (strcmp(lhs, rhs) == 0)); +} + +/* Evaluate a comparison, such as "${VAR} == 12345". */ +static Token +EvalCompare(CondParser *par, const char *lhs, Boolean lhsQuoted, + ComparisonOp op, const char *rhs, Boolean rhsQuoted) +{ + double left, right; + + if (!rhsQuoted && !lhsQuoted) + if (TryParseNumber(lhs, &left) && TryParseNumber(rhs, &right)) + return ToToken(EvalCompareNum(left, op, right)); + + return EvalCompareStr(par, lhs, op, rhs); +} + +static Boolean +CondParser_ComparisonOp(CondParser *par, ComparisonOp *out_op) +{ + const char *p = par->p; + + if (p[0] == '<' && p[1] == '=') { + *out_op = LE; + goto length_2; + } else if (p[0] == '<') { + *out_op = LT; + goto length_1; + } else if (p[0] == '>' && p[1] == '=') { + *out_op = GE; + goto length_2; + } else if (p[0] == '>') { + *out_op = GT; + goto length_1; + } else if (p[0] == '=' && p[1] == '=') { + *out_op = EQ; + goto length_2; + } else if (p[0] == '!' && p[1] == '=') { + *out_op = NE; + goto length_2; + } + return FALSE; + +length_2: + par->p = p + 2; + return TRUE; +length_1: + par->p = p + 1; + return TRUE; +} + +/* + * Parse a comparison condition such as: + * + * 0 + * ${VAR:Mpattern} + * ${VAR} == value + * ${VAR:U0} < 12345 + */ +static Token +CondParser_Comparison(CondParser *par, Boolean doEval) +{ + Token t = TOK_ERROR; + FStr lhs, rhs; + ComparisonOp op; + Boolean lhsQuoted, rhsQuoted; + + /* + * Parse the variable spec and skip over it, saving its + * value in lhs. + */ + CondParser_String(par, doEval, lhsStrict, &lhs, &lhsQuoted); + if (lhs.str == NULL) + goto done_lhs; + + CondParser_SkipWhitespace(par); + + if (!CondParser_ComparisonOp(par, &op)) { + /* Unknown operator, compare against an empty string or 0. */ + t = ToToken(doEval && EvalNotEmpty(par, lhs.str, lhsQuoted)); + goto done_lhs; + } + + CondParser_SkipWhitespace(par); + + if (par->p[0] == '\0') { + Parse_Error(PARSE_FATAL, + "Missing right-hand-side of operator '%s'", opname[op]); + par->printedError = TRUE; + goto done_lhs; + } + + CondParser_String(par, doEval, FALSE, &rhs, &rhsQuoted); + if (rhs.str == NULL) + goto done_rhs; + + if (!doEval) { + t = TOK_FALSE; + goto done_rhs; + } + + t = EvalCompare(par, lhs.str, lhsQuoted, op, rhs.str, rhsQuoted); + +done_rhs: + FStr_Done(&rhs); +done_lhs: + FStr_Done(&lhs); return t; - } +} - /* Push anything numeric through the compare expression */ - cp = condExpr; - if (isdigit((unsigned char)cp[0]) || strchr("+-", cp[0])) - return compare_expression(doEval); +/* + * The argument to empty() is a variable name, optionally followed by + * variable modifiers. + */ +/*ARGSUSED*/ +static size_t +ParseEmptyArg(CondParser *par MAKE_ATTR_UNUSED, const char **pp, + Boolean doEval, const char *func MAKE_ATTR_UNUSED, + char **out_arg) +{ + FStr val; + size_t magic_res; - /* - * Most likely we have a naked token to apply the default function to. - * However ".if a == b" gets here when the "a" is unquoted and doesn't - * start with a '$'. This surprises people. - * If what follows the function argument is a '=' or '!' then the syntax - * would be invalid if we did "defined(a)" - so instead treat as an - * expression. - */ - arglen = CondGetArg(&cp, &arg, NULL); - for (cp1 = cp; isspace(*(unsigned char *)cp1); cp1++) - continue; - if (*cp1 == '=' || *cp1 == '!') - return compare_expression(doEval); - condExpr = cp; + /* We do all the work here and return the result as the length */ + *out_arg = NULL; - /* - * Evaluate the argument using the default function. - * This path always treats .if as .ifdef. To get here the character - * after .if must have been taken literally, so the argument cannot - * be empty - even if it contained a variable expansion. - */ - t = !doEval || if_info->defProc(arglen, arg) != if_info->doNot; - if (arg) + (*pp)--; /* Make (*pp)[1] point to the '('. */ + (void)Var_Parse(pp, SCOPE_CMDLINE, + doEval ? VARE_WANTRES : VARE_PARSE_ONLY, &val); + /* TODO: handle errors */ + /* If successful, *pp points beyond the closing ')' now. */ + + if (val.str == var_Error) { + FStr_Done(&val); + return (size_t)-1; + } + + /* + * A variable is empty when it just contains spaces... + * 4/15/92, christos + */ + cpp_skip_whitespace(&val.str); + + /* + * For consistency with the other functions we can't generate the + * true/false here. + */ + magic_res = val.str[0] != '\0' ? 2 : 1; + FStr_Done(&val); + return magic_res; +} + +/*ARGSUSED*/ +static Boolean +FuncEmpty(size_t arglen, const char *arg MAKE_ATTR_UNUSED) +{ + /* Magic values ahead, see ParseEmptyArg. */ + return arglen == 1; +} + +static Boolean +CondParser_Func(CondParser *par, Boolean doEval, Token *out_token) +{ + static const struct fn_def { + const char *fn_name; + size_t fn_name_len; + size_t (*fn_parse)(CondParser *, const char **, Boolean, + const char *, char **); + Boolean (*fn_eval)(size_t, const char *); + } fns[] = { + { "defined", 7, ParseFuncArg, FuncDefined }, + { "make", 4, ParseFuncArg, FuncMake }, + { "exists", 6, ParseFuncArg, FuncExists }, + { "empty", 5, ParseEmptyArg, FuncEmpty }, + { "target", 6, ParseFuncArg, FuncTarget }, + { "commands", 8, ParseFuncArg, FuncCommands } + }; + const struct fn_def *fn; + char *arg = NULL; + size_t arglen; + const char *cp = par->p; + const struct fn_def *fns_end = fns + sizeof fns / sizeof fns[0]; + + for (fn = fns; fn != fns_end; fn++) { + if (!is_token(cp, fn->fn_name, fn->fn_name_len)) + continue; + + cp += fn->fn_name_len; + cpp_skip_whitespace(&cp); + if (*cp != '(') + break; + + arglen = fn->fn_parse(par, &cp, doEval, fn->fn_name, &arg); + if (arglen == 0 || arglen == (size_t)-1) { + par->p = cp; + *out_token = arglen == 0 ? TOK_FALSE : TOK_ERROR; + return TRUE; + } + + /* Evaluate the argument using the required function. */ + *out_token = ToToken(!doEval || fn->fn_eval(arglen, arg)); + free(arg); + par->p = cp; + return TRUE; + } + + return FALSE; +} + +/* + * Parse a function call, a number, a variable expression or a string + * literal. + */ +static Token +CondParser_LeafToken(CondParser *par, Boolean doEval) +{ + Token t; + char *arg = NULL; + size_t arglen; + const char *cp; + const char *cp1; + + if (CondParser_Func(par, doEval, &t)) + return t; + + /* Push anything numeric through the compare expression */ + cp = par->p; + if (ch_isdigit(cp[0]) || cp[0] == '-' || cp[0] == '+') + return CondParser_Comparison(par, doEval); + + /* + * Most likely we have a naked token to apply the default function to. + * However ".if a == b" gets here when the "a" is unquoted and doesn't + * start with a '$'. This surprises people. + * If what follows the function argument is a '=' or '!' then the + * syntax would be invalid if we did "defined(a)" - so instead treat + * as an expression. + */ + arglen = ParseFuncArg(par, &cp, doEval, NULL, &arg); + cp1 = cp; + cpp_skip_whitespace(&cp1); + if (*cp1 == '=' || *cp1 == '!') + return CondParser_Comparison(par, doEval); + par->p = cp; + + /* + * Evaluate the argument using the default function. + * This path always treats .if as .ifdef. To get here, the character + * after .if must have been taken literally, so the argument cannot + * be empty - even if it contained a variable expansion. + */ + t = ToToken(!doEval || If_Eval(par, arg, arglen)); free(arg); - return t; -} - -static Token -CondToken(Boolean doEval) -{ - Token t; - - t = condPushBack; - if (t != TOK_NONE) { - condPushBack = TOK_NONE; return t; - } - - while (*condExpr == ' ' || *condExpr == '\t') { - condExpr++; - } - - switch (*condExpr) { - - case '(': - condExpr++; - return TOK_LPAREN; - - case ')': - condExpr++; - return TOK_RPAREN; - - case '|': - if (condExpr[1] == '|') { - condExpr++; - } - condExpr++; - return TOK_OR; - - case '&': - if (condExpr[1] == '&') { - condExpr++; - } - condExpr++; - return TOK_AND; - - case '!': - condExpr++; - return TOK_NOT; - - case '#': - case '\n': - case '\0': - return TOK_EOF; - - case '"': - case '$': - return compare_expression(doEval); - - default: - return compare_function(doEval); - } } -/*- - *----------------------------------------------------------------------- - * CondT -- - * Parse a single term in the expression. This consists of a terminal - * symbol or TOK_NOT and a terminal symbol (not including the binary - * operators): - * T -> defined(variable) | make(target) | exists(file) | symbol - * T -> ! T | ( E ) - * - * Results: - * TOK_TRUE, TOK_FALSE or TOK_ERROR. - * - * Side Effects: - * Tokens are consumed. - * - *----------------------------------------------------------------------- - */ +/* Return the next token or comparison result from the parser. */ static Token -CondT(Boolean doEval) +CondParser_Token(CondParser *par, Boolean doEval) { - Token t; + Token t; - t = CondToken(doEval); + t = par->curr; + if (t != TOK_NONE) { + par->curr = TOK_NONE; + return t; + } - if (t == TOK_EOF) { - /* - * If we reached the end of the expression, the expression - * is malformed... - */ - t = TOK_ERROR; - } else if (t == TOK_LPAREN) { - /* - * T -> ( E ) - */ - t = CondE(doEval); - if (t != TOK_ERROR) { - if (CondToken(doEval) != TOK_RPAREN) { - t = TOK_ERROR; - } + cpp_skip_hspace(&par->p); + + switch (par->p[0]) { + + case '(': + par->p++; + return TOK_LPAREN; + + case ')': + par->p++; + return TOK_RPAREN; + + case '|': + par->p++; + if (par->p[0] == '|') + par->p++; + else if (opts.strict) { + Parse_Error(PARSE_FATAL, "Unknown operator '|'"); + par->printedError = TRUE; + return TOK_ERROR; + } + return TOK_OR; + + case '&': + par->p++; + if (par->p[0] == '&') + par->p++; + else if (opts.strict) { + Parse_Error(PARSE_FATAL, "Unknown operator '&'"); + par->printedError = TRUE; + return TOK_ERROR; + } + return TOK_AND; + + case '!': + par->p++; + return TOK_NOT; + + case '#': /* XXX: see unit-tests/cond-token-plain.mk */ + case '\n': /* XXX: why should this end the condition? */ + /* Probably obsolete now, from 1993-03-21. */ + case '\0': + return TOK_EOF; + + case '"': + case '$': + return CondParser_Comparison(par, doEval); + + default: + return CondParser_LeafToken(par, doEval); } - } else if (t == TOK_NOT) { - t = CondT(doEval); - if (t == TOK_TRUE) { - t = TOK_FALSE; - } else if (t == TOK_FALSE) { - t = TOK_TRUE; - } - } - return (t); } - -/*- - *----------------------------------------------------------------------- - * CondF -- - * Parse a conjunctive factor (nice name, wot?) - * F -> T && F | T - * - * Results: - * TOK_TRUE, TOK_FALSE or TOK_ERROR - * - * Side Effects: - * Tokens are consumed. - * - *----------------------------------------------------------------------- + +/* + * Term -> '(' Or ')' + * Term -> '!' Term + * Term -> Leaf Operator Leaf + * Term -> Leaf */ -static Token -CondF(Boolean doEval) +static CondResult +CondParser_Term(CondParser *par, Boolean doEval) { - Token l, o; + CondResult res; + Token t; - l = CondT(doEval); - if (l != TOK_ERROR) { - o = CondToken(doEval); + t = CondParser_Token(par, doEval); + if (t == TOK_TRUE) + return CR_TRUE; + if (t == TOK_FALSE) + return CR_FALSE; - if (o == TOK_AND) { - /* - * F -> T && F - * - * If T is TOK_FALSE, the whole thing will be TOK_FALSE, but we have to - * parse the r.h.s. anyway (to throw it away). - * If T is TOK_TRUE, the result is the r.h.s., be it an TOK_ERROR or no. - */ - if (l == TOK_TRUE) { - l = CondF(doEval); - } else { - (void)CondF(FALSE); - } - } else { - /* - * F -> T - */ - CondPushBack(o); + if (t == TOK_LPAREN) { + res = CondParser_Or(par, doEval); + if (res == CR_ERROR) + return CR_ERROR; + if (CondParser_Token(par, doEval) != TOK_RPAREN) + return CR_ERROR; + return res; } - } - return (l); + + if (t == TOK_NOT) { + res = CondParser_Term(par, doEval); + if (res == CR_TRUE) + res = CR_FALSE; + else if (res == CR_FALSE) + res = CR_TRUE; + return res; + } + + return CR_ERROR; } - -/*- - *----------------------------------------------------------------------- - * CondE -- - * Main expression production. - * E -> F || E | F - * - * Results: - * TOK_TRUE, TOK_FALSE or TOK_ERROR. - * - * Side Effects: - * Tokens are, of course, consumed. - * - *----------------------------------------------------------------------- + +/* + * And -> Term '&&' And + * And -> Term */ -static Token -CondE(Boolean doEval) +static CondResult +CondParser_And(CondParser *par, Boolean doEval) { - Token l, o; + CondResult res; + Token op; - l = CondF(doEval); - if (l != TOK_ERROR) { - o = CondToken(doEval); + res = CondParser_Term(par, doEval); + if (res == CR_ERROR) + return CR_ERROR; - if (o == TOK_OR) { - /* - * E -> F || E - * - * A similar thing occurs for ||, except that here we make sure - * the l.h.s. is TOK_FALSE before we bother to evaluate the r.h.s. - * Once again, if l is TOK_FALSE, the result is the r.h.s. and once - * again if l is TOK_TRUE, we parse the r.h.s. to throw it away. - */ - if (l == TOK_FALSE) { - l = CondE(doEval); - } else { - (void)CondE(FALSE); - } - } else { - /* - * E -> F - */ - CondPushBack(o); + op = CondParser_Token(par, doEval); + if (op == TOK_AND) { + if (res == CR_TRUE) + return CondParser_And(par, doEval); + if (CondParser_And(par, FALSE) == CR_ERROR) + return CR_ERROR; + return res; } - } - return (l); + + CondParser_PushBack(par, op); + return res; } -/*- - *----------------------------------------------------------------------- - * Cond_EvalExpression -- - * Evaluate an expression in the passed line. The expression - * consists of &&, ||, !, make(target), defined(variable) - * and parenthetical groupings thereof. +/* + * Or -> And '||' Or + * Or -> And + */ +static CondResult +CondParser_Or(CondParser *par, Boolean doEval) +{ + CondResult res; + Token op; + + res = CondParser_And(par, doEval); + if (res == CR_ERROR) + return CR_ERROR; + + op = CondParser_Token(par, doEval); + if (op == TOK_OR) { + if (res == CR_FALSE) + return CondParser_Or(par, doEval); + if (CondParser_Or(par, FALSE) == CR_ERROR) + return CR_ERROR; + return res; + } + + CondParser_PushBack(par, op); + return res; +} + +static CondEvalResult +CondParser_Eval(CondParser *par, Boolean *out_value) +{ + CondResult res; + + DEBUG1(COND, "CondParser_Eval: %s\n", par->p); + + res = CondParser_Or(par, TRUE); + if (res == CR_ERROR) + return COND_INVALID; + + if (CondParser_Token(par, FALSE) != TOK_EOF) + return COND_INVALID; + + *out_value = res == CR_TRUE; + return COND_PARSE; +} + +/* + * Evaluate the condition, including any side effects from the variable + * expressions in the condition. The condition consists of &&, ||, !, + * function(arg), comparisons and parenthetical groupings thereof. * * Results: * COND_PARSE if the condition was valid grammatically - * COND_INVALID if not a valid conditional. + * COND_INVALID if not a valid conditional. * * (*value) is set to the boolean value of the condition - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- */ -int -Cond_EvalExpression(const struct If *info, char *line, Boolean *value, int eprint, Boolean strictLHS) +static CondEvalResult +CondEvalExpression(const char *cond, Boolean *out_value, Boolean plain, + Boolean (*evalBare)(size_t, const char *), Boolean negate, + Boolean eprint, Boolean strictLHS) { - static const struct If *dflt_info; - const struct If *sv_if_info = if_info; - char *sv_condExpr = condExpr; - Token sv_condPushBack = condPushBack; - int rval; + CondParser par; + CondEvalResult rval; - lhsStrict = strictLHS; + lhsStrict = strictLHS; - while (*line == ' ' || *line == '\t') - line++; + cpp_skip_hspace(&cond); - if (info == NULL && (info = dflt_info) == NULL) { - /* Scan for the entry for .if - it can't be first */ - for (info = ifs; ; info++) - if (info->form[0] == 0) - break; - dflt_info = info; - } + par.plain = plain; + par.evalBare = evalBare; + par.negateEvalBare = negate; + par.p = cond; + par.curr = TOK_NONE; + par.printedError = FALSE; - if_info = info != NULL ? info : ifs + 4; - condExpr = line; - condPushBack = TOK_NONE; + rval = CondParser_Eval(&par, out_value); - rval = do_Cond_EvalExpression(value); + if (rval == COND_INVALID && eprint && !par.printedError) + Parse_Error(PARSE_FATAL, "Malformed conditional (%s)", cond); - if (rval == COND_INVALID && eprint) - Parse_Error(PARSE_FATAL, "Malformed conditional (%s)", line); - - if_info = sv_if_info; - condExpr = sv_condExpr; - condPushBack = sv_condPushBack; - - return rval; + return rval; } -static int -do_Cond_EvalExpression(Boolean *value) +/* + * Evaluate a condition in a :? modifier, such as + * ${"${VAR}" == value:?yes:no}. + */ +CondEvalResult +Cond_EvalCondition(const char *cond, Boolean *out_value) { - - switch (CondE(TRUE)) { - case TOK_TRUE: - if (CondToken(TRUE) == TOK_EOF) { - *value = TRUE; - return COND_PARSE; - } - break; - case TOK_FALSE: - if (CondToken(TRUE) == TOK_EOF) { - *value = FALSE; - return COND_PARSE; - } - break; - default: - case TOK_ERROR: - break; - } - - return COND_INVALID; + return CondEvalExpression(cond, out_value, TRUE, + FuncDefined, FALSE, FALSE, FALSE); } - -/*- - *----------------------------------------------------------------------- - * Cond_Eval -- - * Evaluate the conditional in the passed line. The line - * looks like this: - * . - * where is any of if, ifmake, ifnmake, ifdef, - * ifndef, elif, elifmake, elifnmake, elifdef, elifndef - * and consists of &&, ||, !, make(target), defined(variable) - * and parenthetical groupings thereof. +static Boolean +IsEndif(const char *p) +{ + return p[0] == 'e' && p[1] == 'n' && p[2] == 'd' && + p[3] == 'i' && p[4] == 'f' && !ch_isalpha(p[5]); +} + +static Boolean +DetermineKindOfConditional(const char **pp, Boolean *out_plain, + Boolean (**out_evalBare)(size_t, const char *), + Boolean *out_negate) +{ + const char *p = *pp; + + p += 2; + *out_plain = FALSE; + *out_evalBare = FuncDefined; + *out_negate = FALSE; + if (*p == 'n') { + p++; + *out_negate = TRUE; + } + if (is_token(p, "def", 3)) { /* .ifdef and .ifndef */ + p += 3; + } else if (is_token(p, "make", 4)) { /* .ifmake and .ifnmake */ + p += 4; + *out_evalBare = FuncMake; + } else if (is_token(p, "", 0) && !*out_negate) { /* plain .if */ + *out_plain = TRUE; + } else { + /* + * TODO: Add error message about unknown directive, + * since there is no other known directive that starts + * with 'el' or 'if'. + * + * Example: .elifx 123 + */ + return FALSE; + } + + *pp = p; + return TRUE; +} + +/* + * Evaluate the conditional directive in the line, which is one of: * - * Input: - * line Line to parse + * .if + * .ifmake + * .ifnmake + * .ifdef + * .ifndef + * .elif + * .elifmake + * .elifnmake + * .elifdef + * .elifndef + * .else + * .endif + * + * In these directives, consists of &&, ||, !, function(arg), + * comparisons, expressions, bare words, numbers and strings, and + * parenthetical groupings thereof. * * Results: - * COND_PARSE if should parse lines after the conditional - * COND_SKIP if should skip lines after the conditional - * COND_INVALID if not a valid conditional. - * - * Side Effects: - * None. - * - * Note that the states IF_ACTIVE and ELSE_ACTIVE are only different in order - * to detect splurious .else lines (as are SKIP_TO_ELSE and SKIP_TO_ENDIF) - * otherwise .else could be treated as '.elif 1'. - * - *----------------------------------------------------------------------- + * COND_PARSE to continue parsing the lines that follow the + * conditional (when evaluates to TRUE) + * COND_SKIP to skip the lines after the conditional + * (when evaluates to FALSE, or when a previous + * branch has already been taken) + * COND_INVALID if the conditional was not valid, either because of + * a syntax error or because some variable was undefined + * or because the condition could not be evaluated */ -int -Cond_Eval(char *line) +CondEvalResult +Cond_EvalLine(const char *line) { -#define MAXIF 128 /* maximum depth of .if'ing */ -#define MAXIF_BUMP 32 /* how much to grow by */ - enum if_states { - IF_ACTIVE, /* .if or .elif part active */ - ELSE_ACTIVE, /* .else part active */ - SEARCH_FOR_ELIF, /* searching for .elif/else to execute */ - SKIP_TO_ELSE, /* has been true, but not seen '.else' */ - SKIP_TO_ENDIF /* nothing else to execute */ - }; - static enum if_states *cond_state = NULL; - static unsigned int max_if_depth = MAXIF; + typedef enum IfState { - const struct If *ifp; - Boolean isElif; - Boolean value; - int level; /* Level at which to report errors. */ - enum if_states state; + /* None of the previous evaluated to TRUE. */ + IFS_INITIAL = 0, - level = PARSE_FATAL; - if (!cond_state) { - cond_state = bmake_malloc(max_if_depth * sizeof(*cond_state)); - cond_state[0] = IF_ACTIVE; - } - /* skip leading character (the '.') and any whitespace */ - for (line++; *line == ' ' || *line == '\t'; line++) - continue; + /* The previous evaluated to TRUE. + * The lines following this condition are interpreted. */ + IFS_ACTIVE = 1 << 0, - /* Find what type of if we're dealing with. */ - if (line[0] == 'e') { - if (line[1] != 'l') { - if (!istoken(line + 1, "ndif", 4)) + /* The previous directive was an '.else'. */ + IFS_SEEN_ELSE = 1 << 1, + + /* One of the previous evaluated to TRUE. */ + IFS_WAS_ACTIVE = 1 << 2 + + } IfState; + + static enum IfState *cond_states = NULL; + static unsigned int cond_states_cap = 128; + + Boolean plain; + Boolean (*evalBare)(size_t, const char *); + Boolean negate; + Boolean isElif; + Boolean value; + IfState state; + const char *p = line; + + if (cond_states == NULL) { + cond_states = bmake_malloc( + cond_states_cap * sizeof *cond_states); + cond_states[0] = IFS_ACTIVE; + } + + p++; /* skip the leading '.' */ + cpp_skip_hspace(&p); + + if (IsEndif(p)) { /* It is an '.endif'. */ + if (p[5] != '\0') { + Parse_Error(PARSE_FATAL, + "The .endif directive does not take arguments."); + } + + if (cond_depth == cond_min_depth) { + Parse_Error(PARSE_FATAL, "if-less endif"); + return COND_PARSE; + } + + /* Return state for previous conditional */ + cond_depth--; + return cond_states[cond_depth] & IFS_ACTIVE + ? COND_PARSE : COND_SKIP; + } + + /* Parse the name of the directive, such as 'if', 'elif', 'endif'. */ + if (p[0] == 'e') { + if (p[1] != 'l') { + /* + * Unknown directive. It might still be a + * transformation rule like '.elisp.scm', + * therefore no error message here. + */ + return COND_INVALID; + } + + /* Quite likely this is 'else' or 'elif' */ + p += 2; + if (is_token(p, "se", 2)) { /* It is an 'else'. */ + + if (p[2] != '\0') + Parse_Error(PARSE_FATAL, + "The .else directive " + "does not take arguments."); + + if (cond_depth == cond_min_depth) { + Parse_Error(PARSE_FATAL, "if-less else"); + return COND_PARSE; + } + + state = cond_states[cond_depth]; + if (state == IFS_INITIAL) { + state = IFS_ACTIVE | IFS_SEEN_ELSE; + } else { + if (state & IFS_SEEN_ELSE) + Parse_Error(PARSE_WARNING, + "extra else"); + state = IFS_WAS_ACTIVE | IFS_SEEN_ELSE; + } + cond_states[cond_depth] = state; + + return state & IFS_ACTIVE ? COND_PARSE : COND_SKIP; + } + /* Assume for now it is an elif */ + isElif = TRUE; + } else + isElif = FALSE; + + if (p[0] != 'i' || p[1] != 'f') { + /* + * Unknown directive. It might still be a transformation rule + * like '.elisp.scm', therefore no error message here. + */ + return COND_INVALID; /* Not an ifxxx or elifxxx line */ + } + + if (!DetermineKindOfConditional(&p, &plain, &evalBare, &negate)) return COND_INVALID; - /* End of conditional section */ - if (cond_depth == cond_min_depth) { - Parse_Error(level, "if-less endif"); - return COND_PARSE; - } - /* Return state for previous conditional */ - cond_depth--; - return cond_state[cond_depth] <= ELSE_ACTIVE ? COND_PARSE : COND_SKIP; + + if (isElif) { + if (cond_depth == cond_min_depth) { + Parse_Error(PARSE_FATAL, "if-less elif"); + return COND_PARSE; + } + state = cond_states[cond_depth]; + if (state & IFS_SEEN_ELSE) { + Parse_Error(PARSE_WARNING, "extra elif"); + cond_states[cond_depth] = + IFS_WAS_ACTIVE | IFS_SEEN_ELSE; + return COND_SKIP; + } + if (state != IFS_INITIAL) { + cond_states[cond_depth] = IFS_WAS_ACTIVE; + return COND_SKIP; + } + } else { + /* Normal .if */ + if (cond_depth + 1 >= cond_states_cap) { + /* + * This is rare, but not impossible. + * In meta mode, dirdeps.mk (only runs at level 0) + * can need more than the default. + */ + cond_states_cap += 32; + cond_states = bmake_realloc(cond_states, + cond_states_cap * + sizeof *cond_states); + } + state = cond_states[cond_depth]; + cond_depth++; + if (!(state & IFS_ACTIVE)) { + /* + * If we aren't parsing the data, + * treat as always false. + */ + cond_states[cond_depth] = IFS_WAS_ACTIVE; + return COND_SKIP; + } } - /* Quite likely this is 'else' or 'elif' */ - line += 2; - if (istoken(line, "se", 2)) { - /* It is else... */ - if (cond_depth == cond_min_depth) { - Parse_Error(level, "if-less else"); - return COND_PARSE; - } - - state = cond_state[cond_depth]; - switch (state) { - case SEARCH_FOR_ELIF: - state = ELSE_ACTIVE; - break; - case ELSE_ACTIVE: - case SKIP_TO_ENDIF: - Parse_Error(PARSE_WARNING, "extra else"); - /* FALLTHROUGH */ - default: - case IF_ACTIVE: - case SKIP_TO_ELSE: - state = SKIP_TO_ENDIF; - break; - } - cond_state[cond_depth] = state; - return state <= ELSE_ACTIVE ? COND_PARSE : COND_SKIP; + /* And evaluate the conditional expression */ + if (CondEvalExpression(p, &value, plain, evalBare, negate, + TRUE, TRUE) == COND_INVALID) { + /* Syntax error in conditional, error message already output. */ + /* Skip everything to matching .endif */ + /* XXX: An extra '.else' is not detected in this case. */ + cond_states[cond_depth] = IFS_WAS_ACTIVE; + return COND_SKIP; } - /* Assume for now it is an elif */ - isElif = TRUE; - } else - isElif = FALSE; - if (line[0] != 'i' || line[1] != 'f') - /* Not an ifxxx or elifxxx line */ - return COND_INVALID; - - /* - * Figure out what sort of conditional it is -- what its default - * function is, etc. -- by looking in the table of valid "ifs" - */ - line += 2; - for (ifp = ifs; ; ifp++) { - if (ifp->form == NULL) - return COND_INVALID; - if (istoken(ifp->form, line, ifp->formlen)) { - line += ifp->formlen; - break; + if (!value) { + cond_states[cond_depth] = IFS_INITIAL; + return COND_SKIP; } - } - - /* Now we know what sort of 'if' it is... */ - - if (isElif) { - if (cond_depth == cond_min_depth) { - Parse_Error(level, "if-less elif"); - return COND_PARSE; - } - state = cond_state[cond_depth]; - if (state == SKIP_TO_ENDIF || state == ELSE_ACTIVE) { - Parse_Error(PARSE_WARNING, "extra elif"); - cond_state[cond_depth] = SKIP_TO_ENDIF; - return COND_SKIP; - } - if (state != SEARCH_FOR_ELIF) { - /* Either just finished the 'true' block, or already SKIP_TO_ELSE */ - cond_state[cond_depth] = SKIP_TO_ELSE; - return COND_SKIP; - } - } else { - /* Normal .if */ - if (cond_depth + 1 >= max_if_depth) { - /* - * This is rare, but not impossible. - * In meta mode, dirdeps.mk (only runs at level 0) - * can need more than the default. - */ - max_if_depth += MAXIF_BUMP; - cond_state = bmake_realloc(cond_state, max_if_depth * - sizeof(*cond_state)); - } - state = cond_state[cond_depth]; - cond_depth++; - if (state > ELSE_ACTIVE) { - /* If we aren't parsing the data, treat as always false */ - cond_state[cond_depth] = SKIP_TO_ELSE; - return COND_SKIP; - } - } - - /* And evaluate the conditional expresssion */ - if (Cond_EvalExpression(ifp, line, &value, 1, TRUE) == COND_INVALID) { - /* Syntax error in conditional, error message already output. */ - /* Skip everything to matching .endif */ - cond_state[cond_depth] = SKIP_TO_ELSE; - return COND_SKIP; - } - - if (!value) { - cond_state[cond_depth] = SEARCH_FOR_ELIF; - return COND_SKIP; - } - cond_state[cond_depth] = IF_ACTIVE; - return COND_PARSE; + cond_states[cond_depth] = IFS_ACTIVE; + return COND_PARSE; } - - -/*- - *----------------------------------------------------------------------- - * Cond_End -- - * Make sure everything's clean at the end of a makefile. - * - * Results: - * None. - * - * Side Effects: - * Parse_Error will be called if open conditionals are around. - * - *----------------------------------------------------------------------- - */ void Cond_restore_depth(unsigned int saved_depth) { - int open_conds = cond_depth - cond_min_depth; + unsigned int open_conds = cond_depth - cond_min_depth; - if (open_conds != 0 || saved_depth > cond_depth) { - Parse_Error(PARSE_FATAL, "%d open conditional%s", open_conds, - open_conds == 1 ? "" : "s"); - cond_depth = cond_min_depth; - } + if (open_conds != 0 || saved_depth > cond_depth) { + Parse_Error(PARSE_FATAL, "%u open conditional%s", + open_conds, open_conds == 1 ? "" : "s"); + cond_depth = cond_min_depth; + } - cond_min_depth = saved_depth; + cond_min_depth = saved_depth; } unsigned int Cond_save_depth(void) { - int depth = cond_min_depth; + unsigned int depth = cond_min_depth; - cond_min_depth = cond_depth; - return depth; + cond_min_depth = cond_depth; + return depth; } diff --git a/usr.bin/make/config.h b/usr.bin/make/config.h index 06af09c2d..dcf5b3162 100644 --- a/usr.bin/make/config.h +++ b/usr.bin/make/config.h @@ -1,4 +1,4 @@ -/* $NetBSD: config.h,v 1.21 2012/03/31 00:12:24 christos Exp $ */ +/* $NetBSD: config.h,v 1.28 2020/12/11 22:53:08 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -72,26 +72,16 @@ * from: @(#)config.h 8.1 (Berkeley) 6/6/93 */ -/* - * DEFMAXJOBS - * DEFMAXLOCAL - * These control the default concurrency. On no occasion will more - * than DEFMAXJOBS targets be created at once (locally or remotely) - * DEFMAXLOCAL is the highest number of targets which will be - * created on the local machine at once. Note that if you set this - * to 0, nothing will ever happen... - */ -#define DEFMAXJOBS 4 -#define DEFMAXLOCAL 1 - /* * INCLUDES * LIBRARIES * These control the handling of the .INCLUDES and .LIBS variables. + * * If INCLUDES is defined, the .INCLUDES variable will be filled * from the search paths of those suffixes which are marked by - * .INCLUDES dependency lines. Similarly for LIBRARIES and .LIBS - * See suff.c for more details. + * .INCLUDES dependency lines. Similarly for LIBRARIES and .LIBS. + * + * See varname-dot-include.mk and varname-dot-libs.mk for more details. */ #define INCLUDES #define LIBRARIES @@ -100,34 +90,39 @@ * LIBSUFF * Is the suffix used to denote libraries and is used by the Suff module * to find the search path on which to seek any -l targets. - * + */ +#define LIBSUFF ".a" + +/* * RECHECK * If defined, Make_Update will check a target for its current * modification time after it has been re-made, setting it to the * starting time of the make only if the target still doesn't exist. + * * Unfortunately, under NFS the modification time often doesn't * get updated in time, so a target will appear to not have been - * re-made, causing later targets to appear up-to-date. On systems - * that don't have this problem, you should defined this. Under - * NFS you probably should not, unless you aren't exporting jobs. + * re-made, causing later targets to appear up-to-date. + * + * On systems that don't have this problem, you should define this. + * Under NFS you probably should not, unless you aren't exporting jobs. */ -#define LIBSUFF ".a" -#define RECHECK +#define RECHECK /* * POSIX * Adhere to the POSIX 1003.2 draft for the make(1) program. * - Use MAKEFLAGS instead of MAKE to pick arguments from the * environment. - * - Allow empty command lines if starting with tab. */ #define POSIX /* * SYSVINCLUDE * Recognize system V like include directives [include "filename"] + * (required by POSIX 2018) * SYSVVARSUB * Recognize system V like ${VAR:x=y} variable substitutions + * (required by POSIX 2018) */ #define SYSVINCLUDE #define SYSVVARSUB @@ -147,12 +142,6 @@ */ #define SUNSHCMD -/* - * USE_IOVEC - * We have writev(2) - */ -#define USE_IOVEC - #if defined(MAKE_NATIVE) && !defined(__ELF__) # ifndef RANLIBMAG # define RANLIBMAG "__.SYMDEF" diff --git a/usr.bin/make/dir.c b/usr.bin/make/dir.c index 7b12769c2..026983e3e 100644 --- a/usr.bin/make/dir.c +++ b/usr.bin/make/dir.c @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $ */ +/* $NetBSD: dir.c,v 1.270 2021/02/05 05:48:19 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -69,70 +69,62 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; -#else -__RCSID("$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * dir.c -- - * Directory searching using wildcards and/or normal names... - * Used both for source wildcarding in the Makefile and for finding - * implicit sources. +/* + * Directory searching using wildcards and/or normal names. + * Used both for source wildcarding in the makefile and for finding + * implicit sources. * * The interface for this module is: - * Dir_Init Initialize the module. + * Dir_Init Initialize the module. * - * Dir_InitCur Set the cur Path. + * Dir_InitCur Set the cur CachedDir. * - * Dir_InitDot Set the dot Path. + * Dir_InitDot Set the dot CachedDir. * - * Dir_End Cleanup the module. + * Dir_End Clean up the module. * - * Dir_SetPATH Set ${.PATH} to reflect state of dirSearchPath. + * Dir_SetPATH Set ${.PATH} to reflect state of dirSearchPath. * - * Dir_HasWildcards Returns TRUE if the name given it needs to - * be wildcard-expanded. + * Dir_HasWildcards + * Returns TRUE if the name given it needs to + * be wildcard-expanded. * - * Dir_Expand Given a pattern and a path, return a Lst of names - * which match the pattern on the search path. + * SearchPath_Expand + * Expand a filename pattern to find all matching files + * from the search path. * - * Dir_FindFile Searches for a file on a given search path. - * If it exists, the entire path is returned. - * Otherwise NULL is returned. + * Dir_FindFile Searches for a file on a given search path. + * If it exists, the entire path is returned. + * Otherwise NULL is returned. * - * Dir_FindHereOrAbove Search for a path in the current directory and - * then all the directories above it in turn until - * the path is found or we reach the root ("/"). - * - * Dir_MTime Return the modification time of a node. The file - * is searched for along the default search path. - * The path and mtime fields of the node are filled - * in. + * Dir_FindHereOrAbove + * Search for a path in the current directory and + * then all the directories above it in turn until + * the path is found or we reach the root ("/"). * - * Dir_AddDir Add a directory to a search path. + * Dir_UpdateMTime + * Update the modification time and path of a node with + * data from the file corresponding to the node. * - * Dir_MakeFlags Given a search path and a command flag, create - * a string with each of the directories in the path - * preceded by the command flag and all of them - * separated by a space. + * SearchPath_Add Add a directory to a search path. * - * Dir_Destroy Destroy an element of a search path. Frees up all - * things that can be freed for the element as long - * as the element is no longer referenced by any other - * search path. - * Dir_ClearPath Resets a search path to the empty list. + * SearchPath_ToFlags + * Given a search path and a command flag, create + * a string with each of the directories in the path + * preceded by the command flag and all of them + * separated by a space. + * + * Dir_Destroy Destroy an element of a search path. Frees up all + * things that can be freed for the element as long + * as the element is no longer referenced by any other + * search path. + * + * SearchPath_Clear + * Resets a search path to the empty list. * * For debugging: - * Dir_PrintDirectories Print stats about the directory cache. + * Dir_PrintDirectories + * Print stats about the directory cache. */ #include @@ -140,244 +132,409 @@ __RCSID("$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"); #include #include -#include #include "make.h" -#include "hash.h" #include "dir.h" #include "job.h" +/* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ +MAKE_RCSID("$NetBSD: dir.c,v 1.270 2021/02/05 05:48:19 rillig Exp $"); + /* - * A search path consists of a Lst of Path structures. A Path structure - * has in it the name of the directory and a hash table of all the files - * in the directory. This is used to cut down on the number of system - * calls necessary to find implicit dependents and their like. Since - * these searches are made before any actions are taken, we need not - * worry about the directory changing due to creation commands. If this - * hampers the style of some makefiles, they must be changed. + * A search path is a list of CachedDir structures. A CachedDir has in it the + * name of the directory and the names of all the files in the directory. + * This is used to cut down on the number of system calls necessary to find + * implicit dependents and their like. Since these searches are made before + * any actions are taken, we need not worry about the directory changing due + * to creation commands. If this hampers the style of some makefiles, they + * must be changed. * - * A list of all previously-read directories is kept in the - * openDirectories Lst. This list is checked first before a directory - * is opened. + * All previously-read directories are kept in openDirs, which is checked + * first before a directory is opened. * - * The need for the caching of whole directories is brought about by - * the multi-level transformation code in suff.c, which tends to search - * for far more files than regular make does. In the initial - * implementation, the amount of time spent performing "stat" calls was - * truly astronomical. The problem with hashing at the start is, - * of course, that pmake doesn't then detect changes to these directories - * during the course of the make. Three possibilities suggest themselves: + * The need for the caching of whole directories is brought about by the + * multi-level transformation code in suff.c, which tends to search for far + * more files than regular make does. In the initial implementation, the + * amount of time spent performing "stat" calls was truly astronomical. + * The problem with caching at the start is, of course, that pmake doesn't + * then detect changes to these directories during the course of the make. + * Three possibilities suggest themselves: * - * 1) just use stat to test for a file's existence. As mentioned - * above, this is very inefficient due to the number of checks - * engendered by the multi-level transformation code. - * 2) use readdir() and company to search the directories, keeping - * them open between checks. I have tried this and while it - * didn't slow down the process too much, it could severely - * affect the amount of parallelism available as each directory - * open would take another file descriptor out of play for - * handling I/O for another job. Given that it is only recently - * that UNIX OS's have taken to allowing more than 20 or 32 - * file descriptors for a process, this doesn't seem acceptable - * to me. - * 3) record the mtime of the directory in the Path structure and - * verify the directory hasn't changed since the contents were - * hashed. This will catch the creation or deletion of files, - * but not the updating of files. However, since it is the - * creation and deletion that is the problem, this could be - * a good thing to do. Unfortunately, if the directory (say ".") - * were fairly large and changed fairly frequently, the constant - * rehashing could seriously degrade performance. It might be - * good in such cases to keep track of the number of rehashes - * and if the number goes over a (small) limit, resort to using - * stat in its place. + * 1) just use stat to test for a file's existence. As mentioned above, + * this is very inefficient due to the number of checks engendered by + * the multi-level transformation code. * - * An additional thing to consider is that pmake is used primarily - * to create C programs and until recently pcc-based compilers refused - * to allow you to specify where the resulting object file should be - * placed. This forced all objects to be created in the current - * directory. This isn't meant as a full excuse, just an explanation of - * some of the reasons for the caching used here. + * 2) use readdir() and company to search the directories, keeping them + * open between checks. I have tried this and while it didn't slow down + * the process too much, it could severely affect the amount of + * parallelism available as each directory open would take another file + * descriptor out of play for handling I/O for another job. Given that + * it is only recently (as of 1993 or earlier) that UNIX OS's have taken + * to allowing more than 20 or 32 file descriptors for a process, this + * doesn't seem acceptable to me. * - * One more note: the location of a target's file is only performed - * on the downward traversal of the graph and then only for terminal - * nodes in the graph. This could be construed as wrong in some cases, - * but prevents inadvertent modification of files when the "installed" - * directory for a file is provided in the search path. + * 3) record the mtime of the directory in the CachedDir structure and + * verify the directory hasn't changed since the contents were cached. + * This will catch the creation or deletion of files, but not the + * updating of files. However, since it is the creation and deletion + * that is the problem, this could be a good thing to do. Unfortunately, + * if the directory (say ".") were fairly large and changed fairly + * frequently, the constant reloading could seriously degrade + * performance. It might be good in such cases to keep track of the + * number of reloadings and if the number goes over a (small) limit, + * resort to using stat in its place. * - * Another data structure maintained by this module is an mtime - * cache used when the searching of cached directories fails to find - * a file. In the past, Dir_FindFile would simply perform an access() - * call in such a case to determine if the file could be found using - * just the name given. When this hit, however, all that was gained - * was the knowledge that the file existed. Given that an access() is - * essentially a stat() without the copyout() call, and that the same - * filesystem overhead would have to be incurred in Dir_MTime, it made - * sense to replace the access() with a stat() and record the mtime - * in a cache for when Dir_MTime was actually called. + * An additional thing to consider is that pmake is used primarily to create + * C programs and until recently (as of 1993 or earlier) pcc-based compilers + * refused to allow you to specify where the resulting object file should be + * placed. This forced all objects to be created in the current directory. + * This isn't meant as a full excuse, just an explanation of some of the + * reasons for the caching used here. + * + * One more note: the location of a target's file is only performed on the + * downward traversal of the graph and then only for terminal nodes in the + * graph. This could be construed as wrong in some cases, but prevents + * inadvertent modification of files when the "installed" directory for a + * file is provided in the search path. + * + * Another data structure maintained by this module is an mtime cache used + * when the searching of cached directories fails to find a file. In the past, + * Dir_FindFile would simply perform an access() call in such a case to + * determine if the file could be found using just the name given. When this + * hit, however, all that was gained was the knowledge that the file existed. + * Given that an access() is essentially a stat() without the copyout() call, + * and that the same filesystem overhead would have to be incurred in + * Dir_MTime, it made sense to replace the access() with a stat() and record + * the mtime in a cache for when Dir_UpdateMTime was actually called. */ -Lst dirSearchPath; /* main search path */ -static Lst openDirectories; /* the list of all open directories */ +/* A cache for the filenames in a directory. */ +struct CachedDir { + /* + * Name of directory, either absolute or relative to the current + * directory. The name is not normalized in any way, that is, "." + * and "./." are different. + * + * Not sure what happens when .CURDIR is assigned a new value; see + * Parse_DoVar. + */ + char *name; + + /* + * The number of SearchPaths that refer to this directory. + * Plus the number of global variables that refer to this directory. + * References from openDirs do not count though. + */ + int refCount; + + /* The number of times a file in this directory has been found. */ + int hits; + + /* The names of the directory entries. */ + HashSet files; +}; + +typedef List CachedDirList; +typedef ListNode CachedDirListNode; + +typedef ListNode SearchPathNode; + +/* A list of cached directories, with fast lookup by directory name. */ +typedef struct OpenDirs { + CachedDirList list; + HashTable /* of CachedDirListNode */ table; +} OpenDirs; + +typedef enum CachedStatsFlags { + CST_NONE = 0, + CST_LSTAT = 1 << 0, /* call lstat(2) instead of stat(2) */ + CST_UPDATE = 1 << 1 /* ignore existing cached entry */ +} CachedStatsFlags; + + +SearchPath dirSearchPath = { LST_INIT }; /* main search path */ + +static OpenDirs openDirs; /* all cached directories */ /* - * Variables for gathering statistics on the efficiency of the hashing + * Variables for gathering statistics on the efficiency of the caching * mechanism. */ -static int hits, /* Found in directory cache */ - misses, /* Sad, but not evil misses */ - nearmisses, /* Found under search path */ - bigmisses; /* Sought by itself */ +static int hits; /* Found in directory cache */ +static int misses; /* Sad, but not evil misses */ +static int nearmisses; /* Found under search path */ +static int bigmisses; /* Sought by itself */ -static Path *dot; /* contents of current directory */ -static Path *cur; /* contents of current directory, if not dot */ -static Path *dotLast; /* a fake path entry indicating we need to - * look for . last */ -static Hash_Table mtimes; /* Results of doing a last-resort stat in - * Dir_FindFile -- if we have to go to the - * system to find the file, we might as well - * have its mtime on record. XXX: If this is done - * way early, there's a chance other rules will - * have already updated the file, in which case - * we'll update it again. Generally, there won't - * be two rules to update a single file, so this - * should be ok, but... */ +/* The cached contents of ".", the relative current directory. */ +static CachedDir *dot = NULL; +/* The cached contents of the absolute current directory. */ +static CachedDir *cur = NULL; +/* A fake path entry indicating we need to look for '.' last. */ +static CachedDir *dotLast = NULL; - -static int DirFindName(const void *, const void *); -static int DirMatchFiles(const char *, Path *, Lst); -static void DirExpandCurly(const char *, const char *, Lst, Lst); -static void DirExpandInt(const char *, Lst, Lst); -static int DirPrintWord(void *, void *); -static int DirPrintDir(void *, void *); -static char *DirLookup(Path *, const char *, const char *, Boolean); -static char *DirLookupSubdir(Path *, const char *); -static char *DirFindDot(Boolean, const char *, const char *); -static char *DirLookupAbs(Path *, const char *, const char *); - -/*- - *----------------------------------------------------------------------- - * Dir_Init -- - * initialize things for this module +/* + * Results of doing a last-resort stat in Dir_FindFile -- if we have to go to + * the system to find the file, we might as well have its mtime on record. * - * Results: - * none - * - * Side Effects: - * some directories may be opened. - *----------------------------------------------------------------------- + * XXX: If this is done way early, there's a chance other rules will have + * already updated the file, in which case we'll update it again. Generally, + * there won't be two rules to update a single file, so this should be ok, + * but... */ -void -Dir_Init(const char *cdname) +static HashTable mtimes; + +static HashTable lmtimes; /* same as mtimes but for lstat */ + + +static void OpenDirs_Remove(OpenDirs *, const char *); + + +static CachedDir * +CachedDir_New(const char *name) { - dirSearchPath = Lst_Init(FALSE); - openDirectories = Lst_Init(FALSE); - Hash_InitTable(&mtimes, 0); + CachedDir *dir = bmake_malloc(sizeof *dir); - Dir_InitCur(cdname); + dir->name = bmake_strdup(name); + dir->refCount = 0; + dir->hits = 0; + HashSet_Init(&dir->files); - dotLast = bmake_malloc(sizeof(Path)); - dotLast->refCount = 1; - dotLast->hits = 0; - dotLast->name = bmake_strdup(".DOTLAST"); - Hash_InitTable(&dotLast->files, -1); +#ifdef DEBUG_REFCNT + DEBUG2(DIR, "CachedDir %p new for \"%s\"\n", dir, dir->name); +#endif + + return dir; +} + +static CachedDir * +CachedDir_Ref(CachedDir *dir) +{ + dir->refCount++; + +#ifdef DEBUG_REFCNT + DEBUG3(DIR, "CachedDir %p ++ %d for \"%s\"\n", + dir, dir->refCount, dir->name); +#endif + + return dir; +} + +static void +CachedDir_Unref(CachedDir *dir) +{ + dir->refCount--; + +#ifdef DEBUG_REFCNT + DEBUG3(DIR, "CachedDir %p -- %d for \"%s\"\n", + dir, dir->refCount, dir->name); +#endif + + if (dir->refCount > 0) + return; + +#ifdef DEBUG_REFCNT + DEBUG2(DIR, "CachedDir %p free for \"%s\"\n", dir, dir->name); +#endif + + OpenDirs_Remove(&openDirs, dir->name); + + free(dir->name); + HashSet_Done(&dir->files); + free(dir); +} + +/* Update the value of the CachedDir variable, updating the reference counts. */ +static void +CachedDir_Assign(CachedDir **var, CachedDir *dir) +{ + CachedDir *prev; + + prev = *var; + *var = dir; + if (dir != NULL) + CachedDir_Ref(dir); + if (prev != NULL) + CachedDir_Unref(prev); +} + +static void +OpenDirs_Init(OpenDirs *odirs) +{ + Lst_Init(&odirs->list); + HashTable_Init(&odirs->table); +} + +#ifdef CLEANUP +static void +OpenDirs_Done(OpenDirs *odirs) +{ + CachedDirListNode *ln = odirs->list.first; + DEBUG1(DIR, "OpenDirs_Done: %u entries to remove\n", + odirs->table.numEntries); + while (ln != NULL) { + CachedDirListNode *next = ln->next; + CachedDir *dir = ln->datum; + DEBUG2(DIR, "OpenDirs_Done: refCount %d for \"%s\"\n", + dir->refCount, dir->name); + CachedDir_Unref(dir); /* removes the dir from odirs->list */ + ln = next; + } + Lst_Done(&odirs->list); + HashTable_Done(&odirs->table); +} +#endif + +static CachedDir * +OpenDirs_Find(OpenDirs *odirs, const char *name) +{ + CachedDirListNode *ln = HashTable_FindValue(&odirs->table, name); + return ln != NULL ? ln->datum : NULL; +} + +static void +OpenDirs_Add(OpenDirs *odirs, CachedDir *cdir) +{ + if (HashTable_FindEntry(&odirs->table, cdir->name) != NULL) + return; + Lst_Append(&odirs->list, cdir); + HashTable_Set(&odirs->table, cdir->name, odirs->list.last); +} + +static void +OpenDirs_Remove(OpenDirs *odirs, const char *name) +{ + HashEntry *he = HashTable_FindEntry(&odirs->table, name); + CachedDirListNode *ln; + if (he == NULL) + return; + ln = HashEntry_Get(he); + HashTable_DeleteEntry(&odirs->table, he); + Lst_Remove(&odirs->list, ln); } /* - * Called by Dir_Init() and whenever .CURDIR is assigned to. + * Returns 0 and the result of stat(2) or lstat(2) in *out_cst, + * or -1 on error. + */ +static int +cached_stats(const char *pathname, struct cached_stat *out_cst, + CachedStatsFlags flags) +{ + HashTable *tbl = flags & CST_LSTAT ? &lmtimes : &mtimes; + struct stat sys_st; + struct cached_stat *cst; + int rc; + + if (pathname == NULL || pathname[0] == '\0') + return -1; /* This can happen in meta mode. */ + + cst = HashTable_FindValue(tbl, pathname); + if (cst != NULL && !(flags & CST_UPDATE)) { + *out_cst = *cst; + DEBUG2(DIR, "Using cached time %s for %s\n", + Targ_FmtTime(cst->cst_mtime), pathname); + return 0; + } + + rc = (flags & CST_LSTAT ? lstat : stat)(pathname, &sys_st); + if (rc == -1) + return -1; /* don't cache negative lookups */ + + if (sys_st.st_mtime == 0) + sys_st.st_mtime = 1; /* avoid confusion with missing file */ + + if (cst == NULL) { + cst = bmake_malloc(sizeof *cst); + HashTable_Set(tbl, pathname, cst); + } + + cst->cst_mtime = sys_st.st_mtime; + cst->cst_mode = sys_st.st_mode; + + *out_cst = *cst; + DEBUG2(DIR, " Caching %s for %s\n", + Targ_FmtTime(sys_st.st_mtime), pathname); + + return 0; +} + +int +cached_stat(const char *pathname, struct cached_stat *cst) +{ + return cached_stats(pathname, cst, CST_NONE); +} + +int +cached_lstat(const char *pathname, struct cached_stat *cst) +{ + return cached_stats(pathname, cst, CST_LSTAT); +} + +/* Initialize the directories module. */ +void +Dir_Init(void) +{ + OpenDirs_Init(&openDirs); + HashTable_Init(&mtimes); + HashTable_Init(&lmtimes); + CachedDir_Assign(&dotLast, CachedDir_New(".DOTLAST")); +} + +/* + * Called by Dir_InitDir and whenever .CURDIR is assigned to. */ void -Dir_InitCur(const char *cdname) +Dir_InitCur(const char *newCurdir) { - Path *p; - - if (cdname != NULL) { + CachedDir *dir; + + if (newCurdir == NULL) + return; + /* * Our build directory is not the same as our source directory. * Keep this one around too. */ - if ((p = Dir_AddDir(NULL, cdname))) { - p->refCount += 1; - if (cur && cur != p) { - /* - * We've been here before, cleanup. - */ - cur->refCount -= 1; - Dir_Destroy(cur); - } - cur = p; - } - } + dir = SearchPath_Add(NULL, newCurdir); + if (dir == NULL) + return; + + CachedDir_Assign(&cur, dir); } -/*- - *----------------------------------------------------------------------- - * Dir_InitDot -- - * (re)initialize "dot" (current/object directory) path hash - * - * Results: - * none - * - * Side Effects: - * some directories may be opened. - *----------------------------------------------------------------------- +/* + * (Re)initialize "dot" (current/object directory) path hash. + * Some directories may be cached. */ void Dir_InitDot(void) { - if (dot != NULL) { - LstNode ln; + CachedDir *dir; - /* Remove old entry from openDirectories, but do not destroy. */ - ln = Lst_Member(openDirectories, dot); - (void)Lst_Remove(openDirectories, ln); - } + dir = SearchPath_Add(NULL, "."); + if (dir == NULL) { + Error("Cannot open `.' (%s)", strerror(errno)); + exit(2); /* Not 1 so -q can distinguish error */ + } - dot = Dir_AddDir(NULL, "."); + CachedDir_Assign(&dot, dir); - if (dot == NULL) { - Error("Cannot open `.' (%s)", strerror(errno)); - exit(1); - } - - /* - * We always need to have dot around, so we increment its reference count - * to make sure it's not destroyed. - */ - dot->refCount += 1; - Dir_SetPATH(); /* initialize */ + Dir_SetPATH(); /* initialize */ } -/*- - *----------------------------------------------------------------------- - * Dir_End -- - * cleanup things for this module - * - * Results: - * none - * - * Side Effects: - * none - *----------------------------------------------------------------------- - */ +/* Clean up the directories module. */ void Dir_End(void) { #ifdef CLEANUP - if (cur) { - cur->refCount -= 1; - Dir_Destroy(cur); - } - dot->refCount -= 1; - dotLast->refCount -= 1; - Dir_Destroy(dotLast); - Dir_Destroy(dot); - Dir_ClearPath(dirSearchPath); - Lst_Destroy(dirSearchPath, NULL); - Dir_ClearPath(openDirectories); - Lst_Destroy(openDirectories, NULL); - Hash_DeleteTable(&mtimes); + CachedDir_Assign(&cur, NULL); + CachedDir_Assign(&dot, NULL); + CachedDir_Assign(&dotLast, NULL); + SearchPath_Clear(&dirSearchPath); + OpenDirs_Done(&openDirs); + HashTable_Done(&mtimes); + HashTable_Done(&lmtimes); #endif } @@ -389,578 +546,475 @@ Dir_End(void) void Dir_SetPATH(void) { - LstNode ln; /* a list element */ - Path *p; - Boolean hasLastDot = FALSE; /* true we should search dot last */ + CachedDirListNode *ln; + Boolean seenDotLast = FALSE; /* true if we should search '.' last */ - Var_Delete(".PATH", VAR_GLOBAL); - - if (Lst_Open(dirSearchPath) == SUCCESS) { - if ((ln = Lst_First(dirSearchPath)) != NULL) { - p = (Path *)Lst_Datum(ln); - if (p == dotLast) { - hasLastDot = TRUE; - Var_Append(".PATH", dotLast->name, VAR_GLOBAL); - } + Global_Delete(".PATH"); + + if ((ln = dirSearchPath.dirs.first) != NULL) { + CachedDir *dir = ln->datum; + if (dir == dotLast) { + seenDotLast = TRUE; + Global_Append(".PATH", dotLast->name); + } } - if (!hasLastDot) { - if (dot) - Var_Append(".PATH", dot->name, VAR_GLOBAL); - if (cur) - Var_Append(".PATH", cur->name, VAR_GLOBAL); + if (!seenDotLast) { + if (dot != NULL) + Global_Append(".PATH", dot->name); + if (cur != NULL) + Global_Append(".PATH", cur->name); } - while ((ln = Lst_Next(dirSearchPath)) != NULL) { - p = (Path *)Lst_Datum(ln); - if (p == dotLast) - continue; - if (p == dot && hasLastDot) - continue; - Var_Append(".PATH", p->name, VAR_GLOBAL); + for (ln = dirSearchPath.dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + if (dir == dotLast) + continue; + if (dir == dot && seenDotLast) + continue; + Global_Append(".PATH", dir->name); } - if (hasLastDot) { - if (dot) - Var_Append(".PATH", dot->name, VAR_GLOBAL); - if (cur) - Var_Append(".PATH", cur->name, VAR_GLOBAL); + if (seenDotLast) { + if (dot != NULL) + Global_Append(".PATH", dot->name); + if (cur != NULL) + Global_Append(".PATH", cur->name); } - Lst_Close(dirSearchPath); - } } -/*- - *----------------------------------------------------------------------- - * DirFindName -- - * See if the Path structure describes the same directory as the - * given one by comparing their names. Called from Dir_AddDir via - * Lst_Find when searching the list of open directories. +/* + * See if the given name has any wildcard characters in it and all braces and + * brackets are properly balanced. * - * Input: - * p Current name - * dname Desired name + * XXX: This code is not 100% correct ([^]] fails etc.). I really don't think + * that make(1) should be expanding patterns, because then you have to set a + * mechanism for escaping the expansion! * - * Results: - * 0 if it is the same. Non-zero otherwise - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -static int -DirFindName(const void *p, const void *dname) -{ - return (strcmp(((const Path *)p)->name, dname)); -} - -/*- - *----------------------------------------------------------------------- - * Dir_HasWildcards -- - * see if the given name has any wildcard characters in it - * be careful not to expand unmatching brackets or braces. - * XXX: This code is not 100% correct. ([^]] fails etc.) - * I really don't think that make(1) should be expanding - * patterns, because then you have to set a mechanism for - * escaping the expansion! - * - * Input: - * name name to check - * - * Results: - * returns TRUE if the word should be expanded, FALSE otherwise - * - * Side Effects: - * none - *----------------------------------------------------------------------- + * Return TRUE if the word should be expanded, FALSE otherwise. */ Boolean -Dir_HasWildcards(char *name) +Dir_HasWildcards(const char *name) { - char *cp; - int wild = 0, brace = 0, bracket = 0; + const char *p; + Boolean wild = FALSE; + int braces = 0, brackets = 0; - for (cp = name; *cp; cp++) { - switch(*cp) { - case '{': - brace++; - wild = 1; - break; - case '}': - brace--; - break; - case '[': - bracket++; - wild = 1; - break; - case ']': - bracket--; - break; - case '?': - case '*': - wild = 1; - break; - default: - break; + for (p = name; *p != '\0'; p++) { + switch (*p) { + case '{': + braces++; + wild = TRUE; + break; + case '}': + braces--; + break; + case '[': + brackets++; + wild = TRUE; + break; + case ']': + brackets--; + break; + case '?': + case '*': + wild = TRUE; + break; + default: + break; + } } - } - return wild && bracket == 0 && brace == 0; + return wild && brackets == 0 && braces == 0; } -/*- - *----------------------------------------------------------------------- - * DirMatchFiles -- - * Given a pattern and a Path structure, see if any files - * match the pattern and add their names to the 'expansions' list if - * any do. This is incomplete -- it doesn't take care of patterns like - * src / *src / *.c properly (just *.c on any of the directories), but it - * will do for now. +/* + * See if any files match the pattern and add their names to the 'expansions' + * list if they do. + * + * This is incomplete -- wildcards are only expanded in the final path + * component, but not in directories like src/lib*c/file*.c, but it + * will do for now (now being 1993 until at least 2020). To expand these, + * delegate the work to the shell, using the '!=' variable assignment + * operator, the ':sh' variable modifier or the ':!...!' variable modifier, + * such as in ${:!echo src/lib*c/file*.c!}. * * Input: * pattern Pattern to look for - * p Directory to search + * dir Directory to search * expansion Place to store the results - * - * Results: - * Always returns 0 - * - * Side Effects: - * File names are added to the expansions lst. The directory will be - * fully hashed when this is done. - *----------------------------------------------------------------------- */ -static int -DirMatchFiles(const char *pattern, Path *p, Lst expansions) +static void +DirMatchFiles(const char *pattern, CachedDir *dir, StringList *expansions) { - Hash_Search search; /* Index into the directory's table */ - Hash_Entry *entry; /* Current entry in the table */ - Boolean isDot; /* TRUE if the directory being searched is . */ + const char *dirName = dir->name; + Boolean isDot = dirName[0] == '.' && dirName[1] == '\0'; + HashIter hi; - isDot = (*p->name == '.' && p->name[1] == '\0'); - - for (entry = Hash_EnumFirst(&p->files, &search); - entry != NULL; - entry = Hash_EnumNext(&search)) - { /* - * See if the file matches the given pattern. Note we follow the UNIX - * convention that dot files will only be found if the pattern - * begins with a dot (note also that as a side effect of the hashing - * scheme, .* won't match . or .. since they aren't hashed). + * XXX: Iterating over all hash entries is inefficient. If the + * pattern is a plain string without any wildcards, a direct lookup + * is faster. */ - if (Str_Match(entry->name, pattern) && - ((entry->name[0] != '.') || - (pattern[0] == '.'))) - { - (void)Lst_AtEnd(expansions, - (isDot ? bmake_strdup(entry->name) : - str_concat(p->name, entry->name, - STR_ADDSLASH))); + + HashIter_InitSet(&hi, &dir->files); + while (HashIter_Next(&hi) != NULL) { + const char *base = hi.entry->key; + + if (!Str_Match(base, pattern)) + continue; + + /* + * Follow the UNIX convention that dot files are only found + * if the pattern begins with a dot. The pattern '.*' does + * not match '.' or '..' since these are not included in the + * directory cache. + * + * This means that the pattern '[a-z.]*' does not find + * '.file', which is consistent with NetBSD sh, NetBSD ksh, + * bash, dash, csh and probably many other shells as well. + */ + if (base[0] == '.' && pattern[0] != '.') + continue; + + { + char *fullName = isDot + ? bmake_strdup(base) + : str_concat3(dirName, "/", base); + Lst_Append(expansions, fullName); + } } - } - return (0); } -/*- - *----------------------------------------------------------------------- - * DirExpandCurly -- - * Expand curly braces like the C shell. Does this recursively. - * Note the special case: if after the piece of the curly brace is - * done there are no wildcard characters in the result, the result is - * placed on the list WITHOUT CHECKING FOR ITS EXISTENCE. +/* + * Find the next closing brace in the string, taking nested braces into + * account. + */ +static const char * +closing_brace(const char *p) +{ + int nest = 0; + while (*p != '\0') { + if (*p == '}' && nest == 0) + break; + if (*p == '{') + nest++; + if (*p == '}') + nest--; + p++; + } + return p; +} + +/* + * Find the next closing brace or comma in the string, taking nested braces + * into account. + */ +static const char * +separator_comma(const char *p) +{ + int nest = 0; + while (*p != '\0') { + if ((*p == '}' || *p == ',') && nest == 0) + break; + if (*p == '{') + nest++; + if (*p == '}') + nest--; + p++; + } + return p; +} + +static Boolean +contains_wildcard(const char *p) +{ + for (; *p != '\0'; p++) { + switch (*p) { + case '*': + case '?': + case '{': + case '[': + return TRUE; + } + } + return FALSE; +} + +static char * +concat3(const char *a, size_t a_len, const char *b, size_t b_len, + const char *c, size_t c_len) +{ + size_t s_len = a_len + b_len + c_len; + char *s = bmake_malloc(s_len + 1); + memcpy(s, a, a_len); + memcpy(s + a_len, b, b_len); + memcpy(s + a_len + b_len, c, c_len); + s[s_len] = '\0'; + return s; +} + +/* + * Expand curly braces like the C shell. Brace expansion by itself is purely + * textual, the expansions are not looked up in the file system. But if an + * expanded word contains wildcard characters, it is expanded further, + * matching only the actually existing files. + * + * Example: "{a{b,c}}" expands to "ab" and "ac". + * Example: "{a}" expands to "a". + * Example: "{a,*.c}" expands to "a" and all "*.c" files that exist. * * Input: * word Entire word to expand * brace First curly brace in it * path Search path to use * expansions Place to store the expansions - * - * Results: - * None. - * - * Side Effects: - * The given list is filled with the expansions... - * - *----------------------------------------------------------------------- */ static void -DirExpandCurly(const char *word, const char *brace, Lst path, Lst expansions) +DirExpandCurly(const char *word, const char *brace, SearchPath *path, + StringList *expansions) { - const char *end; /* Character after the closing brace */ - const char *cp; /* Current position in brace clause */ - const char *start; /* Start of current piece of brace clause */ - int bracelevel; /* Number of braces we've seen. If we see a - * right brace when this is 0, we've hit the - * end of the clause. */ - char *file; /* Current expansion */ - int otherLen; /* The length of the other pieces of the - * expansion (chars before and after the - * clause in 'word') */ - char *cp2; /* Pointer for checking for wildcards in - * expansion before calling Dir_Expand */ + const char *prefix, *middle, *piece, *middle_end, *suffix; + size_t prefix_len, suffix_len; - start = brace+1; + /* Split the word into prefix '{' middle '}' suffix. */ - /* - * Find the end of the brace clause first, being wary of nested brace - * clauses. - */ - for (end = start, bracelevel = 0; *end != '\0'; end++) { - if (*end == '{') { - bracelevel++; - } else if ((*end == '}') && (bracelevel-- == 0)) { - break; + middle = brace + 1; + middle_end = closing_brace(middle); + if (*middle_end == '\0') { + Error("Unterminated {} clause \"%s\"", middle); + return; } - } - if (*end == '\0') { - Error("Unterminated {} clause \"%s\"", start); - return; - } else { - end++; - } - otherLen = brace - word + strlen(end); - for (cp = start; cp < end; cp++) { - /* - * Find the end of this piece of the clause. - */ - bracelevel = 0; - while (*cp != ',') { - if (*cp == '{') { - bracelevel++; - } else if ((*cp == '}') && (bracelevel-- <= 0)) { - break; - } - cp++; - } - /* - * Allocate room for the combination and install the three pieces. - */ - file = bmake_malloc(otherLen + cp - start + 1); - if (brace != word) { - strncpy(file, word, brace-word); - } - if (cp != start) { - strncpy(&file[brace-word], start, cp-start); - } - strcpy(&file[(brace-word)+(cp-start)], end); + prefix = word; + prefix_len = (size_t)(brace - prefix); + suffix = middle_end + 1; + suffix_len = strlen(suffix); - /* - * See if the result has any wildcards in it. If we find one, call - * Dir_Expand right away, telling it to place the result on our list - * of expansions. - */ - for (cp2 = file; *cp2 != '\0'; cp2++) { - switch(*cp2) { - case '*': - case '?': - case '{': - case '[': - Dir_Expand(file, path, expansions); - goto next; - } + /* Split the middle into pieces, separated by commas. */ + + piece = middle; + while (piece < middle_end + 1) { + const char *piece_end = separator_comma(piece); + size_t piece_len = (size_t)(piece_end - piece); + + char *file = concat3(prefix, prefix_len, piece, piece_len, + suffix, suffix_len); + + if (contains_wildcard(file)) { + SearchPath_Expand(path, file, expansions); + free(file); + } else { + Lst_Append(expansions, file); + } + + /* skip over the comma or closing brace */ + piece = piece_end + 1; } - if (*cp2 == '\0') { - /* - * Hit the end w/o finding any wildcards, so stick the expansion - * on the end of the list. - */ - (void)Lst_AtEnd(expansions, file); - } else { - next: - free(file); - } - start = cp+1; - } } -/*- - *----------------------------------------------------------------------- - * DirExpandInt -- - * Internal expand routine. Passes through the directories in the - * path one by one, calling DirMatchFiles for each. NOTE: This still - * doesn't handle patterns in directories... - * - * Input: - * word Word to expand - * path Path on which to look - * expansions Place to store the result - * - * Results: - * None. - * - * Side Effects: - * Things are added to the expansions list. - * - *----------------------------------------------------------------------- +/* Expand the word in each of the directories from the path. */ +static void +DirExpandPath(const char *word, SearchPath *path, StringList *expansions) +{ + SearchPathNode *ln; + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + DirMatchFiles(word, dir, expansions); + } +} + +static void +PrintExpansions(StringList *expansions) +{ + const char *sep = ""; + StringListNode *ln; + for (ln = expansions->first; ln != NULL; ln = ln->next) { + const char *word = ln->datum; + debug_printf("%s%s", sep, word); + sep = " "; + } + debug_printf("\n"); +} + +/* + * The wildcard isn't in the first component. + * Find all the components up to the one with the wildcard. */ static void -DirExpandInt(const char *word, Lst path, Lst expansions) +SearchPath_ExpandMiddle(SearchPath *path, const char *pattern, + const char *wildcardComponent, StringList *expansions) { - LstNode ln; /* Current node */ - Path *p; /* Directory in the node */ + char *prefix, *dirpath, *end; + SearchPath *partPath; - if (Lst_Open(path) == SUCCESS) { - while ((ln = Lst_Next(path)) != NULL) { - p = (Path *)Lst_Datum(ln); - DirMatchFiles(word, p, expansions); - } - Lst_Close(path); - } + prefix = bmake_strsedup(pattern, wildcardComponent + 1); + /* + * XXX: Check the "the directory is added to the path" part. + * It is probably surprising that the directory before a + * wildcard gets added to the path. + */ + /* + * XXX: Only the first match of the prefix in the path is + * taken, any others are ignored. The expectation may be + * that the pattern is expanded in the whole path. + */ + dirpath = Dir_FindFile(prefix, path); + free(prefix); + + /* + * dirpath is null if can't find the leading component + * + * XXX: Dir_FindFile won't find internal components. i.e. if the + * path contains ../Etc/Object and we're looking for Etc, it won't + * be found. Ah well. Probably not important. + * + * XXX: Check whether the above comment is still true. + */ + if (dirpath == NULL) + return; + + end = &dirpath[strlen(dirpath) - 1]; + /* XXX: What about multiple trailing slashes? */ + if (*end == '/') + *end = '\0'; + + partPath = SearchPath_New(); + (void)SearchPath_Add(partPath, dirpath); + DirExpandPath(wildcardComponent + 1, partPath, expansions); + SearchPath_Free(partPath); } -/*- - *----------------------------------------------------------------------- - * DirPrintWord -- - * Print a word in the list of expansions. Callback for Dir_Expand - * when DEBUG(DIR), via Lst_ForEach. - * - * Results: - * === 0 - * - * Side Effects: - * The passed word is printed, followed by a space. - * - *----------------------------------------------------------------------- - */ -static int -DirPrintWord(void *word, void *dummy) -{ - fprintf(debug_file, "%s ", (char *)word); - - return(dummy ? 0 : 0); -} - -/*- - *----------------------------------------------------------------------- - * Dir_Expand -- - * Expand the given word into a list of words by globbing it looking - * in the directories on the given search path. +/* + * Expand the given pattern into a list of existing filenames by globbing it, + * looking in each directory from the search path. * * Input: - * word the word to expand - * path the list of directories in which to find the - * resulting files + * path the directories in which to find the files + * pattern the pattern to expand * expansions the list on which to place the results - * - * Results: - * A list of words consisting of the files which exist along the search - * path matching the given pattern. - * - * Side Effects: - * Directories may be opened. Who knows? - *----------------------------------------------------------------------- */ void -Dir_Expand(const char *word, Lst path, Lst expansions) +SearchPath_Expand(SearchPath *path, const char *pattern, StringList *expansions) { - const char *cp; + const char *brace, *slash, *wildcard, *wildcardComponent; - if (DEBUG(DIR)) { - fprintf(debug_file, "Expanding \"%s\"... ", word); - } + assert(path != NULL); + assert(expansions != NULL); - cp = strchr(word, '{'); - if (cp) { - DirExpandCurly(word, cp, path, expansions); - } else { - cp = strchr(word, '/'); - if (cp) { - /* - * The thing has a directory component -- find the first wildcard - * in the string. - */ - for (cp = word; *cp; cp++) { - if (*cp == '?' || *cp == '[' || *cp == '*' || *cp == '{') { - break; - } - } - if (*cp == '{') { - /* - * This one will be fun. - */ - DirExpandCurly(word, cp, path, expansions); - return; - } else if (*cp != '\0') { - /* - * Back up to the start of the component - */ - char *dirpath; + DEBUG1(DIR, "Expanding \"%s\"... ", pattern); - while (cp > word && *cp != '/') { - cp--; - } - if (cp != word) { - char sc; - /* - * If the glob isn't in the first component, try and find - * all the components up to the one with a wildcard. - */ - sc = cp[1]; - ((char *)UNCONST(cp))[1] = '\0'; - dirpath = Dir_FindFile(word, path); - ((char *)UNCONST(cp))[1] = sc; - /* - * dirpath is null if can't find the leading component - * XXX: Dir_FindFile won't find internal components. - * i.e. if the path contains ../Etc/Object and we're - * looking for Etc, it won't be found. Ah well. - * Probably not important. - */ - if (dirpath != NULL) { - char *dp = &dirpath[strlen(dirpath) - 1]; - if (*dp == '/') - *dp = '\0'; - path = Lst_Init(FALSE); - (void)Dir_AddDir(path, dirpath); - DirExpandInt(cp+1, path, expansions); - Lst_Destroy(path, NULL); - } - } else { - /* - * Start the search from the local directory - */ - DirExpandInt(word, path, expansions); - } - } else { + brace = strchr(pattern, '{'); + if (brace != NULL) { + DirExpandCurly(pattern, brace, path, expansions); + goto done; + } + + /* At this point, the pattern does not contain '{'. */ + + slash = strchr(pattern, '/'); + if (slash == NULL) { + /* The pattern has no directory component. */ + + /* First the files in dot. */ + DirMatchFiles(pattern, dot, expansions); + /* Then the files in every other directory on the path. */ + DirExpandPath(pattern, path, expansions); + goto done; + } + + /* At this point, the pattern has a directory component. */ + + /* Find the first wildcard in the pattern. */ + for (wildcard = pattern; *wildcard != '\0'; wildcard++) + if (*wildcard == '?' || *wildcard == '[' || *wildcard == '*') + break; + + if (*wildcard == '\0') { /* - * Return the file -- this should never happen. + * No directory component and no wildcard at all -- this + * should never happen as in such a simple case there is no + * need to expand anything. */ - DirExpandInt(word, path, expansions); - } + DirExpandPath(pattern, path, expansions); + goto done; + } + + /* Back up to the start of the component containing the wildcard. */ + /* XXX: This handles '///' and '/' differently. */ + wildcardComponent = wildcard; + while (wildcardComponent > pattern && *wildcardComponent != '/') + wildcardComponent--; + + if (wildcardComponent == pattern) { + /* The first component contains the wildcard. */ + /* Start the search from the local directory */ + DirExpandPath(pattern, path, expansions); } else { - /* - * First the files in dot - */ - DirMatchFiles(word, dot, expansions); - - /* - * Then the files in every other directory on the path. - */ - DirExpandInt(word, path, expansions); + SearchPath_ExpandMiddle(path, pattern, wildcardComponent, + expansions); } - } - if (DEBUG(DIR)) { - Lst_ForEach(expansions, DirPrintWord, NULL); - fprintf(debug_file, "\n"); - } + +done: + if (DEBUG(DIR)) + PrintExpansions(expansions); } -/*- - *----------------------------------------------------------------------- - * DirLookup -- - * Find if the file with the given name exists in the given path. - * - * Results: - * The path to the file or NULL. This path is guaranteed to be in a - * different part of memory than name and so may be safely free'd. - * - * Side Effects: - * None. - *----------------------------------------------------------------------- +/* + * Find if the file with the given name exists in the given path. + * Return the freshly allocated path to the file, or NULL. */ static char * -DirLookup(Path *p, const char *name MAKE_ATTR_UNUSED, const char *cp, - Boolean hasSlash MAKE_ATTR_UNUSED) +DirLookup(CachedDir *dir, const char *base) { - char *file; /* the current filename to check */ + char *file; /* the current filename to check */ - if (DEBUG(DIR)) { - fprintf(debug_file, " %s ...\n", p->name); - } + DEBUG1(DIR, " %s ...\n", dir->name); - if (Hash_FindEntry(&p->files, cp) == NULL) + if (!HashSet_Contains(&dir->files, base)) + return NULL; + + file = str_concat3(dir->name, "/", base); + DEBUG1(DIR, " returning %s\n", file); + dir->hits++; + hits++; + return file; +} + + +/* + * Find if the file with the given name exists in the given directory. + * Return the freshly allocated path to the file, or NULL. + */ +static char * +DirLookupSubdir(CachedDir *dir, const char *name) +{ + struct cached_stat cst; + char *file = dir == dot ? bmake_strdup(name) + : str_concat3(dir->name, "/", name); + + DEBUG1(DIR, "checking %s ...\n", file); + + if (cached_stat(file, &cst) == 0) { + nearmisses++; + return file; + } + free(file); return NULL; - - file = str_concat(p->name, cp, STR_ADDSLASH); - if (DEBUG(DIR)) { - fprintf(debug_file, " returning %s\n", file); - } - p->hits += 1; - hits += 1; - return file; } - -/*- - *----------------------------------------------------------------------- - * DirLookupSubdir -- - * Find if the file with the given name exists in the given path. - * - * Results: - * The path to the file or NULL. This path is guaranteed to be in a - * different part of memory than name and so may be safely free'd. - * - * Side Effects: - * If the file is found, it is added in the modification times hash - * table. - *----------------------------------------------------------------------- +/* + * Find if the file with the given name exists in the given path. + * Return the freshly allocated path to the file, the empty string, or NULL. + * Returning the empty string means that the search should be terminated. */ static char * -DirLookupSubdir(Path *p, const char *name) +DirLookupAbs(CachedDir *dir, const char *name, const char *cp) { - struct stat stb; /* Buffer for stat, if necessary */ - Hash_Entry *entry; /* Entry for mtimes table */ - char *file; /* the current filename to check */ + const char *dnp; /* pointer into dir->name */ + const char *np; /* pointer into name */ - if (p != dot) { - file = str_concat(p->name, name, STR_ADDSLASH); - } else { - /* - * Checking in dot -- DON'T put a leading ./ on the thing. - */ - file = bmake_strdup(name); - } - - if (DEBUG(DIR)) { - fprintf(debug_file, "checking %s ...\n", file); - } - - if (stat(file, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; - /* - * Save the modification time so if it's needed, we don't have - * to fetch it again. - */ - if (DEBUG(DIR)) { - fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), - file); - } - entry = Hash_CreateEntry(&mtimes, file, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); - nearmisses += 1; - return (file); - } - free(file); - return NULL; -} - -/*- - *----------------------------------------------------------------------- - * DirLookupAbs -- - * Find if the file with the given name exists in the given path. - * - * Results: - * The path to the file, the empty string or NULL. If the file is - * the empty string, the search should be terminated. - * This path is guaranteed to be in a different part of memory - * than name and so may be safely free'd. - * - * Side Effects: - * None. - *----------------------------------------------------------------------- - */ -static char * -DirLookupAbs(Path *p, const char *name, const char *cp) -{ - char *p1; /* pointer into p->name */ - const char *p2; /* pointer into name */ - - if (DEBUG(DIR)) { - fprintf(debug_file, " %s ...\n", p->name); - } + DEBUG1(DIR, " %s ...\n", dir->name); /* * If the file has a leading path component and that component @@ -968,838 +1022,709 @@ DirLookupAbs(Path *p, const char *name, const char *cp) * directory, we can attempt another cache lookup. And if we don't * have a hit, we can safely assume the file does not exist at all. */ - for (p1 = p->name, p2 = name; *p1 && *p1 == *p2; p1++, p2++) { + for (dnp = dir->name, np = name; + *dnp != '\0' && *dnp == *np; dnp++, np++) continue; - } - if (*p1 != '\0' || p2 != cp - 1) { + if (*dnp != '\0' || np != cp - 1) return NULL; + + if (!HashSet_Contains(&dir->files, cp)) { + DEBUG0(DIR, " must be here but isn't -- returning\n"); + return bmake_strdup(""); /* to terminate the search */ } - if (Hash_FindEntry(&p->files, cp) == NULL) { - if (DEBUG(DIR)) { - fprintf(debug_file, " must be here but isn't -- returning\n"); - } - /* Return empty string: terminates search */ - return bmake_strdup(""); - } - - p->hits += 1; - hits += 1; - if (DEBUG(DIR)) { - fprintf(debug_file, " returning %s\n", name); - } - return (bmake_strdup(name)); + dir->hits++; + hits++; + DEBUG1(DIR, " returning %s\n", name); + return bmake_strdup(name); } -/*- - *----------------------------------------------------------------------- - * DirFindDot -- - * Find the file given on "." or curdir - * - * Results: - * The path to the file or NULL. This path is guaranteed to be in a - * different part of memory than name and so may be safely free'd. - * - * Side Effects: - * Hit counts change - *----------------------------------------------------------------------- +/* + * Find the file given on "." or curdir. + * Return the freshly allocated path to the file, or NULL. */ static char * -DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const char *name, const char *cp) +DirFindDot(const char *name, const char *base) { - if (Hash_FindEntry(&dot->files, cp) != NULL) { - if (DEBUG(DIR)) { - fprintf(debug_file, " in '.'\n"); - } - hits += 1; - dot->hits += 1; - return (bmake_strdup(name)); + if (HashSet_Contains(&dot->files, base)) { + DEBUG0(DIR, " in '.'\n"); + hits++; + dot->hits++; + return bmake_strdup(name); } - if (cur && - Hash_FindEntry(&cur->files, cp) != NULL) { - if (DEBUG(DIR)) { - fprintf(debug_file, " in ${.CURDIR} = %s\n", cur->name); - } - hits += 1; - cur->hits += 1; - return str_concat(cur->name, cp, STR_ADDSLASH); + + if (cur != NULL && HashSet_Contains(&cur->files, base)) { + DEBUG1(DIR, " in ${.CURDIR} = %s\n", cur->name); + hits++; + cur->hits++; + return str_concat3(cur->name, "/", base); } return NULL; } -/*- - *----------------------------------------------------------------------- - * Dir_FindFile -- - * Find the file with the given name along the given search path. - * - * Input: - * name the file to find - * path the Lst of directories to search - * - * Results: - * The path to the file or NULL. This path is guaranteed to be in a - * different part of memory than name and so may be safely free'd. - * - * Side Effects: - * If the file is found in a directory which is not on the path - * already (either 'name' is absolute or it is a relative path - * [ dir1/.../dirn/file ] which exists below one of the directories - * already on the search path), its directory is added to the end - * of the path on the assumption that there will be more files in - * that directory later on. Sometimes this is true. Sometimes not. - *----------------------------------------------------------------------- - */ -char * -Dir_FindFile(const char *name, Lst path) +static Boolean +FindFileRelative(SearchPath *path, Boolean seenDotLast, + const char *name, char **out_file) { - LstNode ln; /* a list element */ - char *file; /* the current filename to check */ - Path *p; /* current path member */ - const char *cp; /* Terminal name of file */ - Boolean hasLastDot = FALSE; /* true we should search dot last */ - Boolean hasSlash; /* true if 'name' contains a / */ - struct stat stb; /* Buffer for stat, if necessary */ - Hash_Entry *entry; /* Entry for mtimes table */ - const char *trailing_dot = "."; + SearchPathNode *ln; + Boolean checkedDot = FALSE; + char *file; - /* - * Find the final component of the name and note whether it has a - * slash in it (the name, I mean) - */ - cp = strrchr(name, '/'); - if (cp) { - hasSlash = TRUE; - cp += 1; - } else { - hasSlash = FALSE; - cp = name; - } + DEBUG0(DIR, " Trying subdirectories...\n"); - if (DEBUG(DIR)) { - fprintf(debug_file, "Searching for %s ...", name); - } - - if (Lst_Open(path) == FAILURE) { - if (DEBUG(DIR)) { - fprintf(debug_file, "couldn't open path, file not found\n"); - } - misses += 1; - return NULL; - } - - if ((ln = Lst_First(path)) != NULL) { - p = (Path *)Lst_Datum(ln); - if (p == dotLast) { - hasLastDot = TRUE; - if (DEBUG(DIR)) - fprintf(debug_file, "[dot last]..."); - } - } - if (DEBUG(DIR)) { - fprintf(debug_file, "\n"); - } - - /* - * If there's no leading directory components or if the leading - * directory component is exactly `./', consult the cached contents - * of each of the directories on the search path. - */ - if (!hasSlash || (cp - name == 2 && *name == '.')) { - /* - * We look through all the directories on the path seeking one which - * contains the final component of the given name. If such a beast - * is found, we concatenate the directory name and the final - * component and return the resulting string. If we don't find any - * such thing, we go on to phase two... - * - * No matter what, we always look for the file in the current - * directory before anywhere else (unless we found the magic - * DOTLAST path, in which case we search it last) and we *do not* - * add the ./ to it if it exists. - * This is so there are no conflicts between what the user - * specifies (fish.c) and what pmake finds (./fish.c). - */ - if (!hasLastDot && - (file = DirFindDot(hasSlash, name, cp)) != NULL) { - Lst_Close(path); - return file; - } - - while ((ln = Lst_Next(path)) != NULL) { - p = (Path *)Lst_Datum(ln); - if (p == dotLast) - continue; - if ((file = DirLookup(p, name, cp, hasSlash)) != NULL) { - Lst_Close(path); - return file; - } - } - - if (hasLastDot && - (file = DirFindDot(hasSlash, name, cp)) != NULL) { - Lst_Close(path); - return file; - } - } - Lst_Close(path); - - /* - * We didn't find the file on any directory in the search path. - * If the name doesn't contain a slash, that means it doesn't exist. - * If it *does* contain a slash, however, there is still hope: it - * could be in a subdirectory of one of the members of the search - * path. (eg. /usr/include and sys/types.h. The above search would - * fail to turn up types.h in /usr/include, but it *is* in - * /usr/include/sys/types.h). - * [ This no longer applies: If we find such a beast, we assume there - * will be more (what else can we assume?) and add all but the last - * component of the resulting name onto the search path (at the - * end).] - * This phase is only performed if the file is *not* absolute. - */ - if (!hasSlash) { - if (DEBUG(DIR)) { - fprintf(debug_file, " failed.\n"); - } - misses += 1; - return NULL; - } - - if (*cp == '\0') { - /* we were given a trailing "/" */ - cp = trailing_dot; - } - - if (name[0] != '/') { - Boolean checkedDot = FALSE; - - if (DEBUG(DIR)) { - fprintf(debug_file, " Trying subdirectories...\n"); - } - - if (!hasLastDot) { - if (dot) { + if (!seenDotLast) { + if (dot != NULL) { checkedDot = TRUE; if ((file = DirLookupSubdir(dot, name)) != NULL) - return file; + goto found; } - if (cur && (file = DirLookupSubdir(cur, name)) != NULL) - return file; + if (cur != NULL && + (file = DirLookupSubdir(cur, name)) != NULL) + goto found; } - (void)Lst_Open(path); - while ((ln = Lst_Next(path)) != NULL) { - p = (Path *)Lst_Datum(ln); - if (p == dotLast) - continue; - if (p == dot) { - if (checkedDot) - continue; - checkedDot = TRUE; - } - if ((file = DirLookupSubdir(p, name)) != NULL) { - Lst_Close(path); - return file; - } + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + if (dir == dotLast) + continue; + if (dir == dot) { + if (checkedDot) + continue; + checkedDot = TRUE; + } + if ((file = DirLookupSubdir(dir, name)) != NULL) + goto found; } - Lst_Close(path); - if (hasLastDot) { - if (dot && !checkedDot) { + if (seenDotLast) { + if (dot != NULL && !checkedDot) { checkedDot = TRUE; if ((file = DirLookupSubdir(dot, name)) != NULL) - return file; + goto found; } - if (cur && (file = DirLookupSubdir(cur, name)) != NULL) - return file; + if (cur != NULL && + (file = DirLookupSubdir(cur, name)) != NULL) + goto found; } if (checkedDot) { - /* - * Already checked by the given name, since . was in the path, - * so no point in proceeding... - */ - if (DEBUG(DIR)) { - fprintf(debug_file, " Checked . already, returning NULL\n"); - } - return NULL; + /* + * Already checked by the given name, since . was in + * the path, so no point in proceeding. + */ + DEBUG0(DIR, " Checked . already, returning NULL\n"); + file = NULL; + goto found; } - } else { /* name[0] == '/' */ + return FALSE; + +found: + *out_file = file; + return TRUE; +} + +static Boolean +FindFileAbsolute(SearchPath *path, Boolean const seenDotLast, + const char *const name, const char *const base, + char **out_file) +{ + char *file; + SearchPathNode *ln; /* - * For absolute names, compare directory path prefix against the - * the directory path of each member on the search path for an exact - * match. If we have an exact match on any member of the search path, - * use the cached contents of that member to lookup the final file - * component. If that lookup fails we can safely assume that the - * file does not exist at all. This is signified by DirLookupAbs() - * returning an empty string. + * For absolute names, compare directory path prefix against + * the the directory path of each member on the search path + * for an exact match. If we have an exact match on any member + * of the search path, use the cached contents of that member + * to lookup the final file component. If that lookup fails we + * can safely assume that the file does not exist at all. + * This is signified by DirLookupAbs() returning an empty + * string. */ - if (DEBUG(DIR)) { - fprintf(debug_file, " Trying exact path matches...\n"); + DEBUG0(DIR, " Trying exact path matches...\n"); + + if (!seenDotLast && cur != NULL && + ((file = DirLookupAbs(cur, name, base)) != NULL)) + goto found; + + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + if (dir == dotLast) + continue; + if ((file = DirLookupAbs(dir, name, base)) != NULL) + goto found; } - if (!hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL) - return *file?file:NULL; + if (seenDotLast && cur != NULL && + ((file = DirLookupAbs(cur, name, base)) != NULL)) + goto found; - (void)Lst_Open(path); - while ((ln = Lst_Next(path)) != NULL) { - p = (Path *)Lst_Datum(ln); - if (p == dotLast) - continue; - if ((file = DirLookupAbs(p, name, cp)) != NULL) { - Lst_Close(path); - return *file?file:NULL; - } + return FALSE; + +found: + if (file[0] == '\0') { + free(file); + file = NULL; } - Lst_Close(path); + *out_file = file; + return TRUE; +} - if (hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL) - return *file?file:NULL; - } +/* + * Find the file with the given name along the given search path. + * + * If the file is found in a directory that is not on the path + * already (either 'name' is absolute or it is a relative path + * [ dir1/.../dirn/file ] which exists below one of the directories + * already on the search path), its directory is added to the end + * of the path, on the assumption that there will be more files in + * that directory later on. Sometimes this is true. Sometimes not. + * + * Input: + * name the file to find + * path the directories to search, or NULL + * + * Results: + * The freshly allocated path to the file, or NULL. + */ +char * +Dir_FindFile(const char *name, SearchPath *path) +{ + char *file; /* the current filename to check */ + Boolean seenDotLast = FALSE; /* true if we should search dot last */ + struct cached_stat cst; /* Buffer for stat, if necessary */ + const char *trailing_dot = "."; + const char *base = str_basename(name); - /* - * Didn't find it that way, either. Sigh. Phase 3. Add its directory - * onto the search path in any case, just in case, then look for the - * thing in the hash table. If we find it, grand. We return a new - * copy of the name. Otherwise we sadly return a NULL pointer. Sigh. - * Note that if the directory holding the file doesn't exist, this will - * do an extra search of the final directory on the path. Unless something - * weird happens, this search won't succeed and life will be groovy. - * - * Sigh. We cannot add the directory onto the search path because - * of this amusing case: - * $(INSTALLDIR)/$(FILE): $(FILE) - * - * $(FILE) exists in $(INSTALLDIR) but not in the current one. - * When searching for $(FILE), we will find it in $(INSTALLDIR) - * b/c we added it here. This is not good... - */ -#ifdef notdef - if (cp == traling_dot) { - cp = strrchr(name, '/'); - cp += 1; - } - cp[-1] = '\0'; - (void)Dir_AddDir(path, name); - cp[-1] = '/'; + DEBUG1(DIR, "Searching for %s ...", name); - bigmisses += 1; - ln = Lst_Last(path); - if (ln == NULL) { + if (path == NULL) { + DEBUG0(DIR, "couldn't open path, file not found\n"); + misses++; + return NULL; + } + + if (path->dirs.first != NULL) { + CachedDir *dir = path->dirs.first->datum; + if (dir == dotLast) { + seenDotLast = TRUE; + DEBUG0(DIR, "[dot last]..."); + } + } + DEBUG0(DIR, "\n"); + + /* + * If there's no leading directory components or if the leading + * directory component is exactly `./', consult the cached contents + * of each of the directories on the search path. + */ + if (base == name || (base - name == 2 && *name == '.')) { + SearchPathNode *ln; + + /* + * We look through all the directories on the path seeking one + * which contains the final component of the given name. If + * such a file is found, we concatenate the directory name + * and the final component and return the resulting string. + * If we don't find any such thing, we go on to phase two. + * + * No matter what, we always look for the file in the current + * directory before anywhere else (unless we found the magic + * DOTLAST path, in which case we search it last) and we *do + * not* add the ./ to it if it exists. + * This is so there are no conflicts between what the user + * specifies (fish.c) and what pmake finds (./fish.c). + */ + if (!seenDotLast && (file = DirFindDot(name, base)) != NULL) + return file; + + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + if (dir == dotLast) + continue; + if ((file = DirLookup(dir, base)) != NULL) + return file; + } + + if (seenDotLast && (file = DirFindDot(name, base)) != NULL) + return file; + } + + /* + * We didn't find the file on any directory in the search path. + * If the name doesn't contain a slash, that means it doesn't exist. + * If it *does* contain a slash, however, there is still hope: it + * could be in a subdirectory of one of the members of the search + * path. (eg. /usr/include and sys/types.h. The above search would + * fail to turn up types.h in /usr/include, but it *is* in + * /usr/include/sys/types.h). + * [ This no longer applies: If we find such a file, we assume there + * will be more (what else can we assume?) and add all but the last + * component of the resulting name onto the search path (at the + * end).] + * This phase is only performed if the file is *not* absolute. + */ + if (base == name) { + DEBUG0(DIR, " failed.\n"); + misses++; + return NULL; + } + + if (*base == '\0') { + /* we were given a trailing "/" */ + base = trailing_dot; + } + + if (name[0] != '/') { + if (FindFileRelative(path, seenDotLast, name, &file)) + return file; + } else { + if (FindFileAbsolute(path, seenDotLast, name, base, &file)) + return file; + } + + /* + * Didn't find it that way, either. Sigh. Phase 3. Add its directory + * onto the search path in any case, just in case, then look for the + * thing in the hash table. If we find it, grand. We return a new + * copy of the name. Otherwise we sadly return a NULL pointer. Sigh. + * Note that if the directory holding the file doesn't exist, this + * will do an extra search of the final directory on the path. Unless + * something weird happens, this search won't succeed and life will + * be groovy. + * + * Sigh. We cannot add the directory onto the search path because + * of this amusing case: + * $(INSTALLDIR)/$(FILE): $(FILE) + * + * $(FILE) exists in $(INSTALLDIR) but not in the current one. + * When searching for $(FILE), we will find it in $(INSTALLDIR) + * b/c we added it here. This is not good... + */ +#if 0 + { + CachedDir *dir; + char *prefix; + + if (base == trailing_dot) { + base = strrchr(name, '/'); + base++; + } + prefix = bmake_strsedup(name, base - 1); + (void)SearchPath_Add(path, prefix); + free(prefix); + + bigmisses++; + if (path->last == NULL) + return NULL; + + dir = path->last->datum; + if (HashSet_Contains(&dir->files, base)) + return bmake_strdup(name); + return NULL; + } +#else + DEBUG1(DIR, " Looking for \"%s\" ...\n", name); + + bigmisses++; + if (cached_stat(name, &cst) == 0) { + return bmake_strdup(name); + } + + DEBUG0(DIR, " failed. Returning NULL\n"); return NULL; - } else { - p = (Path *)Lst_Datum(ln); - } - - if (Hash_FindEntry(&p->files, cp) != NULL) { - return (bmake_strdup(name)); - } else { - return NULL; - } -#else /* !notdef */ - if (DEBUG(DIR)) { - fprintf(debug_file, " Looking for \"%s\" ...\n", name); - } - - bigmisses += 1; - entry = Hash_FindEntry(&mtimes, name); - if (entry != NULL) { - if (DEBUG(DIR)) { - fprintf(debug_file, " got it (in mtime cache)\n"); - } - return(bmake_strdup(name)); - } else if (stat(name, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; - entry = Hash_CreateEntry(&mtimes, name, NULL); - if (DEBUG(DIR)) { - fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), - name); - } - Hash_SetTimeValue(entry, stb.st_mtime); - return (bmake_strdup(name)); - } else { - if (DEBUG(DIR)) { - fprintf(debug_file, " failed. Returning NULL\n"); - } - return NULL; - } -#endif /* notdef */ +#endif } -/*- - *----------------------------------------------------------------------- - * Dir_FindHereOrAbove -- - * search for a path starting at a given directory and then working - * our way up towards the root. +/* + * Search for a path starting at a given directory and then working our way + * up towards the root. * * Input: * here starting directory - * search_path the path we are looking for - * result the result of a successful search is placed here - * rlen the length of the result buffer - * (typically MAXPATHLEN + 1) + * search_path the relative path we are looking for * * Results: - * 0 on failure, 1 on success [in which case the found path is put - * in the result buffer]. - * - * Side Effects: - *----------------------------------------------------------------------- + * The found path, or NULL. */ -int -Dir_FindHereOrAbove(char *here, char *search_path, char *result, int rlen) { - - struct stat st; - char dirbase[MAXPATHLEN + 1], *db_end; - char try[MAXPATHLEN + 1], *try_end; +char * +Dir_FindHereOrAbove(const char *here, const char *search_path) +{ + struct cached_stat cst; + char *dirbase, *dirbase_end; + char *try, *try_end; /* copy out our starting point */ - snprintf(dirbase, sizeof(dirbase), "%s", here); - db_end = dirbase + strlen(dirbase); + dirbase = bmake_strdup(here); + dirbase_end = dirbase + strlen(dirbase); /* loop until we determine a result */ - while (1) { + for (;;) { /* try and stat(2) it ... */ - snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); - if (stat(try, &st) != -1) { + try = str_concat3(dirbase, "/", search_path); + if (cached_stat(try, &cst) != -1) { /* * success! if we found a file, chop off * the filename so we return a directory. */ - if ((st.st_mode & S_IFMT) != S_IFDIR) { + if ((cst.cst_mode & S_IFMT) != S_IFDIR) { try_end = try + strlen(try); while (try_end > try && *try_end != '/') try_end--; - if (try_end > try) - *try_end = 0; /* chop! */ + if (try_end > try) + *try_end = '\0'; /* chop! */ } - /* - * done! - */ - snprintf(result, rlen, "%s", try); - return(1); + free(dirbase); + return try; } + free(try); - /* + /* * nope, we didn't find it. if we used up dirbase we've * reached the root and failed. */ - if (db_end == dirbase) - break; /* failed! */ + if (dirbase_end == dirbase) + break; /* failed! */ /* * truncate dirbase from the end to move up a dir */ - while (db_end > dirbase && *db_end != '/') - db_end--; - *db_end = 0; /* chop! */ + while (dirbase_end > dirbase && *dirbase_end != '/') + dirbase_end--; + *dirbase_end = '\0'; /* chop! */ + } - } /* while (1) */ + free(dirbase); + return NULL; +} + +/* + * This is an implied source, and it may have moved, + * see if we can find it via the current .PATH + */ +static char * +ResolveMovedDepends(GNode *gn) +{ + char *fullName; + + const char *base = str_basename(gn->name); + if (base == gn->name) + return NULL; + + fullName = Dir_FindFile(base, Suff_FindPath(gn)); + if (fullName == NULL) + return NULL; /* - * we failed... + * Put the found file in gn->path so that we give that to the compiler. */ - return(0); + /* + * XXX: Better just reset gn->path to NULL; updating it is already done + * by Dir_UpdateMTime. + */ + gn->path = bmake_strdup(fullName); + if (!Job_RunTarget(".STALE", gn->fname)) + fprintf(stdout, /* XXX: Why stdout? */ + "%s: %s, %d: ignoring stale %s for %s, found %s\n", + progname, gn->fname, gn->lineno, + makeDependfile, gn->name, fullName); + + return fullName; } -/*- - *----------------------------------------------------------------------- - * Dir_MTime -- - * Find the modification time of the file described by gn along the - * search path dirSearchPath. - * - * Input: - * gn the file whose modification time is desired - * - * Results: - * The modification time or 0 if it doesn't exist - * - * Side Effects: - * The modification time is placed in the node's mtime slot. - * If the node didn't have a path entry before, and Dir_FindFile - * found one for it, the full name is placed in the path slot. - *----------------------------------------------------------------------- - */ -int -Dir_MTime(GNode *gn, Boolean recheck) +static char * +ResolveFullName(GNode *gn) { - char *fullName; /* the full pathname of name */ - struct stat stb; /* buffer for finding the mod time */ - Hash_Entry *entry; + char *fullName; - if (gn->type & OP_ARCHV) { - return Arch_MTime(gn); - } else if (gn->type & OP_PHONY) { - gn->mtime = 0; - return 0; - } else if (gn->path == NULL) { - if (gn->type & OP_NOPATH) - fullName = NULL; - else { - fullName = Dir_FindFile(gn->name, Suff_FindPath(gn)); - if (fullName == NULL && gn->flags & FROM_DEPEND && - !Lst_IsEmpty(gn->iParents)) { - char *cp; - - cp = strrchr(gn->name, '/'); - if (cp) { - /* - * This is an implied source, and it may have moved, - * see if we can find it via the current .PATH - */ - cp++; - - fullName = Dir_FindFile(cp, Suff_FindPath(gn)); - if (fullName) { - /* - * Put the found file in gn->path - * so that we give that to the compiler. - */ - gn->path = bmake_strdup(fullName); - if (!Job_RunTarget(".STALE", gn->fname)) - fprintf(stdout, - "%s: %s, %d: ignoring stale %s for %s, " - "found %s\n", progname, gn->fname, gn->lineno, - makeDependfile, gn->name, fullName); - } - } - } - if (DEBUG(DIR)) - fprintf(debug_file, "Found '%s' as '%s'\n", - gn->name, fullName ? fullName : "(not found)" ); - } - } else { fullName = gn->path; - } + if (fullName == NULL && !(gn->type & OP_NOPATH)) { - if (fullName == NULL) { - fullName = bmake_strdup(gn->name); - } + fullName = Dir_FindFile(gn->name, Suff_FindPath(gn)); - if (!recheck) - entry = Hash_FindEntry(&mtimes, fullName); - else - entry = NULL; - if (entry != NULL) { - if (DEBUG(DIR)) { - fprintf(debug_file, "Using cached time %s for %s\n", - Targ_FmtTime(Hash_GetTimeValue(entry)), fullName); - } - stb.st_mtime = Hash_GetTimeValue(entry); - } else if (stat(fullName, &stb) < 0) { - if (gn->type & OP_MEMBER) { - if (fullName != gn->path) - free(fullName); - return Arch_MemMTime(gn); - } else { - stb.st_mtime = 0; - } - } else { - if (stb.st_mtime == 0) { - /* - * 0 handled specially by the code, if the time is really 0, - * return something else instead - */ - stb.st_mtime = 1; - } - entry = Hash_CreateEntry(&mtimes, fullName, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); - } - - if (fullName && gn->path == NULL) { - gn->path = fullName; - } + if (fullName == NULL && gn->flags & FROM_DEPEND && + !Lst_IsEmpty(&gn->implicitParents)) + fullName = ResolveMovedDepends(gn); - gn->mtime = stb.st_mtime; - return (gn->mtime); + DEBUG2(DIR, "Found '%s' as '%s'\n", + gn->name, fullName != NULL ? fullName : "(not found)"); + } + + if (fullName == NULL) + fullName = bmake_strdup(gn->name); + + /* XXX: Is every piece of memory freed as it should? */ + + return fullName; } -/*- - *----------------------------------------------------------------------- - * Dir_AddDir -- - * Add the given name to the end of the given path. The order of - * the arguments is backwards so ParseDoDependency can do a - * Lst_ForEach of its list of paths... +/* + * Search gn along dirSearchPath and store its modification time in gn->mtime. + * If no file is found, store 0 instead. * - * Input: - * path the path to which the directory should be - * added - * name the name of the directory to add - * - * Results: - * none - * - * Side Effects: - * A structure is added to the list and the directory is - * read and hashed. - *----------------------------------------------------------------------- + * The found file is stored in gn->path, unless the node already had a path. */ -Path * -Dir_AddDir(Lst path, const char *name) +void +Dir_UpdateMTime(GNode *gn, Boolean recheck) { - LstNode ln = NULL; /* node in case Path structure is found */ - Path *p = NULL; /* pointer to new Path structure */ - DIR *d; /* for reading directory */ - struct dirent *dp; /* entry in directory */ + char *fullName; + struct cached_stat cst; - if (strcmp(name, ".DOTLAST") == 0) { - ln = Lst_Find(path, name, DirFindName); - if (ln != NULL) - return (Path *)Lst_Datum(ln); - else { - dotLast->refCount += 1; - (void)Lst_AtFront(path, dotLast); - } - } - - if (path) - ln = Lst_Find(openDirectories, name, DirFindName); - if (ln != NULL) { - p = (Path *)Lst_Datum(ln); - if (path && Lst_Member(path, p) == NULL) { - p->refCount += 1; - (void)Lst_AtEnd(path, p); - } - } else { - if (DEBUG(DIR)) { - fprintf(debug_file, "Caching %s ...", name); + if (gn->type & OP_ARCHV) { + Arch_UpdateMTime(gn); + return; } - if ((d = opendir(name)) != NULL) { - p = bmake_malloc(sizeof(Path)); - p->name = bmake_strdup(name); - p->hits = 0; - p->refCount = 1; - Hash_InitTable(&p->files, -1); + if (gn->type & OP_PHONY) { + gn->mtime = 0; + return; + } + + fullName = ResolveFullName(gn); + + if (cached_stats(fullName, &cst, recheck ? CST_UPDATE : CST_NONE) < 0) { + if (gn->type & OP_MEMBER) { + if (fullName != gn->path) + free(fullName); + Arch_UpdateMemberMTime(gn); + return; + } + + cst.cst_mtime = 0; + } + + if (fullName != NULL && gn->path == NULL) + gn->path = fullName; + /* XXX: else free(fullName)? */ + + gn->mtime = cst.cst_mtime; +} + +/* + * Read the directory and add it to the cache in openDirs. + * If a path is given, add the directory to that path as well. + */ +static CachedDir * +CacheNewDir(const char *name, SearchPath *path) +{ + CachedDir *dir = NULL; + DIR *d; + struct dirent *dp; + + if ((d = opendir(name)) == NULL) { + DEBUG1(DIR, "Caching %s ... not found\n", name); + return dir; + } + + DEBUG1(DIR, "Caching %s ...\n", name); + + dir = CachedDir_New(name); + + while ((dp = readdir(d)) != NULL) { - while ((dp = readdir(d)) != NULL) { #if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */ /* * The sun directory library doesn't check for a 0 inode * (0-inode slots just take up space), so we have to do * it ourselves. */ - if (dp->d_fileno == 0) { - continue; - } + if (dp->d_fileno == 0) + continue; #endif /* sun && d_ino */ - (void)Hash_CreateEntry(&p->files, dp->d_name, NULL); - } - (void)closedir(d); - (void)Lst_AtEnd(openDirectories, p); - if (path != NULL) - (void)Lst_AtEnd(path, p); + + (void)HashSet_Add(&dir->files, dp->d_name); } - if (DEBUG(DIR)) { - fprintf(debug_file, "done\n"); - } - } - return p; + (void)closedir(d); + + OpenDirs_Add(&openDirs, dir); + if (path != NULL) + Lst_Append(&path->dirs, CachedDir_Ref(dir)); + + DEBUG1(DIR, "Caching %s done\n", name); + return dir; } -/*- - *----------------------------------------------------------------------- - * Dir_CopyDir -- - * Callback function for duplicating a search path via Lst_Duplicate. - * Ups the reference count for the directory. +/* + * Read the list of filenames in the directory and store the result + * in openDirs. * - * Results: - * Returns the Path it was given. + * If a path is given, append the directory to that path. * - * Side Effects: - * The refCount of the path is incremented. - * - *----------------------------------------------------------------------- + * Input: + * path The path to which the directory should be + * added, or NULL to only add the directory to openDirs + * name The name of the directory to add. + * The name is not normalized in any way. + * Output: + * result If no path is given and the directory exists, the + * returned CachedDir has a reference count of 0. It + * must either be assigned to a variable using + * CachedDir_Assign or be appended to a SearchPath using + * Lst_Append and CachedDir_Ref. */ -void * -Dir_CopyDir(void *p) +CachedDir * +SearchPath_Add(SearchPath *path, const char *name) { - ((Path *)p)->refCount += 1; - return (p); + if (path != NULL && strcmp(name, ".DOTLAST") == 0) { + SearchPathNode *ln; + + /* XXX: Linear search gets slow with thousands of entries. */ + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *pathDir = ln->datum; + if (strcmp(pathDir->name, name) == 0) + return pathDir; + } + + Lst_Prepend(&path->dirs, CachedDir_Ref(dotLast)); + } + + if (path != NULL) { + /* XXX: Why is OpenDirs only checked if path != NULL? */ + CachedDir *dir = OpenDirs_Find(&openDirs, name); + if (dir != NULL) { + if (Lst_FindDatum(&path->dirs, dir) == NULL) + Lst_Append(&path->dirs, CachedDir_Ref(dir)); + return dir; + } + } + + return CacheNewDir(name, path); } -/*- - *----------------------------------------------------------------------- - * Dir_MakeFlags -- - * Make a string by taking all the directories in the given search - * path and preceding them by the given flag. Used by the suffix - * module to create variables for compilers based on suffix search - * paths. +/* + * Return a copy of dirSearchPath, incrementing the reference counts for + * the contained directories. + */ +SearchPath * +Dir_CopyDirSearchPath(void) +{ + SearchPath *path = SearchPath_New(); + SearchPathNode *ln; + for (ln = dirSearchPath.dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + Lst_Append(&path->dirs, CachedDir_Ref(dir)); + } + return path; +} + +/* + * Make a string by taking all the directories in the given search path and + * preceding them by the given flag. Used by the suffix module to create + * variables for compilers based on suffix search paths. * * Input: * flag flag which should precede each directory * path list of directories * * Results: - * The string mentioned above. Note that there is no space between - * the given flag and each directory. The empty string is returned if - * Things don't go well. - * - * Side Effects: - * None - *----------------------------------------------------------------------- + * The string mentioned above. Note that there is no space between the + * given flag and each directory. The empty string is returned if things + * don't go well. */ char * -Dir_MakeFlags(const char *flag, Lst path) +SearchPath_ToFlags(SearchPath *path, const char *flag) { - char *str; /* the string which will be returned */ - char *s1, *s2;/* the current directory preceded by 'flag' */ - LstNode ln; /* the node of the current directory */ - Path *p; /* the structure describing the current directory */ + Buffer buf; + SearchPathNode *ln; - str = bmake_strdup(""); + Buf_Init(&buf); - if (Lst_Open(path) == SUCCESS) { - while ((ln = Lst_Next(path)) != NULL) { - p = (Path *)Lst_Datum(ln); - s2 = str_concat(flag, p->name, 0); - str = str_concat(s1 = str, s2, STR_ADDSPACE); - free(s1); - free(s2); + if (path != NULL) { + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + Buf_AddStr(&buf, " "); + Buf_AddStr(&buf, flag); + Buf_AddStr(&buf, dir->name); + } } - Lst_Close(path); - } - return (str); + return Buf_DoneData(&buf); } -/*- - *----------------------------------------------------------------------- - * Dir_Destroy -- - * Nuke a directory descriptor, if possible. Callback procedure - * for the suffixes module when destroying a search path. - * - * Input: - * pp The directory descriptor to nuke - * - * Results: - * None. - * - * Side Effects: - * If no other path references this directory (refCount == 0), - * the Path and all its data are freed. - * - *----------------------------------------------------------------------- - */ +/* Free the search path and all directories mentioned in it. */ void -Dir_Destroy(void *pp) +SearchPath_Free(SearchPath *path) { - Path *p = (Path *)pp; - p->refCount -= 1; + SearchPathNode *ln; - if (p->refCount == 0) { - LstNode ln; - - ln = Lst_Member(openDirectories, p); - (void)Lst_Remove(openDirectories, ln); - - Hash_DeleteTable(&p->files); - free(p->name); - free(p); - } -} - -/*- - *----------------------------------------------------------------------- - * Dir_ClearPath -- - * Clear out all elements of the given search path. This is different - * from destroying the list, notice. - * - * Input: - * path Path to clear - * - * Results: - * None. - * - * Side Effects: - * The path is set to the empty list. - * - *----------------------------------------------------------------------- - */ -void -Dir_ClearPath(Lst path) -{ - Path *p; - while (!Lst_IsEmpty(path)) { - p = (Path *)Lst_DeQueue(path); - Dir_Destroy(p); - } -} - - -/*- - *----------------------------------------------------------------------- - * Dir_Concat -- - * Concatenate two paths, adding the second to the end of the first. - * Makes sure to avoid duplicates. - * - * Input: - * path1 Dest - * path2 Source - * - * Results: - * None - * - * Side Effects: - * Reference counts for added dirs are upped. - * - *----------------------------------------------------------------------- - */ -void -Dir_Concat(Lst path1, Lst path2) -{ - LstNode ln; - Path *p; - - for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { - p = (Path *)Lst_Datum(ln); - if (Lst_Member(path1, p) == NULL) { - p->refCount += 1; - (void)Lst_AtEnd(path1, p); + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + CachedDir_Unref(dir); } - } + Lst_Done(&path->dirs); + free(path); +} + +/* + * Clear out all elements from the given search path. + * The path is set to the empty list but is not destroyed. + */ +void +SearchPath_Clear(SearchPath *path) +{ + while (!Lst_IsEmpty(&path->dirs)) { + CachedDir *dir = Lst_Dequeue(&path->dirs); + CachedDir_Unref(dir); + } +} + + +/* + * Concatenate two paths, adding the second to the end of the first, + * skipping duplicates. + */ +void +SearchPath_AddAll(SearchPath *dst, SearchPath *src) +{ + SearchPathNode *ln; + + for (ln = src->dirs.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + if (Lst_FindDatum(&dst->dirs, dir) == NULL) + Lst_Append(&dst->dirs, CachedDir_Ref(dir)); + } +} + +static int +percentage(int num, int den) +{ + return den != 0 ? num * 100 / den : 0; } /********** DEBUG INFO **********/ void Dir_PrintDirectories(void) { - LstNode ln; - Path *p; + CachedDirListNode *ln; - fprintf(debug_file, "#*** Directory Cache:\n"); - fprintf(debug_file, "# Stats: %d hits %d misses %d near misses %d losers (%d%%)\n", - hits, misses, nearmisses, bigmisses, - (hits+bigmisses+nearmisses ? - hits * 100 / (hits + bigmisses + nearmisses) : 0)); - fprintf(debug_file, "# %-20s referenced\thits\n", "directory"); - if (Lst_Open(openDirectories) == SUCCESS) { - while ((ln = Lst_Next(openDirectories)) != NULL) { - p = (Path *)Lst_Datum(ln); - fprintf(debug_file, "# %-20s %10d\t%4d\n", p->name, p->refCount, p->hits); + debug_printf("#*** Directory Cache:\n"); + debug_printf( + "# Stats: %d hits %d misses %d near misses %d losers (%d%%)\n", + hits, misses, nearmisses, bigmisses, + percentage(hits, hits + bigmisses + nearmisses)); + debug_printf("# refs hits directory\n"); + + for (ln = openDirs.list.first; ln != NULL; ln = ln->next) { + CachedDir *dir = ln->datum; + debug_printf("# %4d %4d %s\n", + dir->refCount, dir->hits, dir->name); } - Lst_Close(openDirectories); - } -} - -static int -DirPrintDir(void *p, void *dummy) -{ - fprintf(debug_file, "%s ", ((Path *)p)->name); - return (dummy ? 0 : 0); } void -Dir_PrintPath(Lst path) +SearchPath_Print(const SearchPath *path) { - Lst_ForEach(path, DirPrintDir, NULL); + SearchPathNode *ln; + + for (ln = path->dirs.first; ln != NULL; ln = ln->next) { + const CachedDir *dir = ln->datum; + debug_printf("%s ", dir->name); + } } diff --git a/usr.bin/make/dir.h b/usr.bin/make/dir.h index aa004504a..f4bf32ab5 100644 --- a/usr.bin/make/dir.h +++ b/usr.bin/make/dir.h @@ -1,4 +1,4 @@ -/* $NetBSD: dir.h,v 1.15 2012/04/07 18:29:08 christos Exp $ */ +/* $NetBSD: dir.h,v 1.43 2021/02/05 05:48:19 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -72,37 +72,36 @@ * from: @(#)dir.h 8.1 (Berkeley) 6/6/93 */ -/* dir.h -- - */ +#ifndef MAKE_DIR_H +#define MAKE_DIR_H -#ifndef _DIR -#define _DIR +typedef struct CachedDir CachedDir; -typedef struct Path { - char *name; /* Name of directory */ - int refCount; /* Number of paths with this directory */ - int hits; /* the number of times a file in this - * directory has been found */ - Hash_Table files; /* Hash table of files in directory */ -} Path; - -void Dir_Init(const char *); +void Dir_Init(void); void Dir_InitCur(const char *); void Dir_InitDot(void); void Dir_End(void); void Dir_SetPATH(void); -Boolean Dir_HasWildcards(char *); -void Dir_Expand(const char *, Lst, Lst); -char *Dir_FindFile(const char *, Lst); -int Dir_FindHereOrAbove(char *, char *, char *, int); -int Dir_MTime(GNode *, Boolean); -Path *Dir_AddDir(Lst, const char *); -char *Dir_MakeFlags(const char *, Lst); -void Dir_ClearPath(Lst); -void Dir_Concat(Lst, Lst); +Boolean Dir_HasWildcards(const char *); +void SearchPath_Expand(SearchPath *, const char *, StringList *); +char *Dir_FindFile(const char *, SearchPath *); +char *Dir_FindHereOrAbove(const char *, const char *); +void Dir_UpdateMTime(GNode *, Boolean); +CachedDir *SearchPath_Add(SearchPath *, const char *); +char *SearchPath_ToFlags(SearchPath *, const char *); +void SearchPath_Clear(SearchPath *); +void SearchPath_AddAll(SearchPath *, SearchPath *); void Dir_PrintDirectories(void); -void Dir_PrintPath(Lst); -void Dir_Destroy(void *); -void * Dir_CopyDir(void *); +void SearchPath_Print(const SearchPath *); +SearchPath *Dir_CopyDirSearchPath(void); -#endif /* _DIR */ +/* Stripped-down variant of struct stat. */ +struct cached_stat { + time_t cst_mtime; + mode_t cst_mode; +}; + +int cached_lstat(const char *, struct cached_stat *); +int cached_stat(const char *, struct cached_stat *); + +#endif /* MAKE_DIR_H */ diff --git a/usr.bin/make/enum.c b/usr.bin/make/enum.c new file mode 100644 index 000000000..a0ae8569b --- /dev/null +++ b/usr.bin/make/enum.c @@ -0,0 +1,80 @@ +/* $NetBSD: enum.c,v 1.15 2021/02/02 17:56:31 rillig Exp $ */ + +/* + Copyright (c) 2020 Roland Illig + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#include "make.h" + +MAKE_RCSID("$NetBSD: enum.c,v 1.15 2021/02/02 17:56:31 rillig Exp $"); + +/* + * Convert a bitset into a string representation, showing the names of the + * individual bits. + * + * Optionally, shortcuts for groups of bits can be added. To have an effect, + * they need to be listed before their individual bits. + */ +const char * +Enum_FlagsToString(char *buf, size_t buf_size, + int value, const EnumToStringSpec *spec) +{ + const char *buf_start = buf; + const char *sep = ""; + size_t sep_len = 0; + + for (; spec->es_value != 0; spec++) { + size_t name_len; + + if ((value & spec->es_value) != spec->es_value) + continue; + value &= ~spec->es_value; + + assert(buf_size >= sep_len + 1); + memcpy(buf, sep, sep_len); + buf += sep_len; + buf_size -= sep_len; + + name_len = strlen(spec->es_name); + assert(buf_size >= name_len + 1); + memcpy(buf, spec->es_name, name_len); + buf += name_len; + buf_size -= name_len; + + sep = ENUM__SEP; + sep_len = sizeof ENUM__SEP - 1; + } + + /* If this assertion fails, the listed enum values are incomplete. */ + assert(value == 0); + + if (buf == buf_start) + return "none"; + + assert(buf_size >= 1); + buf[0] = '\0'; + return buf_start; +} diff --git a/usr.bin/make/enum.h b/usr.bin/make/enum.h new file mode 100644 index 000000000..e10fcae04 --- /dev/null +++ b/usr.bin/make/enum.h @@ -0,0 +1,179 @@ +/* $NetBSD: enum.h,v 1.19 2021/03/15 16:00:05 rillig Exp $ */ + +/* + Copyright (c) 2020 Roland Illig + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef MAKE_ENUM_H +#define MAKE_ENUM_H + +/* Generate string representations for bitmasks and simple enums. */ + +#include + +typedef struct EnumToStringSpec { + int es_value; + const char *es_name; +} EnumToStringSpec; + + +const char *Enum_FlagsToString(char *, size_t, int, const EnumToStringSpec *); + + +/* For Enum_FlagsToString, the separator between flags. */ +#define ENUM__SEP "|" + +/* + * Generate the string that joins all possible flags, to see how large the + * buffer must be. + */ +#define ENUM__JOIN_STR_1(v1) \ + #v1 +#define ENUM__JOIN_STR_2(v1, v2) \ + ENUM__JOIN_STR_1(v1) ENUM__SEP \ + ENUM__JOIN_STR_1(v2) +#define ENUM__JOIN_STR_4(v1, v2, v3, v4) \ + ENUM__JOIN_STR_2(v1, v2) ENUM__SEP \ + ENUM__JOIN_STR_2(v3, v4) +#define ENUM__JOIN_STR_8(v1, v2, v3, v4, v5, v6, v7, v8) \ + ENUM__JOIN_STR_4(v1, v2, v3, v4) ENUM__SEP \ + ENUM__JOIN_STR_4(v5, v6, v7, v8) +#define ENUM__JOIN_STR_16(v01, v02, v03, v04, v05, v06, v07, v08, \ + v09, v10, v11, v12, v13, v14, v15, v16) \ + ENUM__JOIN_STR_8(v01, v02, v03, v04, v05, v06, v07, v08) ENUM__SEP \ + ENUM__JOIN_STR_8(v09, v10, v11, v12, v13, v14, v15, v16) + +#define ENUM__JOIN_2(part1, part2) \ + part1 ENUM__SEP part2 +#define ENUM__JOIN_3(part1, part2, part3) \ + part1 ENUM__SEP part2 ENUM__SEP part3 +#define ENUM__JOIN_4(part1, part2, part3, part4) \ + part1 ENUM__SEP part2 ENUM__SEP part3 ENUM__SEP part4 +#define ENUM__JOIN_5(part1, part2, part3, part4, part5) \ + part1 ENUM__SEP part2 ENUM__SEP part3 ENUM__SEP part4 ENUM__SEP part5 + +/* List the pairs of enum value and corresponding name. */ +#define ENUM__SPEC_1(v1) \ + { v1, #v1 } +#define ENUM__SPEC_2(v1, v2) \ + ENUM__SPEC_1(v1), \ + ENUM__SPEC_1(v2) +#define ENUM__SPEC_4(v1, v2, v3, v4) \ + ENUM__SPEC_2(v1, v2), \ + ENUM__SPEC_2(v3, v4) +#define ENUM__SPEC_8(v1, v2, v3, v4, v5, v6, v7, v8) \ + ENUM__SPEC_4(v1, v2, v3, v4), \ + ENUM__SPEC_4(v5, v6, v7, v8) +#define ENUM__SPEC_16(v01, v02, v03, v04, v05, v06, v07, v08, \ + v09, v10, v11, v12, v13, v14, v15, v16) \ + ENUM__SPEC_8(v01, v02, v03, v04, v05, v06, v07, v08), \ + ENUM__SPEC_8(v09, v10, v11, v12, v13, v14, v15, v16) + +#define ENUM__SPECS_2(part1, part2) \ + { part1, part2, { 0, "" } } +#define ENUM__SPECS_3(part1, part2, part3) \ + { part1, part2, part3, { 0, "" } } +#define ENUM__SPECS_4(part1, part2, part3, part4) \ + { part1, part2, part3, part4, { 0, "" } } +#define ENUM__SPECS_5(part1, part2, part3, part4, part5) \ + { part1, part2, part3, part4, part5, { 0, "" } } + + +/* Declare the necessary data structures for calling Enum_FlagsToString. */ +#define ENUM__FLAGS_RTTI(typnam, specs, joined) \ + static const EnumToStringSpec typnam ## _ ## ToStringSpecs[] = specs; \ + enum { typnam ## _ ## ToStringSize = sizeof (joined) }; \ + MAKE_INLINE const char *typnam ## _ToString(char *buf, typnam value) \ + { return Enum_FlagsToString(buf, typnam ## _ ## ToStringSize, \ + value, typnam ## _ ## ToStringSpecs); \ + } \ + extern void enum_flags_rtti_dummy(void) + +/* + * Declare the necessary data structures for calling Enum_FlagsToString + * for an enum with 3 flags. + */ +#define ENUM_FLAGS_RTTI_3(typnam, v1, v2, v3) \ + ENUM__FLAGS_RTTI(typnam, \ + ENUM__SPECS_2( \ + ENUM__SPEC_2(v1, v2), \ + ENUM__SPEC_1(v3)), \ + ENUM__JOIN_2( \ + ENUM__JOIN_STR_2(v1, v2), \ + ENUM__JOIN_STR_1(v3))) + +/* + * Declare the necessary data structures for calling Enum_FlagsToString + * for an enum with 6 flags. + */ +#define ENUM_FLAGS_RTTI_6(typnam, v1, v2, v3, v4, v5, v6) \ + ENUM__FLAGS_RTTI(typnam, \ + ENUM__SPECS_2( \ + ENUM__SPEC_4(v1, v2, v3, v4), \ + ENUM__SPEC_2(v5, v6)), \ + ENUM__JOIN_2( \ + ENUM__JOIN_STR_4(v1, v2, v3, v4), \ + ENUM__JOIN_STR_2(v5, v6))) + +/* + * Declare the necessary data structures for calling Enum_FlagsToString + * for an enum with 9 flags. + */ +#define ENUM_FLAGS_RTTI_9(typnam, v1, v2, v3, v4, v5, v6, v7, v8, v9) \ + ENUM__FLAGS_RTTI(typnam, \ + ENUM__SPECS_2( \ + ENUM__SPEC_8(v1, v2, v3, v4, v5, v6, v7, v8), \ + ENUM__SPEC_1(v9)), \ + ENUM__JOIN_2( \ + ENUM__JOIN_STR_8(v1, v2, v3, v4, v5, v6, v7, v8), \ + ENUM__JOIN_STR_1(v9))) + +/* + * Declare the necessary data structures for calling Enum_FlagsToString + * for an enum with 31 flags. + */ +#define ENUM_FLAGS_RTTI_31(typnam, \ + v01, v02, v03, v04, v05, v06, v07, v08, \ + v09, v10, v11, v12, v13, v14, v15, v16, \ + v17, v18, v19, v20, v21, v22, v23, v24, \ + v25, v26, v27, v28, v29, v30, v31) \ + ENUM__FLAGS_RTTI(typnam, \ + ENUM__SPECS_5( \ + ENUM__SPEC_16(v01, v02, v03, v04, v05, v06, v07, v08, \ + v09, v10, v11, v12, v13, v14, v15, v16), \ + ENUM__SPEC_8(v17, v18, v19, v20, v21, v22, v23, v24), \ + ENUM__SPEC_4(v25, v26, v27, v28), \ + ENUM__SPEC_2(v29, v30), \ + ENUM__SPEC_1(v31)), \ + ENUM__JOIN_5( \ + ENUM__JOIN_STR_16(v01, v02, v03, v04, v05, v06, v07, v08, \ + v09, v10, v11, v12, v13, v14, v15, v16), \ + ENUM__JOIN_STR_8(v17, v18, v19, v20, v21, v22, v23, v24), \ + ENUM__JOIN_STR_4(v25, v26, v27, v28), \ + ENUM__JOIN_STR_2(v29, v30), \ + ENUM__JOIN_STR_1(v31))) + +#endif diff --git a/usr.bin/make/strlist.h b/usr.bin/make/filemon/filemon.h similarity index 56% rename from usr.bin/make/strlist.h rename to usr.bin/make/filemon/filemon.h index 2fc049e86..139d62f1a 100644 --- a/usr.bin/make/strlist.h +++ b/usr.bin/make/filemon/filemon.h @@ -1,11 +1,11 @@ -/* $NetBSD: strlist.h,v 1.3 2009/01/16 21:15:34 dsl Exp $ */ +/* $NetBSD: filemon.h,v 1.5 2021/01/19 20:51:46 rillig Exp $ */ -/*- - * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc. +/* + * Copyright (c) 2019 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation - * by David Laight. + * by Taylor R. Campbell. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -15,9 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -32,31 +29,25 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _STRLIST_H -#define _STRLIST_H +#ifndef MAKE_FILEMON_H +#define MAKE_FILEMON_H -typedef struct { - char *si_str; - unsigned int si_info; -} strlist_item_t; +#include -typedef struct { - unsigned int sl_num; - unsigned int sl_max; - strlist_item_t *sl_items; -} strlist_t; +struct filemon; -void strlist_init(strlist_t *); -void strlist_clean(strlist_t *); -void strlist_add_str(strlist_t *, char *, unsigned int); +const char * + filemon_path(void); -#define strlist_num(sl) ((sl)->sl_num) -#define strlist_str(sl, n) ((sl)->sl_items[n].si_str) -#define strlist_info(sl, n) ((sl)->sl_items[n].si_info) -#define strlist_set_info(sl, n, v) ((void)((sl)->sl_items[n].si_info = (v))) +struct filemon * + filemon_open(void); +int filemon_close(struct filemon *); -#define STRLIST_FOREACH(v, sl, index) \ - if ((sl)->sl_items != NULL) \ - for (index = 0; (v = strlist_str(sl, index)) != NULL; index++) +int filemon_setfd(struct filemon *, int); +void filemon_setpid_parent(struct filemon *, pid_t); +int filemon_setpid_child(const struct filemon *, pid_t); -#endif /* _STRLIST_H */ +int filemon_readfd(const struct filemon *); +int filemon_process(struct filemon *); + +#endif /* MAKE_FILEMON_H */ diff --git a/usr.bin/make/filemon/filemon_dev.c b/usr.bin/make/filemon/filemon_dev.c new file mode 100644 index 000000000..728d84c1f --- /dev/null +++ b/usr.bin/make/filemon/filemon_dev.c @@ -0,0 +1,151 @@ +/* $NetBSD: filemon_dev.c,v 1.8 2021/02/01 21:09:25 rillig Exp $ */ + +/* + * Copyright (c) 2020 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Taylor R. Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "filemon.h" + +#include + +#include +#include +#include +#include + +#ifdef HAVE_FILEMON_H +# include +#endif + +#ifndef _PATH_FILEMON +#define _PATH_FILEMON "/dev/filemon" +#endif + +struct filemon { + int fd; +}; + +const char * +filemon_path(void) +{ + + return _PATH_FILEMON; +} + +struct filemon * +filemon_open(void) +{ + struct filemon *F; + unsigned i; + int error; + + /* Allocate and zero a struct filemon object. */ + F = calloc(1, sizeof *F); + if (F == NULL) + return NULL; + + /* Try opening /dev/filemon, up to six times (cargo cult!). */ + for (i = 0; (F->fd = open(_PATH_FILEMON, O_RDWR|O_CLOEXEC)) == -1; i++) { + if (i == 5) { + error = errno; + goto fail0; + } + } + + /* Success! */ + return F; + +fail0: free(F); + errno = error; + return NULL; +} + +int +filemon_setfd(struct filemon *F, int fd) +{ + + /* Point the kernel at this file descriptor. */ + if (ioctl(F->fd, FILEMON_SET_FD, &fd) == -1) + return -1; + + /* No need for it in userland any more; close it. */ + (void)close(fd); + + /* Success! */ + return 0; +} + +void +filemon_setpid_parent(struct filemon *F, pid_t pid) +{ + /* Nothing to do! */ +} + +int +filemon_setpid_child(const struct filemon *F, pid_t pid) +{ + + /* Just pass it on to the kernel. */ + return ioctl(F->fd, FILEMON_SET_PID, &pid); +} + +int +filemon_close(struct filemon *F) +{ + int error = 0; + + /* Close the filemon device fd. */ + if (close(F->fd) == -1 && error == 0) + error = errno; + + /* Free the filemon descriptor. */ + free(F); + + /* Set errno and return -1 if anything went wrong. */ + if (error != 0) { + errno = error; + return -1; + } + + /* Success! */ + return 0; +} + +int +filemon_readfd(const struct filemon *F) +{ + + return -1; +} + +int +filemon_process(struct filemon *F) +{ + + return 0; +} diff --git a/usr.bin/make/filemon/filemon_ktrace.c b/usr.bin/make/filemon/filemon_ktrace.c new file mode 100644 index 000000000..1abef7e78 --- /dev/null +++ b/usr.bin/make/filemon/filemon_ktrace.c @@ -0,0 +1,894 @@ +/* $NetBSD: filemon_ktrace.c,v 1.14 2021/02/01 21:34:41 rillig Exp $ */ + +/* + * Copyright (c) 2019 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Taylor R. Campbell. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#define _KERNTYPES /* register_t */ + +#include "filemon.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef AT_CWD +#define AT_CWD -1 +#endif + +struct filemon; +struct filemon_key; +struct filemon_state; + +typedef struct filemon_state *filemon_syscall_t(struct filemon *, + const struct filemon_key *, const struct ktr_syscall *); + +static filemon_syscall_t filemon_sys_chdir; +static filemon_syscall_t filemon_sys_execve; +static filemon_syscall_t filemon_sys_exit; +static filemon_syscall_t filemon_sys_fork; +static filemon_syscall_t filemon_sys_link; +static filemon_syscall_t filemon_sys_open; +static filemon_syscall_t filemon_sys_openat; +static filemon_syscall_t filemon_sys_symlink; +static filemon_syscall_t filemon_sys_unlink; +static filemon_syscall_t filemon_sys_rename; + +static filemon_syscall_t *const filemon_syscalls[] = { + [SYS_chdir] = &filemon_sys_chdir, + [SYS_execve] = &filemon_sys_execve, + [SYS_exit] = &filemon_sys_exit, + [SYS_fork] = &filemon_sys_fork, + [SYS_link] = &filemon_sys_link, + [SYS_open] = &filemon_sys_open, + [SYS_openat] = &filemon_sys_openat, + [SYS_symlink] = &filemon_sys_symlink, + [SYS_unlink] = &filemon_sys_unlink, + [SYS_rename] = &filemon_sys_rename, +}; + +struct filemon { + int ktrfd; /* kernel writes ktrace events here */ + FILE *in; /* we read ktrace events from here */ + FILE *out; /* we write filemon events to here */ + rb_tree_t active; + pid_t child; + + /* I/O state machine. */ + enum { + FILEMON_START = 0, + FILEMON_HEADER, + FILEMON_PAYLOAD, + FILEMON_ERROR, + } state; + unsigned char *p; + size_t resid; + + /* I/O buffer. */ + struct ktr_header hdr; + union { + struct ktr_syscall syscall; + struct ktr_sysret sysret; + char namei[PATH_MAX]; + unsigned char buf[4096]; + } payload; +}; + +struct filemon_state { + struct filemon_key { + pid_t pid; + lwpid_t lid; + } key; + struct rb_node node; + int syscode; + void (*show)(struct filemon *, const struct filemon_state *, + const struct ktr_sysret *); + unsigned i; + unsigned npath; + char *path[/*npath*/]; +}; + +/*ARGSUSED*/ +static int +compare_filemon_states(void *cookie, const void *na, const void *nb) +{ + const struct filemon_state *Sa = na; + const struct filemon_state *Sb = nb; + + if (Sa->key.pid < Sb->key.pid) + return -1; + if (Sa->key.pid > Sb->key.pid) + return +1; + if (Sa->key.lid < Sb->key.lid) + return -1; + if (Sa->key.lid > Sb->key.lid) + return +1; + return 0; +} + +/*ARGSUSED*/ +static int +compare_filemon_key(void *cookie, const void *n, const void *k) +{ + const struct filemon_state *S = n; + const struct filemon_key *key = k; + + if (S->key.pid < key->pid) + return -1; + if (S->key.pid > key->pid) + return +1; + if (S->key.lid < key->lid) + return -1; + if (S->key.lid > key->lid) + return +1; + return 0; +} + +static const rb_tree_ops_t filemon_rb_ops = { + .rbto_compare_nodes = &compare_filemon_states, + .rbto_compare_key = &compare_filemon_key, + .rbto_node_offset = offsetof(struct filemon_state, node), + .rbto_context = NULL, +}; + +/* + * filemon_path() + * + * Return a pointer to a constant string denoting the `path' of + * the filemon. + */ +const char * +filemon_path(void) +{ + + return "ktrace"; +} + +/* + * filemon_open() + * + * Allocate a filemon descriptor. Returns NULL and sets errno on + * failure. + */ +struct filemon * +filemon_open(void) +{ + struct filemon *F; + int ktrpipe[2]; + int error; + + /* Allocate and zero a struct filemon object. */ + F = calloc(1, sizeof *F); + if (F == NULL) + return NULL; + + /* Create a pipe for ktrace events. */ + if (pipe2(ktrpipe, O_CLOEXEC|O_NONBLOCK) == -1) { + error = errno; + goto fail0; + } + + /* Create a file stream for reading the ktrace events. */ + if ((F->in = fdopen(ktrpipe[0], "r")) == NULL) { + error = errno; + goto fail1; + } + ktrpipe[0] = -1; /* claimed by fdopen */ + + /* + * Set the fd for writing ktrace events and initialize the + * rbtree. The rest can be safely initialized to zero. + */ + F->ktrfd = ktrpipe[1]; + rb_tree_init(&F->active, &filemon_rb_ops); + + /* Success! */ + return F; + + (void)fclose(F->in); +fail1: (void)close(ktrpipe[0]); + (void)close(ktrpipe[1]); +fail0: free(F); + errno = error; + return NULL; +} + +/* + * filemon_closefd(F) + * + * Internal subroutine to try to flush and close the output file. + * If F is not open for output, do nothing. Never leaves F open + * for output even on failure. Returns 0 on success; sets errno + * and return -1 on failure. + */ +static int +filemon_closefd(struct filemon *F) +{ + int error = 0; + + /* If we're not open, nothing to do. */ + if (F->out == NULL) + return 0; + + /* + * Flush it, close it, and null it unconditionally, but be + * careful to return the earliest error in errno. + */ + if (fflush(F->out) == EOF && error == 0) + error = errno; + if (fclose(F->out) == EOF && error == 0) + error = errno; + F->out = NULL; + + /* Set errno and return -1 if anything went wrong. */ + if (error != 0) { + errno = error; + return -1; + } + + /* Success! */ + return 0; +} + +/* + * filemon_setfd(F, fd) + * + * Cause filemon activity on F to be sent to fd. Claims ownership + * of fd; caller should not use fd afterward, and any duplicates + * of fd may see their file positions changed. + */ +int +filemon_setfd(struct filemon *F, int fd) +{ + + /* + * Close an existing output file if done. Fail now if there's + * an error closing. + */ + if ((filemon_closefd(F)) == -1) + return -1; + assert(F->out == NULL); + + /* Open a file stream and claim ownership of the fd. */ + if ((F->out = fdopen(fd, "a")) == NULL) + return -1; + + /* + * Print the opening output. Any failure will be deferred + * until closing. For hysterical raisins, we show the parent + * pid, not the child pid. + */ + fprintf(F->out, "# filemon version 4\n"); + fprintf(F->out, "# Target pid %jd\n", (intmax_t)getpid()); + fprintf(F->out, "V 4\n"); + + /* Success! */ + return 0; +} + +/* + * filemon_setpid_parent(F, pid) + * + * Set the traced pid, from the parent. Never fails. + */ +void +filemon_setpid_parent(struct filemon *F, pid_t pid) +{ + + F->child = pid; +} + +/* + * filemon_setpid_child(F, pid) + * + * Set the traced pid, from the child. Returns 0 on success; sets + * errno and returns -1 on failure. + */ +int +filemon_setpid_child(const struct filemon *F, pid_t pid) +{ + int ops, trpoints; + + ops = KTROP_SET|KTRFLAG_DESCEND; + trpoints = KTRFACv2; + trpoints |= KTRFAC_SYSCALL|KTRFAC_NAMEI|KTRFAC_SYSRET; + trpoints |= KTRFAC_INHERIT; + if (fktrace(F->ktrfd, ops, trpoints, pid) == -1) + return -1; + + return 0; +} + +/* + * filemon_close(F) + * + * Close F for output if necessary, and free a filemon descriptor. + * Returns 0 on success; sets errno and returns -1 on failure, but + * frees the filemon descriptor either way; + */ +int +filemon_close(struct filemon *F) +{ + struct filemon_state *S; + int error = 0; + + /* Close for output. */ + if (filemon_closefd(F) == -1 && error == 0) + error = errno; + + /* Close the ktrace pipe. */ + if (fclose(F->in) == EOF && error == 0) + error = errno; + if (close(F->ktrfd) == -1 && error == 0) + error = errno; + + /* Free any active records. */ + while ((S = RB_TREE_MIN(&F->active)) != NULL) { + rb_tree_remove_node(&F->active, S); + free(S); + } + + /* Free the filemon descriptor. */ + free(F); + + /* Set errno and return -1 if anything went wrong. */ + if (error != 0) { + errno = error; + return -1; + } + + /* Success! */ + return 0; +} + +/* + * filemon_readfd(F) + * + * Returns a file descriptor which will select/poll ready for read + * when there are filemon events to be processed by + * filemon_process, or -1 if anything has gone wrong. + */ +int +filemon_readfd(const struct filemon *F) +{ + + if (F->state == FILEMON_ERROR) + return -1; + return fileno(F->in); +} + +/* + * filemon_dispatch(F) + * + * Internal subroutine to dispatch a filemon ktrace event. + * Silently ignore events that we don't recognize. + */ +static void +filemon_dispatch(struct filemon *F) +{ + const struct filemon_key key = { + .pid = F->hdr.ktr_pid, + .lid = F->hdr.ktr_lid, + }; + struct filemon_state *S; + + switch (F->hdr.ktr_type) { + case KTR_SYSCALL: { + struct ktr_syscall *call = &F->payload.syscall; + struct filemon_state *S1; + + /* Validate the syscall code. */ + if (call->ktr_code < 0 || + (size_t)call->ktr_code >= __arraycount(filemon_syscalls) || + filemon_syscalls[call->ktr_code] == NULL) + break; + + /* + * Invoke the syscall-specific logic to create a new + * active state. + */ + S = (*filemon_syscalls[call->ktr_code])(F, &key, call); + if (S == NULL) + break; + + /* + * Insert the active state, or ignore it if there + * already is one. + * + * Collisions shouldn't happen because the states are + * keyed by , in which syscalls should happen + * sequentially in CALL/RET pairs, but let's be + * defensive. + */ + S1 = rb_tree_insert_node(&F->active, S); + if (S1 != S) { + /* XXX Which one to drop? */ + free(S); + break; + } + break; + } + case KTR_NAMEI: + /* Find an active syscall state, or drop it. */ + S = rb_tree_find_node(&F->active, &key); + if (S == NULL) + break; + /* Find the position of the next path, or drop it. */ + if (S->i >= S->npath) + break; + /* Record the path. */ + S->path[S->i++] = strndup(F->payload.namei, + sizeof F->payload.namei); + break; + case KTR_SYSRET: { + struct ktr_sysret *ret = &F->payload.sysret; + unsigned i; + + /* Find and remove an active syscall state, or drop it. */ + S = rb_tree_find_node(&F->active, &key); + if (S == NULL) + break; + rb_tree_remove_node(&F->active, S); + + /* + * If the active syscall state matches this return, + * invoke the syscall-specific logic to show a filemon + * event. + */ + /* XXX What to do if syscall code doesn't match? */ + if (S->i == S->npath && S->syscode == ret->ktr_code) + S->show(F, S, ret); + + /* Free the state now that it is no longer active. */ + for (i = 0; i < S->i; i++) + free(S->path[i]); + free(S); + break; + } + default: + /* Ignore all other ktrace events. */ + break; + } +} + +/* + * filemon_process(F) + * + * Process all pending events after filemon_readfd(F) has + * selected/polled ready for read. + * + * Returns -1 on failure, 0 on end of events, and anything else if + * there may be more events. + * + * XXX What about fairness to other activities in the event loop? + * If we stop while there's events buffered in F->in, then select + * or poll may not return ready even though there's work queued up + * in the buffer of F->in, but if we don't stop then ktrace events + * may overwhelm all other activity in the event loop. + */ +int +filemon_process(struct filemon *F) +{ + size_t nread; + +top: /* If the child has exited, nothing to do. */ + /* XXX What if one thread calls exit while another is running? */ + if (F->child == 0) + return 0; + + /* If we're waiting for input, read some. */ + if (F->resid > 0) { + nread = fread(F->p, 1, F->resid, F->in); + if (nread == 0) { + if (feof(F->in) != 0) + return 0; + assert(ferror(F->in) != 0); + /* + * If interrupted or would block, there may be + * more events. Otherwise fail. + */ + if (errno == EAGAIN || errno == EINTR) + return 1; + F->state = FILEMON_ERROR; + F->p = NULL; + F->resid = 0; + return -1; + } + assert(nread <= F->resid); + F->p += nread; + F->resid -= nread; + if (F->resid > 0) /* may be more events */ + return 1; + } + + /* Process a state transition now that we've read a buffer. */ + switch (F->state) { + case FILEMON_START: /* just started filemon; read header next */ + F->state = FILEMON_HEADER; + F->p = (void *)&F->hdr; + F->resid = sizeof F->hdr; + goto top; + case FILEMON_HEADER: /* read header */ + /* Sanity-check ktrace header; then read payload. */ + if (F->hdr.ktr_len < 0 || + (size_t)F->hdr.ktr_len > sizeof F->payload) { + F->state = FILEMON_ERROR; + F->p = NULL; + F->resid = 0; + errno = EIO; + return -1; + } + F->state = FILEMON_PAYLOAD; + F->p = (void *)&F->payload; + F->resid = (size_t)F->hdr.ktr_len; + goto top; + case FILEMON_PAYLOAD: /* read header and payload */ + /* Dispatch ktrace event; then read next header. */ + filemon_dispatch(F); + F->state = FILEMON_HEADER; + F->p = (void *)&F->hdr; + F->resid = sizeof F->hdr; + goto top; + default: /* paranoia */ + F->state = FILEMON_ERROR; + /*FALLTHROUGH*/ + case FILEMON_ERROR: /* persistent error indicator */ + F->p = NULL; + F->resid = 0; + errno = EIO; + return -1; + } +} + +static struct filemon_state * +syscall_enter( + const struct filemon_key *key, const struct ktr_syscall *call, + unsigned npath, + void (*show)(struct filemon *, const struct filemon_state *, + const struct ktr_sysret *)) +{ + struct filemon_state *S; + unsigned i; + + S = calloc(1, offsetof(struct filemon_state, path[npath])); + if (S == NULL) + return NULL; + S->key = *key; + S->show = show; + S->syscode = call->ktr_code; + S->i = 0; + S->npath = npath; + for (i = 0; i < npath; i++) + S->path[i] = NULL; /* paranoia */ + + return S; +} + +static void +show_paths(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret, const char *prefix) +{ + unsigned i; + + /* Caller must ensure all paths have been specified. */ + assert(S->i == S->npath); + + /* + * Ignore it if it failed or yielded EJUSTRETURN (-2), or if + * we're not producing output. + */ + if (ret->ktr_error != 0 && ret->ktr_error != -2) + return; + if (F->out == NULL) + return; + + /* + * Print the prefix, pid, and paths -- with the paths quoted if + * there's more than one. + */ + fprintf(F->out, "%s %jd", prefix, (intmax_t)S->key.pid); + for (i = 0; i < S->npath; i++) { + const char *q = S->npath > 1 ? "'" : ""; + fprintf(F->out, " %s%s%s", q, S->path[i], q); + } + fprintf(F->out, "\n"); +} + +static void +show_retval(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret, const char *prefix) +{ + + /* + * Ignore it if it failed or yielded EJUSTRETURN (-2), or if + * we're not producing output. + */ + if (ret->ktr_error != 0 && ret->ktr_error != -2) + return; + if (F->out == NULL) + return; + + fprintf(F->out, "%s %jd %jd\n", prefix, (intmax_t)S->key.pid, + (intmax_t)ret->ktr_retval); +} + +static void +show_chdir(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "C"); +} + +static void +show_execve(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "E"); +} + +static void +show_fork(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_retval(F, S, ret, "F"); +} + +static void +show_link(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "L"); /* XXX same as symlink */ +} + +static void +show_open_read(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "R"); +} + +static void +show_open_write(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "W"); +} + +static void +show_open_readwrite(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "R"); + show_paths(F, S, ret, "W"); +} + +static void +show_openat_read(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + if (S->path[0][0] != '/') + show_paths(F, S, ret, "A"); + show_paths(F, S, ret, "R"); +} + +static void +show_openat_write(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + if (S->path[0][0] != '/') + show_paths(F, S, ret, "A"); + show_paths(F, S, ret, "W"); +} + +static void +show_openat_readwrite(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + if (S->path[0][0] != '/') + show_paths(F, S, ret, "A"); + show_paths(F, S, ret, "R"); + show_paths(F, S, ret, "W"); +} + +static void +show_symlink(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "L"); /* XXX same as link */ +} + +static void +show_unlink(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "D"); +} + +static void +show_rename(struct filemon *F, const struct filemon_state *S, + const struct ktr_sysret *ret) +{ + show_paths(F, S, ret, "M"); +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_chdir(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 1, &show_chdir); +} + +/* TODO: monitor fchdir as well */ + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_execve(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 1, &show_execve); +} + +static struct filemon_state * +filemon_sys_exit(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + const register_t *args = (const void *)&call[1]; + int status = (int)args[0]; + + if (F->out != NULL) { + fprintf(F->out, "X %jd %d\n", (intmax_t)key->pid, status); + if (key->pid == F->child) { + fprintf(F->out, "# Bye bye\n"); + F->child = 0; + } + } + return NULL; +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_fork(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 0, &show_fork); +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_link(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 2, &show_link); +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_open(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + const register_t *args = (const void *)&call[1]; + int flags; + + if (call->ktr_argsize < 2) + return NULL; + flags = (int)args[1]; + + if ((flags & O_RDWR) == O_RDWR) + return syscall_enter(key, call, 1, &show_open_readwrite); + else if ((flags & O_WRONLY) == O_WRONLY) + return syscall_enter(key, call, 1, &show_open_write); + else if ((flags & O_RDONLY) == O_RDONLY) + return syscall_enter(key, call, 1, &show_open_read); + else + return NULL; /* XXX Do we care if no read or write? */ +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_openat(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + const register_t *args = (const void *)&call[1]; + int flags, fd; + + /* + * XXX: In the .meta log, the base directory is missing, which makes + * all references to relative pathnames useless. + */ + + if (call->ktr_argsize < 3) + return NULL; + fd = (int)args[0]; + flags = (int)args[2]; + + if (fd == AT_CWD) { + if ((flags & O_RDWR) == O_RDWR) + return syscall_enter(key, call, 1, + &show_open_readwrite); + else if ((flags & O_WRONLY) == O_WRONLY) + return syscall_enter(key, call, 1, &show_open_write); + else if ((flags & O_RDONLY) == O_RDONLY) + return syscall_enter(key, call, 1, &show_open_read); + else + return NULL; + } else { + if ((flags & O_RDWR) == O_RDWR) + return syscall_enter(key, call, 1, + &show_openat_readwrite); + else if ((flags & O_WRONLY) == O_WRONLY) + return syscall_enter(key, call, 1, &show_openat_write); + else if ((flags & O_RDONLY) == O_RDONLY) + return syscall_enter(key, call, 1, &show_openat_read); + else + return NULL; + } +} + +/* TODO: monitor the other *at syscalls as well, not only openat. */ + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_symlink(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 2, &show_symlink); +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_unlink(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 1, &show_unlink); +} + +/*ARGSUSED*/ +static struct filemon_state * +filemon_sys_rename(struct filemon *F, const struct filemon_key *key, + const struct ktr_syscall *call) +{ + return syscall_enter(key, call, 2, &show_rename); +} diff --git a/usr.bin/make/for.c b/usr.bin/make/for.c index 33bcf1392..5705d9c5d 100644 --- a/usr.bin/make/for.c +++ b/usr.bin/make/for.c @@ -1,4 +1,4 @@ -/* $NetBSD: for.c,v 1.49 2012/06/03 04:29:40 sjg Exp $ */ +/* $NetBSD: for.c,v 1.141 2021/02/04 21:33:13 rillig Exp $ */ /* * Copyright (c) 1992, The Regents of the University of California. @@ -29,106 +29,188 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: for.c,v 1.49 2012/06/03 04:29:40 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: for.c,v 1.49 2012/06/03 04:29:40 sjg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * for.c -- - * Functions to handle loops in a makefile. +/* + * Handling of .for/.endfor loops in a makefile. + * + * For loops have the form: + * + * .for in + * # the body + * .endfor + * + * When a .for line is parsed, the following lines are copied to the body of + * the .for loop, until the corresponding .endfor line is reached. In this + * phase, the body is not yet evaluated. This also applies to any nested + * .for loops. + * + * After reaching the .endfor, the values from the .for line are grouped + * according to the number of variables. For each such group, the unexpanded + * body is scanned for variable expressions, and those that match the variable + * names are replaced with expressions of the form ${:U...} or $(:U...). + * After that, the body is treated like a file from an .include directive. * * Interface: - * For_Eval Evaluate the loop in the passed line. + * For_Eval Evaluate the loop in the passed line. + * * For_Run Run accumulated loop - * */ -#include -#include +#include "make.h" -#include "make.h" -#include "hash.h" -#include "dir.h" -#include "buf.h" -#include "strlist.h" +/* "@(#)for.c 8.1 (Berkeley) 6/6/93" */ +MAKE_RCSID("$NetBSD: for.c,v 1.141 2021/02/04 21:33:13 rillig Exp $"); -#define FOR_SUB_ESCAPE_CHAR 1 -#define FOR_SUB_ESCAPE_BRACE 2 -#define FOR_SUB_ESCAPE_PAREN 4 -/* - * For statements are of the form: - * - * .for in - * ... - * .endfor - * - * The trick is to look for the matching end inside for for loop - * To do that, we count the current nesting level of the for loops. - * and the .endfor statements, accumulating all the statements between - * the initial .for loop and the matching .endfor; - * then we evaluate the for loop for each variable in the varlist. - * - * Note that any nested fors are just passed through; they get handled - * recursively in For_Eval when we're expanding the enclosing for in - * For_Run. - */ +/* One of the variables to the left of the "in" in a .for loop. */ +typedef struct ForVar { + char *name; + size_t nameLen; +} ForVar; -static int forLevel = 0; /* Nesting level */ +typedef struct ForLoop { + Buffer body; /* Unexpanded body of the loop */ + Vector /* of ForVar */ vars; /* Iteration variables */ + Words items; /* Substitution items */ + Buffer curBody; /* Expanded body of the current iteration */ + /* Is any of the names 1 character long? If so, when the variable values + * are substituted, the parser must handle $V expressions as well, not + * only ${V} and $(V). */ + Boolean short_var; + unsigned int sub_next; /* Where to continue iterating */ +} ForLoop; -/* - * State of a for loop. - */ -typedef struct _For { - Buffer buf; /* Body of loop */ - strlist_t vars; /* Iteration variables */ - strlist_t items; /* Substitution items */ - char *parse_buf; - int short_var; - int sub_next; -} For; -static For *accumFor; /* Loop being accumulated */ +static ForLoop *accumFor; /* Loop being accumulated */ +static int forLevel = 0; /* Nesting level */ - -static char * -make_str(const char *ptr, int len) +static ForLoop * +ForLoop_New(void) { - char *new_ptr; + ForLoop *f = bmake_malloc(sizeof *f); - new_ptr = bmake_malloc(len + 1); - memcpy(new_ptr, ptr, len); - new_ptr[len] = 0; - return new_ptr; + Buf_Init(&f->body); + Vector_Init(&f->vars, sizeof(ForVar)); + f->items.words = NULL; + f->items.freeIt = NULL; + Buf_Init(&f->curBody); + f->short_var = FALSE; + f->sub_next = 0; + + return f; } static void -For_Free(For *arg) +ForLoop_Free(ForLoop *f) { - Buf_Destroy(&arg->buf, TRUE); - strlist_clean(&arg->vars); - strlist_clean(&arg->items); - free(arg->parse_buf); + Buf_Done(&f->body); - free(arg); + while (f->vars.len > 0) { + ForVar *var = Vector_Pop(&f->vars); + free(var->name); + } + Vector_Done(&f->vars); + + Words_Free(f->items); + Buf_Done(&f->curBody); + + free(f); } -/*- - *----------------------------------------------------------------------- - * For_Eval -- - * Evaluate the for loop in the passed line. The line - * looks like this: - * .for in +static void +ForLoop_AddVar(ForLoop *f, const char *name, size_t len) +{ + ForVar *var = Vector_Push(&f->vars); + var->name = bmake_strldup(name, len); + var->nameLen = len; +} + +static Boolean +ForLoop_ParseVarnames(ForLoop *f, const char **pp) +{ + const char *p = *pp; + + for (;;) { + size_t len; + + cpp_skip_whitespace(&p); + if (*p == '\0') { + Parse_Error(PARSE_FATAL, "missing `in' in for"); + return FALSE; + } + + /* + * XXX: This allows arbitrary variable names; + * see directive-for.mk. + */ + for (len = 1; p[len] != '\0' && !ch_isspace(p[len]); len++) + continue; + + if (len == 2 && p[0] == 'i' && p[1] == 'n') { + p += 2; + break; + } + if (len == 1) + f->short_var = TRUE; + + ForLoop_AddVar(f, p, len); + p += len; + } + + if (f->vars.len == 0) { + Parse_Error(PARSE_FATAL, "no iteration variables in for"); + return FALSE; + } + + *pp = p; + return TRUE; +} + +static Boolean +ForLoop_ParseItems(ForLoop *f, const char *p) +{ + char *items; + + cpp_skip_whitespace(&p); + + if (Var_Subst(p, SCOPE_GLOBAL, VARE_WANTRES, &items) != VPR_OK) { + Parse_Error(PARSE_FATAL, "Error in .for loop items"); + return FALSE; + } + + f->items = Str_Words(items, FALSE); + free(items); + + if (f->items.len == 1 && f->items.words[0][0] == '\0') + f->items.len = 0; /* .for var in ${:U} */ + + if (f->items.len != 0 && f->items.len % f->vars.len != 0) { + Parse_Error(PARSE_FATAL, + "Wrong number of words (%u) in .for " + "substitution list with %u variables", + (unsigned)f->items.len, (unsigned)f->vars.len); + return FALSE; + } + + return TRUE; +} + +static Boolean +IsFor(const char *p) +{ + return p[0] == 'f' && p[1] == 'o' && p[2] == 'r' && ch_isspace(p[3]); +} + +static Boolean +IsEndfor(const char *p) +{ + return p[0] == 'e' && strncmp(p, "endfor", 6) == 0 && + (p[6] == '\0' || ch_isspace(p[6])); +} + +/* + * Evaluate the for loop in the passed line. The line looks like this: + * .for in * * Input: * line Line to parse @@ -137,360 +219,299 @@ For_Free(For *arg) * 0: Not a .for statement, parse the line * 1: We found a for loop * -1: A .for statement with a bad syntax error, discard. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- */ int -For_Eval(char *line) +For_Eval(const char *line) { - For *new_for; - char *ptr = line, *sub; - int len; - int escapes; - unsigned char ch; - char **words, *word_buf; - int n, nwords; + ForLoop *f; + const char *p; - /* Skip the '.' and any following whitespace */ - for (ptr++; *ptr && isspace((unsigned char) *ptr); ptr++) - continue; + p = line + 1; /* skip the '.' */ + cpp_skip_whitespace(&p); - /* - * If we are not in a for loop quickly determine if the statement is - * a for. - */ - if (ptr[0] != 'f' || ptr[1] != 'o' || ptr[2] != 'r' || - !isspace((unsigned char) ptr[3])) { - if (ptr[0] == 'e' && strncmp(ptr+1, "ndfor", 5) == 0) { - Parse_Error(PARSE_FATAL, "for-less endfor"); - return -1; - } - return 0; - } - ptr += 3; - - /* - * we found a for loop, and now we are going to parse it. - */ - - new_for = bmake_malloc(sizeof *new_for); - memset(new_for, 0, sizeof *new_for); - - /* Grab the variables. Terminate on "in". */ - for (;; ptr += len) { - while (*ptr && isspace((unsigned char) *ptr)) - ptr++; - if (*ptr == '\0') { - Parse_Error(PARSE_FATAL, "missing `in' in for"); - For_Free(new_for); - return -1; - } - for (len = 1; ptr[len] && !isspace((unsigned char)ptr[len]); len++) - continue; - if (len == 2 && ptr[0] == 'i' && ptr[1] == 'n') { - ptr += 2; - break; - } - if (len == 1) - new_for->short_var = 1; - strlist_add_str(&new_for->vars, make_str(ptr, len), len); - } - - if (strlist_num(&new_for->vars) == 0) { - Parse_Error(PARSE_FATAL, "no iteration variables in for"); - For_Free(new_for); - return -1; - } - - while (*ptr && isspace((unsigned char) *ptr)) - ptr++; - - /* - * Make a list with the remaining words - * The values are substituted as ${:U...} so we must \ escape - * characters that break that syntax. - * Variables are fully expanded - so it is safe for escape $. - * We can't do the escapes here - because we don't know whether - * we are substuting into ${...} or $(...). - */ - sub = Var_Subst(NULL, ptr, VAR_GLOBAL, FALSE); - - /* - * Split into words allowing for quoted strings. - */ - words = brk_string(sub, &nwords, FALSE, &word_buf); - - free(sub); - - if (words != NULL) { - for (n = 0; n < nwords; n++) { - ptr = words[n]; - if (!*ptr) - continue; - escapes = 0; - while ((ch = *ptr++)) { - switch(ch) { - case ':': - case '$': - case '\\': - escapes |= FOR_SUB_ESCAPE_CHAR; - break; - case ')': - escapes |= FOR_SUB_ESCAPE_PAREN; - break; - case /*{*/ '}': - escapes |= FOR_SUB_ESCAPE_BRACE; - break; + if (!IsFor(p)) { + if (IsEndfor(p)) { + Parse_Error(PARSE_FATAL, "for-less endfor"); + return -1; } - } - /* - * We have to dup words[n] to maintain the semantics of - * strlist. - */ - strlist_add_str(&new_for->items, bmake_strdup(words[n]), escapes); + return 0; + } + p += 3; + + f = ForLoop_New(); + + if (!ForLoop_ParseVarnames(f, &p)) { + ForLoop_Free(f); + return -1; } - free(words); - free(word_buf); - - if ((len = strlist_num(&new_for->items)) > 0 && - len % (n = strlist_num(&new_for->vars))) { - Parse_Error(PARSE_FATAL, - "Wrong number of words (%d) in .for substitution list" - " with %d vars", len, n); - /* - * Return 'success' so that the body of the .for loop is - * accumulated. - * Remove all items so that the loop doesn't iterate. - */ - strlist_clean(&new_for->items); + if (!ForLoop_ParseItems(f, p)) { + /* Continue parsing the .for loop, but don't iterate. */ + f->items.len = 0; } - } - Buf_Init(&new_for->buf, 0); - accumFor = new_for; - forLevel = 1; - return 1; + accumFor = f; + forLevel = 1; + return 1; } /* - * Add another line to a .for loop. - * Returns 0 when the matching .endfor is reached. + * Add another line to the .for loop that is being built up. + * Returns FALSE when the matching .endfor is reached. */ - -int -For_Accum(char *line) +Boolean +For_Accum(const char *line) { - char *ptr = line; + const char *p = line; - if (*ptr == '.') { + if (*p == '.') { + p++; + cpp_skip_whitespace(&p); - for (ptr++; *ptr && isspace((unsigned char) *ptr); ptr++) - continue; - - if (strncmp(ptr, "endfor", 6) == 0 && - (isspace((unsigned char) ptr[6]) || !ptr[6])) { - if (DEBUG(FOR)) - (void)fprintf(debug_file, "For: end for %d\n", forLevel); - if (--forLevel <= 0) - return 0; - } else if (strncmp(ptr, "for", 3) == 0 && - isspace((unsigned char) ptr[3])) { - forLevel++; - if (DEBUG(FOR)) - (void)fprintf(debug_file, "For: new loop %d\n", forLevel); + if (IsEndfor(p)) { + DEBUG1(FOR, "For: end for %d\n", forLevel); + if (--forLevel <= 0) + return FALSE; + } else if (IsFor(p)) { + forLevel++; + DEBUG1(FOR, "For: new loop %d\n", forLevel); + } } - } - Buf_AddBytes(&accumFor->buf, strlen(line), line); - Buf_AddByte(&accumFor->buf, '\n'); - return 1; + Buf_AddStr(&accumFor->body, line); + Buf_AddByte(&accumFor->body, '\n'); + return TRUE; } - -/*- - *----------------------------------------------------------------------- - * For_Run -- - * Run the for loop, imitating the actions of an include file - * - * Results: - * None. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -static int +static size_t for_var_len(const char *var) { - char ch, var_start, var_end; - int depth; - int len; + char ch, var_start, var_end; + int depth; + size_t len; - var_start = *var; - if (var_start == 0) - /* just escape the $ */ + var_start = *var; + if (var_start == '\0') + /* just escape the $ */ + return 0; + + if (var_start == '(') + var_end = ')'; + else if (var_start == '{') + var_end = '}'; + else + return 1; /* Single char variable */ + + depth = 1; + for (len = 1; (ch = var[len++]) != '\0';) { + if (ch == var_start) + depth++; + else if (ch == var_end && --depth == 0) + return len; + } + + /* Variable end not found, escape the $ */ return 0; - - if (var_start == '(') - var_end = ')'; - else if (var_start == '{') - var_end = '}'; - else - /* Single char variable */ - return 1; - - depth = 1; - for (len = 1; (ch = var[len++]) != 0;) { - if (ch == var_start) - depth++; - else if (ch == var_end && --depth == 0) - return len; - } - - /* Variable end not found, escape the $ */ - return 0; } +/* + * The .for loop substitutes the items as ${:U...}, which means + * that characters that break this syntax must be backslash-escaped. + */ +static Boolean +NeedsEscapes(const char *value, char endc) +{ + const char *p; + + for (p = value; *p != '\0'; p++) { + if (*p == ':' || *p == '$' || *p == '\\' || *p == endc) + return TRUE; + } + return FALSE; +} + +/* + * While expanding the body of a .for loop, write the item in the ${:U...} + * expression, escaping characters as needed. + * + * The result is later unescaped by ApplyModifier_Defined. + */ static void -for_substitute(Buffer *cmds, strlist_t *items, unsigned int item_no, char ech) +Buf_AddEscaped(Buffer *cmds, const char *item, char endc) { - const char *item = strlist_str(items, item_no); - int len; - char ch; + char ch; - /* If there were no escapes, or the only escape is the other variable - * terminator, then just substitute the full string */ - if (!(strlist_info(items, item_no) & - (ech == ')' ? ~FOR_SUB_ESCAPE_BRACE : ~FOR_SUB_ESCAPE_PAREN))) { - Buf_AddBytes(cmds, strlen(item), item); + if (!NeedsEscapes(item, endc)) { + Buf_AddStr(cmds, item); + return; + } + + /* Escape ':', '$', '\\' and 'endc' - these will be removed later by + * :U processing, see ApplyModifier_Defined. */ + while ((ch = *item++) != '\0') { + if (ch == '$') { + size_t len = for_var_len(item); + if (len != 0) { + Buf_AddBytes(cmds, item - 1, len + 1); + item += len; + continue; + } + Buf_AddByte(cmds, '\\'); + } else if (ch == ':' || ch == '\\' || ch == endc) + Buf_AddByte(cmds, '\\'); + Buf_AddByte(cmds, ch); + } +} + +/* + * While expanding the body of a .for loop, replace the variable name of an + * expression like ${i} or ${i:...} or $(i) or $(i:...) with ":Uvalue". + */ +static void +ForLoop_SubstVarLong(ForLoop *f, const char **pp, const char *bodyEnd, + char endc, const char **inout_mark) +{ + size_t i; + const char *p = *pp; + + for (i = 0; i < f->vars.len; i++) { + ForVar *forVar = Vector_Get(&f->vars, i); + char *varname = forVar->name; + size_t varnameLen = forVar->nameLen; + + if (varnameLen >= (size_t)(bodyEnd - p)) + continue; + if (memcmp(p, varname, varnameLen) != 0) + continue; + /* XXX: why test for backslash here? */ + if (p[varnameLen] != ':' && p[varnameLen] != endc && + p[varnameLen] != '\\') + continue; + + /* + * Found a variable match. Skip over the variable name and + * instead add ':U' to the current body. + */ + Buf_AddBytesBetween(&f->curBody, *inout_mark, p); + Buf_AddStr(&f->curBody, ":U"); + Buf_AddEscaped(&f->curBody, + f->items.words[f->sub_next + i], endc); + + p += varnameLen; + *inout_mark = p; + *pp = p; + return; + } +} + +/* + * While expanding the body of a .for loop, replace single-character + * variable expressions like $i with their ${:U...} expansion. + */ +static void +ForLoop_SubstVarShort(ForLoop *f, const char *p, const char **inout_mark) +{ + const char ch = *p; + ForVar *vars; + size_t i; + + /* Skip $$ and stupid ones. */ + if (!f->short_var || strchr("}):$", ch) != NULL) + return; + + vars = Vector_Get(&f->vars, 0); + for (i = 0; i < f->vars.len; i++) { + const char *varname = vars[i].name; + if (varname[0] == ch && varname[1] == '\0') + goto found; + } return; - } - /* Escape ':', '$', '\\' and 'ech' - removed by :U processing */ - while ((ch = *item++) != 0) { - if (ch == '$') { - len = for_var_len(item); - if (len != 0) { - Buf_AddBytes(cmds, len + 1, item - 1); - item += len; - continue; - } - Buf_AddByte(cmds, '\\'); - } else if (ch == ':' || ch == '\\' || ch == ech) - Buf_AddByte(cmds, '\\'); - Buf_AddByte(cmds, ch); - } +found: + /* Replace $ with ${:U} */ + Buf_AddBytesBetween(&f->curBody, *inout_mark, p), *inout_mark = p + 1; + Buf_AddStr(&f->curBody, "{:U"); + Buf_AddEscaped(&f->curBody, f->items.words[f->sub_next + i], '}'); + Buf_AddByte(&f->curBody, '}'); } -static char * -For_Iterate(void *v_arg, size_t *ret_len) +/* + * Compute the body for the current iteration by copying the unexpanded body, + * replacing the expressions for the iteration variables on the way. + * + * Using variable expressions ensures that the .for loop can't generate + * syntax, and that the later parsing will still see a variable. + * This code assumes that the variable with the empty name will never be + * defined, see unit-tests/varname-empty.mk for more details. + * + * The detection of substitutions of the loop control variables is naive. + * Many of the modifiers use '\' to escape '$' (not '$'), so it is possible + * to contrive a makefile where an unwanted substitution happens. + */ +static void +ForLoop_SubstBody(ForLoop *f) { - For *arg = v_arg; - int i, len; - char *var; - char *cp; - char *cmd_cp; - char *body_end; - char ch; - Buffer cmds; + const char *p, *bodyEnd; + const char *mark; /* where the last replacement left off */ - if (arg->sub_next + strlist_num(&arg->vars) > strlist_num(&arg->items)) { - /* No more iterations */ - For_Free(arg); - return NULL; - } + Buf_Empty(&f->curBody); - free(arg->parse_buf); - arg->parse_buf = NULL; - - /* - * Scan the for loop body and replace references to the loop variables - * with variable references that expand to the required text. - * Using variable expansions ensures that the .for loop can't generate - * syntax, and that the later parsing will still see a variable. - * We assume that the null variable will never be defined. - * - * The detection of substitions of the loop control variable is naive. - * Many of the modifiers use \ to escape $ (not $) so it is possible - * to contrive a makefile where an unwanted substitution happens. - */ - - cmd_cp = Buf_GetAll(&arg->buf, &len); - body_end = cmd_cp + len; - Buf_Init(&cmds, len + 256); - for (cp = cmd_cp; (cp = strchr(cp, '$')) != NULL;) { - char ech; - ch = *++cp; - if ((ch == '(' && (ech = ')')) || (ch == '{' && (ech = '}'))) { - cp++; - /* Check variable name against the .for loop variables */ - STRLIST_FOREACH(var, &arg->vars, i) { - len = strlist_info(&arg->vars, i); - if (memcmp(cp, var, len) != 0) - continue; - if (cp[len] != ':' && cp[len] != ech && cp[len] != '\\') - continue; - /* Found a variable match. Replace with :U */ - Buf_AddBytes(&cmds, cp - cmd_cp, cmd_cp); - Buf_AddBytes(&cmds, 2, ":U"); - cp += len; - cmd_cp = cp; - for_substitute(&cmds, &arg->items, arg->sub_next + i, ech); - break; - } - continue; + mark = f->body.data; + bodyEnd = f->body.data + f->body.len; + for (p = mark; (p = strchr(p, '$')) != NULL;) { + if (p[1] == '{' || p[1] == '(') { + p += 2; + ForLoop_SubstVarLong(f, &p, bodyEnd, + p[-1] == '{' ? '}' : ')', &mark); + } else if (p[1] != '\0') { + ForLoop_SubstVarShort(f, p + 1, &mark); + p += 2; + } else + break; } - if (ch == 0) - break; - /* Probably a single character name, ignore $$ and stupid ones. {*/ - if (!arg->short_var || strchr("}):$", ch) != NULL) { - cp++; - continue; - } - STRLIST_FOREACH(var, &arg->vars, i) { - if (var[0] != ch || var[1] != 0) - continue; - /* Found a variable match. Replace with ${:U} */ - Buf_AddBytes(&cmds, cp - cmd_cp, cmd_cp); - Buf_AddBytes(&cmds, 3, "{:U"); - cmd_cp = ++cp; - for_substitute(&cmds, &arg->items, arg->sub_next + i, /*{*/ '}'); - Buf_AddBytes(&cmds, 1, "}"); - break; - } - } - Buf_AddBytes(&cmds, body_end - cmd_cp, cmd_cp); - cp = Buf_Destroy(&cmds, FALSE); - if (DEBUG(FOR)) - (void)fprintf(debug_file, "For: loop body:\n%s", cp); - - arg->sub_next += strlist_num(&arg->vars); - - arg->parse_buf = cp; - *ret_len = strlen(cp); - return cp; + Buf_AddBytesBetween(&f->curBody, mark, bodyEnd); } +/* + * Compute the body for the current iteration by copying the unexpanded body, + * replacing the expressions for the iteration variables on the way. + */ +static char * +ForReadMore(void *v_arg, size_t *out_len) +{ + ForLoop *f = v_arg; + + if (f->sub_next == f->items.len) { + /* No more iterations */ + ForLoop_Free(f); + return NULL; + } + + ForLoop_SubstBody(f); + DEBUG1(FOR, "For: loop body:\n%s", f->curBody.data); + f->sub_next += (unsigned int)f->vars.len; + + *out_len = f->curBody.len; + return f->curBody.data; +} + +/* Run the .for loop, imitating the actions of an include file. */ void For_Run(int lineno) -{ - For *arg; - - arg = accumFor; - accumFor = NULL; +{ + ForLoop *f = accumFor; + accumFor = NULL; - if (strlist_num(&arg->items) == 0) { - /* Nothing to expand - possibly due to an earlier syntax error. */ - For_Free(arg); - return; - } - - Parse_SetInput(NULL, lineno, -1, For_Iterate, arg); + if (f->items.len == 0) { + /* + * Nothing to expand - possibly due to an earlier syntax + * error. + */ + ForLoop_Free(f); + return; + } + + Parse_SetInput(NULL, lineno, -1, ForReadMore, f); } diff --git a/usr.bin/make/hash.c b/usr.bin/make/hash.c index ed2364443..3afc4ac7e 100644 --- a/usr.bin/make/hash.c +++ b/usr.bin/make/hash.c @@ -1,4 +1,4 @@ -/* $NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $ */ +/* $NetBSD: hash.c,v 1.61 2021/02/01 17:32:10 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -69,398 +69,264 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: hash.c,v 1.20 2013/11/14 00:27:05 sjg Exp $"); -#endif -#endif /* not lint */ -#endif +/* Hash tables with string keys. */ -/* hash.c -- - * - * This module contains routines to manipulate a hash table. - * See hash.h for a definition of the structure of the hash - * table. Hash tables grow automatically as the amount of - * information increases. - */ -#include "sprite.h" #include "make.h" -#include "hash.h" + +/* "@(#)hash.c 8.1 (Berkeley) 6/6/93" */ +MAKE_RCSID("$NetBSD: hash.c,v 1.61 2021/02/01 17:32:10 rillig Exp $"); /* - * Forward references to local procedures that are used before they're - * defined: + * The ratio of # entries to # buckets at which we rebuild the table to + * make it larger. */ - -static void RebuildTable(Hash_Table *); - -/* - * The following defines the ratio of # entries to # buckets - * at which we rebuild the table to make it larger. - */ - #define rebuildLimit 3 -/* - *--------------------------------------------------------- - * - * Hash_InitTable -- - * - * This routine just sets up the hash table. - * - * Input: - * t Structure to to hold table. - * numBuckets How many buckets to create for starters. This - * number is rounded up to a power of two. If - * <= 0, a reasonable default is chosen. The - * table will grow in size later as needed. - * - * Results: - * None. - * - * Side Effects: - * Memory is allocated for the initial bucket area. - * - *--------------------------------------------------------- - */ - -void -Hash_InitTable(Hash_Table *t, int numBuckets) +/* This hash function matches Gosling's Emacs and java.lang.String. */ +static unsigned int +hash(const char *key, size_t *out_keylen) { - int i; - struct Hash_Entry **hp; + unsigned int h; + const char *p; - /* - * Round up the size to a power of two. - */ - if (numBuckets <= 0) - i = 16; - else { - for (i = 2; i < numBuckets; i <<= 1) - continue; + h = 0; + for (p = key; *p != '\0'; p++) + h = 31 * h + (unsigned char)*p; + + if (out_keylen != NULL) + *out_keylen = (size_t)(p - key); + return h; +} + +unsigned int +Hash_Hash(const char *key) +{ + return hash(key, NULL); +} + +static HashEntry * +HashTable_Find(HashTable *t, unsigned int h, const char *key) +{ + HashEntry *e; + unsigned int chainlen = 0; + +#ifdef DEBUG_HASH_LOOKUP + DEBUG4(HASH, "%s: %p h=%08x key=%s\n", __func__, t, h, key); +#endif + + for (e = t->buckets[h & t->bucketsMask]; e != NULL; e = e->next) { + chainlen++; + if (e->key_hash == h && strcmp(e->key, key) == 0) + break; } + + if (chainlen > t->maxchain) + t->maxchain = chainlen; + + return e; +} + +/* Set up the hash table. */ +void +HashTable_Init(HashTable *t) +{ + unsigned int n = 16, i; + HashEntry **buckets = bmake_malloc(sizeof *buckets * n); + for (i = 0; i < n; i++) + buckets[i] = NULL; + + t->buckets = buckets; + t->bucketsSize = n; t->numEntries = 0; - t->size = i; - t->mask = i - 1; - t->bucketPtr = hp = bmake_malloc(sizeof(*hp) * i); - while (--i >= 0) - *hp++ = NULL; + t->bucketsMask = n - 1; + t->maxchain = 0; } /* - *--------------------------------------------------------- - * - * Hash_DeleteTable -- - * - * This routine removes everything from a hash table - * and frees up the memory space it occupied (except for - * the space in the Hash_Table structure). - * - * Results: - * None. - * - * Side Effects: - * Lots of memory is freed up. - * - *--------------------------------------------------------- + * Remove everything from the hash table and free up the memory for the keys + * of the hash table, but not for the values associated to these keys. */ - void -Hash_DeleteTable(Hash_Table *t) +HashTable_Done(HashTable *t) { - struct Hash_Entry **hp, *h, *nexth = NULL; - int i; + HashEntry **buckets = t->buckets; + size_t i, n = t->bucketsSize; - for (hp = t->bucketPtr, i = t->size; --i >= 0;) { - for (h = *hp++; h != NULL; h = nexth) { - nexth = h->next; - free(h); - } - } - free(t->bucketPtr); - - /* - * Set up the hash table to cause memory faults on any future access - * attempts until re-initialization. - */ - t->bucketPtr = NULL; -} - -/* - *--------------------------------------------------------- - * - * Hash_FindEntry -- - * - * Searches a hash table for an entry corresponding to key. - * - * Input: - * t Hash table to search. - * key A hash key. - * - * Results: - * The return value is a pointer to the entry for key, - * if key was present in the table. If key was not - * present, NULL is returned. - * - * Side Effects: - * None. - * - *--------------------------------------------------------- - */ - -Hash_Entry * -Hash_FindEntry(Hash_Table *t, const char *key) -{ - Hash_Entry *e; - unsigned h; - const char *p; - - if (t == NULL || t->bucketPtr == NULL) { - return NULL; - } - for (h = 0, p = key; *p;) - h = (h << 5) - h + *p++; - p = key; - for (e = t->bucketPtr[h & t->mask]; e != NULL; e = e->next) - if (e->namehash == h && strcmp(e->name, p) == 0) - return (e); - return NULL; -} - -/* - *--------------------------------------------------------- - * - * Hash_CreateEntry -- - * - * Searches a hash table for an entry corresponding to - * key. If no entry is found, then one is created. - * - * Input: - * t Hash table to search. - * key A hash key. - * newPtr Filled in with TRUE if new entry created, - * FALSE otherwise. - * - * Results: - * The return value is a pointer to the entry. If *newPtr - * isn't NULL, then *newPtr is filled in with TRUE if a - * new entry was created, and FALSE if an entry already existed - * with the given key. - * - * Side Effects: - * Memory may be allocated, and the hash buckets may be modified. - *--------------------------------------------------------- - */ - -Hash_Entry * -Hash_CreateEntry(Hash_Table *t, const char *key, Boolean *newPtr) -{ - Hash_Entry *e; - unsigned h; - const char *p; - int keylen; - struct Hash_Entry **hp; - - /* - * Hash the key. As a side effect, save the length (strlen) of the - * key in case we need to create the entry. - */ - for (h = 0, p = key; *p;) - h = (h << 5) - h + *p++; - keylen = p - key; - p = key; - for (e = t->bucketPtr[h & t->mask]; e != NULL; e = e->next) { - if (e->namehash == h && strcmp(e->name, p) == 0) { - if (newPtr != NULL) - *newPtr = FALSE; - return (e); + for (i = 0; i < n; i++) { + HashEntry *he = buckets[i]; + while (he != NULL) { + HashEntry *next = he->next; + free(he); + he = next; } } - /* - * The desired entry isn't there. Before allocating a new entry, - * expand the table if necessary (and this changes the resulting - * bucket chain). - */ - if (t->numEntries >= rebuildLimit * t->size) - RebuildTable(t); - e = bmake_malloc(sizeof(*e) + keylen); - hp = &t->bucketPtr[h & t->mask]; - e->next = *hp; - *hp = e; - Hash_SetValue(e, NULL); - e->namehash = h; - (void)strcpy(e->name, p); + free(t->buckets); +#ifdef CLEANUP + t->buckets = NULL; +#endif +} + +/* Find the entry corresponding to the key, or return NULL. */ +HashEntry * +HashTable_FindEntry(HashTable *t, const char *key) +{ + unsigned int h = hash(key, NULL); + return HashTable_Find(t, h, key); +} + +/* Find the value corresponding to the key, or return NULL. */ +void * +HashTable_FindValue(HashTable *t, const char *key) +{ + HashEntry *he = HashTable_FindEntry(t, key); + return he != NULL ? he->value : NULL; +} + +/* + * Find the value corresponding to the key and the precomputed hash, + * or return NULL. + */ +void * +HashTable_FindValueHash(HashTable *t, const char *key, unsigned int h) +{ + HashEntry *he = HashTable_Find(t, h, key); + return he != NULL ? he->value : NULL; +} + +/* + * Make the hash table larger. Any bucket numbers from the old table become + * invalid; the hash codes stay valid though. + */ +static void +HashTable_Enlarge(HashTable *t) +{ + unsigned int oldSize = t->bucketsSize; + HashEntry **oldBuckets = t->buckets; + unsigned int newSize = 2 * oldSize; + unsigned int newMask = newSize - 1; + HashEntry **newBuckets = bmake_malloc(sizeof *newBuckets * newSize); + size_t i; + + for (i = 0; i < newSize; i++) + newBuckets[i] = NULL; + + for (i = 0; i < oldSize; i++) { + HashEntry *he = oldBuckets[i]; + while (he != NULL) { + HashEntry *next = he->next; + he->next = newBuckets[he->key_hash & newMask]; + newBuckets[he->key_hash & newMask] = he; + he = next; + } + } + + free(oldBuckets); + + t->bucketsSize = newSize; + t->bucketsMask = newMask; + t->buckets = newBuckets; + DEBUG5(HASH, "%s: %p size=%d entries=%d maxchain=%d\n", + __func__, t, t->bucketsSize, t->numEntries, t->maxchain); + t->maxchain = 0; +} + +/* + * Find or create an entry corresponding to the key. + * Return in out_isNew whether a new entry has been created. + */ +HashEntry * +HashTable_CreateEntry(HashTable *t, const char *key, Boolean *out_isNew) +{ + size_t keylen; + unsigned int h = hash(key, &keylen); + HashEntry *he = HashTable_Find(t, h, key); + + if (he != NULL) { + if (out_isNew != NULL) + *out_isNew = FALSE; + return he; + } + + if (t->numEntries >= rebuildLimit * t->bucketsSize) + HashTable_Enlarge(t); + + he = bmake_malloc(sizeof *he + keylen); + he->value = NULL; + he->key_hash = h; + memcpy(he->key, key, keylen + 1); + + he->next = t->buckets[h & t->bucketsMask]; + t->buckets[h & t->bucketsMask] = he; t->numEntries++; - if (newPtr != NULL) - *newPtr = TRUE; - return (e); + if (out_isNew != NULL) + *out_isNew = TRUE; + return he; } -/* - *--------------------------------------------------------- - * - * Hash_DeleteEntry -- - * - * Delete the given hash table entry and free memory associated with - * it. - * - * Results: - * None. - * - * Side Effects: - * Hash chain that entry lives in is modified and memory is freed. - * - *--------------------------------------------------------- - */ - -void -Hash_DeleteEntry(Hash_Table *t, Hash_Entry *e) +HashEntry * +HashTable_Set(HashTable *t, const char *key, void *value) { - Hash_Entry **hp, *p; + HashEntry *he = HashTable_CreateEntry(t, key, NULL); + HashEntry_Set(he, value); + return he; +} - if (e == NULL) - return; - for (hp = &t->bucketPtr[e->namehash & t->mask]; - (p = *hp) != NULL; hp = &p->next) { - if (p == e) { - *hp = p->next; +/* Delete the entry from the table and free the associated memory. */ +void +HashTable_DeleteEntry(HashTable *t, HashEntry *he) +{ + HashEntry **ref = &t->buckets[he->key_hash & t->bucketsMask]; + HashEntry *p; + + for (; (p = *ref) != NULL; ref = &p->next) { + if (p == he) { + *ref = p->next; free(p); t->numEntries--; return; } } - (void)write(2, "bad call to Hash_DeleteEntry\n", 29); abort(); } -/* - *--------------------------------------------------------- - * - * Hash_EnumFirst -- - * This procedure sets things up for a complete search - * of all entries recorded in the hash table. - * - * Input: - * t Table to be searched. - * searchPtr Area in which to keep state about search. - * - * Results: - * The return value is the address of the first entry in - * the hash table, or NULL if the table is empty. - * - * Side Effects: - * The information in searchPtr is initialized so that successive - * calls to Hash_Next will return successive HashEntry's - * from the table. - * - *--------------------------------------------------------- - */ - -Hash_Entry * -Hash_EnumFirst(Hash_Table *t, Hash_Search *searchPtr) +/* Set things up for iterating over all entries in the hash table. */ +void +HashIter_Init(HashIter *hi, HashTable *t) { - searchPtr->tablePtr = t; - searchPtr->nextIndex = 0; - searchPtr->hashEntryPtr = NULL; - return Hash_EnumNext(searchPtr); + hi->table = t; + hi->nextBucket = 0; + hi->entry = NULL; } /* - *--------------------------------------------------------- - * - * Hash_EnumNext -- - * This procedure returns successive entries in the hash table. - * - * Input: - * searchPtr Area used to keep state about search. - * - * Results: - * The return value is a pointer to the next HashEntry - * in the table, or NULL when the end of the table is - * reached. - * - * Side Effects: - * The information in searchPtr is modified to advance to the - * next entry. - * - *--------------------------------------------------------- + * Return the next entry in the hash table, or NULL if the end of the table + * is reached. */ - -Hash_Entry * -Hash_EnumNext(Hash_Search *searchPtr) +HashEntry * +HashIter_Next(HashIter *hi) { - Hash_Entry *e; - Hash_Table *t = searchPtr->tablePtr; + HashTable *t = hi->table; + HashEntry *he = hi->entry; + HashEntry **buckets = t->buckets; + unsigned int bucketsSize = t->bucketsSize; - /* - * The hashEntryPtr field points to the most recently returned - * entry, or is nil if we are starting up. If not nil, we have - * to start at the next one in the chain. - */ - e = searchPtr->hashEntryPtr; - if (e != NULL) - e = e->next; - /* - * If the chain ran out, or if we are starting up, we need to - * find the next nonempty chain. - */ - while (e == NULL) { - if (searchPtr->nextIndex >= t->size) + if (he != NULL) + he = he->next; /* skip the most recently returned entry */ + + while (he == NULL) { /* find the next nonempty chain */ + if (hi->nextBucket >= bucketsSize) return NULL; - e = t->bucketPtr[searchPtr->nextIndex++]; + he = buckets[hi->nextBucket++]; } - searchPtr->hashEntryPtr = e; - return (e); + hi->entry = he; + return he; } -/* - *--------------------------------------------------------- - * - * RebuildTable -- - * This local routine makes a new hash table that - * is larger than the old one. - * - * Results: - * None. - * - * Side Effects: - * The entire hash table is moved, so any bucket numbers - * from the old table are invalid. - * - *--------------------------------------------------------- - */ - -static void -RebuildTable(Hash_Table *t) +void +HashTable_DebugStats(HashTable *t, const char *name) { - Hash_Entry *e, *next = NULL, **hp, **xp; - int i, mask; - Hash_Entry **oldhp; - int oldsize; - - oldhp = t->bucketPtr; - oldsize = i = t->size; - i <<= 1; - t->size = i; - t->mask = mask = i - 1; - t->bucketPtr = hp = bmake_malloc(sizeof(*hp) * i); - while (--i >= 0) - *hp++ = NULL; - for (hp = oldhp, i = oldsize; --i >= 0;) { - for (e = *hp++; e != NULL; e = next) { - next = e->next; - xp = &t->bucketPtr[e->namehash & mask]; - e->next = *xp; - *xp = e; - } - } - free(oldhp); + DEBUG4(HASH, "HashTable %s: size=%u numEntries=%u maxchain=%u\n", + name, t->bucketsSize, t->numEntries, t->maxchain); } diff --git a/usr.bin/make/hash.h b/usr.bin/make/hash.h index 31d2ff1ea..b101137aa 100644 --- a/usr.bin/make/hash.h +++ b/usr.bin/make/hash.h @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.10 2009/01/24 10:59:09 dsl Exp $ */ +/* $NetBSD: hash.h,v 1.38 2020/12/15 01:23:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -72,83 +72,99 @@ * from: @(#)hash.h 8.1 (Berkeley) 6/6/93 */ -/* hash.h -- - * - * This file contains definitions used by the hash module, - * which maintains hash tables. - */ +/* Hash tables with strings as keys and arbitrary pointers as values. */ -#ifndef _HASH -#define _HASH +#ifndef MAKE_HASH_H +#define MAKE_HASH_H -/* - * The following defines one entry in the hash table. - */ +/* A single key-value entry in the hash table. */ +typedef struct HashEntry { + struct HashEntry *next; /* Used to link together all the entries + * associated with the same bucket. */ + void *value; + unsigned int key_hash; /* hash value of the key */ + char key[1]; /* key string, variable length */ +} HashEntry; -typedef struct Hash_Entry { - struct Hash_Entry *next; /* Used to link together all the - * entries associated with the same - * bucket. */ - union { - void *clientPtr; /* Arbitrary pointer */ - time_t clientTime; /* Arbitrary Time */ - } clientInfo; - unsigned namehash; /* hash value of key */ - char name[1]; /* key string */ -} Hash_Entry; +/* The hash table containing the entries. */ +typedef struct HashTable { + HashEntry **buckets; /* Pointers to HashEntry, one + * for each bucket in the table. */ + unsigned int bucketsSize; + unsigned int numEntries; /* Number of entries in the table. */ + unsigned int bucketsMask; /* Used to select the bucket for a hash. */ + unsigned int maxchain; /* max length of chain detected */ +} HashTable; -typedef struct Hash_Table { - struct Hash_Entry **bucketPtr;/* Pointers to Hash_Entry, one - * for each bucket in the table. */ - int size; /* Actual size of array. */ - int numEntries; /* Number of entries in the table. */ - int mask; /* Used to select bits for hashing. */ -} Hash_Table; +/* State of an iteration over all entries in a table. */ +typedef struct HashIter { + HashTable *table; /* Table being searched. */ + unsigned int nextBucket; /* Next bucket to check (after current). */ + HashEntry *entry; /* Next entry to check in current bucket. */ +} HashIter; -/* - * The following structure is used by the searching routines - * to record where we are in the search. - */ +/* A set of strings. */ +typedef struct HashSet { + HashTable tbl; +} HashSet; -typedef struct Hash_Search { - Hash_Table *tablePtr; /* Table being searched. */ - int nextIndex; /* Next bucket to check (after current). */ - Hash_Entry *hashEntryPtr; /* Next entry to check in current bucket. */ -} Hash_Search; +MAKE_INLINE void * +HashEntry_Get(HashEntry *h) +{ + return h->value; +} -/* - * Macros. - */ +MAKE_INLINE void +HashEntry_Set(HashEntry *h, void *datum) +{ + h->value = datum; +} -/* - * void * Hash_GetValue(h) - * Hash_Entry *h; - */ +void HashTable_Init(HashTable *); +void HashTable_Done(HashTable *); +HashEntry *HashTable_FindEntry(HashTable *, const char *); +void *HashTable_FindValue(HashTable *, const char *); +unsigned int Hash_Hash(const char *); +void *HashTable_FindValueHash(HashTable *, const char *, unsigned int); +HashEntry *HashTable_CreateEntry(HashTable *, const char *, Boolean *); +HashEntry *HashTable_Set(HashTable *, const char *, void *); +void HashTable_DeleteEntry(HashTable *, HashEntry *); +void HashTable_DebugStats(HashTable *, const char *); -#define Hash_GetValue(h) ((h)->clientInfo.clientPtr) -#define Hash_GetTimeValue(h) ((h)->clientInfo.clientTime) +void HashIter_Init(HashIter *, HashTable *); +HashEntry *HashIter_Next(HashIter *); -/* - * Hash_SetValue(h, val); - * Hash_Entry *h; - * char *val; - */ +MAKE_INLINE void +HashSet_Init(HashSet *set) +{ + HashTable_Init(&set->tbl); +} -#define Hash_SetValue(h, val) ((h)->clientInfo.clientPtr = (val)) -#define Hash_SetTimeValue(h, val) ((h)->clientInfo.clientTime = (val)) +MAKE_INLINE void +HashSet_Done(HashSet *set) +{ + HashTable_Done(&set->tbl); +} -/* - * Hash_Size(n) returns the number of words in an object of n bytes - */ +MAKE_INLINE Boolean +HashSet_Add(HashSet *set, const char *key) +{ + Boolean isNew; -#define Hash_Size(n) (((n) + sizeof (int) - 1) / sizeof (int)) + (void)HashTable_CreateEntry(&set->tbl, key, &isNew); + return isNew; +} -void Hash_InitTable(Hash_Table *, int); -void Hash_DeleteTable(Hash_Table *); -Hash_Entry *Hash_FindEntry(Hash_Table *, const char *); -Hash_Entry *Hash_CreateEntry(Hash_Table *, const char *, Boolean *); -void Hash_DeleteEntry(Hash_Table *, Hash_Entry *); -Hash_Entry *Hash_EnumFirst(Hash_Table *, Hash_Search *); -Hash_Entry *Hash_EnumNext(Hash_Search *); +MAKE_INLINE Boolean +HashSet_Contains(HashSet *set, const char *key) +{ + return HashTable_FindEntry(&set->tbl, key) != NULL; +} -#endif /* _HASH */ +MAKE_INLINE void +HashIter_InitSet(HashIter *hi, HashSet *set) +{ + HashIter_Init(hi, &set->tbl); +} + +#endif /* MAKE_HASH_H */ diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c index 1cd3b0c76..e9c6803a2 100644 --- a/usr.bin/make/job.c +++ b/usr.bin/make/job.c @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $ */ +/* $NetBSD: job.c,v 1.420 2021/02/05 22:15:44 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -69,68 +69,57 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; -#else -__RCSID("$NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- +/* * job.c -- * handle the creation etc. of our child processes. * * Interface: - * Job_Make Start the creation of the given target. + * Job_Init Called to initialize this module. In addition, + * the .BEGIN target is made including all of its + * dependencies before this function returns. + * Hence, the makefiles must have been parsed + * before this function is called. * - * Job_CatchChildren Check for and handle the termination of any - * children. This must be called reasonably - * frequently to keep the whole make going at - * a decent clip, since job table entries aren't - * removed until their process is caught this way. + * Job_End Clean up any memory used. * - * Job_CatchOutput Print any output our children have produced. - * Should also be called fairly frequently to - * keep the user informed of what's going on. - * If no output is waiting, it will block for - * a time given by the SEL_* constants, below, - * or until output is ready. + * Job_Make Start the creation of the given target. * - * Job_Init Called to intialize this module. in addition, - * any commands attached to the .BEGIN target - * are executed before this function returns. - * Hence, the makefile must have been parsed - * before this function is called. + * Job_CatchChildren + * Check for and handle the termination of any + * children. This must be called reasonably + * frequently to keep the whole make going at + * a decent clip, since job table entries aren't + * removed until their process is caught this way. * - * Job_End Cleanup any memory used. + * Job_CatchOutput + * Print any output our children have produced. + * Should also be called fairly frequently to + * keep the user informed of what's going on. + * If no output is waiting, it will block for + * a time given by the SEL_* constants, below, + * or until output is ready. * - * Job_ParseShell Given the line following a .SHELL target, parse - * the line as a shell specification. Returns - * FAILURE if the spec was incorrect. + * Job_ParseShell Given a special dependency line with target '.SHELL', + * define the shell that is used for the creation + * commands in jobs mode. * - * Job_Finish Perform any final processing which needs doing. - * This includes the execution of any commands - * which have been/were attached to the .END - * target. It should only be called when the - * job table is empty. + * Job_Finish Perform any final processing which needs doing. + * This includes the execution of any commands + * which have been/were attached to the .END + * target. It should only be called when the + * job table is empty. * - * Job_AbortAll Abort all currently running jobs. It doesn't - * handle output or do anything for the jobs, - * just kills them. It should only be called in - * an emergency, as it were. + * Job_AbortAll Abort all currently running jobs. Do not handle + * output or do anything for the jobs, just kill them. + * Should only be called in an emergency. * - * Job_CheckCommands Verify that the commands for a target are - * ok. Provide them if necessary and possible. + * Job_CheckCommands + * Verify that the commands for a target are + * ok. Provide them if necessary and possible. * - * Job_Touch Update a target without really updating it. + * Job_Touch Update a target without really updating it. * - * Job_Wait Wait for all currently-running jobs to finish. + * Job_Wait Wait for all currently-running jobs to finish. */ #include @@ -139,79 +128,159 @@ __RCSID("$NetBSD: job.c,v 1.180 2015/04/16 13:31:03 joerg Exp $"); #include #include -#include #include -#include #ifndef USE_SELECT #include #endif #include -#include -#include #include #include "make.h" -#include "hash.h" #include "dir.h" #include "job.h" #include "pathnames.h" #include "trace.h" -# define STATIC static + +/* "@(#)job.c 8.2 (Berkeley) 3/19/94" */ +MAKE_RCSID("$NetBSD: job.c,v 1.420 2021/02/05 22:15:44 sjg Exp $"); + +/* + * A shell defines how the commands are run. All commands for a target are + * written into a single file, which is then given to the shell to execute + * the commands from it. The commands are written to the file using a few + * templates for echo control and error control. + * + * The name of the shell is the basename for the predefined shells, such as + * "sh", "csh", "bash". For custom shells, it is the full pathname, and its + * basename is used to select the type of shell; the longest match wins. + * So /usr/pkg/bin/bash has type sh, /usr/local/bin/tcsh has type csh. + * + * The echoing of command lines is controlled using hasEchoCtl, echoOff, + * echoOn, noPrint and noPrintLen. When echoOff is executed by the shell, it + * still outputs something, but this something is not interesting, therefore + * it is filtered out using noPrint and noPrintLen. + * + * The error checking for individual commands is controlled using hasErrCtl, + * errOn, errOff and runChkTmpl. + * + * In case a shell doesn't have error control, echoTmpl is a printf template + * for echoing the command, should echoing be on; runIgnTmpl is another + * printf template for executing the command while ignoring the return + * status. Finally runChkTmpl is a printf template for running the command and + * causing the shell to exit on error. If any of these strings are empty when + * hasErrCtl is FALSE, the command will be executed anyway as is, and if it + * causes an error, so be it. Any templates set up to echo the command will + * escape any '$ ` \ "' characters in the command string to avoid unwanted + * shell code injection, the escaped command is safe to use in double quotes. + * + * The command-line flags "echo" and "exit" also control the behavior. The + * "echo" flag causes the shell to start echoing commands right away. The + * "exit" flag causes the shell to exit when an error is detected in one of + * the commands. + */ +typedef struct Shell { + + /* + * The name of the shell. For Bourne and C shells, this is used only + * to find the shell description when used as the single source of a + * .SHELL target. For user-defined shells, this is the full path of + * the shell. + */ + const char *name; + + Boolean hasEchoCtl; /* whether both echoOff and echoOn are there */ + const char *echoOff; /* command to turn echoing off */ + const char *echoOn; /* command to turn echoing back on */ + const char *noPrint; /* text to skip when printing output from the + * shell. This is usually the same as echoOff */ + size_t noPrintLen; /* length of noPrint command */ + + Boolean hasErrCtl; /* whether error checking can be controlled + * for individual commands */ + const char *errOn; /* command to turn on error checking */ + const char *errOff; /* command to turn off error checking */ + + const char *echoTmpl; /* template to echo a command */ + const char *runIgnTmpl; /* template to run a command + * without error checking */ + const char *runChkTmpl; /* template to run a command + * with error checking */ + + /* string literal that results in a newline character when it appears + * outside of any 'quote' or "quote" characters */ + const char *newline; + char commentChar; /* character used by shell for comment lines */ + + const char *echoFlag; /* shell flag to echo commands */ + const char *errFlag; /* shell flag to exit on error */ +} Shell; + +typedef struct CommandFlags { + /* Whether to echo the command before or instead of running it. */ + Boolean echo; + + /* Run the command even in -n or -N mode. */ + Boolean always; + + /* + * true if we turned error checking off before printing the command + * and need to turn it back on + */ + Boolean ignerr; +} CommandFlags; + +/* + * Write shell commands to a file. + * + * TODO: keep track of whether commands are echoed. + * TODO: keep track of whether error checking is active. + */ +typedef struct ShellWriter { + FILE *f; + + /* we've sent 'set -x' */ + Boolean xtraced; + +} ShellWriter; /* * error handling variables */ -static int errors = 0; /* number of errors reported */ -static int aborting = 0; /* why is the make aborting? */ -#define ABORT_ERROR 1 /* Because of an error */ -#define ABORT_INTERRUPT 2 /* Because it was interrupted */ -#define ABORT_WAIT 3 /* Waiting for jobs to finish */ -#define JOB_TOKENS "+EI+" /* Token to requeue for each abort state */ +static int job_errors = 0; /* number of errors reported */ +typedef enum AbortReason { /* why is the make aborting? */ + ABORT_NONE, + ABORT_ERROR, /* Because of an error */ + ABORT_INTERRUPT, /* Because it was interrupted */ + ABORT_WAIT /* Waiting for jobs to finish */ + /* XXX: "WAIT" is not a _reason_ for aborting, it's rather a status. */ +} AbortReason; +static AbortReason aborting = ABORT_NONE; +#define JOB_TOKENS "+EI+" /* Token to requeue for each abort state */ /* * this tracks the number of tokens currently "out" to build jobs. */ int jobTokensRunning = 0; -int not_parallel = 0; /* set if .NOT_PARALLEL */ -/* - * XXX: Avoid SunOS bug... FILENO() is fp->_file, and file - * is a char! So when we go above 127 we turn negative! - */ -#define FILENO(a) ((unsigned) fileno(a)) - -/* - * post-make command processing. The node postCommands is really just the - * .END target but we keep it around to avoid having to search for it - * all the time. - */ -static GNode *postCommands = NULL; - /* node containing commands to execute when - * everything else is done */ -static int numCommands; /* The number of commands actually printed - * for a target. Should this number be - * 0, no shell will be executed. */ - -/* - * Return values from JobStart. - */ -#define JOB_RUNNING 0 /* Job is running */ -#define JOB_ERROR 1 /* Error in starting the job */ -#define JOB_FINISHED 2 /* The job is already finished */ +typedef enum JobStartResult { + JOB_RUNNING, /* Job is running */ + JOB_ERROR, /* Error in starting the job */ + JOB_FINISHED /* The job is already finished */ +} JobStartResult; /* * Descriptions for various shells. * * The build environment may set DEFSHELL_INDEX to one of * DEFSHELL_INDEX_SH, DEFSHELL_INDEX_KSH, or DEFSHELL_INDEX_CSH, to - * select one of the prefedined shells as the default shell. + * select one of the predefined shells as the default shell. * * Alternatively, the build environment may set DEFSHELL_CUSTOM to the * name or the full path of a sh-compatible shell, which will be used as * the default shell. * * ".SHELL" lines in Makefiles can choose the default shell from the - # set defined here, or add additional shells. + * set defined here, or add additional shells. */ #ifdef DEFSHELL_CUSTOM @@ -229,7 +298,7 @@ static int numCommands; /* The number of commands actually printed #define DEFSHELL_INDEX 0 /* DEFSHELL_INDEX_CUSTOM or DEFSHELL_INDEX_SH */ #endif /* !DEFSHELL_INDEX */ -static Shell shells[] = { +static Shell shells[] = { #ifdef DEFSHELL_CUSTOM /* * An sh-compatible shell with a non-standard name. @@ -238,141 +307,213 @@ static Shell shells[] = { * non-portable features that might not be supplied by all * sh-compatible shells. */ -{ - DEFSHELL_CUSTOM, - FALSE, "", "", "", 0, - FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#', - "", - "", -}, + { + DEFSHELL_CUSTOM, /* .name */ + FALSE, /* .hasEchoCtl */ + "", /* .echoOff */ + "", /* .echoOn */ + "", /* .noPrint */ + 0, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "%s\n", /* .runIgnTmpl */ + "{ %s \n} || exit $?\n", /* .runChkTmpl */ + "'\n'", /* .newline */ + '#', /* .commentChar */ + "", /* .echoFlag */ + "", /* .errFlag */ + }, #endif /* DEFSHELL_CUSTOM */ /* * SH description. Echo control is also possible and, under * sun UNIX anyway, one can even control error checking. */ -{ - "sh", - FALSE, "", "", "", 0, - FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#', + { + "sh", /* .name */ + FALSE, /* .hasEchoCtl */ + "", /* .echoOff */ + "", /* .echoOn */ + "", /* .noPrint */ + 0, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "%s\n", /* .runIgnTmpl */ + "{ %s \n} || exit $?\n", /* .runChkTmpl */ + "'\n'", /* .newline */ + '#', /* .commentChar*/ #if defined(MAKE_NATIVE) && defined(__NetBSD__) - "q", + /* XXX: -q is not really echoFlag, it's more like noEchoInSysFlag. */ + "q", /* .echoFlag */ #else - "", + "", /* .echoFlag */ #endif - "", -}, + "", /* .errFlag */ + }, /* - * KSH description. + * KSH description. */ -{ - "ksh", - TRUE, "set +v", "set -v", "set +v", 6, - FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#', - "v", - "", -}, + { + "ksh", /* .name */ + TRUE, /* .hasEchoCtl */ + "set +v", /* .echoOff */ + "set -v", /* .echoOn */ + "set +v", /* .noPrint */ + 6, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "%s\n", /* .runIgnTmpl */ + "{ %s \n} || exit $?\n", /* .runChkTmpl */ + "'\n'", /* .newline */ + '#', /* .commentChar */ + "v", /* .echoFlag */ + "", /* .errFlag */ + }, /* * CSH description. The csh can do echo control by playing * with the setting of the 'echo' shell variable. Sadly, * however, it is unable to do error control nicely. */ -{ - "csh", - TRUE, "unset verbose", "set verbose", "unset verbose", 10, - FALSE, "echo \"%s\"\n", "csh -c \"%s || exit 0\"\n", "", "'\\\n'", '#', - "v", "e", -}, - /* - * UNKNOWN. - */ -{ - NULL, - FALSE, NULL, NULL, NULL, 0, - FALSE, NULL, NULL, NULL, NULL, 0, - NULL, NULL, -} + { + "csh", /* .name */ + TRUE, /* .hasEchoCtl */ + "unset verbose", /* .echoOff */ + "set verbose", /* .echoOn */ + "unset verbose", /* .noPrint */ + 13, /* .noPrintLen */ + FALSE, /* .hasErrCtl */ + "", /* .errOn */ + "", /* .errOff */ + "echo \"%s\"\n", /* .echoTmpl */ + "csh -c \"%s || exit 0\"\n", /* .runIgnTmpl */ + "", /* .runChkTmpl */ + "'\\\n'", /* .newline */ + '#', /* .commentChar */ + "v", /* .echoFlag */ + "e", /* .errFlag */ + } }; -static Shell *commandShell = &shells[DEFSHELL_INDEX]; /* this is the shell to - * which we pass all - * commands in the Makefile. - * It is set by the - * Job_ParseShell function */ -const char *shellPath = NULL, /* full pathname of - * executable image */ - *shellName = NULL; /* last component of shell */ + +/* + * This is the shell to which we pass all commands in the Makefile. + * It is set by the Job_ParseShell function. + */ +static Shell *shell = &shells[DEFSHELL_INDEX]; +const char *shellPath = NULL; /* full pathname of executable image */ +const char *shellName = NULL; /* last component of shellPath */ char *shellErrFlag = NULL; -static const char *shellArgv = NULL; /* Custom shell args */ +static char *shell_freeIt = NULL; /* Allocated memory for custom .SHELL */ -STATIC Job *job_table; /* The structures that describe them */ -STATIC Job *job_table_end; /* job_table + maxJobs */ -static int wantToken; /* we want a token */ -static int lurking_children = 0; -static int make_suspended = 0; /* non-zero if we've seen a SIGTSTP (etc) */ +static Job *job_table; /* The structures that describe them */ +static Job *job_table_end; /* job_table + maxJobs */ +static unsigned int wantToken; /* we want a token */ +static Boolean lurking_children = FALSE; +static Boolean make_suspended = FALSE; /* Whether we've seen a SIGTSTP (etc) */ /* * Set of descriptors of pipes connected to * the output channels of children */ static struct pollfd *fds = NULL; -static Job **jobfds = NULL; -static int nfds = 0; +static Job **jobByFdIndex = NULL; +static nfds_t fdsLen = 0; static void watchfd(Job *); static void clearfd(Job *); -static int readyfd(Job *); +static Boolean readyfd(Job *); -STATIC GNode *lastNode; /* The node for which output was most recently - * produced. */ -static char *targPrefix = NULL; /* What we print at the start of TARG_FMT */ +static char *targPrefix = NULL; /* To identify a job change in the output. */ static Job tokenWaitJob; /* token wait pseudo-job */ static Job childExitJob; /* child exit pseudo-job */ -#define CHILD_EXIT "." -#define DO_JOB_RESUME "R" +#define CHILD_EXIT "." +#define DO_JOB_RESUME "R" -#define TARG_FMT "%s %s ---\n" /* Default format */ -#define MESSAGE(fp, gn) \ - if (maxJobs != 1 && targPrefix && *targPrefix) \ - (void)fprintf(fp, TARG_FMT, targPrefix, gn->name) +enum { + npseudojobs = 2 /* number of pseudo-jobs */ +}; static sigset_t caught_signals; /* Set of signals we handle */ -#if defined(SYSV) -#define KILLPG(pid, sig) kill(-(pid), (sig)) -#else -#define KILLPG(pid, sig) killpg((pid), (sig)) -#endif +static volatile sig_atomic_t caught_sigchld; -static void JobChildSig(int); -static void JobContinueSig(int); -static Job *JobFindPid(int, int, Boolean); -static int JobPrintCommand(void *, void *); -static int JobSaveCommand(void *, void *); -static void JobClose(Job *); -static void JobExec(Job *, char **); -static void JobMakeArgv(Job *, char **); -static int JobStart(GNode *, int); -static char *JobOutput(Job *, char *, char *, int); static void JobDoOutput(Job *, Boolean); -static Shell *JobMatchShell(const char *); -static void JobInterrupt(int, int) MAKE_ATTR_DEAD; +static void JobInterrupt(Boolean, int) MAKE_ATTR_DEAD; static void JobRestartJobs(void); -static void JobTokenAdd(void); -static void JobSigLock(sigset_t *); -static void JobSigUnlock(sigset_t *); static void JobSigReset(void); -const char *malloc_options="A"; +static void +SwitchOutputTo(GNode *gn) +{ + /* The node for which output was most recently produced. */ + static GNode *lastNode = NULL; + + if (gn == lastNode) + return; + lastNode = gn; + + if (opts.maxJobs != 1 && targPrefix != NULL && targPrefix[0] != '\0') + (void)fprintf(stdout, "%s %s ---\n", targPrefix, gn->name); +} + +static unsigned +nfds_per_job(void) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) + return 2; +#endif + return 1; +} + +void +Job_FlagsToString(const Job *job, char *buf, size_t bufsize) +{ + snprintf(buf, bufsize, "%c%c%c", + job->ignerr ? 'i' : '-', + !job->echo ? 's' : '-', + job->special ? 'S' : '-'); +} static void job_table_dump(const char *where) { - Job *job; + Job *job; + char flags[4]; - fprintf(debug_file, "job table @ %s\n", where); - for (job = job_table; job < job_table_end; job++) { - fprintf(debug_file, "job %d, status %d, flags %d, pid %d\n", - (int)(job - job_table), job->job_state, job->flags, job->pid); - } + debug_printf("job table @ %s\n", where); + for (job = job_table; job < job_table_end; job++) { + Job_FlagsToString(job, flags, sizeof flags); + debug_printf("job %d, status %d, flags %s, pid %d\n", + (int)(job - job_table), job->status, flags, job->pid); + } +} + +/* + * Delete the target of a failed, interrupted, or otherwise + * unsuccessful job unless inhibited by .PRECIOUS. + */ +static void +JobDeleteTarget(GNode *gn) +{ + const char *file; + + if (gn->type & OP_JOIN) + return; + if (gn->type & OP_PHONY) + return; + if (Targ_Precious(gn)) + return; + if (opts.noExecute) + return; + + file = GNode_Path(gn); + if (eunlink(file) != -1) + Error("*** %s removed", file); } /* @@ -381,7 +522,8 @@ job_table_dump(const char *where) * Signal lock routines to get exclusive access. Currently used to * protect `jobs' and `stoppedJobs' list manipulations. */ -static void JobSigLock(sigset_t *omaskp) +static void +JobSigLock(sigset_t *omaskp) { if (sigprocmask(SIG_BLOCK, &caught_signals, omaskp) != 0) { Punt("JobSigLock: sigprocmask: %s", strerror(errno)); @@ -389,7 +531,8 @@ static void JobSigLock(sigset_t *omaskp) } } -static void JobSigUnlock(sigset_t *omaskp) +static void +JobSigUnlock(sigset_t *omaskp) { (void)sigprocmask(SIG_SETMASK, omaskp, NULL); } @@ -397,793 +540,748 @@ static void JobSigUnlock(sigset_t *omaskp) static void JobCreatePipe(Job *job, int minfd) { - int i, fd; + int i, fd, flags; + int pipe_fds[2]; - if (pipe(job->jobPipe) == -1) - Punt("Cannot create pipe: %s", strerror(errno)); + if (pipe(pipe_fds) == -1) + Punt("Cannot create pipe: %s", strerror(errno)); - for (i = 0; i < 2; i++) { - /* Avoid using low numbered fds */ - fd = fcntl(job->jobPipe[i], F_DUPFD, minfd); - if (fd != -1) { - close(job->jobPipe[i]); - job->jobPipe[i] = fd; - } - } - - /* Set close-on-exec flag for both */ - (void)fcntl(job->jobPipe[0], F_SETFD, 1); - (void)fcntl(job->jobPipe[1], F_SETFD, 1); + for (i = 0; i < 2; i++) { + /* Avoid using low numbered fds */ + fd = fcntl(pipe_fds[i], F_DUPFD, minfd); + if (fd != -1) { + close(pipe_fds[i]); + pipe_fds[i] = fd; + } + } - /* - * We mark the input side of the pipe non-blocking; we poll(2) the - * pipe when we're waiting for a job token, but we might lose the - * race for the token when a new one becomes available, so the read - * from the pipe should not block. - */ - fcntl(job->jobPipe[0], F_SETFL, - fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK); + job->inPipe = pipe_fds[0]; + job->outPipe = pipe_fds[1]; + + /* Set close-on-exec flag for both */ + if (fcntl(job->inPipe, F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); + if (fcntl(job->outPipe, F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); + + /* + * We mark the input side of the pipe non-blocking; we poll(2) the + * pipe when we're waiting for a job token, but we might lose the + * race for the token when a new one becomes available, so the read + * from the pipe should not block. + */ + flags = fcntl(job->inPipe, F_GETFL, 0); + if (flags == -1) + Punt("Cannot get flags: %s", strerror(errno)); + flags |= O_NONBLOCK; + if (fcntl(job->inPipe, F_SETFL, flags) == -1) + Punt("Cannot set flags: %s", strerror(errno)); } -/*- - *----------------------------------------------------------------------- - * JobCondPassSig -- - * Pass a signal to a job - * - * Input: - * signop Signal to send it - * - * Side Effects: - * None, except the job may bite it. - * - *----------------------------------------------------------------------- - */ +/* Pass the signal to each running job. */ static void JobCondPassSig(int signo) { - Job *job; + Job *job; - if (DEBUG(JOB)) { - (void)fprintf(debug_file, "JobCondPassSig(%d) called.\n", signo); - } + DEBUG1(JOB, "JobCondPassSig(%d) called.\n", signo); - for (job = job_table; job < job_table_end; job++) { - if (job->job_state != JOB_ST_RUNNING) - continue; - if (DEBUG(JOB)) { - (void)fprintf(debug_file, - "JobCondPassSig passing signal %d to child %d.\n", - signo, job->pid); + for (job = job_table; job < job_table_end; job++) { + if (job->status != JOB_ST_RUNNING) + continue; + DEBUG2(JOB, "JobCondPassSig passing signal %d to child %d.\n", + signo, job->pid); + KILLPG(job->pid, signo); } - KILLPG(job->pid, signo); - } } -/*- - *----------------------------------------------------------------------- - * JobChldSig -- - * SIGCHLD handler. +/* + * SIGCHLD handler. * - * Input: - * signo The signal number we've received - * - * Results: - * None. - * - * Side Effects: - * Sends a token on the child exit pipe to wake us up from - * select()/poll(). - * - *----------------------------------------------------------------------- + * Sends a token on the child exit pipe to wake us up from select()/poll(). */ +/*ARGSUSED*/ static void JobChildSig(int signo MAKE_ATTR_UNUSED) { - while (write(childExitJob.outPipe, CHILD_EXIT, 1) == -1 && errno == EAGAIN) - continue; + caught_sigchld = 1; + while (write(childExitJob.outPipe, CHILD_EXIT, 1) == -1 && + errno == EAGAIN) + continue; } -/*- - *----------------------------------------------------------------------- - * JobContinueSig -- - * Resume all stopped jobs. - * - * Input: - * signo The signal number we've received - * - * Results: - * None. - * - * Side Effects: - * Jobs start running again. - * - *----------------------------------------------------------------------- - */ +/* Resume all stopped jobs. */ +/*ARGSUSED*/ static void JobContinueSig(int signo MAKE_ATTR_UNUSED) { - /* - * Defer sending to SIGCONT to our stopped children until we return - * from the signal handler. - */ - while (write(childExitJob.outPipe, DO_JOB_RESUME, 1) == -1 && - errno == EAGAIN) - continue; + /* + * Defer sending SIGCONT to our stopped children until we return + * from the signal handler. + */ + while (write(childExitJob.outPipe, DO_JOB_RESUME, 1) == -1 && + errno == EAGAIN) + continue; } -/*- - *----------------------------------------------------------------------- - * JobPassSig -- - * Pass a signal on to all jobs, then resend to ourselves. - * - * Input: - * signo The signal number we've received - * - * Results: - * None. - * - * Side Effects: - * We die by the same signal. - * - *----------------------------------------------------------------------- +/* + * Pass a signal on to all jobs, then resend to ourselves. + * We die by the same signal. */ MAKE_ATTR_DEAD static void JobPassSig_int(int signo) { - /* Run .INTERRUPT target then exit */ - JobInterrupt(TRUE, signo); + /* Run .INTERRUPT target then exit */ + JobInterrupt(TRUE, signo); } +/* + * Pass a signal on to all jobs, then resend to ourselves. + * We die by the same signal. + */ MAKE_ATTR_DEAD static void JobPassSig_term(int signo) { - /* Dont run .INTERRUPT target then exit */ - JobInterrupt(FALSE, signo); + /* Dont run .INTERRUPT target then exit */ + JobInterrupt(FALSE, signo); } static void JobPassSig_suspend(int signo) { - sigset_t nmask, omask; - struct sigaction act; + sigset_t nmask, omask; + struct sigaction act; - /* Suppress job started/continued messages */ - make_suspended = 1; + /* Suppress job started/continued messages */ + make_suspended = TRUE; - /* Pass the signal onto every job */ - JobCondPassSig(signo); + /* Pass the signal onto every job */ + JobCondPassSig(signo); - /* - * Send ourselves the signal now we've given the message to everyone else. - * Note we block everything else possible while we're getting the signal. - * This ensures that all our jobs get continued when we wake up before - * we take any other signal. - */ - sigfillset(&nmask); - sigdelset(&nmask, signo); - (void)sigprocmask(SIG_SETMASK, &nmask, &omask); + /* + * Send ourselves the signal now we've given the message to everyone + * else. Note we block everything else possible while we're getting + * the signal. This ensures that all our jobs get continued when we + * wake up before we take any other signal. + */ + sigfillset(&nmask); + sigdelset(&nmask, signo); + (void)sigprocmask(SIG_SETMASK, &nmask, &omask); - act.sa_handler = SIG_DFL; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; - (void)sigaction(signo, &act, NULL); + act.sa_handler = SIG_DFL; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + (void)sigaction(signo, &act, NULL); - if (DEBUG(JOB)) { - (void)fprintf(debug_file, - "JobPassSig passing signal %d to self.\n", signo); - } + DEBUG1(JOB, "JobPassSig passing signal %d to self.\n", signo); - (void)kill(getpid(), signo); + (void)kill(getpid(), signo); - /* - * We've been continued. - * - * A whole host of signals continue to happen! - * SIGCHLD for any processes that actually suspended themselves. - * SIGCHLD for any processes that exited while we were alseep. - * The SIGCONT that actually caused us to wakeup. - * - * Since we defer passing the SIGCONT on to our children until - * the main processing loop, we can be sure that all the SIGCHLD - * events will have happened by then - and that the waitpid() will - * collect the child 'suspended' events. - * For correct sequencing we just need to ensure we process the - * waitpid() before passign on the SIGCONT. - * - * In any case nothing else is needed here. - */ + /* + * We've been continued. + * + * A whole host of signals continue to happen! + * SIGCHLD for any processes that actually suspended themselves. + * SIGCHLD for any processes that exited while we were alseep. + * The SIGCONT that actually caused us to wakeup. + * + * Since we defer passing the SIGCONT on to our children until + * the main processing loop, we can be sure that all the SIGCHLD + * events will have happened by then - and that the waitpid() will + * collect the child 'suspended' events. + * For correct sequencing we just need to ensure we process the + * waitpid() before passing on the SIGCONT. + * + * In any case nothing else is needed here. + */ - /* Restore handler and signal mask */ - act.sa_handler = JobPassSig_suspend; - (void)sigaction(signo, &act, NULL); - (void)sigprocmask(SIG_SETMASK, &omask, NULL); + /* Restore handler and signal mask */ + act.sa_handler = JobPassSig_suspend; + (void)sigaction(signo, &act, NULL); + (void)sigprocmask(SIG_SETMASK, &omask, NULL); } -/*- - *----------------------------------------------------------------------- - * JobFindPid -- - * Compare the pid of the job with the given pid and return 0 if they - * are equal. This function is called from Job_CatchChildren - * to find the job descriptor of the finished job. - * - * Input: - * job job to examine - * pid process id desired - * - * Results: - * Job with matching pid - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ static Job * -JobFindPid(int pid, int status, Boolean isJobs) +JobFindPid(int pid, JobStatus status, Boolean isJobs) { - Job *job; + Job *job; - for (job = job_table; job < job_table_end; job++) { - if ((job->job_state == status) && job->pid == pid) - return job; - } - if (DEBUG(JOB) && isJobs) - job_table_dump("no pid"); - return NULL; + for (job = job_table; job < job_table_end; job++) { + if (job->status == status && job->pid == pid) + return job; + } + if (DEBUG(JOB) && isJobs) + job_table_dump("no pid"); + return NULL; } -/*- - *----------------------------------------------------------------------- - * JobPrintCommand -- - * Put out another command for the given job. If the command starts - * with an @ or a - we process it specially. In the former case, - * so long as the -s and -n flags weren't given to make, we stick - * a shell-specific echoOff command in the script. In the latter, - * we ignore errors for the entire job, unless the shell has error - * control. - * If the command is just "..." we take all future commands for this - * job to be commands to be executed once the entire graph has been - * made and return non-zero to signal that the end of the commands - * was reached. These commands are later attached to the postCommands - * node and executed by Job_End when all things are done. - * This function is called from JobStart via Lst_ForEach. - * - * Input: - * cmdp command string to print - * jobp job for which to print it - * - * Results: - * Always 0, unless the command was "..." - * - * Side Effects: - * If the command begins with a '-' and the shell has no error control, - * the JOB_IGNERR flag is set in the job descriptor. - * If the command is "..." and we're not ignoring such things, - * tailCmds is set to the successor node of the cmd. - * numCommands is incremented if the command is actually printed. - *----------------------------------------------------------------------- - */ -static int -JobPrintCommand(void *cmdp, void *jobp) +/* Parse leading '@', '-' and '+', which control the exact execution mode. */ +static void +ParseCommandFlags(char **pp, CommandFlags *out_cmdFlags) { - Boolean noSpecials; /* true if we shouldn't worry about - * inserting special commands into - * the input stream. */ - Boolean shutUp = FALSE; /* true if we put a no echo command - * into the command file */ - Boolean errOff = FALSE; /* true if we turned error checking - * off before printing the command - * and need to turn it back on */ - const char *cmdTemplate; /* Template to use when printing the - * command */ - char *cmdStart; /* Start of expanded command */ - char *escCmd = NULL; /* Command with quotes/backticks escaped */ - char *cmd = (char *)cmdp; - Job *job = (Job *)jobp; - int i, j; + char *p = *pp; + out_cmdFlags->echo = TRUE; + out_cmdFlags->ignerr = FALSE; + out_cmdFlags->always = FALSE; - noSpecials = NoExecute(job->node); - - if (strcmp(cmd, "...") == 0) { - job->node->type |= OP_SAVE_CMDS; - if ((job->flags & JOB_IGNDOTS) == 0) { - job->tailCmds = Lst_Succ(Lst_Member(job->node->commands, - cmd)); - return 1; + for (;;) { + if (*p == '@') + out_cmdFlags->echo = DEBUG(LOUD); + else if (*p == '-') + out_cmdFlags->ignerr = TRUE; + else if (*p == '+') + out_cmdFlags->always = TRUE; + else + break; + p++; } - return 0; - } -#define DBPRINTF(fmt, arg) if (DEBUG(JOB)) { \ - (void)fprintf(debug_file, fmt, arg); \ - } \ - (void)fprintf(job->cmdFILE, fmt, arg); \ - (void)fflush(job->cmdFILE); + pp_skip_whitespace(&p); - numCommands += 1; + *pp = p; +} - cmdStart = cmd = Var_Subst(NULL, cmd, job->node, FALSE); +/* Escape a string for a double-quoted string literal in sh, csh and ksh. */ +static char * +EscapeShellDblQuot(const char *cmd) +{ + size_t i, j; - cmdTemplate = "%s\n"; + /* Worst that could happen is every char needs escaping. */ + char *esc = bmake_malloc(strlen(cmd) * 2 + 1); + for (i = 0, j = 0; cmd[i] != '\0'; i++, j++) { + if (cmd[i] == '$' || cmd[i] == '`' || cmd[i] == '\\' || + cmd[i] == '"') + esc[j++] = '\\'; + esc[j] = cmd[i]; + } + esc[j] = '\0'; - /* - * Check for leading @' and -'s to control echoing and error checking. - */ - while (*cmd == '@' || *cmd == '-' || (*cmd == '+')) { - switch (*cmd) { - case '@': - shutUp = DEBUG(LOUD) ? FALSE : TRUE; - break; - case '-': - errOff = TRUE; - break; - case '+': - if (noSpecials) { + return esc; +} + +static void +ShellWriter_PrintFmt(ShellWriter *wr, const char *fmt, const char *arg) +{ + DEBUG1(JOB, fmt, arg); + + (void)fprintf(wr->f, fmt, arg); + /* XXX: Is flushing needed in any case, or only if f == stdout? */ + (void)fflush(wr->f); +} + +static void +ShellWriter_Println(ShellWriter *wr, const char *line) +{ + ShellWriter_PrintFmt(wr, "%s\n", line); +} + +static void +ShellWriter_EchoOff(ShellWriter *wr) +{ + if (shell->hasEchoCtl) + ShellWriter_Println(wr, shell->echoOff); +} + +static void +ShellWriter_EchoCmd(ShellWriter *wr, const char *escCmd) +{ + ShellWriter_PrintFmt(wr, shell->echoTmpl, escCmd); +} + +static void +ShellWriter_EchoOn(ShellWriter *wr) +{ + if (shell->hasEchoCtl) + ShellWriter_Println(wr, shell->echoOn); +} + +static void +ShellWriter_TraceOn(ShellWriter *wr) +{ + if (!wr->xtraced) { + ShellWriter_Println(wr, "set -x"); + wr->xtraced = TRUE; + } +} + +static void +ShellWriter_ErrOff(ShellWriter *wr, Boolean echo) +{ + if (echo) + ShellWriter_EchoOff(wr); + ShellWriter_Println(wr, shell->errOff); + if (echo) + ShellWriter_EchoOn(wr); +} + +static void +ShellWriter_ErrOn(ShellWriter *wr, Boolean echo) +{ + if (echo) + ShellWriter_EchoOff(wr); + ShellWriter_Println(wr, shell->errOn); + if (echo) + ShellWriter_EchoOn(wr); +} + +/* + * The shell has no built-in error control, so emulate error control by + * enclosing each shell command in a template like "{ %s \n } || exit $?" + * (configurable per shell). + */ +static void +JobPrintSpecialsEchoCtl(Job *job, ShellWriter *wr, CommandFlags *inout_cmdFlags, + const char *escCmd, const char **inout_cmdTemplate) +{ + /* XXX: Why is the job modified at this point? */ + job->ignerr = TRUE; + + if (job->echo && inout_cmdFlags->echo) { + ShellWriter_EchoOff(wr); + ShellWriter_EchoCmd(wr, escCmd); + + /* + * Leave echoing off so the user doesn't see the commands + * for toggling the error checking. + */ + inout_cmdFlags->echo = FALSE; + } else { + if (inout_cmdFlags->echo) + ShellWriter_EchoCmd(wr, escCmd); + } + *inout_cmdTemplate = shell->runIgnTmpl; + + /* + * The template runIgnTmpl already takes care of ignoring errors, + * so pretend error checking is still on. + * XXX: What effects does this have, and why is it necessary? + */ + inout_cmdFlags->ignerr = FALSE; +} + +static void +JobPrintSpecials(Job *job, ShellWriter *wr, const char *escCmd, Boolean run, + CommandFlags *inout_cmdFlags, const char **inout_cmdTemplate) +{ + if (!run) { + /* + * If there is no command to run, there is no need to switch + * error checking off and on again for nothing. + */ + inout_cmdFlags->ignerr = FALSE; + } else if (shell->hasErrCtl) + ShellWriter_ErrOff(wr, job->echo && inout_cmdFlags->echo); + else if (shell->runIgnTmpl != NULL && shell->runIgnTmpl[0] != '\0') { + JobPrintSpecialsEchoCtl(job, wr, inout_cmdFlags, escCmd, + inout_cmdTemplate); + } else + inout_cmdFlags->ignerr = FALSE; +} + +/* + * Put out another command for the given job. + * + * If the command starts with '@' and neither the -s nor the -n flag was + * given to make, we stick a shell-specific echoOff command in the script. + * + * If the command starts with '-' and the shell has no error control (none + * of the predefined shells has that), we ignore errors for the entire job. + * XXX: Why ignore errors for the entire job? + * XXX: Even ignore errors for the commands before this command? + * + * If the command is just "...", all further commands of this job are skipped + * for now. They are attached to the .END node and will be run by Job_Finish + * after all other targets have been made. + */ +static void +JobPrintCommand(Job *job, ShellWriter *wr, StringListNode *ln, const char *ucmd) +{ + Boolean run; + + CommandFlags cmdFlags; + /* Template for printing a command to the shell file */ + const char *cmdTemplate; + char *xcmd; /* The expanded command */ + char *xcmdStart; + char *escCmd; /* xcmd escaped to be used in double quotes */ + + run = GNode_ShouldExecute(job->node); + + Var_Subst(ucmd, job->node, VARE_WANTRES, &xcmd); + /* TODO: handle errors */ + xcmdStart = xcmd; + + cmdTemplate = "%s\n"; + + ParseCommandFlags(&xcmd, &cmdFlags); + + /* The '+' command flag overrides the -n or -N options. */ + if (cmdFlags.always && !run) { /* * We're not actually executing anything... * but this one needs to be - use compat mode just for it. */ - CompatRunCommand(cmdp, job->node); - return 0; - } - break; + Compat_RunCommand(ucmd, job->node, ln); + free(xcmdStart); + return; } - cmd++; - } - while (isspace((unsigned char) *cmd)) - cmd++; - - /* - * If the shell doesn't have error control the alternate echo'ing will - * be done (to avoid showing additional error checking code) - * and this will need the characters '$ ` \ "' escaped - */ - - if (!commandShell->hasErrCtl) { - /* Worst that could happen is every char needs escaping. */ - escCmd = bmake_malloc((strlen(cmd) * 2) + 1); - for (i = 0, j= 0; cmd[i] != '\0'; i++, j++) { - if (cmd[i] == '$' || cmd[i] == '`' || cmd[i] == '\\' || - cmd[i] == '"') - escCmd[j++] = '\\'; - escCmd[j] = cmd[i]; - } - escCmd[j] = 0; - } - - if (shutUp) { - if (!(job->flags & JOB_SILENT) && !noSpecials && - commandShell->hasEchoCtl) { - DBPRINTF("%s\n", commandShell->echoOff); - } else { - if (commandShell->hasErrCtl) - shutUp = FALSE; - } - } - - if (errOff) { - if (!noSpecials) { - if (commandShell->hasErrCtl) { - /* - * we don't want the error-control commands showing - * up either, so we turn off echoing while executing - * them. We could put another field in the shell - * structure to tell JobDoOutput to look for this - * string too, but why make it any more complex than - * it already is? - */ - if (!(job->flags & JOB_SILENT) && !shutUp && - commandShell->hasEchoCtl) { - DBPRINTF("%s\n", commandShell->echoOff); - DBPRINTF("%s\n", commandShell->ignErr); - DBPRINTF("%s\n", commandShell->echoOn); - } else { - DBPRINTF("%s\n", commandShell->ignErr); - } - } else if (commandShell->ignErr && - (*commandShell->ignErr != '\0')) - { - /* - * The shell has no error control, so we need to be - * weird to get it to ignore any errors from the command. - * If echoing is turned on, we turn it off and use the - * errCheck template to echo the command. Leave echoing - * off so the user doesn't see the weirdness we go through - * to ignore errors. Set cmdTemplate to use the weirdness - * instead of the simple "%s\n" template. - */ - job->flags |= JOB_IGNERR; - if (!(job->flags & JOB_SILENT) && !shutUp) { - if (commandShell->hasEchoCtl) { - DBPRINTF("%s\n", commandShell->echoOff); - } - DBPRINTF(commandShell->errCheck, escCmd); - shutUp = TRUE; - } else { - if (!shutUp) { - DBPRINTF(commandShell->errCheck, escCmd); - } - } - cmdTemplate = commandShell->ignErr; - /* - * The error ignoration (hee hee) is already taken care - * of by the ignErr template, so pretend error checking - * is still on. - */ - errOff = FALSE; - } else { - errOff = FALSE; - } - } else { - errOff = FALSE; - } - } else { - - /* - * If errors are being checked and the shell doesn't have error control - * but does supply an errOut template, then setup commands to run - * through it. - */ - - if (!commandShell->hasErrCtl && commandShell->errOut && - (*commandShell->errOut != '\0')) { - if (!(job->flags & JOB_SILENT) && !shutUp) { - if (commandShell->hasEchoCtl) { - DBPRINTF("%s\n", commandShell->echoOff); - } - DBPRINTF(commandShell->errCheck, escCmd); - shutUp = TRUE; - } - /* If it's a comment line or blank, treat as an ignored error */ - if ((escCmd[0] == commandShell->commentChar) || - (escCmd[0] == 0)) - cmdTemplate = commandShell->ignErr; - else - cmdTemplate = commandShell->errOut; - errOff = FALSE; - } - } - - if (DEBUG(SHELL) && strcmp(shellName, "sh") == 0 && - (job->flags & JOB_TRACED) == 0) { - DBPRINTF("set -%s\n", "x"); - job->flags |= JOB_TRACED; - } - - DBPRINTF(cmdTemplate, cmd); - free(cmdStart); - if (escCmd) - free(escCmd); - if (errOff) { /* - * If echoing is already off, there's no point in issuing the - * echoOff command. Otherwise we issue it and pretend it was on - * for the whole command... + * If the shell doesn't have error control, the alternate echoing + * will be done (to avoid showing additional error checking code) + * and this needs some characters escaped. */ - if (!shutUp && !(job->flags & JOB_SILENT) && commandShell->hasEchoCtl){ - DBPRINTF("%s\n", commandShell->echoOff); - shutUp = TRUE; + escCmd = shell->hasErrCtl ? NULL : EscapeShellDblQuot(xcmd); + + if (!cmdFlags.echo) { + if (job->echo && run && shell->hasEchoCtl) { + ShellWriter_EchoOff(wr); + } else { + if (shell->hasErrCtl) + cmdFlags.echo = TRUE; + } } - DBPRINTF("%s\n", commandShell->errCheck); - } - if (shutUp && commandShell->hasEchoCtl) { - DBPRINTF("%s\n", commandShell->echoOn); - } - return 0; + + if (cmdFlags.ignerr) { + JobPrintSpecials(job, wr, escCmd, run, &cmdFlags, &cmdTemplate); + } else { + + /* + * If errors are being checked and the shell doesn't have + * error control but does supply an runChkTmpl template, then + * set up commands to run through it. + */ + + if (!shell->hasErrCtl && shell->runChkTmpl != NULL && + shell->runChkTmpl[0] != '\0') { + if (job->echo && cmdFlags.echo) { + ShellWriter_EchoOff(wr); + ShellWriter_EchoCmd(wr, escCmd); + cmdFlags.echo = FALSE; + } + /* + * If it's a comment line or blank, avoid the possible + * syntax error generated by "{\n} || exit $?". + */ + cmdTemplate = escCmd[0] == shell->commentChar || + escCmd[0] == '\0' + ? shell->runIgnTmpl + : shell->runChkTmpl; + cmdFlags.ignerr = FALSE; + } + } + + if (DEBUG(SHELL) && strcmp(shellName, "sh") == 0) + ShellWriter_TraceOn(wr); + + ShellWriter_PrintFmt(wr, cmdTemplate, xcmd); + free(xcmdStart); + free(escCmd); + + if (cmdFlags.ignerr) + ShellWriter_ErrOn(wr, cmdFlags.echo && job->echo); + + if (!cmdFlags.echo) + ShellWriter_EchoOn(wr); } -/*- - *----------------------------------------------------------------------- - * JobSaveCommand -- - * Save a command to be executed when everything else is done. - * Callback function for JobFinish... +/* + * Print all commands to the shell file that is later executed. * - * Results: - * Always returns 0 + * The special command "..." stops printing and saves the remaining commands + * to be executed later, when the target '.END' is made. * - * Side Effects: - * The command is tacked onto the end of postCommands's commands list. - * - *----------------------------------------------------------------------- + * Return whether at least one command was written to the shell file. */ -static int -JobSaveCommand(void *cmd, void *gn) +static Boolean +JobPrintCommands(Job *job) { - cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, FALSE); - (void)Lst_AtEnd(postCommands->commands, cmd); - return(0); + StringListNode *ln; + Boolean seen = FALSE; + ShellWriter wr = { job->cmdFILE, FALSE }; + + for (ln = job->node->commands.first; ln != NULL; ln = ln->next) { + const char *cmd = ln->datum; + + if (strcmp(cmd, "...") == 0) { + job->node->type |= OP_SAVE_CMDS; + job->tailCmds = ln->next; + break; + } + + JobPrintCommand(job, &wr, ln, ln->datum); + seen = TRUE; + } + + return seen; } - -/*- - *----------------------------------------------------------------------- - * JobClose -- - * Called to close both input and output pipes when a job is finished. - * - * Results: - * Nada - * - * Side Effects: - * The file descriptors associated with the job are closed. - * - *----------------------------------------------------------------------- +/* + * Save the delayed commands (those after '...'), to be executed later in + * the '.END' node, when everything else is done. */ static void -JobClose(Job *job) +JobSaveCommands(Job *job) { - clearfd(job); - (void)close(job->outPipe); - job->outPipe = -1; + StringListNode *ln; - JobDoOutput(job, TRUE); - (void)close(job->inPipe); - job->inPipe = -1; + for (ln = job->tailCmds; ln != NULL; ln = ln->next) { + const char *cmd = ln->datum; + char *expanded_cmd; + /* + * XXX: This Var_Subst is only intended to expand the dynamic + * variables such as .TARGET, .IMPSRC. It is not intended to + * expand the other variables as well; see deptgt-end.mk. + */ + (void)Var_Subst(cmd, job->node, VARE_WANTRES, &expanded_cmd); + /* TODO: handle errors */ + Lst_Append(&Targ_GetEndNode()->commands, expanded_cmd); + } } -/*- - *----------------------------------------------------------------------- - * JobFinish -- - * Do final processing for the given job including updating - * parents and starting new jobs as available/necessary. Note - * that we pay no attention to the JOB_IGNERR flag here. - * This is because when we're called because of a noexecute flag - * or something, jstat.w_status is 0 and when called from - * Job_CatchChildren, the status is zeroed if it s/b ignored. + +/* Called to close both input and output pipes when a job is finished. */ +static void +JobClosePipes(Job *job) +{ + clearfd(job); + (void)close(job->outPipe); + job->outPipe = -1; + + JobDoOutput(job, TRUE); + (void)close(job->inPipe); + job->inPipe = -1; +} + +static void +JobFinishDoneExitedError(Job *job, int *inout_status) +{ + SwitchOutputTo(job->node); +#ifdef USE_META + if (useMeta) { + meta_job_error(job, job->node, + job->ignerr, WEXITSTATUS(*inout_status)); + } +#endif + if (!shouldDieQuietly(job->node, -1)) { + (void)printf("*** [%s] Error code %d%s\n", + job->node->name, WEXITSTATUS(*inout_status), + job->ignerr ? " (ignored)" : ""); + } + + if (job->ignerr) + *inout_status = 0; + else { + if (deleteOnError) + JobDeleteTarget(job->node); + PrintOnError(job->node, NULL); + } +} + +static void +JobFinishDoneExited(Job *job, int *inout_status) +{ + DEBUG2(JOB, "Process %d [%s] exited.\n", job->pid, job->node->name); + + if (WEXITSTATUS(*inout_status) != 0) + JobFinishDoneExitedError(job, inout_status); + else if (DEBUG(JOB)) { + SwitchOutputTo(job->node); + (void)printf("*** [%s] Completed successfully\n", + job->node->name); + } +} + +static void +JobFinishDoneSignaled(Job *job, int status) +{ + SwitchOutputTo(job->node); + (void)printf("*** [%s] Signal %d\n", job->node->name, WTERMSIG(status)); + if (deleteOnError) + JobDeleteTarget(job->node); +} + +static void +JobFinishDone(Job *job, int *inout_status) +{ + if (WIFEXITED(*inout_status)) + JobFinishDoneExited(job, inout_status); + else + JobFinishDoneSignaled(job, *inout_status); + + (void)fflush(stdout); +} + +/* + * Do final processing for the given job including updating parent nodes and + * starting new jobs as available/necessary. + * + * Deferred commands for the job are placed on the .END node. + * + * If there was a serious error (job_errors != 0; not an ignored one), no more + * jobs will be started. * * Input: * job job to finish * status sub-why job went away - * - * Results: - * None - * - * Side Effects: - * Final commands for the job are placed on postCommands. - * - * If we got an error and are aborting (aborting == ABORT_ERROR) and - * the job list is now empty, we are done for the day. - * If we recognized an error (errors !=0), we set the aborting flag - * to ABORT_ERROR so no more jobs will be started. - *----------------------------------------------------------------------- */ -/*ARGSUSED*/ static void JobFinish(Job *job, int status) { - Boolean done, return_job_token; + Boolean done, return_job_token; - if (DEBUG(JOB)) { - fprintf(debug_file, "Jobfinish: %d [%s], status %d\n", - job->pid, job->node->name, status); - } + DEBUG3(JOB, "JobFinish: %d [%s], status %d\n", + job->pid, job->node->name, status); - if ((WIFEXITED(status) && - (((WEXITSTATUS(status) != 0) && !(job->flags & JOB_IGNERR)))) || - WIFSIGNALED(status)) - { - /* - * If it exited non-zero and either we're doing things our - * way or we're not ignoring errors, the job is finished. - * Similarly, if the shell died because of a signal - * the job is also finished. In these - * cases, finish out the job's output before printing the exit - * status... - */ - JobClose(job); - if (job->cmdFILE != NULL && job->cmdFILE != stdout) { - (void)fclose(job->cmdFILE); - job->cmdFILE = NULL; - } - done = TRUE; - } else if (WIFEXITED(status)) { - /* - * Deal with ignored errors in -B mode. We need to print a message - * telling of the ignored error as well as setting status.w_status - * to 0 so the next command gets run. To do this, we set done to be - * TRUE if in -B mode and the job exited non-zero. - */ - done = WEXITSTATUS(status) != 0; - /* - * Old comment said: "Note we don't - * want to close down any of the streams until we know we're at the - * end." - * But we do. Otherwise when are we going to print the rest of the - * stuff? - */ - JobClose(job); - } else { - /* - * No need to close things down or anything. - */ - done = FALSE; - } + if ((WIFEXITED(status) && + ((WEXITSTATUS(status) != 0 && !job->ignerr))) || + WIFSIGNALED(status)) { + /* Finished because of an error. */ - if (done) { - if (WIFEXITED(status)) { - if (DEBUG(JOB)) { - (void)fprintf(debug_file, "Process %d [%s] exited.\n", - job->pid, job->node->name); - } - if (WEXITSTATUS(status) != 0) { - if (job->node != lastNode) { - MESSAGE(stdout, job->node); - lastNode = job->node; + JobClosePipes(job); + if (job->cmdFILE != NULL && job->cmdFILE != stdout) { + (void)fclose(job->cmdFILE); + job->cmdFILE = NULL; } -#ifdef USE_META - if (useMeta) { - meta_job_error(job, job->node, job->flags, WEXITSTATUS(status)); - } -#endif - (void)printf("*** [%s] Error code %d%s\n", - job->node->name, - WEXITSTATUS(status), - (job->flags & JOB_IGNERR) ? " (ignored)" : ""); - if (job->flags & JOB_IGNERR) { - status = 0; - } else { - PrintOnError(job->node, NULL); - } - } else if (DEBUG(JOB)) { - if (job->node != lastNode) { - MESSAGE(stdout, job->node); - lastNode = job->node; - } - (void)printf("*** [%s] Completed successfully\n", - job->node->name); - } + done = TRUE; + + } else if (WIFEXITED(status)) { + /* + * Deal with ignored errors in -B mode. We need to print a + * message telling of the ignored error as well as to run + * the next command. + */ + done = WEXITSTATUS(status) != 0; + + JobClosePipes(job); + } else { - if (job->node != lastNode) { - MESSAGE(stdout, job->node); - lastNode = job->node; - } - (void)printf("*** [%s] Signal %d\n", - job->node->name, WTERMSIG(status)); + /* No need to close things down or anything. */ + done = FALSE; } - (void)fflush(stdout); - } + + if (done) + JobFinishDone(job, &status); #ifdef USE_META - if (useMeta) { - meta_job_finish(job); - } -#endif - - return_job_token = FALSE; - - Trace_Log(JOBEND, job); - if (!(job->flags & JOB_SPECIAL)) { - if ((status != 0) || - (aborting == ABORT_ERROR) || - (aborting == ABORT_INTERRUPT)) - return_job_token = TRUE; - } - - if ((aborting != ABORT_ERROR) && (aborting != ABORT_INTERRUPT) && (status == 0)) { - /* - * As long as we aren't aborting and the job didn't return a non-zero - * status that we shouldn't ignore, we call Make_Update to update - * the parents. In addition, any saved commands for the node are placed - * on the .END target. - */ - if (job->tailCmds != NULL) { - Lst_ForEachFrom(job->node->commands, job->tailCmds, - JobSaveCommand, - job->node); + if (useMeta) { + int meta_status = meta_job_finish(job); + if (meta_status != 0 && status == 0) + status = meta_status; } - job->node->made = MADE; - if (!(job->flags & JOB_SPECIAL)) - return_job_token = TRUE; - Make_Update(job->node); - job->job_state = JOB_ST_FREE; - } else if (status != 0) { - errors += 1; - job->job_state = JOB_ST_FREE; - } +#endif - /* - * Set aborting if any error. - */ - if (errors && !keepgoing && (aborting != ABORT_INTERRUPT)) { - /* - * If we found any errors in this batch of children and the -k flag - * wasn't given, we set the aborting flag so no more jobs get - * started. - */ - aborting = ABORT_ERROR; - } + return_job_token = FALSE; - if (return_job_token) - Job_TokenReturn(); + Trace_Log(JOBEND, job); + if (!job->special) { + if (status != 0 || + (aborting == ABORT_ERROR) || aborting == ABORT_INTERRUPT) + return_job_token = TRUE; + } - if (aborting == ABORT_ERROR && jobTokensRunning == 0) { - /* - * If we are aborting and the job table is now empty, we finish. - */ - Finish(errors); - } + if (aborting != ABORT_ERROR && aborting != ABORT_INTERRUPT && + (status == 0)) { + /* + * As long as we aren't aborting and the job didn't return a + * non-zero status that we shouldn't ignore, we call + * Make_Update to update the parents. + */ + JobSaveCommands(job); + job->node->made = MADE; + if (!job->special) + return_job_token = TRUE; + Make_Update(job->node); + job->status = JOB_ST_FREE; + } else if (status != 0) { + job_errors++; + job->status = JOB_ST_FREE; + } + + if (job_errors > 0 && !opts.keepgoing && aborting != ABORT_INTERRUPT) { + /* Prevent more jobs from getting started. */ + aborting = ABORT_ERROR; + } + + if (return_job_token) + Job_TokenReturn(); + + if (aborting == ABORT_ERROR && jobTokensRunning == 0) + Finish(job_errors); } -/*- - *----------------------------------------------------------------------- - * Job_Touch -- - * Touch the given target. Called by JobStart when the -t flag was - * given +static void +TouchRegular(GNode *gn) +{ + const char *file = GNode_Path(gn); + struct utimbuf times = { now, now }; + int fd; + char c; + + if (utime(file, ×) >= 0) + return; + + fd = open(file, O_RDWR | O_CREAT, 0666); + if (fd < 0) { + (void)fprintf(stderr, "*** couldn't touch %s: %s\n", + file, strerror(errno)); + (void)fflush(stderr); + return; /* XXX: What about propagating the error? */ + } + + /* Last resort: update the file's time stamps in the traditional way. + * XXX: This doesn't work for empty files, which are sometimes used + * as marker files. */ + if (read(fd, &c, 1) == 1) { + (void)lseek(fd, 0, SEEK_SET); + while (write(fd, &c, 1) == -1 && errno == EAGAIN) + continue; + } + (void)close(fd); /* XXX: What about propagating the error? */ +} + +/* + * Touch the given target. Called by JobStart when the -t flag was given. * - * Input: - * gn the node of the file to touch - * silent TRUE if should not print message - * - * Results: - * None - * - * Side Effects: - * The data modification of the file is changed. In addition, if the - * file did not exist, it is created. - *----------------------------------------------------------------------- + * The modification date of the file is changed. + * If the file did not exist, it is created. */ void -Job_Touch(GNode *gn, Boolean silent) +Job_Touch(GNode *gn, Boolean echo) { - int streamID; /* ID of stream opened to do the touch */ - struct utimbuf times; /* Times for utime() call */ - - if (gn->type & (OP_JOIN|OP_USE|OP_USEBEFORE|OP_EXEC|OP_OPTIONAL| - OP_SPECIAL|OP_PHONY)) { - /* - * .JOIN, .USE, .ZEROTIME and .OPTIONAL targets are "virtual" targets - * and, as such, shouldn't really be created. - */ - return; - } - - if (!silent || NoExecute(gn)) { - (void)fprintf(stdout, "touch %s\n", gn->name); - (void)fflush(stdout); - } - - if (NoExecute(gn)) { - return; - } - - if (gn->type & OP_ARCHV) { - Arch_Touch(gn); - } else if (gn->type & OP_LIB) { - Arch_TouchLib(gn); - } else { - char *file = gn->path ? gn->path : gn->name; - - times.actime = times.modtime = now; - if (utime(file, ×) < 0){ - streamID = open(file, O_RDWR | O_CREAT, 0666); - - if (streamID >= 0) { - char c; - + if (gn->type & + (OP_JOIN | OP_USE | OP_USEBEFORE | OP_EXEC | OP_OPTIONAL | + OP_SPECIAL | OP_PHONY)) { /* - * Read and write a byte to the file to change the - * modification time, then close the file. + * These are "virtual" targets and should not really be + * created. */ - if (read(streamID, &c, 1) == 1) { - (void)lseek(streamID, (off_t)0, SEEK_SET); - while (write(streamID, &c, 1) == -1 && errno == EAGAIN) - continue; - } - - (void)close(streamID); - } else { - (void)fprintf(stdout, "*** couldn't touch %s: %s", - file, strerror(errno)); - (void)fflush(stdout); - } + return; } - } + + if (echo || !GNode_ShouldExecute(gn)) { + (void)fprintf(stdout, "touch %s\n", gn->name); + (void)fflush(stdout); + } + + if (!GNode_ShouldExecute(gn)) + return; + + if (gn->type & OP_ARCHV) + Arch_Touch(gn); + else if (gn->type & OP_LIB) + Arch_TouchLib(gn); + else + TouchRegular(gn); } -/*- - *----------------------------------------------------------------------- - * Job_CheckCommands -- - * Make sure the given node has all the commands it needs. +/* + * Make sure the given node has all the commands it needs. + * + * The node will have commands from the .DEFAULT rule added to it if it + * needs them. * * Input: * gn The target whose commands need verifying @@ -1191,302 +1289,324 @@ Job_Touch(GNode *gn, Boolean silent) * * Results: * TRUE if the commands list is/was ok. - * - * Side Effects: - * The node will have commands from the .DEFAULT rule added to it - * if it needs them. - *----------------------------------------------------------------------- */ Boolean Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...)) { - if (OP_NOP(gn->type) && Lst_IsEmpty(gn->commands) && - ((gn->type & OP_LIB) == 0 || Lst_IsEmpty(gn->children))) { + if (GNode_IsTarget(gn)) + return TRUE; + if (!Lst_IsEmpty(&gn->commands)) + return TRUE; + if ((gn->type & OP_LIB) && !Lst_IsEmpty(&gn->children)) + return TRUE; + /* * No commands. Look for .DEFAULT rule from which we might infer - * commands + * commands. */ - if ((DEFAULT != NULL) && !Lst_IsEmpty(DEFAULT->commands) && - (gn->type & OP_SPECIAL) == 0) { - char *p1; - /* - * Make only looks for a .DEFAULT if the node was never the - * target of an operator, so that's what we do too. If - * a .DEFAULT was given, we substitute its commands for gn's - * commands and set the IMPSRC variable to be the target's name - * The DEFAULT node acts like a transformation rule, in that - * gn also inherits any attributes or sources attached to - * .DEFAULT itself. - */ - Make_HandleUse(DEFAULT, gn); - Var_Set(IMPSRC, Var_Value(TARGET, gn, &p1), gn, 0); - if (p1) - free(p1); - } else if (Dir_MTime(gn, 0) == 0 && (gn->type & OP_SPECIAL) == 0) { - /* - * The node wasn't the target of an operator we have no .DEFAULT - * rule to go on and the target doesn't already exist. There's - * nothing more we can do for this branch. If the -k flag wasn't - * given, we stop in our tracks, otherwise we just don't update - * this node's parents so they never get examined. - */ - static const char msg[] = ": don't know how to make"; - - if (gn->flags & FROM_DEPEND) { - if (!Job_RunTarget(".STALE", gn->fname)) - fprintf(stdout, "%s: %s, %d: ignoring stale %s for %s\n", - progname, gn->fname, gn->lineno, makeDependfile, - gn->name); + if (defaultNode != NULL && !Lst_IsEmpty(&defaultNode->commands) && + !(gn->type & OP_SPECIAL)) { + /* + * The traditional Make only looks for a .DEFAULT if the node + * was never the target of an operator, so that's what we do + * too. + * + * The .DEFAULT node acts like a transformation rule, in that + * gn also inherits any attributes or sources attached to + * .DEFAULT itself. + */ + Make_HandleUse(defaultNode, gn); + Var_Set(gn, IMPSRC, GNode_VarTarget(gn)); return TRUE; - } - - if (gn->type & OP_OPTIONAL) { - (void)fprintf(stdout, "%s%s %s (ignored)\n", progname, - msg, gn->name); - (void)fflush(stdout); - } else if (keepgoing) { - (void)fprintf(stdout, "%s%s %s (continuing)\n", progname, - msg, gn->name); - (void)fflush(stdout); - return FALSE; - } else { - (*abortProc)("%s%s %s. Stop", progname, msg, gn->name); - return FALSE; - } } - } - return TRUE; + + Dir_UpdateMTime(gn, FALSE); + if (gn->mtime != 0 || (gn->type & OP_SPECIAL)) + return TRUE; + + /* + * The node wasn't the target of an operator. We have no .DEFAULT + * rule to go on and the target doesn't already exist. There's + * nothing more we can do for this branch. If the -k flag wasn't + * given, we stop in our tracks, otherwise we just don't update + * this node's parents so they never get examined. + */ + + if (gn->flags & FROM_DEPEND) { + if (!Job_RunTarget(".STALE", gn->fname)) + fprintf(stdout, + "%s: %s, %d: ignoring stale %s for %s\n", + progname, gn->fname, gn->lineno, makeDependfile, + gn->name); + return TRUE; + } + + if (gn->type & OP_OPTIONAL) { + (void)fprintf(stdout, "%s: don't know how to make %s (%s)\n", + progname, gn->name, "ignored"); + (void)fflush(stdout); + return TRUE; + } + + if (opts.keepgoing) { + (void)fprintf(stdout, "%s: don't know how to make %s (%s)\n", + progname, gn->name, "continuing"); + (void)fflush(stdout); + return FALSE; + } + + abortProc("%s: don't know how to make %s. Stop", progname, gn->name); + return FALSE; } -/*- - *----------------------------------------------------------------------- - * JobExec -- - * Execute the shell for the given job. Called from JobStart +/* + * Execute the shell for the given job. * - * Input: - * job Job to execute - * - * Results: - * None. - * - * Side Effects: - * A shell is executed, outputs is altered and the Job structure added - * to the job table. - * - *----------------------------------------------------------------------- + * See Job_CatchOutput for handling the output of the shell. */ static void JobExec(Job *job, char **argv) { - int cpid; /* ID of new child */ - sigset_t mask; + int cpid; /* ID of new child */ + sigset_t mask; - job->flags &= ~JOB_TRACED; + if (DEBUG(JOB)) { + int i; - if (DEBUG(JOB)) { - int i; - - (void)fprintf(debug_file, "Running %s %sly\n", job->node->name, "local"); - (void)fprintf(debug_file, "\tCommand: "); - for (i = 0; argv[i] != NULL; i++) { - (void)fprintf(debug_file, "%s ", argv[i]); + debug_printf("Running %s\n", job->node->name); + debug_printf("\tCommand: "); + for (i = 0; argv[i] != NULL; i++) { + debug_printf("%s ", argv[i]); + } + debug_printf("\n"); } - (void)fprintf(debug_file, "\n"); - } - /* - * Some jobs produce no output and it's disconcerting to have - * no feedback of their running (since they produce no output, the - * banner with their name in it never appears). This is an attempt to - * provide that feedback, even if nothing follows it. - */ - if ((lastNode != job->node) && !(job->flags & JOB_SILENT)) { - MESSAGE(stdout, job->node); - lastNode = job->node; - } + /* + * Some jobs produce no output and it's disconcerting to have + * no feedback of their running (since they produce no output, the + * banner with their name in it never appears). This is an attempt to + * provide that feedback, even if nothing follows it. + */ + if (job->echo) + SwitchOutputTo(job->node); - /* No interruptions until this job is on the `jobs' list */ - JobSigLock(&mask); + /* No interruptions until this job is on the `jobs' list */ + JobSigLock(&mask); - /* Pre-emptively mark job running, pid still zero though */ - job->job_state = JOB_ST_RUNNING; + /* Pre-emptively mark job running, pid still zero though */ + job->status = JOB_ST_RUNNING; - cpid = vFork(); - if (cpid == -1) - Punt("Cannot vfork: %s", strerror(errno)); + Var_ReexportVars(); - if (cpid == 0) { - /* Child */ - sigset_t tmask; + cpid = vfork(); + if (cpid == -1) + Punt("Cannot vfork: %s", strerror(errno)); + + if (cpid == 0) { + /* Child */ + sigset_t tmask; + +#ifdef USE_META + if (useMeta) { + meta_job_child(job); + } +#endif + /* + * Reset all signal handlers; this is necessary because we + * also need to unblock signals before we exec(2). + */ + JobSigReset(); + + /* Now unblock signals */ + sigemptyset(&tmask); + JobSigUnlock(&tmask); + + /* + * Must duplicate the input stream down to the child's input + * and reset it to the beginning (again). Since the stream + * was marked close-on-exec, we must clear that bit in the + * new input. + */ + if (dup2(fileno(job->cmdFILE), 0) == -1) + execDie("dup2", "job->cmdFILE"); + if (fcntl(0, F_SETFD, 0) == -1) + execDie("fcntl clear close-on-exec", "stdin"); + if (lseek(0, 0, SEEK_SET) == -1) + execDie("lseek to 0", "stdin"); + + if (job->node->type & (OP_MAKE | OP_SUBMAKE)) { + /* + * Pass job token pipe to submakes. + */ + if (fcntl(tokenWaitJob.inPipe, F_SETFD, 0) == -1) + execDie("clear close-on-exec", + "tokenWaitJob.inPipe"); + if (fcntl(tokenWaitJob.outPipe, F_SETFD, 0) == -1) + execDie("clear close-on-exec", + "tokenWaitJob.outPipe"); + } + + /* + * Set up the child's output to be routed through the pipe + * we've created for it. + */ + if (dup2(job->outPipe, 1) == -1) + execDie("dup2", "job->outPipe"); + + /* + * The output channels are marked close on exec. This bit + * was duplicated by the dup2(on some systems), so we have + * to clear it before routing the shell's error output to + * the same place as its standard output. + */ + if (fcntl(1, F_SETFD, 0) == -1) + execDie("clear close-on-exec", "stdout"); + if (dup2(1, 2) == -1) + execDie("dup2", "1, 2"); + + /* + * We want to switch the child into a different process + * family so we can kill it and all its descendants in + * one fell swoop, by killing its process family, but not + * commit suicide. + */ +#if defined(MAKE_NATIVE) || defined(HAVE_SETPGID) +# if defined(SYSV) + /* XXX: dsl - I'm sure this should be setpgrp()... */ + (void)setsid(); +# else + (void)setpgid(0, getpid()); +# endif +#endif + + (void)execv(shellPath, argv); + execDie("exec", shellPath); + } + + /* Parent, continuing after the child exec */ + job->pid = cpid; + + Trace_Log(JOBSTART, job); #ifdef USE_META if (useMeta) { - meta_job_child(job); + meta_job_parent(job, cpid); } #endif - /* - * Reset all signal handlers; this is necessary because we also - * need to unblock signals before we exec(2). - */ - JobSigReset(); - - /* Now unblock signals */ - sigemptyset(&tmask); - JobSigUnlock(&tmask); /* - * Must duplicate the input stream down to the child's input and - * reset it to the beginning (again). Since the stream was marked - * close-on-exec, we must clear that bit in the new input. + * Set the current position in the buffer to the beginning + * and mark another stream to watch in the outputs mask */ - if (dup2(FILENO(job->cmdFILE), 0) == -1) { - execError("dup2", "job->cmdFILE"); - _exit(1); - } - (void)fcntl(0, F_SETFD, 0); - (void)lseek(0, (off_t)0, SEEK_SET); + job->curPos = 0; - if (job->node->type & (OP_MAKE | OP_SUBMAKE)) { - /* - * Pass job token pipe to submakes. - */ - fcntl(tokenWaitJob.inPipe, F_SETFD, 0); - fcntl(tokenWaitJob.outPipe, F_SETFD, 0); - } - - /* - * Set up the child's output to be routed through the pipe - * we've created for it. - */ - if (dup2(job->outPipe, 1) == -1) { - execError("dup2", "job->outPipe"); - _exit(1); - } - /* - * The output channels are marked close on exec. This bit was - * duplicated by the dup2(on some systems), so we have to clear - * it before routing the shell's error output to the same place as - * its standard output. - */ - (void)fcntl(1, F_SETFD, 0); - if (dup2(1, 2) == -1) { - execError("dup2", "1, 2"); - _exit(1); + watchfd(job); + + if (job->cmdFILE != NULL && job->cmdFILE != stdout) { + (void)fclose(job->cmdFILE); + job->cmdFILE = NULL; } - /* - * We want to switch the child into a different process family so - * we can kill it and all its descendants in one fell swoop, - * by killing its process family, but not commit suicide. - */ -#if defined(MAKE_NATIVE) || defined(HAVE_SETPGID) -#if defined(SYSV) - /* XXX: dsl - I'm sure this should be setpgrp()... */ - (void)setsid(); -#else - (void)setpgid(0, getpid()); -#endif -#endif - - Var_ExportVars(); - - (void)execv(shellPath, argv); - execError("exec", shellPath); - _exit(1); - } - - /* Parent, continuing after the child exec */ - job->pid = cpid; - - Trace_Log(JOBSTART, job); - - /* - * Set the current position in the buffer to the beginning - * and mark another stream to watch in the outputs mask - */ - job->curPos = 0; - - watchfd(job); - - if (job->cmdFILE != NULL && job->cmdFILE != stdout) { - (void)fclose(job->cmdFILE); - job->cmdFILE = NULL; - } - - /* - * Now the job is actually running, add it to the table. - */ - if (DEBUG(JOB)) { - fprintf(debug_file, "JobExec(%s): pid %d added to jobs table\n", - job->node->name, job->pid); - job_table_dump("job started"); - } - JobSigUnlock(&mask); + /* Now that the job is actually running, add it to the table. */ + if (DEBUG(JOB)) { + debug_printf("JobExec(%s): pid %d added to jobs table\n", + job->node->name, job->pid); + job_table_dump("job started"); + } + JobSigUnlock(&mask); } -/*- - *----------------------------------------------------------------------- - * JobMakeArgv -- - * Create the argv needed to execute the shell for a given job. - * - * - * Results: - * - * Side Effects: - * - *----------------------------------------------------------------------- - */ +/* Create the argv needed to execute the shell for a given job. */ static void JobMakeArgv(Job *job, char **argv) { - int argc; - static char args[10]; /* For merged arguments */ + int argc; + static char args[10]; /* For merged arguments */ - argv[0] = UNCONST(shellName); - argc = 1; + argv[0] = UNCONST(shellName); + argc = 1; - if ((commandShell->exit && (*commandShell->exit != '-')) || - (commandShell->echo && (*commandShell->echo != '-'))) - { - /* - * At least one of the flags doesn't have a minus before it, so - * merge them together. Have to do this because the *(&(@*#*&#$# - * Bourne shell thinks its second argument is a file to source. - * Grrrr. Note the ten-character limitation on the combined arguments. - */ - (void)snprintf(args, sizeof(args), "-%s%s", - ((job->flags & JOB_IGNERR) ? "" : - (commandShell->exit ? commandShell->exit : "")), - ((job->flags & JOB_SILENT) ? "" : - (commandShell->echo ? commandShell->echo : ""))); + if ((shell->errFlag != NULL && shell->errFlag[0] != '-') || + (shell->echoFlag != NULL && shell->echoFlag[0] != '-')) { + /* + * At least one of the flags doesn't have a minus before it, + * so merge them together. Have to do this because the Bourne + * shell thinks its second argument is a file to source. + * Grrrr. Note the ten-character limitation on the combined + * arguments. + * + * TODO: Research until when the above comments were + * practically relevant. + */ + (void)snprintf(args, sizeof args, "-%s%s", + (job->ignerr ? "" : + (shell->errFlag != NULL ? shell->errFlag : "")), + (!job->echo ? "" : + (shell->echoFlag != NULL ? shell->echoFlag : ""))); - if (args[1]) { - argv[argc] = args; - argc++; + if (args[1] != '\0') { + argv[argc] = args; + argc++; + } + } else { + if (!job->ignerr && shell->errFlag != NULL) { + argv[argc] = UNCONST(shell->errFlag); + argc++; + } + if (job->echo && shell->echoFlag != NULL) { + argv[argc] = UNCONST(shell->echoFlag); + argc++; + } } - } else { - if (!(job->flags & JOB_IGNERR) && commandShell->exit) { - argv[argc] = UNCONST(commandShell->exit); - argc++; - } - if (!(job->flags & JOB_SILENT) && commandShell->echo) { - argv[argc] = UNCONST(commandShell->echo); - argc++; - } - } - argv[argc] = NULL; + argv[argc] = NULL; } -/*- - *----------------------------------------------------------------------- - * JobStart -- - * Start a target-creation process going for the target described - * by the graph node gn. +static void +JobWriteShellCommands(Job *job, GNode *gn, Boolean cmdsOK, Boolean *out_run) +{ + /* + * tfile is the name of a file into which all shell commands + * are put. It is removed before the child shell is executed, + * unless DEBUG(SCRIPT) is set. + */ + char tfile[MAXPATHLEN]; + int tfd; /* File descriptor to the temp file */ + + /* + * We're serious here, but if the commands were bogus, we're + * also dead... + */ + if (!cmdsOK) { + PrintOnError(gn, NULL); /* provide some clue */ + DieHorribly(); + } + + tfd = Job_TempFile(TMPPAT, tfile, sizeof tfile); + + job->cmdFILE = fdopen(tfd, "w+"); + if (job->cmdFILE == NULL) + Punt("Could not fdopen %s", tfile); + + (void)fcntl(fileno(job->cmdFILE), F_SETFD, FD_CLOEXEC); + +#ifdef USE_META + if (useMeta) { + meta_job_start(job, gn); + if (gn->type & OP_SILENT) /* might have changed */ + job->echo = FALSE; + } +#endif + + *out_run = JobPrintCommands(job); +} + +/* + * Start a target-creation process going for the target described by the + * graph node gn. * * Input: * gn target to create * flags flags for the job to override normal ones. - * e.g. JOB_SPECIAL or JOB_IGNDOTS * previous The previous Job structure for this node, if any. * * Results: @@ -1498,479 +1618,357 @@ JobMakeArgv(Job *job, char **argv) * A new Job node is created and added to the list of running * jobs. PMake is forked and a child shell created. * - * NB: I'm fairly sure that this code is never called with JOB_SPECIAL set - * JOB_IGNDOTS is never set (dsl) - * Also the return value is ignored by everyone. - *----------------------------------------------------------------------- + * NB: The return value is ignored by everyone. */ -static int -JobStart(GNode *gn, int flags) +static JobStartResult +JobStart(GNode *gn, Boolean special) { - Job *job; /* new job descriptor */ - char *argv[10]; /* Argument vector to shell */ - Boolean cmdsOK; /* true if the nodes commands were all right */ - Boolean noExec; /* Set true if we decide not to run the job */ - int tfd; /* File descriptor to the temp file */ + Job *job; /* new job descriptor */ + char *argv[10]; /* Argument vector to shell */ + Boolean cmdsOK; /* true if the nodes commands were all right */ + Boolean run; - for (job = job_table; job < job_table_end; job++) { - if (job->job_state == JOB_ST_FREE) - break; - } - if (job >= job_table_end) - Punt("JobStart no job slots vacant"); + for (job = job_table; job < job_table_end; job++) { + if (job->status == JOB_ST_FREE) + break; + } + if (job >= job_table_end) + Punt("JobStart no job slots vacant"); - memset(job, 0, sizeof *job); - job->job_state = JOB_ST_SETUP; - if (gn->type & OP_SPECIAL) - flags |= JOB_SPECIAL; + memset(job, 0, sizeof *job); + job->node = gn; + job->tailCmds = NULL; + job->status = JOB_ST_SET_UP; - job->node = gn; - job->tailCmds = NULL; + job->special = special || gn->type & OP_SPECIAL; + job->ignerr = opts.ignoreErrors || gn->type & OP_IGNORE; + job->echo = !(opts.beSilent || gn->type & OP_SILENT); - /* - * Set the initial value of the flags for this job based on the global - * ones and the node's attributes... Any flags supplied by the caller - * are also added to the field. - */ - job->flags = 0; - if (Targ_Ignore(gn)) { - job->flags |= JOB_IGNERR; - } - if (Targ_Silent(gn)) { - job->flags |= JOB_SILENT; - } - job->flags |= flags; - - /* - * Check the commands now so any attributes from .DEFAULT have a chance - * to migrate to the node - */ - cmdsOK = Job_CheckCommands(gn, Error); - - job->inPollfd = NULL; - /* - * If the -n flag wasn't given, we open up OUR (not the child's) - * temporary file to stuff commands in it. The thing is rd/wr so we don't - * need to reopen it to feed it to the shell. If the -n flag *was* given, - * we just set the file to be stdout. Cute, huh? - */ - if (((gn->type & OP_MAKE) && !(noRecursiveExecute)) || - (!noExecute && !touchFlag)) { /* - * tfile is the name of a file into which all shell commands are - * put. It is removed before the child shell is executed, unless - * DEBUG(SCRIPT) is set. + * Check the commands now so any attributes from .DEFAULT have a + * chance to migrate to the node. */ - char *tfile; - sigset_t mask; - /* - * We're serious here, but if the commands were bogus, we're - * also dead... - */ - if (!cmdsOK) { - PrintOnError(gn, NULL); /* provide some clue */ - DieHorribly(); + cmdsOK = Job_CheckCommands(gn, Error); + + job->inPollfd = NULL; + + if (Lst_IsEmpty(&gn->commands)) { + job->cmdFILE = stdout; + run = FALSE; + } else if (((gn->type & OP_MAKE) && !opts.noRecursiveExecute) || + (!opts.noExecute && !opts.touchFlag)) { + /* + * The above condition looks very similar to + * GNode_ShouldExecute but is subtly different. It prevents + * that .MAKE targets are touched since these are usually + * virtual targets. + */ + + JobWriteShellCommands(job, gn, cmdsOK, &run); + (void)fflush(job->cmdFILE); + } else if (!GNode_ShouldExecute(gn)) { + /* + * Just print all the commands to stdout in one fell swoop. + * This still sets up job->tailCmds correctly. + */ + SwitchOutputTo(gn); + job->cmdFILE = stdout; + if (cmdsOK) + JobPrintCommands(job); + run = FALSE; + (void)fflush(job->cmdFILE); + } else { + Job_Touch(gn, job->echo); + run = FALSE; } - JobSigLock(&mask); - tfd = mkTempFile(TMPPAT, &tfile); - if (!DEBUG(SCRIPT)) - (void)eunlink(tfile); - JobSigUnlock(&mask); + /* If we're not supposed to execute a shell, don't. */ + if (!run) { + if (!job->special) + Job_TokenReturn(); + /* Unlink and close the command file if we opened one */ + if (job->cmdFILE != NULL && job->cmdFILE != stdout) { + (void)fclose(job->cmdFILE); + job->cmdFILE = NULL; + } - job->cmdFILE = fdopen(tfd, "w+"); - if (job->cmdFILE == NULL) { - Punt("Could not fdopen %s", tfile); - } - (void)fcntl(FILENO(job->cmdFILE), F_SETFD, 1); - /* - * Send the commands to the command file, flush all its buffers then - * rewind and remove the thing. - */ - noExec = FALSE; - -#ifdef USE_META - if (useMeta) { - meta_job_start(job, gn); - if (Targ_Silent(gn)) { /* might have changed */ - job->flags |= JOB_SILENT; - } - } -#endif - /* - * We can do all the commands at once. hooray for sanity - */ - numCommands = 0; - Lst_ForEach(gn->commands, JobPrintCommand, job); - - /* - * If we didn't print out any commands to the shell script, - * there's not much point in executing the shell, is there? - */ - if (numCommands == 0) { - noExec = TRUE; - } - - free(tfile); - } else if (NoExecute(gn)) { - /* - * Not executing anything -- just print all the commands to stdout - * in one fell swoop. This will still set up job->tailCmds correctly. - */ - if (lastNode != gn) { - MESSAGE(stdout, gn); - lastNode = gn; - } - job->cmdFILE = stdout; - /* - * Only print the commands if they're ok, but don't die if they're - * not -- just let the user know they're bad and keep going. It - * doesn't do any harm in this case and may do some good. - */ - if (cmdsOK) { - Lst_ForEach(gn->commands, JobPrintCommand, job); - } - /* - * Don't execute the shell, thank you. - */ - noExec = TRUE; - } else { - /* - * Just touch the target and note that no shell should be executed. - * Set cmdFILE to stdout to make life easier. Check the commands, too, - * but don't die if they're no good -- it does no harm to keep working - * up the graph. - */ - job->cmdFILE = stdout; - Job_Touch(gn, job->flags&JOB_SILENT); - noExec = TRUE; - } - /* Just in case it isn't already... */ - (void)fflush(job->cmdFILE); - - /* - * If we're not supposed to execute a shell, don't. - */ - if (noExec) { - if (!(job->flags & JOB_SPECIAL)) - Job_TokenReturn(); - /* - * Unlink and close the command file if we opened one - */ - if (job->cmdFILE != stdout) { - if (job->cmdFILE != NULL) { - (void)fclose(job->cmdFILE); - job->cmdFILE = NULL; - } + /* + * We only want to work our way up the graph if we aren't + * here because the commands for the job were no good. + */ + if (cmdsOK && aborting == ABORT_NONE) { + JobSaveCommands(job); + job->node->made = MADE; + Make_Update(job->node); + } + job->status = JOB_ST_FREE; + return cmdsOK ? JOB_FINISHED : JOB_ERROR; } /* - * We only want to work our way up the graph if we aren't here because - * the commands for the job were no good. + * Set up the control arguments to the shell. This is based on the + * flags set earlier for this job. */ - if (cmdsOK && aborting == 0) { - if (job->tailCmds != NULL) { - Lst_ForEachFrom(job->node->commands, job->tailCmds, - JobSaveCommand, - job->node); - } - job->node->made = MADE; - Make_Update(job->node); - } - job->job_state = JOB_ST_FREE; - return cmdsOK ? JOB_FINISHED : JOB_ERROR; - } + JobMakeArgv(job, argv); - /* - * Set up the control arguments to the shell. This is based on the flags - * set earlier for this job. - */ - JobMakeArgv(job, argv); + /* Create the pipe by which we'll get the shell's output. */ + JobCreatePipe(job, 3); - /* Create the pipe by which we'll get the shell's output. */ - JobCreatePipe(job, 3); - - JobExec(job, argv); - return(JOB_RUNNING); + JobExec(job, argv); + return JOB_RUNNING; } +/* + * Print the output of the shell command, skipping the noPrint text of the + * shell, if any. The default shell does not have noPrint though, which means + * that in all practical cases, handling the output is left to the caller. + */ static char * -JobOutput(Job *job, char *cp, char *endp, int msg) +JobOutput(char *cp, char *endp) /* XXX: should all be const */ { - char *ecp; + char *ecp; /* XXX: should be const */ - if (commandShell->noPrint) { - ecp = Str_FindSubstring(cp, commandShell->noPrint); - while (ecp != NULL) { - if (cp != ecp) { - *ecp = '\0'; - if (!beSilent && msg && job->node != lastNode) { - MESSAGE(stdout, job->node); - lastNode = job->node; - } - /* - * The only way there wouldn't be a newline after - * this line is if it were the last in the buffer. - * however, since the non-printable comes after it, - * there must be a newline, so we don't print one. - */ - (void)fprintf(stdout, "%s", cp); - (void)fflush(stdout); - } - cp = ecp + commandShell->noPLen; - if (cp != endp) { - /* - * Still more to print, look again after skipping - * the whitespace following the non-printable - * command.... - */ - cp++; - while (*cp == ' ' || *cp == '\t' || *cp == '\n') { - cp++; - } - ecp = Str_FindSubstring(cp, commandShell->noPrint); - } else { + if (shell->noPrint == NULL || shell->noPrint[0] == '\0') return cp; - } + + /* + * XXX: What happens if shell->noPrint occurs on the boundary of + * the buffer? To work correctly in all cases, this should rather + * be a proper stream filter instead of doing string matching on + * selected chunks of the output. + */ + while ((ecp = strstr(cp, shell->noPrint)) != NULL) { + if (ecp != cp) { + *ecp = '\0'; /* XXX: avoid writing to the buffer */ + /* + * The only way there wouldn't be a newline after + * this line is if it were the last in the buffer. + * however, since the noPrint output comes after it, + * there must be a newline, so we don't print one. + */ + /* XXX: What about null bytes in the output? */ + (void)fprintf(stdout, "%s", cp); + (void)fflush(stdout); + } + cp = ecp + shell->noPrintLen; + if (cp == endp) + break; + cp++; /* skip over the (XXX: assumed) newline */ + pp_skip_whitespace(&cp); } - } - return cp; + return cp; } -/*- - *----------------------------------------------------------------------- - * JobDoOutput -- - * This function is called at different times depending on - * whether the user has specified that output is to be collected - * via pipes or temporary files. In the former case, we are called - * whenever there is something to read on the pipe. We collect more - * output from the given job and store it in the job's outBuf. If - * this makes up a line, we print it tagged by the job's identifier, - * as necessary. - * If output has been collected in a temporary file, we open the - * file and read it line by line, transfering it to our own - * output channel until the file is empty. At which point we - * remove the temporary file. - * In both cases, however, we keep our figurative eye out for the - * 'noPrint' line for the shell from which the output came. If - * we recognize a line, we don't print it. If the command is not - * alone on the line (the character after it is not \0 or \n), we - * do print whatever follows it. +/* + * This function is called whenever there is something to read on the pipe. + * We collect more output from the given job and store it in the job's + * outBuf. If this makes up a line, we print it tagged by the job's + * identifier, as necessary. + * + * In the output of the shell, the 'noPrint' lines are removed. If the + * command is not alone on the line (the character after it is not \0 or + * \n), we do print whatever follows it. * * Input: * job the job whose output needs printing * finish TRUE if this is the last time we'll be called * for this job - * - * Results: - * None - * - * Side Effects: - * curPos may be shifted as may the contents of outBuf. - *----------------------------------------------------------------------- */ -STATIC void +static void JobDoOutput(Job *job, Boolean finish) { - Boolean gotNL = FALSE; /* true if got a newline */ - Boolean fbuf; /* true if our buffer filled up */ - int nr; /* number of bytes read */ - int i; /* auxiliary index into outBuf */ - int max; /* limit for i (end of current data) */ - int nRead; /* (Temporary) number of bytes read */ + Boolean gotNL; /* true if got a newline */ + Boolean fbuf; /* true if our buffer filled up */ + size_t nr; /* number of bytes read */ + size_t i; /* auxiliary index into outBuf */ + size_t max; /* limit for i (end of current data) */ + ssize_t nRead; /* (Temporary) number of bytes read */ - /* - * Read as many bytes as will fit in the buffer. - */ -end_loop: - gotNL = FALSE; - fbuf = FALSE; + /* Read as many bytes as will fit in the buffer. */ +again: + gotNL = FALSE; + fbuf = FALSE; - nRead = read(job->inPipe, &job->outBuf[job->curPos], - JOB_BUFSIZE - job->curPos); - if (nRead < 0) { - if (errno == EAGAIN) - return; - if (DEBUG(JOB)) { - perror("JobDoOutput(piperead)"); - } - nr = 0; - } else { - nr = nRead; - } - - /* - * If we hit the end-of-file (the job is dead), we must flush its - * remaining output, so pretend we read a newline if there's any - * output remaining in the buffer. - * Also clear the 'finish' flag so we stop looping. - */ - if ((nr == 0) && (job->curPos != 0)) { - job->outBuf[job->curPos] = '\n'; - nr = 1; - finish = FALSE; - } else if (nr == 0) { - finish = FALSE; - } - - /* - * Look for the last newline in the bytes we just got. If there is - * one, break out of the loop with 'i' as its index and gotNL set - * TRUE. - */ - max = job->curPos + nr; - for (i = job->curPos + nr - 1; i >= job->curPos; i--) { - if (job->outBuf[i] == '\n') { - gotNL = TRUE; - break; - } else if (job->outBuf[i] == '\0') { - /* - * Why? - */ - job->outBuf[i] = ' '; - } - } - - if (!gotNL) { - job->curPos += nr; - if (job->curPos == JOB_BUFSIZE) { - /* - * If we've run out of buffer space, we have no choice - * but to print the stuff. sigh. - */ - fbuf = TRUE; - i = job->curPos; - } - } - if (gotNL || fbuf) { - /* - * Need to send the output to the screen. Null terminate it - * first, overwriting the newline character if there was one. - * So long as the line isn't one we should filter (according - * to the shell description), we print the line, preceded - * by a target banner if this target isn't the same as the - * one for which we last printed something. - * The rest of the data in the buffer are then shifted down - * to the start of the buffer and curPos is set accordingly. - */ - job->outBuf[i] = '\0'; - if (i >= job->curPos) { - char *cp; - - cp = JobOutput(job, job->outBuf, &job->outBuf[i], FALSE); - - /* - * There's still more in that thar buffer. This time, though, - * we know there's no newline at the end, so we add one of - * our own free will. - */ - if (*cp != '\0') { - if (!beSilent && job->node != lastNode) { - MESSAGE(stdout, job->node); - lastNode = job->node; + nRead = read(job->inPipe, &job->outBuf[job->curPos], + JOB_BUFSIZE - job->curPos); + if (nRead < 0) { + if (errno == EAGAIN) + return; + if (DEBUG(JOB)) { + perror("JobDoOutput(piperead)"); } -#ifdef USE_META - if (useMeta) { - meta_job_output(job, cp, gotNL ? "\n" : ""); - } -#endif - (void)fprintf(stdout, "%s%s", cp, gotNL ? "\n" : ""); - (void)fflush(stdout); - } - } - /* - * max is the last offset still in the buffer. Move any remaining - * characters to the start of the buffer and update the end marker - * curPos. - */ - if (i < max) { - (void)memmove(job->outBuf, &job->outBuf[i + 1], max - (i + 1)); - job->curPos = max - (i + 1); + nr = 0; } else { - assert(i == max); - job->curPos = 0; + nr = (size_t)nRead; } - } - if (finish) { + /* - * If the finish flag is true, we must loop until we hit - * end-of-file on the pipe. This is guaranteed to happen - * eventually since the other end of the pipe is now closed - * (we closed it explicitly and the child has exited). When - * we do get an EOF, finish will be set FALSE and we'll fall - * through and out. + * If we hit the end-of-file (the job is dead), we must flush its + * remaining output, so pretend we read a newline if there's any + * output remaining in the buffer. + * Also clear the 'finish' flag so we stop looping. */ - goto end_loop; - } + if (nr == 0 && job->curPos != 0) { + job->outBuf[job->curPos] = '\n'; + nr = 1; + finish = FALSE; + } else if (nr == 0) { + finish = FALSE; + } + + /* + * Look for the last newline in the bytes we just got. If there is + * one, break out of the loop with 'i' as its index and gotNL set + * TRUE. + */ + max = job->curPos + nr; + for (i = job->curPos + nr - 1; + i >= job->curPos && i != (size_t)-1; i--) { + if (job->outBuf[i] == '\n') { + gotNL = TRUE; + break; + } else if (job->outBuf[i] == '\0') { + /* + * Why? + */ + job->outBuf[i] = ' '; + } + } + + if (!gotNL) { + job->curPos += nr; + if (job->curPos == JOB_BUFSIZE) { + /* + * If we've run out of buffer space, we have no choice + * but to print the stuff. sigh. + */ + fbuf = TRUE; + i = job->curPos; + } + } + if (gotNL || fbuf) { + /* + * Need to send the output to the screen. Null terminate it + * first, overwriting the newline character if there was one. + * So long as the line isn't one we should filter (according + * to the shell description), we print the line, preceded + * by a target banner if this target isn't the same as the + * one for which we last printed something. + * The rest of the data in the buffer are then shifted down + * to the start of the buffer and curPos is set accordingly. + */ + job->outBuf[i] = '\0'; + if (i >= job->curPos) { + char *cp; + + cp = JobOutput(job->outBuf, &job->outBuf[i]); + + /* + * There's still more in that thar buffer. This time, + * though, we know there's no newline at the end, so + * we add one of our own free will. + */ + if (*cp != '\0') { + if (!opts.beSilent) + SwitchOutputTo(job->node); +#ifdef USE_META + if (useMeta) { + meta_job_output(job, cp, + gotNL ? "\n" : ""); + } +#endif + (void)fprintf(stdout, "%s%s", cp, + gotNL ? "\n" : ""); + (void)fflush(stdout); + } + } + /* + * max is the last offset still in the buffer. Move any + * remaining characters to the start of the buffer and + * update the end marker curPos. + */ + if (i < max) { + (void)memmove(job->outBuf, &job->outBuf[i + 1], + max - (i + 1)); + job->curPos = max - (i + 1); + } else { + assert(i == max); + job->curPos = 0; + } + } + if (finish) { + /* + * If the finish flag is true, we must loop until we hit + * end-of-file on the pipe. This is guaranteed to happen + * eventually since the other end of the pipe is now closed + * (we closed it explicitly and the child has exited). When + * we do get an EOF, finish will be set FALSE and we'll fall + * through and out. + */ + goto again; + } } static void JobRun(GNode *targ) { -#ifdef notyet - /* - * Unfortunately it is too complicated to run .BEGIN, .END, - * and .INTERRUPT job in the parallel job module. This has - * the nice side effect that it avoids a lot of other problems. - */ - Lst lst = Lst_Init(FALSE); - Lst_AtEnd(lst, targ); - (void)Make_Run(lst); - Lst_Destroy(lst, NULL); - JobStart(targ, JOB_SPECIAL); - while (jobTokensRunning) { - Job_CatchOutput(); - } +#if 0 + /* + * Unfortunately it is too complicated to run .BEGIN, .END, and + * .INTERRUPT job in the parallel job module. As of 2020-09-25, + * unit-tests/deptgt-end-jobs.mk hangs in an endless loop. + * + * Running these jobs in compat mode also guarantees that these + * jobs do not overlap with other unrelated jobs. + */ + GNodeList lst = LST_INIT; + Lst_Append(&lst, targ); + (void)Make_Run(&lst); + Lst_Done(&lst); + JobStart(targ, TRUE); + while (jobTokensRunning != 0) { + Job_CatchOutput(); + } #else - Compat_Make(targ, targ); - if (targ->made == ERROR) { - PrintOnError(targ, "\n\nStop."); - exit(1); - } + Compat_Make(targ, targ); + /* XXX: Replace with GNode_IsError(gn) */ + if (targ->made == ERROR) { + PrintOnError(targ, "\n\nStop."); + exit(1); + } #endif } -/*- - *----------------------------------------------------------------------- - * Job_CatchChildren -- - * Handle the exit of a child. Called from Make_Make. +/* + * Handle the exit of a child. Called from Make_Make. * - * Input: - * block TRUE if should block on the wait - * - * Results: - * none. - * - * Side Effects: - * The job descriptor is removed from the list of children. + * The job descriptor is removed from the list of children. * * Notes: * We do waits, blocking or not, according to the wisdom of our * caller, until there are no more children to report. For each * job, call JobFinish to finish things off. - * - *----------------------------------------------------------------------- */ - void Job_CatchChildren(void) { - int pid; /* pid of dead child */ - int status; /* Exit/termination status */ + int pid; /* pid of dead child */ + int status; /* Exit/termination status */ - /* - * Don't even bother if we know there's no one around. - */ - if (jobTokensRunning == 0) - return; + /* Don't even bother if we know there's no one around. */ + if (jobTokensRunning == 0) + return; - while ((pid = waitpid((pid_t) -1, &status, WNOHANG | WUNTRACED)) > 0) { - if (DEBUG(JOB)) { - (void)fprintf(debug_file, "Process %d exited/stopped status %x.\n", pid, - status); + /* Have we received SIGCHLD since last call? */ + if (caught_sigchld == 0) + return; + caught_sigchld = 0; + + while ((pid = waitpid((pid_t)-1, &status, WNOHANG | WUNTRACED)) > 0) { + DEBUG2(JOB, "Process %d exited/stopped status %x.\n", + pid, status); + JobReapChild(pid, status, TRUE); } - JobReapChild(pid, status, TRUE); - } } /* @@ -1980,373 +1978,349 @@ Job_CatchChildren(void) void JobReapChild(pid_t pid, int status, Boolean isJobs) { - Job *job; /* job descriptor for dead child */ + Job *job; /* job descriptor for dead child */ - /* - * Don't even bother if we know there's no one around. - */ - if (jobTokensRunning == 0) - return; + /* Don't even bother if we know there's no one around. */ + if (jobTokensRunning == 0) + return; - job = JobFindPid(pid, JOB_ST_RUNNING, isJobs); - if (job == NULL) { - if (isJobs) { - if (!lurking_children) - Error("Child (%d) status %x not in table?", pid, status); + job = JobFindPid(pid, JOB_ST_RUNNING, isJobs); + if (job == NULL) { + if (isJobs) { + if (!lurking_children) + Error("Child (%d) status %x not in table?", + pid, status); + } + return; /* not ours */ } - return; /* not ours */ - } - if (WIFSTOPPED(status)) { - if (DEBUG(JOB)) { - (void)fprintf(debug_file, "Process %d (%s) stopped.\n", - job->pid, job->node->name); + if (WIFSTOPPED(status)) { + DEBUG2(JOB, "Process %d (%s) stopped.\n", + job->pid, job->node->name); + if (!make_suspended) { + switch (WSTOPSIG(status)) { + case SIGTSTP: + (void)printf("*** [%s] Suspended\n", + job->node->name); + break; + case SIGSTOP: + (void)printf("*** [%s] Stopped\n", + job->node->name); + break; + default: + (void)printf("*** [%s] Stopped -- signal %d\n", + job->node->name, WSTOPSIG(status)); + } + job->suspended = TRUE; + } + (void)fflush(stdout); + return; } - if (!make_suspended) { - switch (WSTOPSIG(status)) { - case SIGTSTP: - (void)printf("*** [%s] Suspended\n", job->node->name); - break; - case SIGSTOP: - (void)printf("*** [%s] Stopped\n", job->node->name); - break; - default: - (void)printf("*** [%s] Stopped -- signal %d\n", - job->node->name, WSTOPSIG(status)); - } - job->job_suspended = 1; - } - (void)fflush(stdout); - return; - } - job->job_state = JOB_ST_FINISHED; - job->exit_status = status; + job->status = JOB_ST_FINISHED; + job->exit_status = status; - JobFinish(job, status); + JobFinish(job, status); } -/*- - *----------------------------------------------------------------------- - * Job_CatchOutput -- - * Catch the output from our children, if we're using - * pipes do so. Otherwise just block time until we get a - * signal(most likely a SIGCHLD) since there's no point in - * just spinning when there's nothing to do and the reaping - * of a child can wait for a while. - * - * Results: - * None - * - * Side Effects: - * Output is read from pipes if we're piping. - * ----------------------------------------------------------------------- +/* + * Catch the output from our children, if we're using pipes do so. Otherwise + * just block time until we get a signal(most likely a SIGCHLD) since there's + * no point in just spinning when there's nothing to do and the reaping of a + * child can wait for a while. */ void Job_CatchOutput(void) { - int nready; - Job *job; - int i; + int nready; + Job *job; + unsigned int i; - (void)fflush(stdout); + (void)fflush(stdout); - /* The first fd in the list is the job token pipe */ - do { - nready = poll(fds + 1 - wantToken, nfds - 1 + wantToken, POLL_MSEC); - } while (nready < 0 && errno == EINTR); - - if (nready < 0) - Punt("poll: %s", strerror(errno)); - - if (nready > 0 && readyfd(&childExitJob)) { - char token = 0; - ssize_t count; -#if defined(__minix) - /* Workaround: While the pipe is deemed ready to be read, it can still - * return EAGAIN in the read below. */ + /* The first fd in the list is the job token pipe */ do { -#endif /* defined(__minix) */ - count = read(childExitJob.inPipe, &token, 1); + nready = poll(fds + 1 - wantToken, fdsLen - 1 + wantToken, + POLL_MSEC); + } while (nready < 0 && errno == EINTR); + + if (nready < 0) + Punt("poll: %s", strerror(errno)); + + if (nready > 0 && readyfd(&childExitJob)) { + char token = 0; + ssize_t count; #if defined(__minix) - } while(-1 == count && EAGAIN == errno); + /* Workaround: While the pipe is deemed ready to be read, it can still + * return EAGAIN in the read below. */ + do { #endif /* defined(__minix) */ - switch (count) { - case 0: - Punt("unexpected eof on token pipe"); - case -1: - Punt("token pipe read: %s", strerror(errno)); - case 1: - if (token == DO_JOB_RESUME[0]) - /* Complete relay requested from our SIGCONT handler */ - JobRestartJobs(); - break; - default: - abort(); + count = read(childExitJob.inPipe, &token, 1); +#if defined(__minix) + } while(-1 == count && EAGAIN == errno); +#endif /* defined(__minix) */ + if (count == 1) { + if (token == DO_JOB_RESUME[0]) + /* + * Complete relay requested from our SIGCONT + * handler + */ + JobRestartJobs(); + } else if (count == 0) + Punt("unexpected eof on token pipe"); + else + Punt("token pipe read: %s", strerror(errno)); + nready--; } - --nready; - } - Job_CatchChildren(); - if (nready == 0) - return; - - for (i = 2; i < nfds; i++) { - if (!fds[i].revents) - continue; - job = jobfds[i]; - if (job->job_state == JOB_ST_RUNNING) - JobDoOutput(job, FALSE); - if (--nready == 0) + Job_CatchChildren(); + if (nready == 0) return; - } + + for (i = npseudojobs * nfds_per_job(); i < fdsLen; i++) { + if (fds[i].revents == 0) + continue; + job = jobByFdIndex[i]; + if (job->status == JOB_ST_RUNNING) + JobDoOutput(job, FALSE); +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + /* + * With meta mode, we may have activity on the job's filemon + * descriptor too, which at the moment is any pollfd other + * than job->inPollfd. + */ + if (useMeta && job->inPollfd != &fds[i]) { + if (meta_job_event(job) <= 0) { + fds[i].events = 0; /* never mind */ + } + } +#endif + if (--nready == 0) + return; + } } -/*- - *----------------------------------------------------------------------- - * Job_Make -- - * Start the creation of a target. Basically a front-end for - * JobStart used by the Make module. - * - * Results: - * None. - * - * Side Effects: - * Another job is started. - * - *----------------------------------------------------------------------- +/* + * Start the creation of a target. Basically a front-end for JobStart used by + * the Make module. */ void Job_Make(GNode *gn) { - (void)JobStart(gn, 0); + (void)JobStart(gn, FALSE); +} + +static void +InitShellNameAndPath(void) +{ + shellName = shell->name; + +#ifdef DEFSHELL_CUSTOM + if (shellName[0] == '/') { + shellPath = shellName; + shellName = str_basename(shellPath); + return; + } +#endif + + shellPath = str_concat3(_PATH_DEFSHELLDIR, "/", shellName); } void Shell_Init(void) { - if (shellPath == NULL) { - /* - * We are using the default shell, which may be an absolute - * path if DEFSHELL_CUSTOM is defined. - */ - shellName = commandShell->name; -#ifdef DEFSHELL_CUSTOM - if (*shellName == '/') { - shellPath = shellName; - shellName = strrchr(shellPath, '/'); - shellName++; - } else -#endif - shellPath = str_concat(_PATH_DEFSHELLDIR, shellName, STR_ADDSLASH); - } - if (commandShell->exit == NULL) { - commandShell->exit = ""; - } - if (commandShell->echo == NULL) { - commandShell->echo = ""; - } - if (commandShell->hasErrCtl && *commandShell->exit) { - if (shellErrFlag && - strcmp(commandShell->exit, &shellErrFlag[1]) != 0) { - free(shellErrFlag); - shellErrFlag = NULL; - } - if (!shellErrFlag) { - int n = strlen(commandShell->exit) + 2; + if (shellPath == NULL) + InitShellNameAndPath(); - shellErrFlag = bmake_malloc(n); - if (shellErrFlag) { - snprintf(shellErrFlag, n, "-%s", commandShell->exit); - } + Var_SetWithFlags(SCOPE_CMDLINE, ".SHELL", shellPath, VAR_SET_READONLY); + if (shell->errFlag == NULL) + shell->errFlag = ""; + if (shell->echoFlag == NULL) + shell->echoFlag = ""; + if (shell->hasErrCtl && shell->errFlag[0] != '\0') { + if (shellErrFlag != NULL && + strcmp(shell->errFlag, &shellErrFlag[1]) != 0) { + free(shellErrFlag); + shellErrFlag = NULL; + } + if (shellErrFlag == NULL) { + size_t n = strlen(shell->errFlag) + 2; + + shellErrFlag = bmake_malloc(n); + if (shellErrFlag != NULL) + snprintf(shellErrFlag, n, "-%s", + shell->errFlag); + } + } else if (shellErrFlag != NULL) { + free(shellErrFlag); + shellErrFlag = NULL; } - } else if (shellErrFlag) { - free(shellErrFlag); - shellErrFlag = NULL; - } } -/*- - * Returns the string literal that is used in the current command shell +/* + * Return the string literal that is used in the current command shell * to produce a newline character. */ const char * Shell_GetNewline(void) { - - return commandShell->newline; + return shell->newline; } void Job_SetPrefix(void) { - - if (targPrefix) { - free(targPrefix); - } else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) { - Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL, 0); - } + if (targPrefix != NULL) { + free(targPrefix); + } else if (!Var_Exists(SCOPE_GLOBAL, MAKE_JOB_PREFIX)) { + Global_Set(MAKE_JOB_PREFIX, "---"); + } - targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}", VAR_GLOBAL, 0); + (void)Var_Subst("${" MAKE_JOB_PREFIX "}", + SCOPE_GLOBAL, VARE_WANTRES, &targPrefix); + /* TODO: handle errors */ } -/*- - *----------------------------------------------------------------------- - * Job_Init -- - * Initialize the process module - * - * Input: - * - * Results: - * none - * - * Side Effects: - * lists and counters are initialized - *----------------------------------------------------------------------- - */ +static void +AddSig(int sig, SignalProc handler) +{ + if (bmake_signal(sig, SIG_IGN) != SIG_IGN) { + sigaddset(&caught_signals, sig); + (void)bmake_signal(sig, handler); + } +} + +/* Initialize the process module. */ void Job_Init(void) { - Job_SetPrefix(); - /* Allocate space for all the job info */ - job_table = bmake_malloc(maxJobs * sizeof *job_table); - memset(job_table, 0, maxJobs * sizeof *job_table); - job_table_end = job_table + maxJobs; - wantToken = 0; + Job_SetPrefix(); + /* Allocate space for all the job info */ + job_table = bmake_malloc((size_t)opts.maxJobs * sizeof *job_table); + memset(job_table, 0, (size_t)opts.maxJobs * sizeof *job_table); + job_table_end = job_table + opts.maxJobs; + wantToken = 0; + caught_sigchld = 0; - aborting = 0; - errors = 0; + aborting = ABORT_NONE; + job_errors = 0; - lastNode = NULL; + /* + * There is a non-zero chance that we already have children. + * eg after 'make -f- < 0) + continue; + if (rval == 0) + lurking_children = TRUE; + break; + } - /* - * There is a non-zero chance that we already have children. - * eg after 'make -f- < 0) - continue; - if (rval == 0) - lurking_children = 1; - break; - } + Shell_Init(); - Shell_Init(); + JobCreatePipe(&childExitJob, 3); - JobCreatePipe(&childExitJob, 3); + { + /* Preallocate enough for the maximum number of jobs. */ + size_t nfds = (npseudojobs + (size_t)opts.maxJobs) * + nfds_per_job(); + fds = bmake_malloc(sizeof *fds * nfds); + jobByFdIndex = bmake_malloc(sizeof *jobByFdIndex * nfds); + } - /* We can only need to wait for tokens, children and output from each job */ - fds = bmake_malloc(sizeof (*fds) * (2 + maxJobs)); - jobfds = bmake_malloc(sizeof (*jobfds) * (2 + maxJobs)); + /* These are permanent entries and take slots 0 and 1 */ + watchfd(&tokenWaitJob); + watchfd(&childExitJob); - /* These are permanent entries and take slots 0 and 1 */ - watchfd(&tokenWaitJob); - watchfd(&childExitJob); + sigemptyset(&caught_signals); + /* + * Install a SIGCHLD handler. + */ + (void)bmake_signal(SIGCHLD, JobChildSig); + sigaddset(&caught_signals, SIGCHLD); - sigemptyset(&caught_signals); - /* - * Install a SIGCHLD handler. - */ - (void)bmake_signal(SIGCHLD, JobChildSig); - sigaddset(&caught_signals, SIGCHLD); + /* + * Catch the four signals that POSIX specifies if they aren't ignored. + * JobPassSig will take care of calling JobInterrupt if appropriate. + */ + AddSig(SIGINT, JobPassSig_int); + AddSig(SIGHUP, JobPassSig_term); + AddSig(SIGTERM, JobPassSig_term); + AddSig(SIGQUIT, JobPassSig_term); -#define ADDSIG(s,h) \ - if (bmake_signal(s, SIG_IGN) != SIG_IGN) { \ - sigaddset(&caught_signals, s); \ - (void)bmake_signal(s, h); \ - } + /* + * There are additional signals that need to be caught and passed if + * either the export system wants to be told directly of signals or if + * we're giving each job its own process group (since then it won't get + * signals from the terminal driver as we own the terminal) + */ + AddSig(SIGTSTP, JobPassSig_suspend); + AddSig(SIGTTOU, JobPassSig_suspend); + AddSig(SIGTTIN, JobPassSig_suspend); + AddSig(SIGWINCH, JobCondPassSig); + AddSig(SIGCONT, JobContinueSig); - /* - * Catch the four signals that POSIX specifies if they aren't ignored. - * JobPassSig will take care of calling JobInterrupt if appropriate. - */ - ADDSIG(SIGINT, JobPassSig_int) - ADDSIG(SIGHUP, JobPassSig_term) - ADDSIG(SIGTERM, JobPassSig_term) - ADDSIG(SIGQUIT, JobPassSig_term) - - /* - * There are additional signals that need to be caught and passed if - * either the export system wants to be told directly of signals or if - * we're giving each job its own process group (since then it won't get - * signals from the terminal driver as we own the terminal) - */ - ADDSIG(SIGTSTP, JobPassSig_suspend) - ADDSIG(SIGTTOU, JobPassSig_suspend) - ADDSIG(SIGTTIN, JobPassSig_suspend) - ADDSIG(SIGWINCH, JobCondPassSig) - ADDSIG(SIGCONT, JobContinueSig) -#undef ADDSIG - - (void)Job_RunTarget(".BEGIN", NULL); - postCommands = Targ_FindNode(".END", TARG_CREATE); + (void)Job_RunTarget(".BEGIN", NULL); + /* Create the .END node now, even though no code in the unit tests + * depends on it. See also Targ_GetEndNode in Compat_Run. */ + (void)Targ_GetEndNode(); } -static void JobSigReset(void) +static void +DelSig(int sig) { -#define DELSIG(s) \ - if (sigismember(&caught_signals, s)) { \ - (void)bmake_signal(s, SIG_DFL); \ - } - - DELSIG(SIGINT) - DELSIG(SIGHUP) - DELSIG(SIGQUIT) - DELSIG(SIGTERM) - DELSIG(SIGTSTP) - DELSIG(SIGTTOU) - DELSIG(SIGTTIN) - DELSIG(SIGWINCH) - DELSIG(SIGCONT) -#undef DELSIG - (void)bmake_signal(SIGCHLD, SIG_DFL); + if (sigismember(&caught_signals, sig) != 0) + (void)bmake_signal(sig, SIG_DFL); } -/*- - *----------------------------------------------------------------------- - * JobMatchShell -- - * Find a shell in 'shells' given its name. - * - * Results: - * A pointer to the Shell structure. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ +static void +JobSigReset(void) +{ + DelSig(SIGINT); + DelSig(SIGHUP); + DelSig(SIGQUIT); + DelSig(SIGTERM); + DelSig(SIGTSTP); + DelSig(SIGTTOU); + DelSig(SIGTTIN); + DelSig(SIGWINCH); + DelSig(SIGCONT); + (void)bmake_signal(SIGCHLD, SIG_DFL); +} + +/* Find a shell in 'shells' given its name, or return NULL. */ static Shell * -JobMatchShell(const char *name) +FindShellByName(const char *name) { - Shell *sh; + Shell *sh = shells; + const Shell *shellsEnd = sh + sizeof shells / sizeof shells[0]; - for (sh = shells; sh->name != NULL; sh++) { - if (strcmp(name, sh->name) == 0) - return (sh); - } - return NULL; + for (sh = shells; sh < shellsEnd; sh++) { + if (strcmp(name, sh->name) == 0) + return sh; + } + return NULL; } -/*- - *----------------------------------------------------------------------- - * Job_ParseShell -- - * Parse a shell specification and set up commandShell, shellPath - * and shellName appropriately. +/* + * Parse a shell specification and set up 'shell', shellPath and + * shellName appropriately. * * Input: * line The shell spec * * Results: - * FAILURE if the specification was incorrect. + * FALSE if the specification was incorrect. * * Side Effects: - * commandShell points to a Shell structure (either predefined or + * 'shell' points to a Shell structure (either predefined or * created from the shell spec), shellPath is the full path of the - * shell described by commandShell, while shellName is just the + * shell described by 'shell', while shellName is just the * final component of shellPath. * * Notes: @@ -2357,690 +2331,645 @@ JobMatchShell(const char *name) * provides the functionality it does in C. Each word consists of * keyword and value separated by an equal sign. There should be no * unnecessary spaces in the word. The keywords are as follows: - * name Name of shell. - * path Location of shell. - * quiet Command to turn off echoing. - * echo Command to turn echoing on - * filter Result of turning off echoing that shouldn't be - * printed. - * echoFlag Flag to turn echoing on at the start - * errFlag Flag to turn error checking on at the start - * hasErrCtl True if shell has error checking control - * newline String literal to represent a newline char - * check Command to turn on error checking if hasErrCtl - * is TRUE or template of command to echo a command - * for which error checking is off if hasErrCtl is - * FALSE. - * ignore Command to turn off error checking if hasErrCtl - * is TRUE or template of command to execute a - * command so as to ignore any errors it returns if - * hasErrCtl is FALSE. - * - *----------------------------------------------------------------------- + * name Name of shell. + * path Location of shell. + * quiet Command to turn off echoing. + * echo Command to turn echoing on + * filter Result of turning off echoing that shouldn't be + * printed. + * echoFlag Flag to turn echoing on at the start + * errFlag Flag to turn error checking on at the start + * hasErrCtl True if shell has error checking control + * newline String literal to represent a newline char + * check Command to turn on error checking if hasErrCtl + * is TRUE or template of command to echo a command + * for which error checking is off if hasErrCtl is + * FALSE. + * ignore Command to turn off error checking if hasErrCtl + * is TRUE or template of command to execute a + * command so as to ignore any errors it returns if + * hasErrCtl is FALSE. */ -ReturnStatus +Boolean Job_ParseShell(char *line) { - char **words; - char **argv; - int argc; - char *path; - Shell newShell; - Boolean fullSpec = FALSE; - Shell *sh; + Words wordsList; + char **words; + char **argv; + size_t argc; + char *path; + Shell newShell; + Boolean fullSpec = FALSE; + Shell *sh; - while (isspace((unsigned char)*line)) { - line++; - } + /* XXX: don't use line as an iterator variable */ + pp_skip_whitespace(&line); - if (shellArgv) - free(UNCONST(shellArgv)); + free(shell_freeIt); - memset(&newShell, 0, sizeof(newShell)); + memset(&newShell, 0, sizeof newShell); - /* - * Parse the specification by keyword - */ - words = brk_string(line, &argc, TRUE, &path); - if (words == NULL) { - Error("Unterminated quoted string [%s]", line); - return FAILURE; - } - shellArgv = path; + /* + * Parse the specification by keyword + */ + wordsList = Str_Words(line, TRUE); + words = wordsList.words; + argc = wordsList.len; + path = wordsList.freeIt; + if (words == NULL) { + Error("Unterminated quoted string [%s]", line); + return FALSE; + } + shell_freeIt = path; - for (path = NULL, argv = words; argc != 0; argc--, argv++) { - if (strncmp(*argv, "path=", 5) == 0) { - path = &argv[0][5]; - } else if (strncmp(*argv, "name=", 5) == 0) { - newShell.name = &argv[0][5]; - } else { - if (strncmp(*argv, "quiet=", 6) == 0) { - newShell.echoOff = &argv[0][6]; - } else if (strncmp(*argv, "echo=", 5) == 0) { - newShell.echoOn = &argv[0][5]; - } else if (strncmp(*argv, "filter=", 7) == 0) { - newShell.noPrint = &argv[0][7]; - newShell.noPLen = strlen(newShell.noPrint); - } else if (strncmp(*argv, "echoFlag=", 9) == 0) { - newShell.echo = &argv[0][9]; - } else if (strncmp(*argv, "errFlag=", 8) == 0) { - newShell.exit = &argv[0][8]; - } else if (strncmp(*argv, "hasErrCtl=", 10) == 0) { - char c = argv[0][10]; - newShell.hasErrCtl = !((c != 'Y') && (c != 'y') && - (c != 'T') && (c != 't')); - } else if (strncmp(*argv, "newline=", 8) == 0) { - newShell.newline = &argv[0][8]; - } else if (strncmp(*argv, "check=", 6) == 0) { - newShell.errCheck = &argv[0][6]; - } else if (strncmp(*argv, "ignore=", 7) == 0) { - newShell.ignErr = &argv[0][7]; - } else if (strncmp(*argv, "errout=", 7) == 0) { - newShell.errOut = &argv[0][7]; - } else if (strncmp(*argv, "comment=", 8) == 0) { - newShell.commentChar = argv[0][8]; + for (path = NULL, argv = words; argc != 0; argc--, argv++) { + char *arg = *argv; + if (strncmp(arg, "path=", 5) == 0) { + path = arg + 5; + } else if (strncmp(arg, "name=", 5) == 0) { + newShell.name = arg + 5; } else { - Parse_Error(PARSE_FATAL, "Unknown keyword \"%s\"", - *argv); - free(words); - return(FAILURE); + if (strncmp(arg, "quiet=", 6) == 0) { + newShell.echoOff = arg + 6; + } else if (strncmp(arg, "echo=", 5) == 0) { + newShell.echoOn = arg + 5; + } else if (strncmp(arg, "filter=", 7) == 0) { + newShell.noPrint = arg + 7; + newShell.noPrintLen = strlen(newShell.noPrint); + } else if (strncmp(arg, "echoFlag=", 9) == 0) { + newShell.echoFlag = arg + 9; + } else if (strncmp(arg, "errFlag=", 8) == 0) { + newShell.errFlag = arg + 8; + } else if (strncmp(arg, "hasErrCtl=", 10) == 0) { + char c = arg[10]; + newShell.hasErrCtl = c == 'Y' || c == 'y' || + c == 'T' || c == 't'; + } else if (strncmp(arg, "newline=", 8) == 0) { + newShell.newline = arg + 8; + } else if (strncmp(arg, "check=", 6) == 0) { + /* Before 2020-12-10, these two variables + * had been a single variable. */ + newShell.errOn = arg + 6; + newShell.echoTmpl = arg + 6; + } else if (strncmp(arg, "ignore=", 7) == 0) { + /* Before 2020-12-10, these two variables + * had been a single variable. */ + newShell.errOff = arg + 7; + newShell.runIgnTmpl = arg + 7; + } else if (strncmp(arg, "errout=", 7) == 0) { + newShell.runChkTmpl = arg + 7; + } else if (strncmp(arg, "comment=", 8) == 0) { + newShell.commentChar = arg[8]; + } else { + Parse_Error(PARSE_FATAL, + "Unknown keyword \"%s\"", arg); + free(words); + return FALSE; + } + fullSpec = TRUE; } - fullSpec = TRUE; - } - } - - if (path == NULL) { - /* - * If no path was given, the user wants one of the pre-defined shells, - * yes? So we find the one s/he wants with the help of JobMatchShell - * and set things up the right way. shellPath will be set up by - * Shell_Init. - */ - if (newShell.name == NULL) { - Parse_Error(PARSE_FATAL, "Neither path nor name specified"); - free(words); - return(FAILURE); - } else { - if ((sh = JobMatchShell(newShell.name)) == NULL) { - Parse_Error(PARSE_WARNING, "%s: No matching shell", - newShell.name); - free(words); - return(FAILURE); - } - commandShell = sh; - shellName = newShell.name; - if (shellPath) { - /* Shell_Init has already been called! Do it again. */ - free(UNCONST(shellPath)); - shellPath = NULL; - Shell_Init(); - } } - } else { - /* - * The user provided a path. If s/he gave nothing else (fullSpec is - * FALSE), try and find a matching shell in the ones we know of. - * Else we just take the specification at its word and copy it - * to a new location. In either case, we need to record the - * path the user gave for the shell. - */ - shellPath = path; - path = strrchr(path, '/'); + if (path == NULL) { - path = UNCONST(shellPath); + /* + * If no path was given, the user wants one of the + * pre-defined shells, yes? So we find the one s/he wants + * with the help of FindShellByName and set things up the + * right way. shellPath will be set up by Shell_Init. + */ + if (newShell.name == NULL) { + Parse_Error(PARSE_FATAL, + "Neither path nor name specified"); + free(words); + return FALSE; + } else { + if ((sh = FindShellByName(newShell.name)) == NULL) { + Parse_Error(PARSE_WARNING, + "%s: No matching shell", newShell.name); + free(words); + return FALSE; + } + shell = sh; + shellName = newShell.name; + if (shellPath != NULL) { + /* + * Shell_Init has already been called! + * Do it again. + */ + free(UNCONST(shellPath)); + shellPath = NULL; + Shell_Init(); + } + } } else { - path += 1; + /* + * The user provided a path. If s/he gave nothing else + * (fullSpec is FALSE), try and find a matching shell in the + * ones we know of. Else we just take the specification at + * its word and copy it to a new location. In either case, + * we need to record the path the user gave for the shell. + */ + shellPath = path; + path = strrchr(path, '/'); + if (path == NULL) { + path = UNCONST(shellPath); + } else { + path++; + } + if (newShell.name != NULL) { + shellName = newShell.name; + } else { + shellName = path; + } + if (!fullSpec) { + if ((sh = FindShellByName(shellName)) == NULL) { + Parse_Error(PARSE_WARNING, + "%s: No matching shell", shellName); + free(words); + return FALSE; + } + shell = sh; + } else { + shell = bmake_malloc(sizeof *shell); + *shell = newShell; + } + /* this will take care of shellErrFlag */ + Shell_Init(); } - if (newShell.name != NULL) { - shellName = newShell.name; - } else { - shellName = path; - } - if (!fullSpec) { - if ((sh = JobMatchShell(shellName)) == NULL) { - Parse_Error(PARSE_WARNING, "%s: No matching shell", - shellName); - free(words); - return(FAILURE); - } - commandShell = sh; - } else { - commandShell = bmake_malloc(sizeof(Shell)); - *commandShell = newShell; - } - /* this will take care of shellErrFlag */ - Shell_Init(); - } - if (commandShell->echoOn && commandShell->echoOff) { - commandShell->hasEchoCtl = TRUE; - } + if (shell->echoOn != NULL && shell->echoOff != NULL) + shell->hasEchoCtl = TRUE; - if (!commandShell->hasErrCtl) { - if (commandShell->errCheck == NULL) { - commandShell->errCheck = ""; + if (!shell->hasErrCtl) { + if (shell->echoTmpl == NULL) + shell->echoTmpl = ""; + if (shell->runIgnTmpl == NULL) + shell->runIgnTmpl = "%s\n"; } - if (commandShell->ignErr == NULL) { - commandShell->ignErr = "%s\n"; - } - } - /* - * Do not free up the words themselves, since they might be in use by the - * shell specification. - */ - free(words); - return SUCCESS; + /* + * Do not free up the words themselves, since they might be in use + * by the shell specification. + */ + free(words); + return TRUE; } -/*- - *----------------------------------------------------------------------- - * JobInterrupt -- - * Handle the receipt of an interrupt. +/* + * Handle the receipt of an interrupt. + * + * All children are killed. Another job will be started if the .INTERRUPT + * target is defined. * * Input: * runINTERRUPT Non-zero if commands for the .INTERRUPT target * should be executed * signo signal received - * - * Results: - * None - * - * Side Effects: - * All children are killed. Another job will be started if the - * .INTERRUPT target was given. - *----------------------------------------------------------------------- */ static void -JobInterrupt(int runINTERRUPT, int signo) +JobInterrupt(Boolean runINTERRUPT, int signo) { - Job *job; /* job descriptor in that element */ - GNode *interrupt; /* the node describing the .INTERRUPT target */ - sigset_t mask; - GNode *gn; + Job *job; /* job descriptor in that element */ + GNode *interrupt; /* the node describing the .INTERRUPT target */ + sigset_t mask; + GNode *gn; - aborting = ABORT_INTERRUPT; + aborting = ABORT_INTERRUPT; - JobSigLock(&mask); + JobSigLock(&mask); - for (job = job_table; job < job_table_end; job++) { - if (job->job_state != JOB_ST_RUNNING) - continue; + for (job = job_table; job < job_table_end; job++) { + if (job->status != JOB_ST_RUNNING) + continue; - gn = job->node; + gn = job->node; - if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) { - char *file = (gn->path == NULL ? gn->name : gn->path); - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); - } + JobDeleteTarget(gn); + if (job->pid != 0) { + DEBUG2(JOB, + "JobInterrupt passing signal %d to child %d.\n", + signo, job->pid); + KILLPG(job->pid, signo); + } } - if (job->pid) { - if (DEBUG(JOB)) { - (void)fprintf(debug_file, - "JobInterrupt passing signal %d to child %d.\n", - signo, job->pid); - } - KILLPG(job->pid, signo); - } - } - JobSigUnlock(&mask); + JobSigUnlock(&mask); - if (runINTERRUPT && !touchFlag) { - interrupt = Targ_FindNode(".INTERRUPT", TARG_NOCREATE); - if (interrupt != NULL) { - ignoreErrors = FALSE; - JobRun(interrupt); + if (runINTERRUPT && !opts.touchFlag) { + interrupt = Targ_FindNode(".INTERRUPT"); + if (interrupt != NULL) { + opts.ignoreErrors = FALSE; + JobRun(interrupt); + } } - } - Trace_Log(MAKEINTR, 0); - exit(signo); + Trace_Log(MAKEINTR, NULL); + exit(signo); /* XXX: why signo? */ } /* - *----------------------------------------------------------------------- - * Job_Finish -- - * Do final processing such as the running of the commands - * attached to the .END target. + * Do the final processing, i.e. run the commands attached to the .END target. * - * Results: - * Number of errors reported. - * - * Side Effects: - * None. - *----------------------------------------------------------------------- + * Return the number of errors reported. */ int Job_Finish(void) { - if (postCommands != NULL && - (!Lst_IsEmpty(postCommands->commands) || - !Lst_IsEmpty(postCommands->children))) { - if (errors) { - Error("Errors reported so .END ignored"); - } else { - JobRun(postCommands); + GNode *endNode = Targ_GetEndNode(); + if (!Lst_IsEmpty(&endNode->commands) || + !Lst_IsEmpty(&endNode->children)) { + if (job_errors != 0) { + Error("Errors reported so .END ignored"); + } else { + JobRun(endNode); + } } - } - return(errors); + return job_errors; } -/*- - *----------------------------------------------------------------------- - * Job_End -- - * Cleanup any memory used by the jobs module - * - * Results: - * None. - * - * Side Effects: - * Memory is freed - *----------------------------------------------------------------------- - */ +/* Clean up any memory used by the jobs module. */ void Job_End(void) { #ifdef CLEANUP - if (shellArgv) - free(shellArgv); + free(shell_freeIt); #endif } -/*- - *----------------------------------------------------------------------- - * Job_Wait -- - * Waits for all running jobs to finish and returns. Sets 'aborting' - * to ABORT_WAIT to prevent other jobs from starting. - * - * Results: - * None. - * - * Side Effects: - * Currently running jobs finish. - * - *----------------------------------------------------------------------- +/* + * Waits for all running jobs to finish and returns. + * Sets 'aborting' to ABORT_WAIT to prevent other jobs from starting. */ void Job_Wait(void) { - aborting = ABORT_WAIT; - while (jobTokensRunning != 0) { - Job_CatchOutput(); - } - aborting = 0; + aborting = ABORT_WAIT; + while (jobTokensRunning != 0) { + Job_CatchOutput(); + } + aborting = ABORT_NONE; } -/*- - *----------------------------------------------------------------------- - * Job_AbortAll -- - * Abort all currently running jobs without handling output or anything. - * This function is to be called only in the event of a major - * error. Most definitely NOT to be called from JobInterrupt. +/* + * Abort all currently running jobs without handling output or anything. + * This function is to be called only in the event of a major error. + * Most definitely NOT to be called from JobInterrupt. * - * Results: - * None - * - * Side Effects: - * All children are killed, not just the firstborn - *----------------------------------------------------------------------- + * All children are killed, not just the firstborn. */ void Job_AbortAll(void) { - Job *job; /* the job descriptor in that element */ - int foo; + Job *job; /* the job descriptor in that element */ + int foo; - aborting = ABORT_ERROR; + aborting = ABORT_ERROR; - if (jobTokensRunning) { - for (job = job_table; job < job_table_end; job++) { - if (job->job_state != JOB_ST_RUNNING) - continue; - /* - * kill the child process with increasingly drastic signals to make - * darn sure it's dead. - */ - KILLPG(job->pid, SIGINT); - KILLPG(job->pid, SIGKILL); + if (jobTokensRunning != 0) { + for (job = job_table; job < job_table_end; job++) { + if (job->status != JOB_ST_RUNNING) + continue; + /* + * kill the child process with increasingly drastic + * signals to make darn sure it's dead. + */ + KILLPG(job->pid, SIGINT); + KILLPG(job->pid, SIGKILL); + } } - } - /* - * Catch as many children as want to report in at first, then give up - */ - while (waitpid((pid_t) -1, &foo, WNOHANG) > 0) - continue; + /* + * Catch as many children as want to report in at first, then give up + */ + while (waitpid((pid_t)-1, &foo, WNOHANG) > 0) + continue; } - -/*- - *----------------------------------------------------------------------- - * JobRestartJobs -- - * Tries to restart stopped jobs if there are slots available. - * Called in process context in response to a SIGCONT. - * - * Results: - * None. - * - * Side Effects: - * Resumes jobs. - * - *----------------------------------------------------------------------- +/* + * Tries to restart stopped jobs if there are slots available. + * Called in process context in response to a SIGCONT. */ static void JobRestartJobs(void) { - Job *job; + Job *job; - for (job = job_table; job < job_table_end; job++) { - if (job->job_state == JOB_ST_RUNNING && - (make_suspended || job->job_suspended)) { - if (DEBUG(JOB)) { - (void)fprintf(debug_file, "Restarting stopped job pid %d.\n", - job->pid); - } - if (job->job_suspended) { - (void)printf("*** [%s] Continued\n", job->node->name); - (void)fflush(stdout); - } - job->job_suspended = 0; - if (KILLPG(job->pid, SIGCONT) != 0 && DEBUG(JOB)) { - fprintf(debug_file, "Failed to send SIGCONT to %d\n", job->pid); - } + for (job = job_table; job < job_table_end; job++) { + if (job->status == JOB_ST_RUNNING && + (make_suspended || job->suspended)) { + DEBUG1(JOB, "Restarting stopped job pid %d.\n", + job->pid); + if (job->suspended) { + (void)printf("*** [%s] Continued\n", + job->node->name); + (void)fflush(stdout); + } + job->suspended = FALSE; + if (KILLPG(job->pid, SIGCONT) != 0 && DEBUG(JOB)) { + debug_printf("Failed to send SIGCONT to %d\n", + job->pid); + } + } + if (job->status == JOB_ST_FINISHED) { + /* + * Job exit deferred after calling waitpid() in a + * signal handler + */ + JobFinish(job, job->exit_status); + } } - if (job->job_state == JOB_ST_FINISHED) - /* Job exit deferred after calling waitpid() in a signal handler */ - JobFinish(job, job->exit_status); - } - make_suspended = 0; + make_suspended = FALSE; } static void watchfd(Job *job) { - if (job->inPollfd != NULL) - Punt("Watching watched job"); + if (job->inPollfd != NULL) + Punt("Watching watched job"); - fds[nfds].fd = job->inPipe; - fds[nfds].events = POLLIN; - jobfds[nfds] = job; - job->inPollfd = &fds[nfds]; - nfds++; + fds[fdsLen].fd = job->inPipe; + fds[fdsLen].events = POLLIN; + jobByFdIndex[fdsLen] = job; + job->inPollfd = &fds[fdsLen]; + fdsLen++; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + fds[fdsLen].fd = meta_job_fd(job); + fds[fdsLen].events = fds[fdsLen].fd == -1 ? 0 : POLLIN; + jobByFdIndex[fdsLen] = job; + fdsLen++; + } +#endif } static void clearfd(Job *job) { - int i; - if (job->inPollfd == NULL) - Punt("Unwatching unwatched job"); - i = job->inPollfd - fds; - nfds--; - /* - * Move last job in table into hole made by dead job. - */ - if (nfds != i) { - fds[i] = fds[nfds]; - jobfds[i] = jobfds[nfds]; - jobfds[i]->inPollfd = &fds[i]; - } - job->inPollfd = NULL; + size_t i; + if (job->inPollfd == NULL) + Punt("Unwatching unwatched job"); + i = (size_t)(job->inPollfd - fds); + fdsLen--; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + /* + * Sanity check: there should be two fds per job, so the job's + * pollfd number should be even. + */ + assert(nfds_per_job() == 2); + if (i % 2 != 0) + Punt("odd-numbered fd with meta"); + fdsLen--; + } +#endif + /* + * Move last job in table into hole made by dead job. + */ + if (fdsLen != i) { + fds[i] = fds[fdsLen]; + jobByFdIndex[i] = jobByFdIndex[fdsLen]; + jobByFdIndex[i]->inPollfd = &fds[i]; +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + if (useMeta) { + fds[i + 1] = fds[fdsLen + 1]; + jobByFdIndex[i + 1] = jobByFdIndex[fdsLen + 1]; + } +#endif + } + job->inPollfd = NULL; } -static int +static Boolean readyfd(Job *job) { - if (job->inPollfd == NULL) - Punt("Polling unwatched job"); - return (job->inPollfd->revents & POLLIN) != 0; + if (job->inPollfd == NULL) + Punt("Polling unwatched job"); + return (job->inPollfd->revents & POLLIN) != 0; } -/*- - *----------------------------------------------------------------------- - * JobTokenAdd -- - * Put a token into the job pipe so that some make process can start - * another job. - * - * Side Effects: - * Allows more build jobs to be spawned somewhere. - * - *----------------------------------------------------------------------- +/* + * Put a token (back) into the job pipe. + * This allows a make process to start a build job. */ - static void JobTokenAdd(void) { - char tok = JOB_TOKENS[aborting], tok1; + char tok = JOB_TOKENS[aborting], tok1; - /* If we are depositing an error token flush everything else */ - while (tok != '+' && read(tokenWaitJob.inPipe, &tok1, 1) == 1) - continue; + /* If we are depositing an error token flush everything else */ + while (tok != '+' && read(tokenWaitJob.inPipe, &tok1, 1) == 1) + continue; - if (DEBUG(JOB)) - fprintf(debug_file, "(%d) aborting %d, deposit token %c\n", + DEBUG3(JOB, "(%d) aborting %d, deposit token %c\n", getpid(), aborting, JOB_TOKENS[aborting]); - while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN) - continue; + while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN) + continue; } -/*- - *----------------------------------------------------------------------- - * Job_ServerStartTokenAdd -- - * Prep the job token pipe in the root make process. - * - *----------------------------------------------------------------------- - */ +/* Get a temp file */ +int +Job_TempFile(const char *pattern, char *tfile, size_t tfile_sz) +{ + int fd; + sigset_t mask; + JobSigLock(&mask); + fd = mkTempFile(pattern, tfile, tfile_sz); + if (tfile != NULL && !DEBUG(SCRIPT)) + unlink(tfile); + JobSigUnlock(&mask); + + return fd; +} + +/* Prep the job token pipe in the root make process. */ void Job_ServerStart(int max_tokens, int jp_0, int jp_1) { - int i; - char jobarg[64]; - - if (jp_0 >= 0 && jp_1 >= 0) { - /* Pipe passed in from parent */ - tokenWaitJob.inPipe = jp_0; - tokenWaitJob.outPipe = jp_1; - (void)fcntl(jp_0, F_SETFD, 1); - (void)fcntl(jp_1, F_SETFD, 1); - return; - } + int i; + char jobarg[64]; - JobCreatePipe(&tokenWaitJob, 15); + if (jp_0 >= 0 && jp_1 >= 0) { + /* Pipe passed in from parent */ + tokenWaitJob.inPipe = jp_0; + tokenWaitJob.outPipe = jp_1; + (void)fcntl(jp_0, F_SETFD, FD_CLOEXEC); + (void)fcntl(jp_1, F_SETFD, FD_CLOEXEC); + return; + } - snprintf(jobarg, sizeof(jobarg), "%d,%d", + JobCreatePipe(&tokenWaitJob, 15); + + snprintf(jobarg, sizeof jobarg, "%d,%d", tokenWaitJob.inPipe, tokenWaitJob.outPipe); - Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL); - Var_Append(MAKEFLAGS, jobarg, VAR_GLOBAL); + Global_Append(MAKEFLAGS, "-J"); + Global_Append(MAKEFLAGS, jobarg); - /* - * Preload the job pipe with one token per job, save the one - * "extra" token for the primary job. - * - * XXX should clip maxJobs against PIPE_BUF -- if max_tokens is - * larger than the write buffer size of the pipe, we will - * deadlock here. - */ - for (i = 1; i < max_tokens; i++) - JobTokenAdd(); + /* + * Preload the job pipe with one token per job, save the one + * "extra" token for the primary job. + * + * XXX should clip maxJobs against PIPE_BUF -- if max_tokens is + * larger than the write buffer size of the pipe, we will + * deadlock here. + */ + for (i = 1; i < max_tokens; i++) + JobTokenAdd(); } -/*- - *----------------------------------------------------------------------- - * Job_TokenReturn -- - * Return a withdrawn token to the pool. - * - *----------------------------------------------------------------------- - */ - +/* Return a withdrawn token to the pool. */ void Job_TokenReturn(void) { - jobTokensRunning--; - if (jobTokensRunning < 0) - Punt("token botch"); - if (jobTokensRunning || JOB_TOKENS[aborting] != '+') - JobTokenAdd(); + jobTokensRunning--; + if (jobTokensRunning < 0) + Punt("token botch"); + if (jobTokensRunning != 0 || JOB_TOKENS[aborting] != '+') + JobTokenAdd(); } -/*- - *----------------------------------------------------------------------- - * Job_TokenWithdraw -- - * Attempt to withdraw a token from the pool. +/* + * Attempt to withdraw a token from the pool. * - * Results: - * Returns TRUE if a token was withdrawn, and FALSE if the pool - * is currently empty. + * If pool is empty, set wantToken so that we wake up when a token is + * released. * - * Side Effects: - * If pool is empty, set wantToken so that we wake up - * when a token is released. - * - *----------------------------------------------------------------------- + * Returns TRUE if a token was withdrawn, and FALSE if the pool is currently + * empty. */ - - Boolean Job_TokenWithdraw(void) { - char tok, tok1; - int count; + char tok, tok1; + ssize_t count; - wantToken = 0; - if (DEBUG(JOB)) - fprintf(debug_file, "Job_TokenWithdraw(%d): aborting %d, running %d\n", - getpid(), aborting, jobTokensRunning); + wantToken = 0; + DEBUG3(JOB, "Job_TokenWithdraw(%d): aborting %d, running %d\n", + getpid(), aborting, jobTokensRunning); - if (aborting || (jobTokensRunning >= maxJobs)) - return FALSE; + if (aborting != ABORT_NONE || (jobTokensRunning >= opts.maxJobs)) + return FALSE; - count = read(tokenWaitJob.inPipe, &tok, 1); - if (count == 0) - Fatal("eof on job pipe!"); - if (count < 0 && jobTokensRunning != 0) { - if (errno != EAGAIN) { - Fatal("job pipe read: %s", strerror(errno)); + count = read(tokenWaitJob.inPipe, &tok, 1); + if (count == 0) + Fatal("eof on job pipe!"); + if (count < 0 && jobTokensRunning != 0) { + if (errno != EAGAIN) { + Fatal("job pipe read: %s", strerror(errno)); + } + DEBUG1(JOB, "(%d) blocked for token\n", getpid()); + wantToken = 1; + return FALSE; } - if (DEBUG(JOB)) - fprintf(debug_file, "(%d) blocked for token\n", getpid()); - wantToken = 1; - return FALSE; - } - if (count == 1 && tok != '+') { - /* make being abvorted - remove any other job tokens */ - if (DEBUG(JOB)) - fprintf(debug_file, "(%d) aborted by token %c\n", getpid(), tok); - while (read(tokenWaitJob.inPipe, &tok1, 1) == 1) - continue; - /* And put the stopper back */ - while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN) - continue; - Fatal("A failure has been detected in another branch of the parallel make"); - } + if (count == 1 && tok != '+') { + /* make being aborted - remove any other job tokens */ + DEBUG2(JOB, "(%d) aborted by token %c\n", getpid(), tok); + while (read(tokenWaitJob.inPipe, &tok1, 1) == 1) + continue; + /* And put the stopper back */ + while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && + errno == EAGAIN) + continue; + if (shouldDieQuietly(NULL, 1)) + exit(6); /* we aborted */ + Fatal("A failure has been detected " + "in another branch of the parallel make"); + } - if (count == 1 && jobTokensRunning == 0) - /* We didn't want the token really */ - while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && errno == EAGAIN) - continue; + if (count == 1 && jobTokensRunning == 0) + /* We didn't want the token really */ + while (write(tokenWaitJob.outPipe, &tok, 1) == -1 && + errno == EAGAIN) + continue; - jobTokensRunning++; - if (DEBUG(JOB)) - fprintf(debug_file, "(%d) withdrew token\n", getpid()); - return TRUE; + jobTokensRunning++; + DEBUG1(JOB, "(%d) withdrew token\n", getpid()); + return TRUE; } -/*- - *----------------------------------------------------------------------- - * Job_RunTarget -- - * Run the named target if found. If a filename is specified, then - * set that to the sources. +/* + * Run the named target if found. If a filename is specified, then set that + * to the sources. * - * Results: - * None - * - * Side Effects: - * exits if the target fails. - * - *----------------------------------------------------------------------- + * Exits if the target fails. */ Boolean -Job_RunTarget(const char *target, const char *fname) { - GNode *gn = Targ_FindNode(target, TARG_NOCREATE); +Job_RunTarget(const char *target, const char *fname) +{ + GNode *gn = Targ_FindNode(target); + if (gn == NULL) + return FALSE; - if (gn == NULL) - return FALSE; + if (fname != NULL) + Var_Set(gn, ALLSRC, fname); - if (fname) - Var_Set(ALLSRC, fname, gn, 0); - - JobRun(gn); - if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); - exit(1); - } - return TRUE; + JobRun(gn); + /* XXX: Replace with GNode_IsError(gn) */ + if (gn->made == ERROR) { + PrintOnError(gn, "\n\nStop."); + exit(1); + } + return TRUE; } #ifdef USE_SELECT int emul_poll(struct pollfd *fd, int nfd, int timeout) { - fd_set rfds, wfds; - int i, maxfd, nselect, npoll; - struct timeval tv, *tvp; - long usecs; + fd_set rfds, wfds; + int i, maxfd, nselect, npoll; + struct timeval tv, *tvp; + long usecs; - FD_ZERO(&rfds); - FD_ZERO(&wfds); + FD_ZERO(&rfds); + FD_ZERO(&wfds); - maxfd = -1; - for (i = 0; i < nfd; i++) { - fd[i].revents = 0; + maxfd = -1; + for (i = 0; i < nfd; i++) { + fd[i].revents = 0; - if (fd[i].events & POLLIN) - FD_SET(fd[i].fd, &rfds); + if (fd[i].events & POLLIN) + FD_SET(fd[i].fd, &rfds); - if (fd[i].events & POLLOUT) - FD_SET(fd[i].fd, &wfds); + if (fd[i].events & POLLOUT) + FD_SET(fd[i].fd, &wfds); - if (fd[i].fd > maxfd) - maxfd = fd[i].fd; - } - - if (maxfd >= FD_SETSIZE) { - Punt("Ran out of fd_set slots; " - "recompile with a larger FD_SETSIZE."); - } + if (fd[i].fd > maxfd) + maxfd = fd[i].fd; + } - if (timeout < 0) { - tvp = NULL; - } else { - usecs = timeout * 1000; - tv.tv_sec = usecs / 1000000; - tv.tv_usec = usecs % 1000000; - tvp = &tv; - } + if (maxfd >= FD_SETSIZE) { + Punt("Ran out of fd_set slots; " + "recompile with a larger FD_SETSIZE."); + } - nselect = select(maxfd + 1, &rfds, &wfds, 0, tvp); + if (timeout < 0) { + tvp = NULL; + } else { + usecs = timeout * 1000; + tv.tv_sec = usecs / 1000000; + tv.tv_usec = usecs % 1000000; + tvp = &tv; + } - if (nselect <= 0) - return nselect; + nselect = select(maxfd + 1, &rfds, &wfds, NULL, tvp); - npoll = 0; - for (i = 0; i < nfd; i++) { - if (FD_ISSET(fd[i].fd, &rfds)) - fd[i].revents |= POLLIN; + if (nselect <= 0) + return nselect; - if (FD_ISSET(fd[i].fd, &wfds)) - fd[i].revents |= POLLOUT; + npoll = 0; + for (i = 0; i < nfd; i++) { + if (FD_ISSET(fd[i].fd, &rfds)) + fd[i].revents |= POLLIN; - if (fd[i].revents) - npoll++; - } + if (FD_ISSET(fd[i].fd, &wfds)) + fd[i].revents |= POLLOUT; - return npoll; + if (fd[i].revents) + npoll++; + } + + return npoll; } #endif /* USE_SELECT */ diff --git a/usr.bin/make/job.h b/usr.bin/make/job.h index 91e2c8782..0d7d7313b 100644 --- a/usr.bin/make/job.h +++ b/usr.bin/make/job.h @@ -1,4 +1,4 @@ -/* $NetBSD: job.h,v 1.42 2013/07/05 22:14:56 sjg Exp $ */ +/* $NetBSD: job.h,v 1.72 2021/02/05 19:19:17 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -73,12 +73,12 @@ * from: @(#)job.h 8.1 (Berkeley) 6/6/93 */ -/*- - * job.h -- - * Definitions pertaining to the running of jobs in parallel mode. +/* + * Running of jobs in parallel mode. */ -#ifndef _JOB_H_ -#define _JOB_H_ + +#ifndef MAKE_JOB_H +#define MAKE_JOB_H #define TMPPAT "makeXXXXXX" /* relative to tmpdir */ @@ -97,8 +97,8 @@ struct emul_pollfd { short revents; }; -#define POLLIN 0x0001 -#define POLLOUT 0x0004 +#define POLLIN 0x0001 +#define POLLOUT 0x0004 int emul_poll(struct pollfd *fd, int nfd, int timeout); @@ -106,33 +106,10 @@ emul_poll(struct pollfd *fd, int nfd, int timeout); /* * The POLL_MSEC constant determines the maximum number of milliseconds spent - * in poll before coming out to see if a child has finished. + * in poll before coming out to see if a child has finished. */ #define POLL_MSEC 5000 - -/*- - * Job Table definitions. - * - * Each job has several things associated with it: - * 1) The process id of the child shell - * 2) The graph node describing the target being made by this job - * 3) A LstNode for the first command to be saved after the job - * completes. This is NULL if there was no "..." in the job's - * commands. - * 4) An FILE* for writing out the commands. This is only - * used before the job is actually started. - * 5) The output is being caught via a pipe and - * the descriptors of our pipe, an array in which output is line - * buffered and the current position in that buffer are all - * maintained for each job. - * 6) A word of flags which determine how the module handles errors, - * echoing, etc. for the job - * - * When a job is finished, the Make_Update function is called on each of the - * parents of the node which was just remade. This takes care of the upward - * traversal of the dependency graph. - */ struct pollfd; @@ -140,135 +117,94 @@ struct pollfd; # include "meta.h" #endif -#define JOB_BUFSIZE 1024 -typedef struct Job { - int pid; /* The child's process ID */ - GNode *node; /* The target the child is making */ - LstNode tailCmds; /* The node of the first command to be - * saved when the job has been run */ - FILE *cmdFILE; /* When creating the shell script, this is - * where the commands go */ - int exit_status; /* from wait4() in signal handler */ - char job_state; /* status of the job entry */ -#define JOB_ST_FREE 0 /* Job is available */ -#define JOB_ST_SETUP 1 /* Job is allocated but otherwise invalid */ -#define JOB_ST_RUNNING 3 /* Job is running, pid valid */ -#define JOB_ST_FINISHED 4 /* Job is done (ie after SIGCHILD) */ - char job_suspended; - short flags; /* Flags to control treatment of job */ -#define JOB_IGNERR 0x001 /* Ignore non-zero exits */ -#define JOB_SILENT 0x002 /* no output */ -#define JOB_SPECIAL 0x004 /* Target is a special one. i.e. run it locally - * if we can't export it and maxLocal is 0 */ -#define JOB_IGNDOTS 0x008 /* Ignore "..." lines when processing - * commands */ -#define JOB_TRACED 0x400 /* we've sent 'set -x' */ +typedef enum JobStatus { + JOB_ST_FREE = 0, /* Job is available */ + JOB_ST_SET_UP = 1, /* Job is allocated but otherwise invalid */ + /* XXX: What about the 2? */ + JOB_ST_RUNNING = 3, /* Job is running, pid valid */ + JOB_ST_FINISHED = 4 /* Job is done (ie after SIGCHILD) */ +} JobStatus; - int jobPipe[2]; /* Pipe for readind output from job */ - struct pollfd *inPollfd; /* pollfd associated with inPipe */ - char outBuf[JOB_BUFSIZE + 1]; - /* Buffer for storing the output of the - * job, line by line */ - int curPos; /* Current position in op_outBuf */ +/* + * A Job manages the shell commands that are run to create a single target. + * Each job is run in a separate subprocess by a shell. Several jobs can run + * in parallel. + * + * The shell commands for the target are written to a temporary file, + * then the shell is run with the temporary file as stdin, and the output + * of that shell is captured via a pipe. + * + * When a job is finished, Make_Update updates all parents of the node + * that was just remade, marking them as ready to be made next if all + * other dependencies are finished as well. + */ +typedef struct Job { + /* The process ID of the shell running the commands */ + int pid; + + /* The target the child is making */ + GNode *node; + + /* If one of the shell commands is "...", all following commands are + * delayed until the .END node is made. This list node points to the + * first of these commands, if any. */ + StringListNode *tailCmds; + + /* This is where the shell commands go. */ + FILE *cmdFILE; + + int exit_status; /* from wait4() in signal handler */ + + JobStatus status; + + Boolean suspended; + + /* Ignore non-zero exits */ + Boolean ignerr; + /* Output the command before or instead of running it. */ + Boolean echo; + /* Target is a special one. */ + Boolean special; + + int inPipe; /* Pipe for reading output from job */ + int outPipe; /* Pipe for writing control commands */ + struct pollfd *inPollfd; /* pollfd associated with inPipe */ + +#define JOB_BUFSIZE 1024 + /* Buffer for storing the output of the job, line by line. */ + char outBuf[JOB_BUFSIZE + 1]; + size_t curPos; /* Current position in outBuf. */ #ifdef USE_META - struct BuildMon bm; + struct BuildMon bm; #endif } Job; -#define inPipe jobPipe[0] -#define outPipe jobPipe[1] - - -/*- - * Shell Specifications: - * Each shell type has associated with it the following information: - * 1) The string which must match the last character of the shell name - * for the shell to be considered of this type. The longest match - * wins. - * 2) A command to issue to turn off echoing of command lines - * 3) A command to issue to turn echoing back on again - * 4) What the shell prints, and its length, when given the echo-off - * command. This line will not be printed when received from the shell - * 5) A boolean to tell if the shell has the ability to control - * error checking for individual commands. - * 6) The string to turn this checking on. - * 7) The string to turn it off. - * 8) The command-flag to give to cause the shell to start echoing - * commands right away. - * 9) The command-flag to cause the shell to Lib_Exit when an error is - * detected in one of the commands. - * - * Some special stuff goes on if a shell doesn't have error control. In such - * a case, errCheck becomes a printf template for echoing the command, - * should echoing be on and ignErr becomes another printf template for - * executing the command while ignoring the return status. Finally errOut - * is a printf template for running the command and causing the shell to - * exit on error. If any of these strings are empty when hasErrCtl is FALSE, - * the command will be executed anyway as is and if it causes an error, so be - * it. Any templates setup to echo the command will escape any '$ ` \ "'i - * characters in the command string to avoid common problems with - * echo "%s\n" as a template. - */ -typedef struct Shell { - const char *name; /* the name of the shell. For Bourne and C - * shells, this is used only to find the - * shell description when used as the single - * source of a .SHELL target. For user-defined - * shells, this is the full path of the shell. - */ - Boolean hasEchoCtl; /* True if both echoOff and echoOn defined */ - const char *echoOff; /* command to turn off echo */ - const char *echoOn; /* command to turn it back on again */ - const char *noPrint; /* command to skip when printing output from - * shell. This is usually the command which - * was executed to turn off echoing */ - int noPLen; /* length of noPrint command */ - Boolean hasErrCtl; /* set if can control error checking for - * individual commands */ - const char *errCheck; /* string to turn error checking on */ - const char *ignErr; /* string to turn off error checking */ - const char *errOut; /* string to use for testing exit code */ - const char *newline; /* string literal that results in a newline - * character when it appears outside of any - * 'quote' or "quote" characters */ - char commentChar; /* character used by shell for comment lines */ - - /* - * command-line flags - */ - const char *echo; /* echo commands */ - const char *exit; /* exit on error */ -} Shell; - extern const char *shellPath; extern const char *shellName; extern char *shellErrFlag; -extern int jobTokensRunning; /* tokens currently "out" */ -extern int maxJobs; /* Max jobs we can run */ +extern int jobTokensRunning; /* tokens currently "out" */ void Shell_Init(void); const char *Shell_GetNewline(void); void Job_Touch(GNode *, Boolean); -Boolean Job_CheckCommands(GNode *, void (*abortProc )(const char *, ...)); -#define CATCH_BLOCK 1 +Boolean Job_CheckCommands(GNode *, void (*abortProc)(const char *, ...)); void Job_CatchChildren(void); void Job_CatchOutput(void); void Job_Make(GNode *); void Job_Init(void); -Boolean Job_Full(void); -Boolean Job_Empty(void); -ReturnStatus Job_ParseShell(char *); +Boolean Job_ParseShell(char *); int Job_Finish(void); void Job_End(void); void Job_Wait(void); void Job_AbortAll(void); -void JobFlagForMigration(int); void Job_TokenReturn(void); Boolean Job_TokenWithdraw(void); void Job_ServerStart(int, int, int); void Job_SetPrefix(void); Boolean Job_RunTarget(const char *, const char *); +void Job_FlagsToString(const Job *, char *, size_t); +int Job_TempFile(const char *, char *, size_t); -#endif /* _JOB_H_ */ +#endif /* MAKE_JOB_H */ diff --git a/usr.bin/make/lst.c b/usr.bin/make/lst.c new file mode 100644 index 000000000..372973112 --- /dev/null +++ b/usr.bin/make/lst.c @@ -0,0 +1,292 @@ +/* $NetBSD: lst.c,v 1.105 2021/03/15 16:45:30 rillig Exp $ */ + +/* + * Copyright (c) 1988, 1989, 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Adam de Boor. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "make.h" + +MAKE_RCSID("$NetBSD: lst.c,v 1.105 2021/03/15 16:45:30 rillig Exp $"); + +static ListNode * +LstNodeNew(ListNode *prev, ListNode *next, void *datum) +{ + ListNode *ln = bmake_malloc(sizeof *ln); + + ln->prev = prev; + ln->next = next; + ln->datum = datum; + + return ln; +} + +/* Create and initialize a new, empty list. */ +List * +Lst_New(void) +{ + List *list = bmake_malloc(sizeof *list); + Lst_Init(list); + return list; +} + +void +Lst_Done(List *list) +{ + ListNode *ln, *next; + + for (ln = list->first; ln != NULL; ln = next) { + next = ln->next; + free(ln); + } +} + +void +Lst_DoneCall(List *list, LstFreeProc freeProc) +{ + ListNode *ln, *next; + + for (ln = list->first; ln != NULL; ln = next) { + next = ln->next; + freeProc(ln->datum); + free(ln); + } +} + +/* Free a list and all its nodes. The node data are not freed though. */ +void +Lst_Free(List *list) +{ + + Lst_Done(list); + free(list); +} + +/* Insert a new node with the datum before the given node. */ +void +Lst_InsertBefore(List *list, ListNode *ln, void *datum) +{ + ListNode *newNode; + + assert(datum != NULL); + + newNode = LstNodeNew(ln->prev, ln, datum); + + if (ln->prev != NULL) + ln->prev->next = newNode; + ln->prev = newNode; + + if (ln == list->first) + list->first = newNode; +} + +/* Add a piece of data at the start of the given list. */ +void +Lst_Prepend(List *list, void *datum) +{ + ListNode *ln; + + assert(datum != NULL); + + ln = LstNodeNew(NULL, list->first, datum); + + if (list->first == NULL) { + list->first = ln; + list->last = ln; + } else { + list->first->prev = ln; + list->first = ln; + } +} + +/* Add a piece of data at the end of the given list. */ +void +Lst_Append(List *list, void *datum) +{ + ListNode *ln; + + assert(datum != NULL); + + ln = LstNodeNew(list->last, NULL, datum); + + if (list->last == NULL) { + list->first = ln; + list->last = ln; + } else { + list->last->next = ln; + list->last = ln; + } +} + +/* + * Remove the given node from the given list. + * The datum stored in the node must be freed by the caller, if necessary. + */ +void +Lst_Remove(List *list, ListNode *ln) +{ + /* unlink it from its neighbors */ + if (ln->next != NULL) + ln->next->prev = ln->prev; + if (ln->prev != NULL) + ln->prev->next = ln->next; + + /* unlink it from the list */ + if (list->first == ln) + list->first = ln->next; + if (list->last == ln) + list->last = ln->prev; +} + +/* Replace the datum in the given node with the new datum. */ +void +LstNode_Set(ListNode *ln, void *datum) +{ + assert(datum != NULL); + + ln->datum = datum; +} + +/* + * Replace the datum in the given node with NULL. + * Having NULL values in a list is unusual though. + */ +void +LstNode_SetNull(ListNode *ln) +{ + ln->datum = NULL; +} + +/* + * Return the first node that contains the given datum, or NULL. + * + * Time complexity: O(length(list)) + */ +ListNode * +Lst_FindDatum(List *list, const void *datum) +{ + ListNode *ln; + + assert(datum != NULL); + + for (ln = list->first; ln != NULL; ln = ln->next) + if (ln->datum == datum) + return ln; + + return NULL; +} + +/* + * Move all nodes from src to the end of dst. + * The source list becomes indeterminate. + */ +void +Lst_MoveAll(List *dst, List *src) +{ + if (src->first != NULL) { + src->first->prev = dst->last; + if (dst->last != NULL) + dst->last->next = src->first; + else + dst->first = src->first; + + dst->last = src->last; + } +#ifdef CLEANUP + src->first = NULL; + src->last = NULL; +#endif +} + +/* Copy the element data from src to the start of dst. */ +void +Lst_PrependAll(List *dst, List *src) +{ + ListNode *ln; + + for (ln = src->last; ln != NULL; ln = ln->prev) + Lst_Prepend(dst, ln->datum); +} + +/* Copy the element data from src to the end of dst. */ +void +Lst_AppendAll(List *dst, List *src) +{ + ListNode *ln; + + for (ln = src->first; ln != NULL; ln = ln->next) + Lst_Append(dst, ln->datum); +} + +/* Remove and return the datum at the head of the given list. */ +void * +Lst_Dequeue(List *list) +{ + void *datum = list->first->datum; + Lst_Remove(list, list->first); + assert(datum != NULL); /* since NULL would mean end of the list */ + return datum; +} + +void +Vector_Init(Vector *v, size_t itemSize) +{ + v->len = 0; + v->cap = 10; + v->itemSize = itemSize; + v->items = bmake_malloc(v->cap * v->itemSize); +} + +/* + * Add space for a new item to the vector and return a pointer to that space. + * The returned data is valid until the next modifying operation. + */ +void * +Vector_Push(Vector *v) +{ + if (v->len >= v->cap) { + v->cap *= 2; + v->items = bmake_realloc(v->items, v->cap * v->itemSize); + } + v->len++; + return Vector_Get(v, v->len - 1); +} + +/* + * Remove the last item from the vector, return the pointer to it. + * The returned data is valid until the next modifying operation. + */ +void * +Vector_Pop(Vector *v) +{ + assert(v->len > 0); + v->len--; + return Vector_Get(v, v->len); +} diff --git a/usr.bin/make/lst.h b/usr.bin/make/lst.h index e207bc808..e8ba65b6d 100644 --- a/usr.bin/make/lst.h +++ b/usr.bin/make/lst.h @@ -1,4 +1,4 @@ -/* $NetBSD: lst.h,v 1.20 2014/09/07 20:55:34 joerg Exp $ */ +/* $NetBSD: lst.h,v 1.97 2021/03/15 16:06:05 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -73,117 +73,128 @@ * from: @(#)lst.h 8.1 (Berkeley) 6/6/93 */ -/*- - * lst.h -- - * Header for using the list library - */ -#ifndef _LST_H_ -#define _LST_H_ +/* Doubly-linked lists of arbitrary pointers. */ -#include -#include +#ifndef MAKE_LST_H +#define MAKE_LST_H -#include "sprite.h" +#include +#include +#include + +/* A doubly-linked list of pointers. */ +typedef struct List List; +/* A single node in the doubly-linked list. */ +typedef struct ListNode ListNode; + +struct ListNode { + ListNode *prev; /* previous node in list, or NULL */ + ListNode *next; /* next node in list, or NULL */ + void *datum; /* datum associated with this element */ +}; + +struct List { + ListNode *first; + ListNode *last; +}; + +/* Free the datum of a node, called before freeing the node itself. */ +typedef void LstFreeProc(void *); + +/* Create or destroy a list */ + +/* Create a new list. */ +List *Lst_New(void); +/* Free the list nodes, but not the list itself. */ +void Lst_Done(List *); +/* Free the list nodes, freeing the node data using the given function. */ +void Lst_DoneCall(List *, LstFreeProc); +/* Free the list, leaving the node data unmodified. */ +void Lst_Free(List *); + +#define LST_INIT { NULL, NULL } + +/* Initialize a list, without memory allocation. */ +MAKE_INLINE void +Lst_Init(List *list) +{ + list->first = NULL; + list->last = NULL; +} + +/* Get information about a list */ + +MAKE_INLINE Boolean +Lst_IsEmpty(List *list) +{ + return list->first == NULL; +} + +/* Find the first node that contains the given datum, or NULL. */ +ListNode *Lst_FindDatum(List *, const void *); + +/* Modify a list */ + +/* Insert a datum before the given node. */ +void Lst_InsertBefore(List *, ListNode *, void *); +/* Place a datum at the front of the list. */ +void Lst_Prepend(List *, void *); +/* Place a datum at the end of the list. */ +void Lst_Append(List *, void *); +/* Remove the node from the list. */ +void Lst_Remove(List *, ListNode *); +void Lst_PrependAll(List *, List *); +void Lst_AppendAll(List *, List *); +void Lst_MoveAll(List *, List *); + +/* Node-specific functions */ + +/* Replace the value of the node. */ +void LstNode_Set(ListNode *, void *); +/* Set the value of the node to NULL. Having NULL in a list is unusual. */ +void LstNode_SetNull(ListNode *); + +/* Using the list as a queue */ + +/* Add a datum at the tail of the queue. */ +MAKE_INLINE void +Lst_Enqueue(List *list, void *datum) { + Lst_Append(list, datum); +} + +/* Remove the head node of the queue and return its datum. */ +void *Lst_Dequeue(List *); /* - * basic typedef. This is what the Lst_ functions handle + * A vector is an ordered collection of items, allowing for fast indexed + * access. */ +typedef struct Vector { + void *items; /* memory holding the items */ + size_t itemSize; /* size of a single item */ + size_t len; /* number of actually usable elements */ + size_t cap; /* capacity */ +} Vector; -typedef struct List *Lst; -typedef struct ListNode *LstNode; - -typedef void *DuplicateProc(void *); -typedef void FreeProc(void *); - -#define LST_CONCNEW 0 /* create new LstNode's when using Lst_Concat */ -#define LST_CONCLINK 1 /* relink LstNode's when using Lst_Concat */ +void Vector_Init(Vector *, size_t); /* - * Creation/destruction functions + * Return the pointer to the given item in the vector. + * The returned data is valid until the next modifying operation. */ -/* Create a new list */ -Lst Lst_Init(Boolean); -/* Duplicate an existing list */ -Lst Lst_Duplicate(Lst, DuplicateProc *); -/* Destroy an old one */ -void Lst_Destroy(Lst, FreeProc *); -/* True if list is empty */ -Boolean Lst_IsEmpty(Lst); +MAKE_INLINE void * +Vector_Get(Vector *v, size_t i) +{ + unsigned char *items = v->items; + return items + i * v->itemSize; +} -/* - * Functions to modify a list - */ -/* Insert an element before another */ -ReturnStatus Lst_InsertBefore(Lst, LstNode, void *); -/* Insert an element after another */ -ReturnStatus Lst_InsertAfter(Lst, LstNode, void *); -/* Place an element at the front of a lst. */ -ReturnStatus Lst_AtFront(Lst, void *); -/* Place an element at the end of a lst. */ -ReturnStatus Lst_AtEnd(Lst, void *); -/* Remove an element */ -ReturnStatus Lst_Remove(Lst, LstNode); -/* Replace a node with a new value */ -ReturnStatus Lst_Replace(LstNode, void *); -/* Concatenate two lists */ -ReturnStatus Lst_Concat(Lst, Lst, int); +void *Vector_Push(Vector *); +void *Vector_Pop(Vector *); -/* - * Node-specific functions - */ -/* Return first element in list */ -LstNode Lst_First(Lst); -/* Return last element in list */ -LstNode Lst_Last(Lst); -/* Return successor to given element */ -LstNode Lst_Succ(LstNode); -/* Return predecessor to given element */ -LstNode Lst_Prev(LstNode); -/* Get datum from LstNode */ -void *Lst_Datum(LstNode); +MAKE_INLINE void +Vector_Done(Vector *v) { + free(v->items); +} -/* - * Functions for entire lists - */ -/* Find an element in a list */ -LstNode Lst_Find(Lst, const void *, int (*)(const void *, const void *)); -/* Find an element starting from somewhere */ -LstNode Lst_FindFrom(Lst, LstNode, const void *, - int (*cProc)(const void *, const void *)); -/* - * See if the given datum is on the list. Returns the LstNode containing - * the datum - */ -LstNode Lst_Member(Lst, void *); -/* Apply a function to all elements of a lst */ -int Lst_ForEach(Lst, int (*)(void *, void *), void *); -/* - * Apply a function to all elements of a lst starting from a certain point. - * If the list is circular, the application will wrap around to the - * beginning of the list again. - */ -int Lst_ForEachFrom(Lst, LstNode, int (*)(void *, void *), - void *); -/* - * these functions are for dealing with a list as a table, of sorts. - * An idea of the "current element" is kept and used by all the functions - * between Lst_Open() and Lst_Close(). - */ -/* Open the list */ -ReturnStatus Lst_Open(Lst); -/* Next element please */ -LstNode Lst_Next(Lst); -/* Done yet? */ -Boolean Lst_IsAtEnd(Lst); -/* Finish table access */ -void Lst_Close(Lst); - -/* - * for using the list as a queue - */ -/* Place an element at tail of queue */ -ReturnStatus Lst_EnQueue(Lst, void *); -/* Remove an element from head of queue */ -void *Lst_DeQueue(Lst); - -#endif /* _LST_H_ */ +#endif /* MAKE_LST_H */ diff --git a/usr.bin/make/lst.lib/Makefile b/usr.bin/make/lst.lib/Makefile deleted file mode 100644 index 5b33a5062..000000000 --- a/usr.bin/make/lst.lib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $NetBSD: Makefile,v 1.6 2006/11/11 21:23:36 dsl Exp $ - -OBJ=lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o \ - lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o \ - lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o \ - lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o \ - lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o - -CPPFLAGS=-I${.CURDIR}/.. -all: ${OBJ} diff --git a/usr.bin/make/lst.lib/lstAppend.c b/usr.bin/make/lst.lib/lstAppend.c deleted file mode 100644 index 4dafe8314..000000000 --- a/usr.bin/make/lst.lib/lstAppend.c +++ /dev/null @@ -1,122 +0,0 @@ -/* $NetBSD: lstAppend.c,v 1.14 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstAppend.c,v 1.14 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstAppend.c,v 1.14 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstAppend.c -- - * Add a new node with a new datum after an existing node - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_InsertAfter -- - * Create a new node and add it to the given list after the given node. - * - * Input: - * l affected list - * ln node after which to append the datum - * d said datum - * - * Results: - * SUCCESS if all went well. - * - * Side Effects: - * A new ListNode is created and linked in to the List. The lastPtr - * field of the List will be altered if ln is the last node in the - * list. lastPtr and firstPtr will alter if the list was empty and - * ln was NULL. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_InsertAfter(Lst l, LstNode ln, void *d) -{ - List list; - ListNode lNode; - ListNode nLNode; - - if (LstValid (l) && (ln == NULL && LstIsEmpty (l))) { - goto ok; - } - - if (!LstValid (l) || LstIsEmpty (l) || ! LstNodeValid (ln, l)) { - return (FAILURE); - } - ok: - - list = l; - lNode = ln; - - PAlloc (nLNode, ListNode); - nLNode->datum = d; - nLNode->useCount = nLNode->flags = 0; - - if (lNode == NULL) { - if (list->isCirc) { - nLNode->nextPtr = nLNode->prevPtr = nLNode; - } else { - nLNode->nextPtr = nLNode->prevPtr = NULL; - } - list->firstPtr = list->lastPtr = nLNode; - } else { - nLNode->prevPtr = lNode; - nLNode->nextPtr = lNode->nextPtr; - - lNode->nextPtr = nLNode; - if (nLNode->nextPtr != NULL) { - nLNode->nextPtr->prevPtr = nLNode; - } - - if (lNode == list->lastPtr) { - list->lastPtr = nLNode; - } - } - - return (SUCCESS); -} - diff --git a/usr.bin/make/lst.lib/lstAtEnd.c b/usr.bin/make/lst.lib/lstAtEnd.c deleted file mode 100644 index 10f191a20..000000000 --- a/usr.bin/make/lst.lib/lstAtEnd.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $NetBSD: lstAtEnd.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstAtEnd.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstAtEnd.c -- - * Add a node at the end of the list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_AtEnd -- - * Add a node to the end of the given list - * - * Input: - * l List to which to add the datum - * d Datum to add - * - * Results: - * SUCCESS if life is good. - * - * Side Effects: - * A new ListNode is created and added to the list. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_AtEnd(Lst l, void *d) -{ - LstNode end; - - end = Lst_Last(l); - return (Lst_InsertAfter(l, end, d)); -} diff --git a/usr.bin/make/lst.lib/lstAtFront.c b/usr.bin/make/lst.lib/lstAtFront.c deleted file mode 100644 index d8be16647..000000000 --- a/usr.bin/make/lst.lib/lstAtFront.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $NetBSD: lstAtFront.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstAtFront.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstAtFront.c -- - * Add a node at the front of the list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_AtFront -- - * Place a piece of data at the front of a list - * - * Results: - * SUCCESS or FAILURE - * - * Side Effects: - * A new ListNode is created and stuck at the front of the list. - * hence, firstPtr (and possible lastPtr) in the list are altered. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_AtFront(Lst l, void *d) -{ - LstNode front; - - front = Lst_First(l); - return (Lst_InsertBefore(l, front, d)); -} diff --git a/usr.bin/make/lst.lib/lstClose.c b/usr.bin/make/lst.lib/lstClose.c deleted file mode 100644 index 06b68c5c0..000000000 --- a/usr.bin/make/lst.lib/lstClose.c +++ /dev/null @@ -1,86 +0,0 @@ -/* $NetBSD: lstClose.c,v 1.11 2006/10/27 21:37:25 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstClose.c,v 1.11 2006/10/27 21:37:25 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstClose.c,v 1.11 2006/10/27 21:37:25 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstClose.c -- - * Close a list for sequential access. - * The sequential functions access the list in a slightly different way. - * CurPtr points to their idea of the current node in the list and they - * access the list based on it. Because the list is circular, Lst_Next - * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be - * used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Close -- - * Close a list which was opened for sequential access. - * - * Input: - * l The list to close - * - * Results: - * None. - * - * Side Effects: - * The list is closed. - * - *----------------------------------------------------------------------- - */ -void -Lst_Close(Lst l) -{ - List list = l; - - if (LstValid(l) == TRUE) { - list->isOpen = FALSE; - list->atEnd = Unknown; - } -} - diff --git a/usr.bin/make/lst.lib/lstConcat.c b/usr.bin/make/lst.lib/lstConcat.c deleted file mode 100644 index 534d34e45..000000000 --- a/usr.bin/make/lst.lib/lstConcat.c +++ /dev/null @@ -1,185 +0,0 @@ -/* $NetBSD: lstConcat.c,v 1.16 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstConcat.c,v 1.16 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstConcat.c,v 1.16 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * listConcat.c -- - * Function to concatentate two lists. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Concat -- - * Concatenate two lists. New elements are created to hold the data - * elements, if specified, but the elements themselves are not copied. - * If the elements should be duplicated to avoid confusion with another - * list, the Lst_Duplicate function should be called first. - * If LST_CONCLINK is specified, the second list is destroyed since - * its pointers have been corrupted and the list is no longer useable. - * - * Input: - * l1 The list to which l2 is to be appended - * l2 The list to append to l1 - * flags LST_CONCNEW if LstNode's should be duplicated - * LST_CONCLINK if should just be relinked - * - * Results: - * SUCCESS if all went well. FAILURE otherwise. - * - * Side Effects: - * New elements are created and appended the first list. - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Concat(Lst l1, Lst l2, int flags) -{ - ListNode ln; /* original LstNode */ - ListNode nln; /* new LstNode */ - ListNode last; /* the last element in the list. Keeps - * bookkeeping until the end */ - List list1 = l1; - List list2 = l2; - - if (!LstValid (l1) || !LstValid (l2)) { - return (FAILURE); - } - - if (flags == LST_CONCLINK) { - if (list2->firstPtr != NULL) { - /* - * We set the nextPtr of the - * last element of list two to be NIL to make the loop easier and - * so we don't need an extra case should the first list turn - * out to be non-circular -- the final element will already point - * to NIL space and the first element will be untouched if it - * existed before and will also point to NIL space if it didn't. - */ - list2->lastPtr->nextPtr = NULL; - /* - * So long as the second list isn't empty, we just link the - * first element of the second list to the last element of the - * first list. If the first list isn't empty, we then link the - * last element of the list to the first element of the second list - * The last element of the second list, if it exists, then becomes - * the last element of the first list. - */ - list2->firstPtr->prevPtr = list1->lastPtr; - if (list1->lastPtr != NULL) { - list1->lastPtr->nextPtr = list2->firstPtr; - } else { - list1->firstPtr = list2->firstPtr; - } - list1->lastPtr = list2->lastPtr; - } - if (list1->isCirc && list1->firstPtr != NULL) { - /* - * If the first list is supposed to be circular and it is (now) - * non-empty, we must make sure it's circular by linking the - * first element to the last and vice versa - */ - list1->firstPtr->prevPtr = list1->lastPtr; - list1->lastPtr->nextPtr = list1->firstPtr; - } - free(l2); - } else if (list2->firstPtr != NULL) { - /* - * We set the nextPtr of the last element of list 2 to be nil to make - * the loop less difficult. The loop simply goes through the entire - * second list creating new LstNodes and filling in the nextPtr, and - * prevPtr to fit into l1 and its datum field from the - * datum field of the corresponding element in l2. The 'last' node - * follows the last of the new nodes along until the entire l2 has - * been appended. Only then does the bookkeeping catch up with the - * changes. During the first iteration of the loop, if 'last' is nil, - * the first list must have been empty so the newly-created node is - * made the first node of the list. - */ - list2->lastPtr->nextPtr = NULL; - for (last = list1->lastPtr, ln = list2->firstPtr; - ln != NULL; - ln = ln->nextPtr) - { - PAlloc (nln, ListNode); - nln->datum = ln->datum; - if (last != NULL) { - last->nextPtr = nln; - } else { - list1->firstPtr = nln; - } - nln->prevPtr = last; - nln->flags = nln->useCount = 0; - last = nln; - } - - /* - * Finish bookkeeping. The last new element becomes the last element - * of list one. - */ - list1->lastPtr = last; - - /* - * The circularity of both list one and list two must be corrected - * for -- list one because of the new nodes added to it; list two - * because of the alteration of list2->lastPtr's nextPtr to ease the - * above for loop. - */ - if (list1->isCirc) { - list1->lastPtr->nextPtr = list1->firstPtr; - list1->firstPtr->prevPtr = list1->lastPtr; - } else { - last->nextPtr = NULL; - } - - if (list2->isCirc) { - list2->lastPtr->nextPtr = list2->firstPtr; - } - } - - return (SUCCESS); -} - diff --git a/usr.bin/make/lst.lib/lstDatum.c b/usr.bin/make/lst.lib/lstDatum.c deleted file mode 100644 index 6e2d9ad0e..000000000 --- a/usr.bin/make/lst.lib/lstDatum.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstDatum.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDatum.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDatum.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstDatum.c -- - * Return the datum associated with a list node. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Datum -- - * Return the datum stored in the given node. - * - * Results: - * The datum or NULL if the node is invalid. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -void * -Lst_Datum(LstNode ln) -{ - if (ln != NULL) { - return ((ln)->datum); - } else { - return NULL; - } -} - diff --git a/usr.bin/make/lst.lib/lstDeQueue.c b/usr.bin/make/lst.lib/lstDeQueue.c deleted file mode 100644 index bdb05cc11..000000000 --- a/usr.bin/make/lst.lib/lstDeQueue.c +++ /dev/null @@ -1,87 +0,0 @@ -/* $NetBSD: lstDeQueue.c,v 1.14 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.14 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDeQueue.c,v 1.14 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstDeQueue.c -- - * Remove the node and return its datum from the head of the list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_DeQueue -- - * Remove and return the datum at the head of the given list. - * - * Results: - * The datum in the node at the head or NULL if the list - * is empty. - * - * Side Effects: - * The head node is removed from the list. - * - *----------------------------------------------------------------------- - */ -void * -Lst_DeQueue(Lst l) -{ - void *rd; - ListNode tln; - - tln = Lst_First(l); - if (tln == NULL) { - return NULL; - } - - rd = tln->datum; - if (Lst_Remove(l, tln) == FAILURE) { - return NULL; - } else { - return (rd); - } -} - diff --git a/usr.bin/make/lst.lib/lstDestroy.c b/usr.bin/make/lst.lib/lstDestroy.c deleted file mode 100644 index 92c5b2b20..000000000 --- a/usr.bin/make/lst.lib/lstDestroy.c +++ /dev/null @@ -1,101 +0,0 @@ -/* $NetBSD: lstDestroy.c,v 1.16 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.16 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDestroy.c,v 1.16 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstDestroy.c -- - * Nuke a list and all its resources - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Destroy -- - * Destroy a list and free all its resources. If the freeProc is - * given, it is called with the datum from each node in turn before - * the node is freed. - * - * Results: - * None. - * - * Side Effects: - * The given list is freed in its entirety. - * - *----------------------------------------------------------------------- - */ -void -Lst_Destroy(Lst list, FreeProc *freeProc) -{ - ListNode ln; - ListNode tln = NULL; - - if (list == NULL) - return; - - /* To ease scanning */ - if (list->lastPtr != NULL) - list->lastPtr->nextPtr = NULL; - else { - free(list); - return; - } - - if (freeProc) { - for (ln = list->firstPtr; ln != NULL; ln = tln) { - tln = ln->nextPtr; - freeProc(ln->datum); - free(ln); - } - } else { - for (ln = list->firstPtr; ln != NULL; ln = tln) { - tln = ln->nextPtr; - free(ln); - } - } - - free(list); -} diff --git a/usr.bin/make/lst.lib/lstDupl.c b/usr.bin/make/lst.lib/lstDupl.c deleted file mode 100644 index 2174ff782..000000000 --- a/usr.bin/make/lst.lib/lstDupl.c +++ /dev/null @@ -1,107 +0,0 @@ -/* $NetBSD: lstDupl.c,v 1.16 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDupl.c,v 1.16 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDupl.c,v 1.16 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * listDupl.c -- - * Duplicate a list. This includes duplicating the individual - * elements. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Duplicate -- - * Duplicate an entire list. If a function to copy a void *is - * given, the individual client elements will be duplicated as well. - * - * Input: - * l the list to duplicate - * copyProc A function to duplicate each void * - * - * Results: - * The new Lst structure or NULL if failure. - * - * Side Effects: - * A new list is created. - *----------------------------------------------------------------------- - */ -Lst -Lst_Duplicate(Lst l, DuplicateProc *copyProc) -{ - Lst nl; - ListNode ln; - List list = l; - - if (!LstValid (l)) { - return NULL; - } - - nl = Lst_Init(list->isCirc); - if (nl == NULL) { - return NULL; - } - - ln = list->firstPtr; - while (ln != NULL) { - if (copyProc != NULL) { - if (Lst_AtEnd(nl, copyProc(ln->datum)) == FAILURE) { - return NULL; - } - } else if (Lst_AtEnd(nl, ln->datum) == FAILURE) { - return NULL; - } - - if (list->isCirc && ln == list->lastPtr) { - ln = NULL; - } else { - ln = ln->nextPtr; - } - } - - return (nl); -} diff --git a/usr.bin/make/lst.lib/lstEnQueue.c b/usr.bin/make/lst.lib/lstEnQueue.c deleted file mode 100644 index be386c91a..000000000 --- a/usr.bin/make/lst.lib/lstEnQueue.c +++ /dev/null @@ -1,78 +0,0 @@ -/* $NetBSD: lstEnQueue.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstEnQueue.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstEnQueue.c-- - * Treat the list as a queue and place a datum at its end - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_EnQueue -- - * Add the datum to the tail of the given list. - * - * Results: - * SUCCESS or FAILURE as returned by Lst_InsertAfter. - * - * Side Effects: - * the lastPtr field is altered all the time and the firstPtr field - * will be altered if the list used to be empty. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_EnQueue(Lst l, void *d) -{ - if (LstValid (l) == FALSE) { - return (FAILURE); - } - - return (Lst_InsertAfter(l, Lst_Last(l), d)); -} - diff --git a/usr.bin/make/lst.lib/lstFind.c b/usr.bin/make/lst.lib/lstFind.c deleted file mode 100644 index d07dbe7f9..000000000 --- a/usr.bin/make/lst.lib/lstFind.c +++ /dev/null @@ -1,74 +0,0 @@ -/* $NetBSD: lstFind.c,v 1.15 2009/01/23 21:58:28 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstFind.c,v 1.15 2009/01/23 21:58:28 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstFind.c,v 1.15 2009/01/23 21:58:28 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstFind.c -- - * Find a node on a list. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Find -- - * Find a node on the given list using the given comparison function - * and the given datum. - * - * Results: - * The found node or NULL if none matches. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Find(Lst l, const void *d, int (*cProc)(const void *, const void *)) -{ - return (Lst_FindFrom(l, Lst_First(l), d, cProc)); -} - diff --git a/usr.bin/make/lst.lib/lstFindFrom.c b/usr.bin/make/lst.lib/lstFindFrom.c deleted file mode 100644 index e2beab632..000000000 --- a/usr.bin/make/lst.lib/lstFindFrom.c +++ /dev/null @@ -1,90 +0,0 @@ -/* $NetBSD: lstFindFrom.c,v 1.15 2009/01/23 21:58:28 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.15 2009/01/23 21:58:28 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstFindFrom.c,v 1.15 2009/01/23 21:58:28 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstFindFrom.c -- - * Find a node on a list from a given starting point. Used by Lst_Find. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_FindFrom -- - * Search for a node starting and ending with the given one on the - * given list using the passed datum and comparison function to - * determine when it has been found. - * - * Results: - * The found node or NULL - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_FindFrom(Lst l, LstNode ln, const void *d, - int (*cProc)(const void *, const void *)) -{ - ListNode tln; - - if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { - return NULL; - } - - tln = ln; - - do { - if ((*cProc)(tln->datum, d) == 0) - return (tln); - tln = tln->nextPtr; - } while (tln != ln && tln != NULL); - - return NULL; -} - diff --git a/usr.bin/make/lst.lib/lstFirst.c b/usr.bin/make/lst.lib/lstFirst.c deleted file mode 100644 index 4e8334f8b..000000000 --- a/usr.bin/make/lst.lib/lstFirst.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstFirst.c,v 1.12 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstFirst.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstFirst.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstFirst.c -- - * Return the first node of a list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_First -- - * Return the first node on the given list. - * - * Results: - * The first node or NULL if the list is empty. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_First(Lst l) -{ - if (!LstValid (l) || LstIsEmpty (l)) { - return NULL; - } else { - return (l->firstPtr); - } -} - diff --git a/usr.bin/make/lst.lib/lstForEach.c b/usr.bin/make/lst.lib/lstForEach.c deleted file mode 100644 index 917e4ea80..000000000 --- a/usr.bin/make/lst.lib/lstForEach.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $NetBSD: lstForEach.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstForEach.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstForEach.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstForeach.c -- - * Perform a given function on all elements of a list. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_ForEach -- - * Apply the given function to each element of the given list. The - * function should return 0 if Lst_ForEach should continue and non- - * zero if it should abort. - * - * Results: - * None. - * - * Side Effects: - * Only those created by the passed-in function. - * - *----------------------------------------------------------------------- - */ -/*VARARGS2*/ -int -Lst_ForEach(Lst l, int (*proc)(void *, void *), void *d) -{ - return Lst_ForEachFrom(l, Lst_First(l), proc, d); -} - diff --git a/usr.bin/make/lst.lib/lstForEachFrom.c b/usr.bin/make/lst.lib/lstForEachFrom.c deleted file mode 100644 index c7f44adc4..000000000 --- a/usr.bin/make/lst.lib/lstForEachFrom.c +++ /dev/null @@ -1,125 +0,0 @@ -/* $NetBSD: lstForEachFrom.c,v 1.17 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.17 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstForEachFrom.c,v 1.17 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * lstForEachFrom.c -- - * Perform a given function on all elements of a list starting from - * a given point. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_ForEachFrom -- - * Apply the given function to each element of the given list. The - * function should return 0 if traversal should continue and non- - * zero if it should abort. - * - * Results: - * None. - * - * Side Effects: - * Only those created by the passed-in function. - * - *----------------------------------------------------------------------- - */ -/*VARARGS2*/ -int -Lst_ForEachFrom(Lst l, LstNode ln, int (*proc)(void *, void *), - void *d) -{ - ListNode tln = ln; - List list = l; - ListNode next; - Boolean done; - int result; - - if (!LstValid (list) || LstIsEmpty (list)) { - return 0; - } - - do { - /* - * Take care of having the current element deleted out from under - * us. - */ - - next = tln->nextPtr; - - /* - * We're done with the traversal if - * - the next node to examine is the first in the queue or - * doesn't exist and - * - nothing's been added after the current node (check this - * after proc() has been called). - */ - done = (next == NULL || next == list->firstPtr); - - (void) tln->useCount++; - result = (*proc) (tln->datum, d); - (void) tln->useCount--; - - /* - * Now check whether a node has been added. - * Note: this doesn't work if this node was deleted before - * the new node was added. - */ - if (next != tln->nextPtr) { - next = tln->nextPtr; - done = 0; - } - - if (tln->flags & LN_DELETED) { - free((char *)tln); - } - tln = next; - } while (!result && !LstIsEmpty(list) && !done); - - return result; -} - diff --git a/usr.bin/make/lst.lib/lstInit.c b/usr.bin/make/lst.lib/lstInit.c deleted file mode 100644 index f98ac42b0..000000000 --- a/usr.bin/make/lst.lib/lstInit.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $NetBSD: lstInit.c,v 1.12 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstInit.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstInit.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * init.c -- - * Initialize a new linked list. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Init -- - * Create and initialize a new list. - * - * Input: - * circ TRUE if the list should be made circular - * - * Results: - * The created list. - * - * Side Effects: - * A list is created, what else? - * - *----------------------------------------------------------------------- - */ -Lst -Lst_Init(Boolean circ) -{ - List nList; - - PAlloc (nList, List); - - nList->firstPtr = NULL; - nList->lastPtr = NULL; - nList->isOpen = FALSE; - nList->isCirc = circ; - nList->atEnd = Unknown; - - return (nList); -} diff --git a/usr.bin/make/lst.lib/lstInsert.c b/usr.bin/make/lst.lib/lstInsert.c deleted file mode 100644 index 77187bb32..000000000 --- a/usr.bin/make/lst.lib/lstInsert.c +++ /dev/null @@ -1,122 +0,0 @@ -/* $NetBSD: lstInsert.c,v 1.14 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstInsert.c,v 1.14 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstInsert.c,v 1.14 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstInsert.c -- - * Insert a new datum before an old one - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_InsertBefore -- - * Insert a new node with the given piece of data before the given - * node in the given list. - * - * Input: - * l list to manipulate - * ln node before which to insert d - * d datum to be inserted - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * the firstPtr field will be changed if ln is the first node in the - * list. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_InsertBefore(Lst l, LstNode ln, void *d) -{ - ListNode nLNode; /* new lnode for d */ - ListNode lNode = ln; - List list = l; - - - /* - * check validity of arguments - */ - if (LstValid (l) && (LstIsEmpty (l) && ln == NULL)) - goto ok; - - if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { - return (FAILURE); - } - - ok: - PAlloc (nLNode, ListNode); - - nLNode->datum = d; - nLNode->useCount = nLNode->flags = 0; - - if (ln == NULL) { - if (list->isCirc) { - nLNode->prevPtr = nLNode->nextPtr = nLNode; - } else { - nLNode->prevPtr = nLNode->nextPtr = NULL; - } - list->firstPtr = list->lastPtr = nLNode; - } else { - nLNode->prevPtr = lNode->prevPtr; - nLNode->nextPtr = lNode; - - if (nLNode->prevPtr != NULL) { - nLNode->prevPtr->nextPtr = nLNode; - } - lNode->prevPtr = nLNode; - - if (lNode == list->firstPtr) { - list->firstPtr = nLNode; - } - } - - return (SUCCESS); -} - diff --git a/usr.bin/make/lst.lib/lstInt.h b/usr.bin/make/lst.lib/lstInt.h deleted file mode 100644 index ac53dcb67..000000000 --- a/usr.bin/make/lst.lib/lstInt.h +++ /dev/null @@ -1,105 +0,0 @@ -/* $NetBSD: lstInt.h,v 1.22 2014/09/07 20:55:34 joerg Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)lstInt.h 8.1 (Berkeley) 6/6/93 - */ - -/*- - * lstInt.h -- - * Internals for the list library - */ -#ifndef _LSTINT_H_ -#define _LSTINT_H_ - -#include "../lst.h" -#include "../make_malloc.h" - -typedef struct ListNode { - struct ListNode *prevPtr; /* previous element in list */ - struct ListNode *nextPtr; /* next in list */ - unsigned int useCount:8, /* Count of functions using the node. - * node may not be deleted until count - * goes to 0 */ - flags:8; /* Node status flags */ - void *datum; /* datum associated with this element */ -} *ListNode; -/* - * Flags required for synchronization - */ -#define LN_DELETED 0x0001 /* List node should be removed when done */ - -typedef enum { - Head, Middle, Tail, Unknown -} Where; - -typedef struct List { - ListNode firstPtr; /* first node in list */ - ListNode lastPtr; /* last node in list */ - Boolean isCirc; /* true if the list should be considered - * circular */ -/* - * fields for sequential access - */ - Where atEnd; /* Where in the list the last access was */ - Boolean isOpen; /* true if list has been Lst_Open'ed */ - ListNode curPtr; /* current node, if open. NULL if - * *just* opened */ - ListNode prevPtr; /* Previous node, if open. Used by - * Lst_Remove */ -} *List; - -/* - * PAlloc (var, ptype) -- - * Allocate a pointer-typedef structure 'ptype' into the variable 'var' - */ -#define PAlloc(var,ptype) var = (ptype) bmake_malloc(sizeof *(var)) - -/* - * LstValid (l) -- - * Return TRUE if the list l is valid - */ -#define LstValid(l) ((Lst)(l) != NULL) - -/* - * LstNodeValid (ln, l) -- - * Return TRUE if the LstNode ln is valid with respect to l - */ -#define LstNodeValid(ln, l) ((ln) != NULL) - -/* - * LstIsEmpty (l) -- - * TRUE if the list l is empty. - */ -#define LstIsEmpty(l) (((List)(l))->firstPtr == NULL) - -#endif /* _LSTINT_H_ */ diff --git a/usr.bin/make/lst.lib/lstIsAtEnd.c b/usr.bin/make/lst.lib/lstIsAtEnd.c deleted file mode 100644 index 70270d295..000000000 --- a/usr.bin/make/lst.lib/lstIsAtEnd.c +++ /dev/null @@ -1,87 +0,0 @@ -/* $NetBSD: lstIsAtEnd.c,v 1.13 2008/02/15 21:29:50 christos Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.13 2008/02/15 21:29:50 christos Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstIsAtEnd.c,v 1.13 2008/02/15 21:29:50 christos Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstIsAtEnd.c -- - * Tell if the current node is at the end of the list. - * The sequential functions access the list in a slightly different way. - * CurPtr points to their idea of the current node in the list and they - * access the list based on it. Because the list is circular, Lst_Next - * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be - * used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_IsAtEnd -- - * Return true if have reached the end of the given list. - * - * Results: - * TRUE if at the end of the list (this includes the list not being - * open or being invalid) or FALSE if not. We return TRUE if the list - * is invalid or unopend so as to cause the caller to exit its loop - * asap, the assumption being that the loop is of the form - * while (!Lst_IsAtEnd (l)) { - * ... - * } - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -Boolean -Lst_IsAtEnd(Lst l) -{ - List list = l; - - return (!LstValid (l) || !list->isOpen || - (list->atEnd == Head) || (list->atEnd == Tail)); -} - diff --git a/usr.bin/make/lst.lib/lstIsEmpty.c b/usr.bin/make/lst.lib/lstIsEmpty.c deleted file mode 100644 index 8b1d6ed0d..000000000 --- a/usr.bin/make/lst.lib/lstIsEmpty.c +++ /dev/null @@ -1,75 +0,0 @@ -/* $NetBSD: lstIsEmpty.c,v 1.11 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.11 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstIsEmpty.c,v 1.11 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstIsEmpty.c -- - * A single function to decide if a list is empty - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_IsEmpty -- - * Return TRUE if the given list is empty. - * - * Results: - * TRUE if the list is empty, FALSE otherwise. - * - * Side Effects: - * None. - * - * A list is considered empty if its firstPtr == NULL (or if - * the list itself is NULL). - *----------------------------------------------------------------------- - */ -Boolean -Lst_IsEmpty(Lst l) -{ - return ( ! LstValid (l) || LstIsEmpty(l)); -} - diff --git a/usr.bin/make/lst.lib/lstLast.c b/usr.bin/make/lst.lib/lstLast.c deleted file mode 100644 index 096ca24d1..000000000 --- a/usr.bin/make/lst.lib/lstLast.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstLast.c,v 1.12 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstLast.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstLast.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstLast.c -- - * Return the last element of a list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Last -- - * Return the last node on the list l. - * - * Results: - * The requested node or NULL if the list is empty. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Last(Lst l) -{ - if (!LstValid(l) || LstIsEmpty (l)) { - return NULL; - } else { - return (l->lastPtr); - } -} - diff --git a/usr.bin/make/lst.lib/lstMember.c b/usr.bin/make/lst.lib/lstMember.c deleted file mode 100644 index e9046aca1..000000000 --- a/usr.bin/make/lst.lib/lstMember.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * lstMember.c -- - * See if a given datum is on a given list. - */ - -#include "lstInt.h" - -LstNode -Lst_Member(Lst l, void *d) -{ - List list = l; - ListNode lNode; - - if (list == NULL) { - return NULL; - } - lNode = list->firstPtr; - if (lNode == NULL) { - return NULL; - } - - do { - if (lNode->datum == d) { - return lNode; - } - lNode = lNode->nextPtr; - } while (lNode != NULL && lNode != list->firstPtr); - - return NULL; -} diff --git a/usr.bin/make/lst.lib/lstNext.c b/usr.bin/make/lst.lib/lstNext.c deleted file mode 100644 index 5c2e0eece..000000000 --- a/usr.bin/make/lst.lib/lstNext.c +++ /dev/null @@ -1,120 +0,0 @@ -/* $NetBSD: lstNext.c,v 1.12 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstNext.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstNext.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstNext.c -- - * Return the next node for a list. - * The sequential functions access the list in a slightly different way. - * CurPtr points to their idea of the current node in the list and they - * access the list based on it. Because the list is circular, Lst_Next - * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be - * used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Next -- - * Return the next node for the given list. - * - * Results: - * The next node or NULL if the list has yet to be opened. Also - * if the list is non-circular and the end has been reached, NULL - * is returned. - * - * Side Effects: - * the curPtr field is updated. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Next(Lst l) -{ - ListNode tln; - List list = l; - - if ((LstValid (l) == FALSE) || - (list->isOpen == FALSE)) { - return NULL; - } - - list->prevPtr = list->curPtr; - - if (list->curPtr == NULL) { - if (list->atEnd == Unknown) { - /* - * If we're just starting out, atEnd will be Unknown. - * Then we want to start this thing off in the right - * direction -- at the start with atEnd being Middle. - */ - list->curPtr = tln = list->firstPtr; - list->atEnd = Middle; - } else { - tln = NULL; - list->atEnd = Tail; - } - } else { - tln = list->curPtr->nextPtr; - list->curPtr = tln; - - if (tln == list->firstPtr || tln == NULL) { - /* - * If back at the front, then we've hit the end... - */ - list->atEnd = Tail; - } else { - /* - * Reset to Middle if gone past first. - */ - list->atEnd = Middle; - } - } - - return (tln); -} - diff --git a/usr.bin/make/lst.lib/lstOpen.c b/usr.bin/make/lst.lib/lstOpen.c deleted file mode 100644 index 941293e7a..000000000 --- a/usr.bin/make/lst.lib/lstOpen.c +++ /dev/null @@ -1,87 +0,0 @@ -/* $NetBSD: lstOpen.c,v 1.12 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstOpen.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstOpen.c,v 1.12 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstOpen.c -- - * Open a list for sequential access. The sequential functions access the - * list in a slightly different way. CurPtr points to their idea of the - * current node in the list and they access the list based on it. - * If the list is circular, Lst_Next and Lst_Prev will go around - * the list forever. Lst_IsAtEnd must be used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Open -- - * Open a list for sequential access. A list can still be searched, - * etc., without confusing these functions. - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * isOpen is set TRUE and curPtr is set to NULL so the - * other sequential functions no it was just opened and can choose - * the first element accessed based on this. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Open(Lst l) -{ - if (LstValid (l) == FALSE) { - return (FAILURE); - } - (l)->isOpen = TRUE; - (l)->atEnd = LstIsEmpty (l) ? Head : Unknown; - (l)->curPtr = NULL; - - return (SUCCESS); -} - diff --git a/usr.bin/make/lst.lib/lstPrev.c b/usr.bin/make/lst.lib/lstPrev.c deleted file mode 100644 index 0ec865d51..000000000 --- a/usr.bin/make/lst.lib/lstPrev.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $NetBSD: lstPrev.c,v 1.3 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstPrev.c,v 1.3 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstPrev.c,v 1.3 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstPrev.c -- - * return the predecessor to a given node - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Prev -- - * Return the predecessor to the given node on its list. - * - * Results: - * The predecessor of the node, if it exists (note that on a circular - * list, if the node is the only one in the list, it is its own - * predecessor). - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Prev(LstNode ln) -{ - if (ln == NULL) { - return NULL; - } else { - return (ln->prevPtr); - } -} - diff --git a/usr.bin/make/lst.lib/lstRemove.c b/usr.bin/make/lst.lib/lstRemove.c deleted file mode 100644 index 7480d30ba..000000000 --- a/usr.bin/make/lst.lib/lstRemove.c +++ /dev/null @@ -1,136 +0,0 @@ -/* $NetBSD: lstRemove.c,v 1.16 2014/09/07 20:55:34 joerg Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstRemove.c,v 1.16 2014/09/07 20:55:34 joerg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstRemove.c,v 1.16 2014/09/07 20:55:34 joerg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstRemove.c -- - * Remove an element from a list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Remove -- - * Remove the given node from the given list. - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * The list's firstPtr will be set to NULL if ln is the last - * node on the list. firsPtr and lastPtr will be altered if ln is - * either the first or last node, respectively, on the list. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Remove(Lst l, LstNode ln) -{ - List list = l; - ListNode lNode = ln; - - if (!LstValid (l) || - !LstNodeValid (ln, l)) { - return (FAILURE); - } - - /* - * unlink it from the list - */ - if (lNode->nextPtr != NULL) { - lNode->nextPtr->prevPtr = lNode->prevPtr; - } - if (lNode->prevPtr != NULL) { - lNode->prevPtr->nextPtr = lNode->nextPtr; - } - - /* - * if either the firstPtr or lastPtr of the list point to this node, - * adjust them accordingly - */ - if (list->firstPtr == lNode) { - list->firstPtr = lNode->nextPtr; - } - if (list->lastPtr == lNode) { - list->lastPtr = lNode->prevPtr; - } - - /* - * Sequential access stuff. If the node we're removing is the current - * node in the list, reset the current node to the previous one. If the - * previous one was non-existent (prevPtr == NULL), we set the - * end to be Unknown, since it is. - */ - if (list->isOpen && (list->curPtr == lNode)) { - list->curPtr = list->prevPtr; - if (list->curPtr == NULL) { - list->atEnd = Unknown; - } - } - - /* - * the only way firstPtr can still point to ln is if ln is the last - * node on the list (the list is circular, so lNode->nextptr == lNode in - * this case). The list is, therefore, empty and is marked as such - */ - if (list->firstPtr == lNode) { - list->firstPtr = NULL; - } - - /* - * note that the datum is unmolested. The caller must free it as - * necessary and as expected. - */ - if (lNode->useCount == 0) { - free(ln); - } else { - lNode->flags |= LN_DELETED; - } - - return (SUCCESS); -} - diff --git a/usr.bin/make/lst.lib/lstReplace.c b/usr.bin/make/lst.lib/lstReplace.c deleted file mode 100644 index 090e91a72..000000000 --- a/usr.bin/make/lst.lib/lstReplace.c +++ /dev/null @@ -1,78 +0,0 @@ -/* $NetBSD: lstReplace.c,v 1.13 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstReplace.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstReplace.c,v 1.13 2009/01/23 21:26:30 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstReplace.c -- - * Replace the datum in a node with a new datum - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Replace -- - * Replace the datum in the given node with the new datum - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * The datum field fo the node is altered. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Replace(LstNode ln, void *d) -{ - if (ln == NULL) { - return (FAILURE); - } else { - (ln)->datum = d; - return (SUCCESS); - } -} - diff --git a/usr.bin/make/lst.lib/lstSucc.c b/usr.bin/make/lst.lib/lstSucc.c deleted file mode 100644 index 3f13aa5e7..000000000 --- a/usr.bin/make/lst.lib/lstSucc.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $NetBSD: lstSucc.c,v 1.13 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstSucc.c,v 1.13 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstSucc.c,v 1.13 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstSucc.c -- - * return the successor to a given node - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Succ -- - * Return the successor to the given node on its list. - * - * Results: - * The successor of the node, if it exists (note that on a circular - * list, if the node is the only one in the list, it is its own - * successor). - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Succ(LstNode ln) -{ - if (ln == NULL) { - return NULL; - } else { - return (ln->nextPtr); - } -} - diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 73f4aaa9c..cd9321a61 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.233 2015/09/10 17:15:11 sjg Exp $ */ +/* $NetBSD: main.c,v 1.533 2021/02/05 19:19:17 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,49 +68,24 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.233 2015/09/10 17:15:11 sjg Exp $"; -#else -#include -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ - The Regents of the University of California. All rights reserved."); -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; -#else -__RCSID("$NetBSD: main.c,v 1.233 2015/09/10 17:15:11 sjg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * main.c -- - * The main file for this entire program. Exit routines etc - * reside here. +/* + * The main file for this entire program. Exit routines etc. reside here. * * Utility functions defined in this file: - * Main_ParseArgLine Takes a line of arguments, breaks them and - * treats them as if they were given when first - * invoked. Used by the parse module to implement - * the .MFLAGS target. * - * Error Print a tagged error message. The global - * MAKE variable must have been defined. This - * takes a format string and optional arguments - * for it. + * Main_ParseArgLine + * Parse and process command line arguments from a + * single string. Used to implement the special targets + * .MFLAGS and .MAKEFLAGS. * - * Fatal Print an error message and exit. Also takes - * a format string and arguments for it. + * Error Print a tagged error message. * - * Punt Aborts all jobs and exits with a message. Also - * takes a format string and arguments for it. + * Fatal Print an error message and exit. * - * Finish Finish things up by printing the number of - * errors which occurred, as passed to it, and - * exiting. + * Punt Abort all jobs and exit with a message. + * + * Finish Finish things up by printing the number of errors + * that occurred, and exit. */ #include @@ -125,121 +100,157 @@ __RCSID("$NetBSD: main.c,v 1.233 2015/09/10 17:15:11 sjg Exp $"); #include #include -#include #include #include -#include -#include #include -#include #include "make.h" -#include "hash.h" #include "dir.h" #include "job.h" #include "pathnames.h" #include "trace.h" -#ifdef USE_IOVEC -#include +/* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ +MAKE_RCSID("$NetBSD: main.c,v 1.533 2021/02/05 19:19:17 sjg Exp $"); +#if defined(MAKE_NATIVE) && !defined(lint) +__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " + "The Regents of the University of California. " + "All rights reserved."); #endif -#ifndef DEFMAXLOCAL -#define DEFMAXLOCAL DEFMAXJOBS -#endif /* DEFMAXLOCAL */ +CmdOpts opts; +time_t now; /* Time at start of make */ +GNode *defaultNode; /* .DEFAULT node */ +Boolean allPrecious; /* .PRECIOUS given on line by itself */ +Boolean deleteOnError; /* .DELETE_ON_ERROR: set */ -Lst create; /* Targets to be made */ -time_t now; /* Time at start of make */ -GNode *DEFAULT; /* .DEFAULT node */ -Boolean allPrecious; /* .PRECIOUS given on line by itself */ +static int maxJobTokens; /* -j argument */ +Boolean enterFlagObj; /* -w and objdir != srcdir */ -static Boolean noBuiltins; /* -r flag */ -static Lst makefiles; /* ordered list of makefiles to read */ -static Boolean printVars; /* print value of one or more vars */ -static Lst variables; /* list of variables to print */ -int maxJobs; /* -j argument */ -static int maxJobTokens; /* -j argument */ -Boolean compatMake; /* -B argument */ -int debug; /* -d argument */ -Boolean debugVflag; /* -dV */ -Boolean noExecute; /* -n flag */ -Boolean noRecursiveExecute; /* -N flag */ -Boolean keepgoing; /* -k flag */ -Boolean queryFlag; /* -q flag */ -Boolean touchFlag; /* -t flag */ -Boolean enterFlag; /* -w flag */ -Boolean enterFlagObj; /* -w and objdir != srcdir */ -Boolean ignoreErrors; /* -i flag */ -Boolean beSilent; /* -s flag */ -Boolean oldVars; /* variable substitution style */ -Boolean checkEnvFirst; /* -e flag */ -Boolean parseWarnFatal; /* -W flag */ -Boolean jobServer; /* -J flag */ -static int jp_0 = -1, jp_1 = -1; /* ends of parent job pipe */ -Boolean varNoExportEnv; /* -X flag */ -Boolean doing_depend; /* Set while reading .depend */ -static Boolean jobsRunning; /* TRUE if the jobs might be running */ -static const char * tracefile; -static void MainParseArgs(int, char **); -static int ReadMakefile(const void *, const void *); -static void usage(void) MAKE_ATTR_DEAD; +static int jp_0 = -1, jp_1 = -1; /* ends of parent job pipe */ +Boolean doing_depend; /* Set while reading .depend */ +static Boolean jobsRunning; /* TRUE if the jobs might be running */ +static const char *tracefile; +static int ReadMakefile(const char *); +static void purge_relative_cached_realpaths(void); -static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ -static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ -char curdir[MAXPATHLEN + 1]; /* Startup directory */ -char *progname; /* the program name */ +static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ +static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ +char curdir[MAXPATHLEN + 1]; /* Startup directory */ +const char *progname; char *makeDependfile; pid_t myPid; int makelevel; Boolean forceJobs = FALSE; - -extern Lst parseIncPath; +static int main_errors = 0; +static HashTable cached_realpaths; /* * For compatibility with the POSIX version of MAKEFLAGS that includes - * all the options with out -, convert flags to -f -l -a -g -s. + * all the options without '-', convert 'flags' to '-f -l -a -g -s'. */ static char * explode(const char *flags) { - size_t len; - char *nf, *st; - const char *f; + size_t len; + char *nf, *st; + const char *f; - if (flags == NULL) - return NULL; + if (flags == NULL) + return NULL; - for (f = flags; *f; f++) - if (!isalpha((unsigned char)*f)) - break; + for (f = flags; *f != '\0'; f++) + if (!ch_isalpha(*f)) + break; - if (*f) - return bmake_strdup(flags); + if (*f != '\0') + return bmake_strdup(flags); - len = strlen(flags); - st = nf = bmake_malloc(len * 3 + 1); - while (*flags) { - *nf++ = '-'; - *nf++ = *flags++; - *nf++ = ' '; - } - *nf = '\0'; - return st; + len = strlen(flags); + st = nf = bmake_malloc(len * 3 + 1); + while (*flags != '\0') { + *nf++ = '-'; + *nf++ = *flags++; + *nf++ = ' '; + } + *nf = '\0'; + return st; } - + +/* + * usage -- + * exit with usage message + */ +MAKE_ATTR_DEAD static void +usage(void) +{ + size_t prognameLen = strcspn(progname, "["); + + (void)fprintf(stderr, +"usage: %.*s [-BeikNnqrSstWwX]\n" +" [-C directory] [-D variable] [-d flags] [-f makefile]\n" +" [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n" +" [-V variable] [-v variable] [variable=value] [target ...]\n", + (int)prognameLen, progname); + exit(2); +} + static void -parse_debug_options(const char *argvalue) +MainParseArgDebugFile(const char *arg) +{ + const char *mode; + size_t len; + char *fname; + + if (opts.debug_file != stdout && opts.debug_file != stderr) + fclose(opts.debug_file); + + if (*arg == '+') { + arg++; + mode = "a"; + } else + mode = "w"; + + if (strcmp(arg, "stdout") == 0) { + opts.debug_file = stdout; + return; + } + if (strcmp(arg, "stderr") == 0) { + opts.debug_file = stderr; + return; + } + + len = strlen(arg); + fname = bmake_malloc(len + 20); + memcpy(fname, arg, len + 1); + + /* Let the filename be modified by the pid */ + if (strcmp(fname + len - 3, ".%d") == 0) + snprintf(fname + len - 2, 20, "%d", getpid()); + + opts.debug_file = fopen(fname, mode); + if (opts.debug_file == NULL) { + fprintf(stderr, "Cannot open debug file %s\n", + fname); + usage(); + } + free(fname); +} + +static void +MainParseArgDebug(const char *argvalue) { const char *modules; - const char *mode; - char *fname; - int len; + DebugFlags debug = opts.debug; - for (modules = argvalue; *modules; ++modules) { + for (modules = argvalue; *modules != '\0'; modules++) { switch (*modules) { + case '0': /* undocumented, only intended for tests */ + debug = DEBUG_NONE; + break; case 'A': - debug = ~0; + debug = DEBUG_ALL; break; case 'a': debug |= DEBUG_ARCH; @@ -262,20 +273,24 @@ parse_debug_options(const char *argvalue) case 'g': if (modules[1] == '1') { debug |= DEBUG_GRAPH1; - ++modules; - } - else if (modules[1] == '2') { + modules++; + } else if (modules[1] == '2') { debug |= DEBUG_GRAPH2; - ++modules; - } - else if (modules[1] == '3') { + modules++; + } else if (modules[1] == '3') { debug |= DEBUG_GRAPH3; - ++modules; + modules++; } break; + case 'h': + debug |= DEBUG_HASH; + break; case 'j': debug |= DEBUG_JOB; break; + case 'L': + opts.strict = TRUE; + break; case 'l': debug |= DEBUG_LOUD; break; @@ -298,7 +313,7 @@ parse_debug_options(const char *argvalue) debug |= DEBUG_TARG; break; case 'V': - debugVflag = TRUE; + opts.debugVflag = TRUE; break; case 'v': debug |= DEBUG_VAR; @@ -307,34 +322,7 @@ parse_debug_options(const char *argvalue) debug |= DEBUG_SHELL; break; case 'F': - if (debug_file != stdout && debug_file != stderr) - fclose(debug_file); - if (*++modules == '+') { - modules++; - mode = "a"; - } else - mode = "w"; - if (strcmp(modules, "stdout") == 0) { - debug_file = stdout; - goto debug_setbuf; - } - if (strcmp(modules, "stderr") == 0) { - debug_file = stderr; - goto debug_setbuf; - } - len = strlen(modules); - fname = malloc(len + 20); - memcpy(fname, modules, len + 1); - /* Let the filename be modified by the pid */ - if (strcmp(fname + len - 3, ".%d") == 0) - snprintf(fname + len - 2, 20, "%d", getpid()); - debug_file = fopen(fname, mode); - if (!debug_file) { - fprintf(stderr, "Cannot open debug file %s\n", - fname); - usage(); - } - free(fname); + MainParseArgDebugFile(modules + 1); goto debug_setbuf; default: (void)fprintf(stderr, @@ -343,60 +331,281 @@ parse_debug_options(const char *argvalue) usage(); } } + debug_setbuf: + opts.debug = debug; + /* * Make the debug_file unbuffered, and make * stdout line buffered (unless debugfile == stdout). */ - setvbuf(debug_file, NULL, _IONBF, 0); - if (debug_file != stdout) { + setvbuf(opts.debug_file, NULL, _IONBF, 0); + if (opts.debug_file != stdout) { setvbuf(stdout, NULL, _IOLBF, 0); } } -/*- - * MainParseArgs -- - * Parse a given argument vector. Called from main() and from - * Main_ParseArgLine() when the .MAKEFLAGS target is used. +/* Is path relative, or does it contain any relative component "." or ".."? */ +static Boolean +IsRelativePath(const char *path) +{ + const char *cp; + + if (path[0] != '/') + return TRUE; + cp = path; + while ((cp = strstr(cp, "/.")) != NULL) { + cp += 2; + if (*cp == '.') + cp++; + if (cp[0] == '/' || cp[0] == '\0') + return TRUE; + } + return FALSE; +} + +static void +MainParseArgChdir(const char *argvalue) +{ + struct stat sa, sb; + + if (chdir(argvalue) == -1) { + (void)fprintf(stderr, "%s: chdir %s: %s\n", + progname, argvalue, strerror(errno)); + exit(2); /* Not 1 so -q can distinguish error */ + } + if (getcwd(curdir, MAXPATHLEN) == NULL) { + (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); + exit(2); + } + if (!IsRelativePath(argvalue) && + stat(argvalue, &sa) != -1 && + stat(curdir, &sb) != -1 && + sa.st_ino == sb.st_ino && + sa.st_dev == sb.st_dev) + strncpy(curdir, argvalue, MAXPATHLEN); + ignorePWD = TRUE; +} + +static void +MainParseArgJobsInternal(const char *argvalue) +{ + char end; + if (sscanf(argvalue, "%d,%d%c", &jp_0, &jp_1, &end) != 2) { + (void)fprintf(stderr, + "%s: internal error -- J option malformed (%s)\n", + progname, argvalue); + usage(); + } + if ((fcntl(jp_0, F_GETFD, 0) < 0) || + (fcntl(jp_1, F_GETFD, 0) < 0)) { +#if 0 + (void)fprintf(stderr, + "%s: ###### warning -- J descriptors were closed!\n", + progname); + exit(2); +#endif + jp_0 = -1; + jp_1 = -1; + opts.compatMake = TRUE; + } else { + Global_Append(MAKEFLAGS, "-J"); + Global_Append(MAKEFLAGS, argvalue); + } +} + +static void +MainParseArgJobs(const char *argvalue) +{ + char *p; + + forceJobs = TRUE; + opts.maxJobs = (int)strtol(argvalue, &p, 0); + if (*p != '\0' || opts.maxJobs < 1) { + (void)fprintf(stderr, + "%s: illegal argument to -j -- must be positive integer!\n", + progname); + exit(2); /* Not 1 so -q can distinguish error */ + } + Global_Append(MAKEFLAGS, "-j"); + Global_Append(MAKEFLAGS, argvalue); + Global_Set(".MAKE.JOBS", argvalue); + maxJobTokens = opts.maxJobs; +} + +static void +MainParseArgSysInc(const char *argvalue) +{ + /* look for magic parent directory search string */ + if (strncmp(".../", argvalue, 4) == 0) { + char *found_path = Dir_FindHereOrAbove(curdir, argvalue + 4); + if (found_path == NULL) + return; + (void)SearchPath_Add(sysIncPath, found_path); + free(found_path); + } else { + (void)SearchPath_Add(sysIncPath, argvalue); + } + Global_Append(MAKEFLAGS, "-m"); + Global_Append(MAKEFLAGS, argvalue); +} + +static Boolean +MainParseArg(char c, const char *argvalue) +{ + switch (c) { + case '\0': + break; + case 'B': + opts.compatMake = TRUE; + Global_Append(MAKEFLAGS, "-B"); + Global_Set(MAKE_MODE, "compat"); + break; + case 'C': + MainParseArgChdir(argvalue); + break; + case 'D': + if (argvalue[0] == '\0') return FALSE; + Global_SetExpand(argvalue, "1"); + Global_Append(MAKEFLAGS, "-D"); + Global_Append(MAKEFLAGS, argvalue); + break; + case 'I': + Parse_AddIncludeDir(argvalue); + Global_Append(MAKEFLAGS, "-I"); + Global_Append(MAKEFLAGS, argvalue); + break; + case 'J': + MainParseArgJobsInternal(argvalue); + break; + case 'N': + opts.noExecute = TRUE; + opts.noRecursiveExecute = TRUE; + Global_Append(MAKEFLAGS, "-N"); + break; + case 'S': + opts.keepgoing = FALSE; + Global_Append(MAKEFLAGS, "-S"); + break; + case 'T': + tracefile = bmake_strdup(argvalue); + Global_Append(MAKEFLAGS, "-T"); + Global_Append(MAKEFLAGS, argvalue); + break; + case 'V': + case 'v': + opts.printVars = c == 'v' ? PVM_EXPANDED : PVM_UNEXPANDED; + Lst_Append(&opts.variables, bmake_strdup(argvalue)); + /* XXX: Why always -V? */ + Global_Append(MAKEFLAGS, "-V"); + Global_Append(MAKEFLAGS, argvalue); + break; + case 'W': + opts.parseWarnFatal = TRUE; + /* XXX: why no Var_Append? */ + break; + case 'X': + opts.varNoExportEnv = TRUE; + Global_Append(MAKEFLAGS, "-X"); + break; + case 'd': + /* If '-d-opts' don't pass to children */ + if (argvalue[0] == '-') + argvalue++; + else { + Global_Append(MAKEFLAGS, "-d"); + Global_Append(MAKEFLAGS, argvalue); + } + MainParseArgDebug(argvalue); + break; + case 'e': + opts.checkEnvFirst = TRUE; + Global_Append(MAKEFLAGS, "-e"); + break; + case 'f': + Lst_Append(&opts.makefiles, bmake_strdup(argvalue)); + break; + case 'i': + opts.ignoreErrors = TRUE; + Global_Append(MAKEFLAGS, "-i"); + break; + case 'j': + MainParseArgJobs(argvalue); + break; + case 'k': + opts.keepgoing = TRUE; + Global_Append(MAKEFLAGS, "-k"); + break; + case 'm': + MainParseArgSysInc(argvalue); + /* XXX: why no Var_Append? */ + break; + case 'n': + opts.noExecute = TRUE; + Global_Append(MAKEFLAGS, "-n"); + break; + case 'q': + opts.queryFlag = TRUE; + /* Kind of nonsensical, wot? */ + Global_Append(MAKEFLAGS, "-q"); + break; + case 'r': + opts.noBuiltins = TRUE; + Global_Append(MAKEFLAGS, "-r"); + break; + case 's': + opts.beSilent = TRUE; + Global_Append(MAKEFLAGS, "-s"); + break; + case 't': + opts.touchFlag = TRUE; + Global_Append(MAKEFLAGS, "-t"); + break; + case 'w': + opts.enterFlag = TRUE; + Global_Append(MAKEFLAGS, "-w"); + break; + default: + case '?': + usage(); + } + return TRUE; +} + +/* + * Parse the given arguments. Called from main() and from + * Main_ParseArgLine() when the .MAKEFLAGS target is used. * - * XXX: Deal with command line overriding .MAKEFLAGS in makefile + * The arguments must be treated as read-only and will be freed after the + * call. * - * Results: - * None - * - * Side Effects: - * Various global and local flags will be set depending on the flags - * given + * XXX: Deal with command line overriding .MAKEFLAGS in makefile */ static void MainParseArgs(int argc, char **argv) { - char *p; - int c = '?'; + char c; int arginc; char *argvalue; - const char *getopt_def; char *optscan; Boolean inOption, dashDash = FALSE; - char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */ -#define OPTFLAGS "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstw" + const char *optspecs = "BC:D:I:J:NST:V:WXd:ef:ij:km:nqrstv:w"; /* Can't actually use getopt(3) because rescanning is not portable */ - getopt_def = OPTFLAGS; -rearg: +rearg: inOption = FALSE; optscan = NULL; - while(argc > 1) { - char *getopt_spec; - if(!inOption) + while (argc > 1) { + const char *optspec; + if (!inOption) optscan = argv[1]; c = *optscan++; arginc = 0; - if(inOption) { - if(c == '\0') { - ++argv; - --argc; + if (inOption) { + if (c == '\0') { + argv++; + argc--; inOption = FALSE; continue; } @@ -407,219 +616,54 @@ rearg: c = *optscan++; } /* '-' found at some earlier point */ - getopt_spec = strchr(getopt_def, c); - if(c != '\0' && getopt_spec != NULL && getopt_spec[1] == ':') { + optspec = strchr(optspecs, c); + if (c != '\0' && optspec != NULL && optspec[1] == ':') { /* - found, and should have an arg */ inOption = FALSE; arginc = 1; argvalue = optscan; - if(*argvalue == '\0') { + if (*argvalue == '\0') { if (argc < 3) goto noarg; argvalue = argv[2]; arginc = 2; } } else { - argvalue = NULL; + argvalue = NULL; } - switch(c) { + switch (c) { case '\0': arginc = 1; inOption = FALSE; break; - case 'B': - compatMake = TRUE; - Var_Append(MAKEFLAGS, "-B", VAR_GLOBAL); - Var_Set(MAKE_MODE, "compat", VAR_GLOBAL, 0); - break; - case 'C': - if (chdir(argvalue) == -1) { - (void)fprintf(stderr, - "%s: chdir %s: %s\n", - progname, argvalue, - strerror(errno)); - exit(1); - } - if (getcwd(curdir, MAXPATHLEN) == NULL) { - (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); - exit(2); - } - ignorePWD = TRUE; - break; - case 'D': - if (argvalue == NULL || argvalue[0] == 0) goto noarg; - Var_Set(argvalue, "1", VAR_GLOBAL, 0); - Var_Append(MAKEFLAGS, "-D", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - break; - case 'I': - if (argvalue == NULL) goto noarg; - Parse_AddIncludeDir(argvalue); - Var_Append(MAKEFLAGS, "-I", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - break; - case 'J': - if (argvalue == NULL) goto noarg; - if (sscanf(argvalue, "%d,%d", &jp_0, &jp_1) != 2) { - (void)fprintf(stderr, - "%s: internal error -- J option malformed (%s)\n", - progname, argvalue); - usage(); - } - if ((fcntl(jp_0, F_GETFD, 0) < 0) || - (fcntl(jp_1, F_GETFD, 0) < 0)) { -#if 0 - (void)fprintf(stderr, - "%s: ###### warning -- J descriptors were closed!\n", - progname); - exit(2); -#endif - jp_0 = -1; - jp_1 = -1; - compatMake = TRUE; - } else { - Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - jobServer = TRUE; - } - break; - case 'N': - noExecute = TRUE; - noRecursiveExecute = TRUE; - Var_Append(MAKEFLAGS, "-N", VAR_GLOBAL); - break; - case 'S': - keepgoing = FALSE; - Var_Append(MAKEFLAGS, "-S", VAR_GLOBAL); - break; - case 'T': - if (argvalue == NULL) goto noarg; - tracefile = bmake_strdup(argvalue); - Var_Append(MAKEFLAGS, "-T", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - break; - case 'V': - if (argvalue == NULL) goto noarg; - printVars = TRUE; - (void)Lst_AtEnd(variables, argvalue); - Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - break; - case 'W': - parseWarnFatal = TRUE; - break; - case 'X': - varNoExportEnv = TRUE; - Var_Append(MAKEFLAGS, "-X", VAR_GLOBAL); - break; - case 'd': - if (argvalue == NULL) goto noarg; - /* If '-d-opts' don't pass to children */ - if (argvalue[0] == '-') - argvalue++; - else { - Var_Append(MAKEFLAGS, "-d", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - } - parse_debug_options(argvalue); - break; - case 'e': - checkEnvFirst = TRUE; - Var_Append(MAKEFLAGS, "-e", VAR_GLOBAL); - break; - case 'f': - if (argvalue == NULL) goto noarg; - (void)Lst_AtEnd(makefiles, argvalue); - break; - case 'i': - ignoreErrors = TRUE; - Var_Append(MAKEFLAGS, "-i", VAR_GLOBAL); - break; - case 'j': - if (argvalue == NULL) goto noarg; - forceJobs = TRUE; - maxJobs = strtol(argvalue, &p, 0); - if (*p != '\0' || maxJobs < 1) { - (void)fprintf(stderr, "%s: illegal argument to -j -- must be positive integer!\n", - progname); - exit(1); - } - Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - Var_Set(".MAKE.JOBS", argvalue, VAR_GLOBAL, 0); - maxJobTokens = maxJobs; - break; - case 'k': - keepgoing = TRUE; - Var_Append(MAKEFLAGS, "-k", VAR_GLOBAL); - break; - case 'm': - if (argvalue == NULL) goto noarg; - /* look for magic parent directory search string */ - if (strncmp(".../", argvalue, 4) == 0) { - if (!Dir_FindHereOrAbove(curdir, argvalue+4, - found_path, sizeof(found_path))) - break; /* nothing doing */ - (void)Dir_AddDir(sysIncPath, found_path); - } else { - (void)Dir_AddDir(sysIncPath, argvalue); - } - Var_Append(MAKEFLAGS, "-m", VAR_GLOBAL); - Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL); - break; - case 'n': - noExecute = TRUE; - Var_Append(MAKEFLAGS, "-n", VAR_GLOBAL); - break; - case 'q': - queryFlag = TRUE; - /* Kind of nonsensical, wot? */ - Var_Append(MAKEFLAGS, "-q", VAR_GLOBAL); - break; - case 'r': - noBuiltins = TRUE; - Var_Append(MAKEFLAGS, "-r", VAR_GLOBAL); - break; - case 's': - beSilent = TRUE; - Var_Append(MAKEFLAGS, "-s", VAR_GLOBAL); - break; - case 't': - touchFlag = TRUE; - Var_Append(MAKEFLAGS, "-t", VAR_GLOBAL); - break; - case 'w': - enterFlag = TRUE; - Var_Append(MAKEFLAGS, "-w", VAR_GLOBAL); - break; case '-': dashDash = TRUE; break; default: - case '?': - usage(); + if (!MainParseArg(c, argvalue)) + goto noarg; } argv += arginc; argc -= arginc; } - oldVars = TRUE; - /* * See if the rest of the arguments are variable assignments and * perform them if so. Else take them to be targets and stuff them * on the end of the "create" list. */ - for (; argc > 1; ++argv, --argc) - if (Parse_IsVar(argv[1])) { - Parse_DoVar(argv[1], VAR_CMD); + for (; argc > 1; argv++, argc--) { + VarAssign var; + if (Parse_IsVar(argv[1], &var)) { + Parse_DoVar(&var, SCOPE_CMDLINE); } else { - if (!*argv[1]) + if (argv[1][0] == '\0') Punt("illegal (null) argument."); - if (*argv[1] == '-' && !dashDash) + if (argv[1][0] == '-' && !dashDash) goto rearg; - (void)Lst_AtEnd(create, bmake_strdup(argv[1])); + Lst_Append(&opts.create, bmake_strdup(argv[1])); } + } return; noarg: @@ -628,126 +672,128 @@ noarg: usage(); } -/*- - * Main_ParseArgLine -- - * Used by the parse module when a .MFLAGS or .MAKEFLAGS target - * is encountered and by main() when reading the .MAKEFLAGS envariable. - * Takes a line of arguments and breaks it into its - * component words and passes those words and the number of them to the - * MainParseArgs function. - * The line should have all its leading whitespace removed. +/* + * Break a line of arguments into words and parse them. * - * Input: - * line Line to fracture - * - * Results: - * None - * - * Side Effects: - * Only those that come from the various arguments. + * Used when a .MFLAGS or .MAKEFLAGS target is encountered during parsing and + * by main() when reading the MAKEFLAGS environment variable. */ void Main_ParseArgLine(const char *line) { - char **argv; /* Manufactured argument vector */ - int argc; /* Number of arguments in argv */ - char *args; /* Space used by the args */ - char *buf, *p1; - char *argv0 = Var_Value(".MAKE", VAR_GLOBAL, &p1); - size_t len; + Words words; + char *buf; if (line == NULL) return; - for (; *line == ' '; ++line) + /* XXX: don't use line as an iterator variable */ + for (; *line == ' '; line++) continue; - if (!*line) + if (line[0] == '\0') return; - buf = bmake_malloc(len = strlen(line) + strlen(argv0) + 2); - (void)snprintf(buf, len, "%s %s", argv0, line); - if (p1) - free(p1); + { + FStr argv0 = Var_Value(SCOPE_GLOBAL, ".MAKE"); + buf = str_concat3(argv0.str, " ", line); + FStr_Done(&argv0); + } - argv = brk_string(buf, &argc, TRUE, &args); - if (argv == NULL) { + words = Str_Words(buf, TRUE); + if (words.words == NULL) { Error("Unterminated quoted string [%s]", buf); free(buf); return; } free(buf); - MainParseArgs(argc, argv); + MainParseArgs((int)words.len, words.words); - free(args); - free(argv); + Words_Free(words); } Boolean -Main_SetObjdir(const char *path) +Main_SetObjdir(Boolean writable, const char *fmt, ...) { struct stat sb; - char *p = NULL; + char *path; char buf[MAXPATHLEN + 1]; + char buf2[MAXPATHLEN + 1]; Boolean rc = FALSE; + va_list ap; - /* expand variable substitutions */ - if (strchr(path, '$') != 0) { - snprintf(buf, MAXPATHLEN, "%s", path); - path = p = Var_Subst(NULL, buf, VAR_GLOBAL, 0); - } + va_start(ap, fmt); + vsnprintf(path = buf, MAXPATHLEN, fmt, ap); + va_end(ap); if (path[0] != '/') { - snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path); - path = buf; + snprintf(buf2, MAXPATHLEN, "%s/%s", curdir, path); + path = buf2; } /* look for the directory and try to chdir there */ if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { - if (chdir(path)) { - (void)fprintf(stderr, "make warning: %s: %s.\n", - path, strerror(errno)); + if ((writable && access(path, W_OK) != 0) || + (chdir(path) != 0)) { + (void)fprintf(stderr, "%s warning: %s: %s.\n", + progname, path, strerror(errno)); } else { - strncpy(objdir, path, MAXPATHLEN); - Var_Set(".OBJDIR", objdir, VAR_GLOBAL, 0); + snprintf(objdir, sizeof objdir, "%s", path); + Global_Set(".OBJDIR", objdir); setenv("PWD", objdir, 1); Dir_InitDot(); + purge_relative_cached_realpaths(); rc = TRUE; - if (enterFlag && strcmp(objdir, curdir) != 0) + if (opts.enterFlag && strcmp(objdir, curdir) != 0) enterFlagObj = TRUE; } } - if (p) - free(p); return rc; } -/*- - * ReadAllMakefiles -- - * wrapper around ReadMakefile() to read all. - * - * Results: - * TRUE if ok, FALSE on error - */ -static int -ReadAllMakefiles(const void *p, const void *q) +static Boolean +SetVarObjdir(Boolean writable, const char *var, const char *suffix) { - return (ReadMakefile(p, q) == 0); + FStr path = Var_Value(SCOPE_CMDLINE, var); + FStr xpath; + + if (path.str == NULL || path.str[0] == '\0') { + FStr_Done(&path); + return FALSE; + } + + /* expand variable substitutions */ + xpath = FStr_InitRefer(path.str); + if (strchr(path.str, '$') != 0) { + char *expanded; + (void)Var_Subst(path.str, SCOPE_GLOBAL, VARE_WANTRES, &expanded); + /* TODO: handle errors */ + xpath = FStr_InitOwn(expanded); + } + + (void)Main_SetObjdir(writable, "%s%s", xpath.str, suffix); + + FStr_Done(&xpath); + FStr_Done(&path); + return TRUE; } +/* + * Splits str into words, adding them to the list. + * The string must be kept alive as long as the list. + */ int -str2Lst_Append(Lst lp, char *str, const char *sep) +str2Lst_Append(StringList *lp, char *str) { - char *cp; - int n; + char *cp; + int n; - if (!sep) - sep = " \t"; + const char *sep = " \t"; - for (n = 0, cp = strtok(str, sep); cp; cp = strtok(NULL, sep)) { - (void)Lst_AtEnd(lp, cp); - n++; - } - return (n); + for (n = 0, cp = strtok(str, sep); cp != NULL; cp = strtok(NULL, sep)) { + Lst_Append(lp, cp); + n++; + } + return n; } #ifdef SIGINFO @@ -758,110 +804,565 @@ siginfo(int signo MAKE_ATTR_UNUSED) char dir[MAXPATHLEN]; char str[2 * MAXPATHLEN]; int len; - if (getcwd(dir, sizeof(dir)) == NULL) + if (getcwd(dir, sizeof dir) == NULL) return; - len = snprintf(str, sizeof(str), "%s: Working in: %s\n", progname, dir); + len = snprintf(str, sizeof str, "%s: Working in: %s\n", progname, dir); if (len > 0) (void)write(STDERR_FILENO, str, (size_t)len); } #endif -/* - * Allow makefiles some control over the mode we run in. - */ -void -MakeMode(const char *mode) +/* Allow makefiles some control over the mode we run in. */ +static void +MakeMode(void) { - char *mp = NULL; + char *mode; - if (!mode) - mode = mp = Var_Subst(NULL, "${" MAKE_MODE ":tl}", VAR_GLOBAL, 0); + (void)Var_Subst("${" MAKE_MODE ":tl}", SCOPE_GLOBAL, VARE_WANTRES, &mode); + /* TODO: handle errors */ - if (mode && *mode) { - if (strstr(mode, "compat")) { - compatMake = TRUE; - forceJobs = FALSE; - } + if (mode[0] != '\0') { + if (strstr(mode, "compat") != NULL) { + opts.compatMake = TRUE; + forceJobs = FALSE; + } #if USE_META - if (strstr(mode, "meta")) - meta_mode_init(mode); + if (strstr(mode, "meta") != NULL) + meta_mode_init(mode); #endif - } - if (mp) - free(mp); + } + + free(mode); } -/*- - * main -- - * The main function, for obvious reasons. Initializes variables - * and a few modules, then parses the arguments give it in the - * environment and on the command line. Reads the system makefile - * followed by either Makefile, makefile or the file given by the - * -f argument. Sets the .MAKEFLAGS PMake variable based on all the - * flags it has received by then uses either the Make or the Compat - * module to create the initial list of targets. - * - * Results: - * If -q was given, exits -1 if anything was out-of-date. Else it exits - * 0. - * - * Side Effects: - * The program exits when done. Targets are created. etc. etc. etc. - */ -int -main(int argc, char **argv) +static void +PrintVar(const char *varname, Boolean expandVars) +{ + if (strchr(varname, '$') != NULL) { + char *evalue; + (void)Var_Subst(varname, SCOPE_GLOBAL, VARE_WANTRES, &evalue); + /* TODO: handle errors */ + printf("%s\n", evalue); + bmake_free(evalue); + + } else if (expandVars) { + char *expr = str_concat3("${", varname, "}"); + char *evalue; + (void)Var_Subst(expr, SCOPE_GLOBAL, VARE_WANTRES, &evalue); + /* TODO: handle errors */ + free(expr); + printf("%s\n", evalue); + bmake_free(evalue); + + } else { + FStr value = Var_Value(SCOPE_GLOBAL, varname); + printf("%s\n", value.str != NULL ? value.str : ""); + FStr_Done(&value); + } +} + +/* + * Return a Boolean based on a variable. + * + * If the knob is not set, return the fallback. + * If set, anything that looks or smells like "No", "False", "Off", "0", etc. + * is FALSE, otherwise TRUE. + */ +static Boolean +GetBooleanVar(const char *varname, Boolean fallback) +{ + char *expr = str_concat3("${", varname, ":U}"); + char *value; + Boolean res; + + (void)Var_Subst(expr, SCOPE_GLOBAL, VARE_WANTRES, &value); + /* TODO: handle errors */ + res = ParseBoolean(value, fallback); + free(value); + free(expr); + return res; +} + +static void +doPrintVars(void) +{ + StringListNode *ln; + Boolean expandVars; + + if (opts.printVars == PVM_EXPANDED) + expandVars = TRUE; + else if (opts.debugVflag) + expandVars = FALSE; + else + expandVars = GetBooleanVar(".MAKE.EXPAND_VARIABLES", FALSE); + + for (ln = opts.variables.first; ln != NULL; ln = ln->next) { + const char *varname = ln->datum; + PrintVar(varname, expandVars); + } +} + +static Boolean +runTargets(void) +{ + GNodeList targs = LST_INIT; /* target nodes to create */ + Boolean outOfDate; /* FALSE if all targets up to date */ + + /* + * Have now read the entire graph and need to make a list of + * targets to create. If none was given on the command line, + * we consult the parsing module to find the main target(s) + * to create. + */ + if (Lst_IsEmpty(&opts.create)) + Parse_MainName(&targs); + else + Targ_FindList(&targs, &opts.create); + + if (!opts.compatMake) { + /* + * Initialize job module before traversing the graph + * now that any .BEGIN and .END targets have been read. + * This is done only if the -q flag wasn't given + * (to prevent the .BEGIN from being executed should + * it exist). + */ + if (!opts.queryFlag) { + Job_Init(); + jobsRunning = TRUE; + } + + /* Traverse the graph, checking on all the targets */ + outOfDate = Make_Run(&targs); + } else { + /* + * Compat_Init will take care of creating all the + * targets as well as initializing the module. + */ + Compat_Run(&targs); + outOfDate = FALSE; + } + Lst_Done(&targs); /* Don't free the targets themselves. */ + return outOfDate; +} + +/* + * Set up the .TARGETS variable to contain the list of targets to be + * created. If none specified, make the variable empty -- the parser + * will fill the thing in with the default or .MAIN target. + */ +static void +InitVarTargets(void) +{ + StringListNode *ln; + + if (Lst_IsEmpty(&opts.create)) { + Global_Set(".TARGETS", ""); + return; + } + + for (ln = opts.create.first; ln != NULL; ln = ln->next) { + const char *name = ln->datum; + Global_Append(".TARGETS", name); + } +} + +static void +InitRandom(void) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + srandom((unsigned int)(tv.tv_sec + tv.tv_usec)); +} + +static const char * +InitVarMachine(const struct utsname *utsname MAKE_ATTR_UNUSED) +{ + const char *machine = getenv("MACHINE"); + if (machine != NULL) + return machine; + +#if defined(MAKE_NATIVE) + return utsname->machine; +#elif defined(MAKE_MACHINE) + return MAKE_MACHINE; +#else + return "unknown"; +#endif +} + +static const char * +InitVarMachineArch(void) +{ + const char *env = getenv("MACHINE_ARCH"); + if (env != NULL) + return env; + +#ifdef MAKE_NATIVE + { + struct utsname utsname; + static char machine_arch_buf[sizeof utsname.machine]; + const int mib[2] = { CTL_HW, HW_MACHINE_ARCH }; + size_t len = sizeof machine_arch_buf; + + if (sysctl(mib, (unsigned int)__arraycount(mib), + machine_arch_buf, &len, NULL, 0) < 0) { + (void)fprintf(stderr, "%s: sysctl failed (%s).\n", + progname, strerror(errno)); + exit(2); + } + + return machine_arch_buf; + } +#elif defined(MACHINE_ARCH) + return MACHINE_ARCH; +#elif defined(MAKE_MACHINE_ARCH) + return MAKE_MACHINE_ARCH; +#else + return "unknown"; +#endif +} + +#ifndef NO_PWD_OVERRIDE +/* + * All this code is so that we know where we are when we start up + * on a different machine with pmake. + * + * XXX: Make no longer has "local" and "remote" mode. Is this code still + * necessary? + * + * Overriding getcwd() with $PWD totally breaks MAKEOBJDIRPREFIX + * since the value of curdir can vary depending on how we got + * here. Ie sitting at a shell prompt (shell that provides $PWD) + * or via subdir.mk in which case its likely a shell which does + * not provide it. + * + * So, to stop it breaking this case only, we ignore PWD if + * MAKEOBJDIRPREFIX is set or MAKEOBJDIR contains a variable expression. + */ +static void +HandlePWD(const struct stat *curdir_st) +{ + char *pwd; + FStr prefix, makeobjdir; + struct stat pwd_st; + + if (ignorePWD || (pwd = getenv("PWD")) == NULL) + return; + + prefix = Var_Value(SCOPE_CMDLINE, "MAKEOBJDIRPREFIX"); + if (prefix.str != NULL) { + FStr_Done(&prefix); + return; + } + + makeobjdir = Var_Value(SCOPE_CMDLINE, "MAKEOBJDIR"); + if (makeobjdir.str != NULL && strchr(makeobjdir.str, '$') != NULL) + goto ignore_pwd; + + if (stat(pwd, &pwd_st) == 0 && + curdir_st->st_ino == pwd_st.st_ino && + curdir_st->st_dev == pwd_st.st_dev) + (void)strncpy(curdir, pwd, MAXPATHLEN); + +ignore_pwd: + FStr_Done(&makeobjdir); +} +#endif + +/* + * Find the .OBJDIR. If MAKEOBJDIRPREFIX, or failing that, + * MAKEOBJDIR is set in the environment, try only that value + * and fall back to .CURDIR if it does not exist. + * + * Otherwise, try _PATH_OBJDIR.MACHINE-MACHINE_ARCH, _PATH_OBJDIR.MACHINE, + * and * finally _PATH_OBJDIRPREFIX`pwd`, in that order. If none + * of these paths exist, just use .CURDIR. + */ +static void +InitObjdir(const char *machine, const char *machine_arch) +{ + Boolean writable; + + Dir_InitCur(curdir); + writable = GetBooleanVar("MAKE_OBJDIR_CHECK_WRITABLE", TRUE); + (void)Main_SetObjdir(FALSE, "%s", curdir); + + if (!SetVarObjdir(writable, "MAKEOBJDIRPREFIX", curdir) && + !SetVarObjdir(writable, "MAKEOBJDIR", "") && + !Main_SetObjdir(writable, "%s.%s-%s", _PATH_OBJDIR, machine, machine_arch) && + !Main_SetObjdir(writable, "%s.%s", _PATH_OBJDIR, machine) && + !Main_SetObjdir(writable, "%s", _PATH_OBJDIR)) + (void)Main_SetObjdir(writable, "%s%s", _PATH_OBJDIRPREFIX, curdir); +} + +/* get rid of resource limit on file descriptors */ +static void +UnlimitFiles(void) +{ +#if defined(MAKE_NATIVE) || (defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)) + struct rlimit rl; + if (getrlimit(RLIMIT_NOFILE, &rl) != -1 && + rl.rlim_cur != rl.rlim_max) { + rl.rlim_cur = rl.rlim_max; + (void)setrlimit(RLIMIT_NOFILE, &rl); + } +#endif +} + +static void +CmdOpts_Init(void) +{ + opts.compatMake = FALSE; + opts.debug = DEBUG_NONE; + /* opts.debug_file has already been initialized earlier */ + opts.strict = FALSE; + opts.debugVflag = FALSE; + opts.checkEnvFirst = FALSE; + Lst_Init(&opts.makefiles); + opts.ignoreErrors = FALSE; /* Pay attention to non-zero returns */ + opts.maxJobs = 1; + opts.keepgoing = FALSE; /* Stop on error */ + opts.noRecursiveExecute = FALSE; /* Execute all .MAKE targets */ + opts.noExecute = FALSE; /* Execute all commands */ + opts.queryFlag = FALSE; + opts.noBuiltins = FALSE; /* Read the built-in rules */ + opts.beSilent = FALSE; /* Print commands as executed */ + opts.touchFlag = FALSE; + opts.printVars = PVM_NONE; + Lst_Init(&opts.variables); + opts.parseWarnFatal = FALSE; + opts.enterFlag = FALSE; + opts.varNoExportEnv = FALSE; + Lst_Init(&opts.create); +} + +/* + * Initialize MAKE and .MAKE to the path of the executable, so that it can be + * found by execvp(3) and the shells, even after a chdir. + * + * If it's a relative path and contains a '/', resolve it to an absolute path. + * Otherwise keep it as is, assuming it will be found in the PATH. + */ +static void +InitVarMake(const char *argv0) +{ + const char *make = argv0; + + if (argv0[0] != '/' && strchr(argv0, '/') != NULL) { + char pathbuf[MAXPATHLEN]; + const char *abspath = cached_realpath(argv0, pathbuf); + struct stat st; + if (abspath != NULL && abspath[0] == '/' && + stat(make, &st) == 0) + make = abspath; + } + + Global_Set("MAKE", make); + Global_Set(".MAKE", make); +} + +/* + * Add the directories from the colon-separated syspath to defSysIncPath. + * After returning, the contents of syspath is unspecified. + */ +static void +InitDefSysIncPath(char *syspath) { - Lst targs; /* target nodes to create -- passed to Make_Init */ - Boolean outOfDate = FALSE; /* FALSE if all targets up to date */ - struct stat sb, sa; - char *p1, *path; - char mdpath[MAXPATHLEN]; - const char *machine = getenv("MACHINE"); - const char *machine_arch = getenv("MACHINE_ARCH"); - char *syspath = getenv("MAKESYSPATH"); - Lst sysMkPath; /* Path of sys.mk */ - char *cp = NULL, *start; - /* avoid faults on read-only strings */ static char defsyspath[] = _PATH_DEFSYSPATH; - char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */ - struct timeval rightnow; /* to initialize random seed */ + char *start, *cp; + + /* + * If no user-supplied system path was given (through the -m option) + * add the directories from the DEFSYSPATH (more than one may be given + * as dir1:...:dirn) to the system include path. + */ + if (syspath == NULL || syspath[0] == '\0') + syspath = defsyspath; + else + syspath = bmake_strdup(syspath); + + for (start = syspath; *start != '\0'; start = cp) { + for (cp = start; *cp != '\0' && *cp != ':'; cp++) + continue; + if (*cp == ':') + *cp++ = '\0'; + + /* look for magic parent directory search string */ + if (strncmp(start, ".../", 4) == 0) { + char *dir = Dir_FindHereOrAbove(curdir, start + 4); + if (dir != NULL) { + (void)SearchPath_Add(defSysIncPath, dir); + free(dir); + } + } else { + (void)SearchPath_Add(defSysIncPath, start); + } + } + + if (syspath != defsyspath) + free(syspath); +} + +static void +ReadBuiltinRules(void) +{ + StringListNode *ln; + StringList sysMkFiles = LST_INIT; + + SearchPath_Expand( + Lst_IsEmpty(&sysIncPath->dirs) ? defSysIncPath : sysIncPath, + _PATH_DEFSYSMK, + &sysMkFiles); + if (Lst_IsEmpty(&sysMkFiles)) + Fatal("%s: no system rules (%s).", progname, _PATH_DEFSYSMK); + + for (ln = sysMkFiles.first; ln != NULL; ln = ln->next) + if (ReadMakefile(ln->datum) == 0) + break; + + if (ln == NULL) + Fatal("%s: cannot open %s.", + progname, (const char *)sysMkFiles.first->datum); + + /* Free the list nodes but not the actual filenames since these may + * still be used in GNodes. */ + Lst_Done(&sysMkFiles); +} + +static void +InitMaxJobs(void) +{ + char *value; + int n; + + if (forceJobs || opts.compatMake || + !Var_Exists(SCOPE_GLOBAL, ".MAKE.JOBS")) + return; + + (void)Var_Subst("${.MAKE.JOBS}", SCOPE_GLOBAL, VARE_WANTRES, &value); + /* TODO: handle errors */ + n = (int)strtol(value, NULL, 0); + if (n < 1) { + (void)fprintf(stderr, + "%s: illegal value for .MAKE.JOBS " + "-- must be positive integer!\n", + progname); + exit(2); /* Not 1 so -q can distinguish error */ + } + + if (n != opts.maxJobs) { + Global_Append(MAKEFLAGS, "-j"); + Global_Append(MAKEFLAGS, value); + } + + opts.maxJobs = n; + maxJobTokens = opts.maxJobs; + forceJobs = TRUE; + free(value); +} + +/* + * For compatibility, look at the directories in the VPATH variable + * and add them to the search path, if the variable is defined. The + * variable's value is in the same format as the PATH environment + * variable, i.e. ::... + */ +static void +InitVpath(void) +{ + char *vpath, savec, *path; + if (!Var_Exists(SCOPE_CMDLINE, "VPATH")) + return; + + (void)Var_Subst("${VPATH}", SCOPE_CMDLINE, VARE_WANTRES, &vpath); + /* TODO: handle errors */ + path = vpath; + do { + char *cp; + /* skip to end of directory */ + for (cp = path; *cp != ':' && *cp != '\0'; cp++) + continue; + /* Save terminator character so know when to stop */ + savec = *cp; + *cp = '\0'; + /* Add directory to search path */ + (void)SearchPath_Add(&dirSearchPath, path); + *cp = savec; + path = cp + 1; + } while (savec == ':'); + free(vpath); +} + +static void +ReadAllMakefiles(StringList *makefiles) +{ + StringListNode *ln; + + for (ln = makefiles->first; ln != NULL; ln = ln->next) { + const char *fname = ln->datum; + if (ReadMakefile(fname) != 0) + Fatal("%s: cannot open %s.", progname, fname); + } +} + +static void +ReadFirstDefaultMakefile(void) +{ + StringListNode *ln; + char *prefs; + + (void)Var_Subst("${" MAKE_MAKEFILE_PREFERENCE "}", + SCOPE_CMDLINE, VARE_WANTRES, &prefs); + /* TODO: handle errors */ + + /* XXX: This should use a local list instead of opts.makefiles + * since these makefiles do not come from the command line. They + * also have different semantics in that only the first file that + * is found is processed. See ReadAllMakefiles. */ + (void)str2Lst_Append(&opts.makefiles, prefs); + + for (ln = opts.makefiles.first; ln != NULL; ln = ln->next) + if (ReadMakefile(ln->datum) == 0) + break; + + free(prefs); +} + +/* + * Initialize variables such as MAKE, MACHINE, .MAKEFLAGS. + * Initialize a few modules. + * Parse the arguments from MAKEFLAGS and the command line. + */ +static void +main_Init(int argc, char **argv) +{ + struct stat sa; + const char *machine; + const char *machine_arch; + char *syspath = getenv("MAKESYSPATH"); struct utsname utsname; /* default to writing debug to stderr */ - debug_file = stderr; + opts.debug_file = stderr; + + HashTable_Init(&cached_realpaths); #ifdef SIGINFO (void)bmake_signal(SIGINFO, siginfo); #endif - /* - * Set the seed to produce a different random sequence - * on each program execution. - */ - gettimeofday(&rightnow, NULL); - srandom(rightnow.tv_sec + rightnow.tv_usec); - - if ((progname = strrchr(argv[0], '/')) != NULL) - progname++; - else - progname = argv[0]; -#if defined(MAKE_NATIVE) || (defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)) - /* - * get rid of resource limit on file descriptors - */ - { - struct rlimit rl; - if (getrlimit(RLIMIT_NOFILE, &rl) != -1 && - rl.rlim_cur != rl.rlim_max) { - rl.rlim_cur = rl.rlim_max; - (void)setrlimit(RLIMIT_NOFILE, &rl); - } - } -#endif + + InitRandom(); + + progname = str_basename(argv[0]); + + UnlimitFiles(); if (uname(&utsname) == -1) { - (void)fprintf(stderr, "%s: uname failed (%s).\n", progname, - strerror(errno)); - exit(2); + (void)fprintf(stderr, "%s: uname failed (%s).\n", progname, + strerror(errno)); + exit(2); } /* @@ -872,89 +1373,38 @@ main(int argc, char **argv) * Note that both MACHINE and MACHINE_ARCH are decided at * run-time. */ - if (!machine) { -#ifdef MAKE_NATIVE - machine = utsname.machine; -#else -#ifdef MAKE_MACHINE - machine = MAKE_MACHINE; -#else - machine = "unknown"; -#endif -#endif - } + machine = InitVarMachine(&utsname); + machine_arch = InitVarMachineArch(); - if (!machine_arch) { -#if defined(MAKE_NATIVE) - static char machine_arch_buf[sizeof(utsname.machine)]; - const int mib[2] = { CTL_HW, HW_MACHINE_ARCH }; - size_t len = sizeof(machine_arch_buf); - - if (sysctl(mib, __arraycount(mib), machine_arch_buf, - &len, NULL, 0) < 0) { - (void)fprintf(stderr, "%s: sysctl failed (%s).\n", progname, - strerror(errno)); - exit(2); - } - - machine_arch = machine_arch_buf; -#else -#ifndef MACHINE_ARCH -#ifdef MAKE_MACHINE_ARCH - machine_arch = MAKE_MACHINE_ARCH; -#else - machine_arch = "unknown"; -#endif -#else - machine_arch = MACHINE_ARCH; -#endif -#endif - } - - myPid = getpid(); /* remember this for vFork() */ + myPid = getpid(); /* remember this for vFork() */ /* * Just in case MAKEOBJDIR wants us to do something tricky. */ - Var_Init(); /* Initialize the lists of variables for - * parsing arguments */ - Var_Set(".MAKE.OS", utsname.sysname, VAR_GLOBAL, 0); - Var_Set("MACHINE", machine, VAR_GLOBAL, 0); - Var_Set("MACHINE_ARCH", machine_arch, VAR_GLOBAL, 0); + Targ_Init(); + Var_Init(); + Global_Set(".MAKE.OS", utsname.sysname); + Global_Set("MACHINE", machine); + Global_Set("MACHINE_ARCH", machine_arch); #ifdef MAKE_VERSION - Var_Set("MAKE_VERSION", MAKE_VERSION, VAR_GLOBAL, 0); + Global_Set("MAKE_VERSION", MAKE_VERSION); #endif - Var_Set(".newline", "\n", VAR_GLOBAL, 0); /* handy for :@ loops */ + Global_Set(".newline", "\n"); /* handy for :@ loops */ /* * This is the traditional preference for makefiles. */ #ifndef MAKEFILE_PREFERENCE_LIST # define MAKEFILE_PREFERENCE_LIST "makefile Makefile" #endif - Var_Set(MAKEFILE_PREFERENCE, MAKEFILE_PREFERENCE_LIST, - VAR_GLOBAL, 0); - Var_Set(MAKE_DEPENDFILE, ".depend", VAR_GLOBAL, 0); + Global_Set(MAKE_MAKEFILE_PREFERENCE, MAKEFILE_PREFERENCE_LIST); + Global_Set(MAKE_DEPENDFILE, ".depend"); - create = Lst_Init(FALSE); - makefiles = Lst_Init(FALSE); - printVars = FALSE; - debugVflag = FALSE; - variables = Lst_Init(FALSE); - beSilent = FALSE; /* Print commands as executed */ - ignoreErrors = FALSE; /* Pay attention to non-zero returns */ - noExecute = FALSE; /* Execute all commands */ - noRecursiveExecute = FALSE; /* Execute all .MAKE targets */ - keepgoing = FALSE; /* Stop on error */ - allPrecious = FALSE; /* Remove targets when interrupted */ - queryFlag = FALSE; /* This is not just a check-run */ - noBuiltins = FALSE; /* Read the built-in rules */ - touchFlag = FALSE; /* Actually update targets */ - debug = 0; /* No debug verbosity, please. */ + CmdOpts_Init(); + allPrecious = FALSE; /* Remove targets when interrupted */ + deleteOnError = FALSE; /* Historical default behavior */ jobsRunning = FALSE; - maxJobs = DEFMAXLOCAL; /* Set default local max concurrency */ - maxJobTokens = maxJobs; - compatMake = FALSE; /* No compat mode */ + maxJobTokens = opts.maxJobs; ignorePWD = FALSE; /* @@ -970,65 +1420,54 @@ main(int argc, char **argv) * MFLAGS also gets initialized empty, for compatibility. */ Parse_Init(); - if (argv[0][0] == '/' || strchr(argv[0], '/') == NULL) { - /* - * Leave alone if it is an absolute path, or if it does - * not contain a '/' in which case we need to find it in - * the path, like execvp(3) and the shells do. - */ - p1 = argv[0]; - } else { - /* - * A relative path, canonicalize it. - */ - p1 = realpath(argv[0], mdpath); - if (!p1 || *p1 != '/' || stat(p1, &sb) < 0) { - p1 = argv[0]; /* realpath failed */ - } - } - Var_Set("MAKE", p1, VAR_GLOBAL, 0); - Var_Set(".MAKE", p1, VAR_GLOBAL, 0); - Var_Set(MAKEFLAGS, "", VAR_GLOBAL, 0); - Var_Set(MAKEOVERRIDES, "", VAR_GLOBAL, 0); - Var_Set("MFLAGS", "", VAR_GLOBAL, 0); - Var_Set(".ALLTARGETS", "", VAR_GLOBAL, 0); + InitVarMake(argv[0]); + Global_Set(MAKEFLAGS, ""); + Global_Set(MAKEOVERRIDES, ""); + Global_Set("MFLAGS", ""); + Global_Set(".ALLTARGETS", ""); /* some makefiles need to know this */ - Var_Set(MAKE_LEVEL ".ENV", MAKE_LEVEL_ENV, VAR_CMD, 0); + Var_Set(SCOPE_CMDLINE, MAKE_LEVEL ".ENV", MAKE_LEVEL_ENV); - /* - * Set some other useful macros - */ + /* Set some other useful variables. */ { - char tmp[64], *ep; + char tmp[64], *ep = getenv(MAKE_LEVEL_ENV); - makelevel = ((ep = getenv(MAKE_LEVEL_ENV)) && *ep) ? atoi(ep) : 0; - if (makelevel < 0) - makelevel = 0; - snprintf(tmp, sizeof(tmp), "%d", makelevel); - Var_Set(MAKE_LEVEL, tmp, VAR_GLOBAL, 0); - snprintf(tmp, sizeof(tmp), "%u", myPid); - Var_Set(".MAKE.PID", tmp, VAR_GLOBAL, 0); - snprintf(tmp, sizeof(tmp), "%u", getppid()); - Var_Set(".MAKE.PPID", tmp, VAR_GLOBAL, 0); + makelevel = ep != NULL && ep[0] != '\0' ? atoi(ep) : 0; + if (makelevel < 0) + makelevel = 0; + snprintf(tmp, sizeof tmp, "%d", makelevel); + Global_Set(MAKE_LEVEL, tmp); + snprintf(tmp, sizeof tmp, "%u", myPid); + Global_Set(".MAKE.PID", tmp); + snprintf(tmp, sizeof tmp, "%u", getppid()); + Global_Set(".MAKE.PPID", tmp); + snprintf(tmp, sizeof tmp, "%u", getuid()); + Global_Set(".MAKE.UID", tmp); + snprintf(tmp, sizeof tmp, "%u", getgid()); + Global_Set(".MAKE.GID", tmp); } if (makelevel > 0) { char pn[1024]; - snprintf(pn, sizeof(pn), "%s[%d]", progname, makelevel); + snprintf(pn, sizeof pn, "%s[%d]", progname, makelevel); progname = bmake_strdup(pn); } #ifdef USE_META meta_init(); #endif + Dir_Init(); + /* * First snag any flags out of the MAKE environment variable. * (Note this is *not* MAKEFLAGS since /bin/make uses that and it's * in a different format). */ #ifdef POSIX - p1 = explode(getenv("MAKEFLAGS")); - Main_ParseArgLine(p1); - free(p1); + { + char *p1 = explode(getenv("MAKEFLAGS")); + Main_ParseArgLine(p1); + free(p1); + } #else Main_ParseArgLine(getenv("MAKE")); #endif @@ -1045,244 +1484,105 @@ main(int argc, char **argv) MainParseArgs(argc, argv); - if (enterFlag) + if (opts.enterFlag) printf("%s: Entering directory `%s'\n", progname, curdir); /* * Verify that cwd is sane. */ if (stat(curdir, &sa) == -1) { - (void)fprintf(stderr, "%s: %s: %s.\n", - progname, curdir, strerror(errno)); - exit(2); + (void)fprintf(stderr, "%s: %s: %s.\n", + progname, curdir, strerror(errno)); + exit(2); } - /* - * All this code is so that we know where we are when we start up - * on a different machine with pmake. - * Overriding getcwd() with $PWD totally breaks MAKEOBJDIRPREFIX - * since the value of curdir can vary depending on how we got - * here. Ie sitting at a shell prompt (shell that provides $PWD) - * or via subdir.mk in which case its likely a shell which does - * not provide it. - * So, to stop it breaking this case only, we ignore PWD if - * MAKEOBJDIRPREFIX is set or MAKEOBJDIR contains a transform. - */ #ifndef NO_PWD_OVERRIDE - if (!ignorePWD) { - char *pwd, *ptmp1 = NULL, *ptmp2 = NULL; - - if ((pwd = getenv("PWD")) != NULL && - Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &ptmp1) == NULL) { - const char *makeobjdir = Var_Value("MAKEOBJDIR", - VAR_CMD, &ptmp2); - - if (makeobjdir == NULL || !strchr(makeobjdir, '$')) { - if (stat(pwd, &sb) == 0 && - sa.st_ino == sb.st_ino && - sa.st_dev == sb.st_dev) - (void)strncpy(curdir, pwd, MAXPATHLEN); - } - } - free(ptmp1); - free(ptmp2); - } + HandlePWD(&sa); #endif - Var_Set(".CURDIR", curdir, VAR_GLOBAL, 0); + Global_Set(".CURDIR", curdir); - /* - * Find the .OBJDIR. If MAKEOBJDIRPREFIX, or failing that, - * MAKEOBJDIR is set in the environment, try only that value - * and fall back to .CURDIR if it does not exist. - * - * Otherwise, try _PATH_OBJDIR.MACHINE, _PATH_OBJDIR, and - * finally _PATH_OBJDIRPREFIX`pwd`, in that order. If none - * of these paths exist, just use .CURDIR. - */ - Dir_Init(curdir); - (void)Main_SetObjdir(curdir); + InitObjdir(machine, machine_arch); - if ((path = Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &p1)) != NULL) { - (void)snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir); - (void)Main_SetObjdir(mdpath); - free(p1); - } else if ((path = Var_Value("MAKEOBJDIR", VAR_CMD, &p1)) != NULL) { - (void)Main_SetObjdir(path); - free(p1); - } else { - (void)snprintf(mdpath, MAXPATHLEN, "%s.%s", _PATH_OBJDIR, machine); - if (!Main_SetObjdir(mdpath) && !Main_SetObjdir(_PATH_OBJDIR)) { - (void)snprintf(mdpath, MAXPATHLEN, "%s%s", - _PATH_OBJDIRPREFIX, curdir); - (void)Main_SetObjdir(mdpath); - } - } - - /* - * Be compatible if user did not specify -j and did not explicitly - * turned compatibility on - */ - if (!compatMake && !forceJobs) { - compatMake = TRUE; - } - /* * Initialize archive, target and suffix modules in preparation for * parsing the makefile(s) */ Arch_Init(); - Targ_Init(); Suff_Init(); Trace_Init(tracefile); - DEFAULT = NULL; + defaultNode = NULL; (void)time(&now); Trace_Log(MAKESTART, NULL); - - /* - * Set up the .TARGETS variable to contain the list of targets to be - * created. If none specified, make the variable empty -- the parser - * will fill the thing in with the default or .MAIN target. - */ - if (!Lst_IsEmpty(create)) { - LstNode ln; - for (ln = Lst_First(create); ln != NULL; - ln = Lst_Succ(ln)) { - char *name = (char *)Lst_Datum(ln); + InitVarTargets(); - Var_Append(".TARGETS", name, VAR_GLOBAL); - } - } else - Var_Set(".TARGETS", "", VAR_GLOBAL, 0); + InitDefSysIncPath(syspath); +} +/* + * Read the system makefile followed by either makefile, Makefile or the + * files given by the -f option. Exit on parse errors. + */ +static void +main_ReadFiles(void) +{ - /* - * If no user-supplied system path was given (through the -m option) - * add the directories from the DEFSYSPATH (more than one may be given - * as dir1:...:dirn) to the system include path. - */ - if (syspath == NULL || *syspath == '\0') - syspath = defsyspath; + if (!opts.noBuiltins) + ReadBuiltinRules(); + + if (!Lst_IsEmpty(&opts.makefiles)) + ReadAllMakefiles(&opts.makefiles); else - syspath = bmake_strdup(syspath); - - for (start = syspath; *start != '\0'; start = cp) { - for (cp = start; *cp != '\0' && *cp != ':'; cp++) - continue; - if (*cp == ':') { - *cp++ = '\0'; - } - /* look for magic parent directory search string */ - if (strncmp(".../", start, 4) != 0) { - (void)Dir_AddDir(defIncPath, start); - } else { - if (Dir_FindHereOrAbove(curdir, start+4, - found_path, sizeof(found_path))) { - (void)Dir_AddDir(defIncPath, found_path); - } - } - } - if (syspath != defsyspath) - free(syspath); - - /* - * Read in the built-in rules first, followed by the specified - * makefile, if it was (makefile != NULL), or the default - * makefile and Makefile, in that order, if it wasn't. - */ - if (!noBuiltins) { - LstNode ln; - - sysMkPath = Lst_Init(FALSE); - Dir_Expand(_PATH_DEFSYSMK, - Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath, - sysMkPath); - if (Lst_IsEmpty(sysMkPath)) - Fatal("%s: no system rules (%s).", progname, - _PATH_DEFSYSMK); - ln = Lst_Find(sysMkPath, NULL, ReadMakefile); - if (ln == NULL) - Fatal("%s: cannot open %s.", progname, - (char *)Lst_Datum(ln)); - } - - if (!Lst_IsEmpty(makefiles)) { - LstNode ln; - - ln = Lst_Find(makefiles, NULL, ReadAllMakefiles); - if (ln != NULL) - Fatal("%s: cannot open %s.", progname, - (char *)Lst_Datum(ln)); - } else { - p1 = Var_Subst(NULL, "${" MAKEFILE_PREFERENCE "}", - VAR_CMD, 0); - if (p1) { - (void)str2Lst_Append(makefiles, p1, NULL); - (void)Lst_Find(makefiles, NULL, ReadMakefile); - free(p1); - } - } + ReadFirstDefaultMakefile(); +} +/* Compute the dependency graph. */ +static void +main_PrepareMaking(void) +{ /* In particular suppress .depend for '-r -V .OBJDIR -f /dev/null' */ - if (!noBuiltins || !printVars) { - makeDependfile = Var_Subst(NULL, "${.MAKE.DEPENDFILE:T}", - VAR_CMD, 0); - doing_depend = TRUE; - (void)ReadMakefile(makeDependfile, NULL); - doing_depend = FALSE; + if (!opts.noBuiltins || opts.printVars == PVM_NONE) { + (void)Var_Subst("${.MAKE.DEPENDFILE}", + SCOPE_CMDLINE, VARE_WANTRES, &makeDependfile); + if (makeDependfile[0] != '\0') { + /* TODO: handle errors */ + doing_depend = TRUE; + (void)ReadMakefile(makeDependfile); + doing_depend = FALSE; + } } if (enterFlagObj) printf("%s: Entering directory `%s'\n", progname, objdir); - - MakeMode(NULL); - Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL); - if (p1) - free(p1); + MakeMode(); - if (!compatMake) - Job_ServerStart(maxJobTokens, jp_0, jp_1); - if (DEBUG(JOB)) - fprintf(debug_file, "job_pipe %d %d, maxjobs %d, tokens %d, compat %d\n", - jp_0, jp_1, maxJobs, maxJobTokens, compatMake); + { + FStr makeflags = Var_Value(SCOPE_GLOBAL, MAKEFLAGS); + Global_Append("MFLAGS", makeflags.str); + FStr_Done(&makeflags); + } - Main_ExportMAKEFLAGS(TRUE); /* initial export */ - + InitMaxJobs(); /* - * For compatibility, look at the directories in the VPATH variable - * and add them to the search path, if the variable is defined. The - * variable's value is in the same format as the PATH envariable, i.e. - * ::... + * Be compatible if the user did not specify -j and did not explicitly + * turn compatibility on. */ - if (Var_Exists("VPATH", VAR_CMD)) { - char *vpath, savec; - /* - * GCC stores string constants in read-only memory, but - * Var_Subst will want to write this thing, so store it - * in an array - */ - static char VPATH[] = "${VPATH}"; + if (!opts.compatMake && !forceJobs) + opts.compatMake = TRUE; - vpath = Var_Subst(NULL, VPATH, VAR_CMD, FALSE); - path = vpath; - do { - /* skip to end of directory */ - for (cp = path; *cp != ':' && *cp != '\0'; cp++) - continue; - /* Save terminator character so know when to stop */ - savec = *cp; - *cp = '\0'; - /* Add directory to search path */ - (void)Dir_AddDir(dirSearchPath, path); - *cp = savec; - path = cp + 1; - } while (savec == ':'); - free(vpath); - } + if (!opts.compatMake) + Job_ServerStart(maxJobTokens, jp_0, jp_1); + DEBUG5(JOB, "job_pipe %d %d, maxjobs %d, tokens %d, compat %d\n", + jp_0, jp_1, opts.maxJobs, maxJobTokens, opts.compatMake ? 1 : 0); + + if (opts.printVars == PVM_NONE) + Main_ExportMAKEFLAGS(TRUE); /* initial export */ + + InitVpath(); /* * Now that all search paths have been read for suffixes et al, it's @@ -1298,143 +1598,113 @@ main(int argc, char **argv) /* print the initial graph, if the user requested it */ if (DEBUG(GRAPH1)) Targ_PrintGraph(1); +} - /* print the values of any variables requested by the user */ - if (printVars) { - LstNode ln; - Boolean expandVars; - - if (debugVflag) - expandVars = FALSE; - else - expandVars = getBoolean(".MAKE.EXPAND_VARIABLES", FALSE); - for (ln = Lst_First(variables); ln != NULL; - ln = Lst_Succ(ln)) { - char *var = (char *)Lst_Datum(ln); - char *value; - - if (strchr(var, '$')) { - value = p1 = Var_Subst(NULL, var, VAR_GLOBAL, 0); - } else if (expandVars) { - char tmp[128]; - - if (snprintf(tmp, sizeof(tmp), "${%s}", var) >= (int)(sizeof(tmp))) - Fatal("%s: variable name too big: %s", - progname, var); - value = p1 = Var_Subst(NULL, tmp, VAR_GLOBAL, 0); - } else { - value = Var_Value(var, VAR_GLOBAL, &p1); - } - printf("%s\n", value ? value : ""); - if (p1) - free(p1); - } +/* + * Make the targets. + * If the -v or -V options are given, print variables instead. + * Return whether any of the targets is out-of-date. + */ +static Boolean +main_Run(void) +{ + if (opts.printVars != PVM_NONE) { + /* print the values of any variables requested by the user */ + doPrintVars(); + return FALSE; } else { - /* - * Have now read the entire graph and need to make a list of - * targets to create. If none was given on the command line, - * we consult the parsing module to find the main target(s) - * to create. - */ - if (Lst_IsEmpty(create)) - targs = Parse_MainName(); - else - targs = Targ_FindList(create, TARG_CREATE); - - if (!compatMake) { - /* - * Initialize job module before traversing the graph - * now that any .BEGIN and .END targets have been read. - * This is done only if the -q flag wasn't given - * (to prevent the .BEGIN from being executed should - * it exist). - */ - if (!queryFlag) { - Job_Init(); - jobsRunning = TRUE; - } - - /* Traverse the graph, checking on all the targets */ - outOfDate = Make_Run(targs); - } else { - /* - * Compat_Init will take care of creating all the - * targets as well as initializing the module. - */ - Compat_Run(targs); - } + return runTargets(); } +} +/* Clean up after making the targets. */ +static void +main_CleanUp(void) +{ #ifdef CLEANUP - Lst_Destroy(targs, NULL); - Lst_Destroy(variables, NULL); - Lst_Destroy(makefiles, NULL); - Lst_Destroy(create, (FreeProc *)free); + Lst_DoneCall(&opts.variables, free); + /* + * Don't free the actual strings from opts.makefiles, they may be + * used in GNodes. + */ + Lst_Done(&opts.makefiles); + Lst_DoneCall(&opts.create, free); #endif /* print the graph now it's been processed if the user requested it */ if (DEBUG(GRAPH2)) Targ_PrintGraph(2); - Trace_Log(MAKEEND, 0); + Trace_Log(MAKEEND, NULL); if (enterFlagObj) printf("%s: Leaving directory `%s'\n", progname, objdir); - if (enterFlag) + if (opts.enterFlag) printf("%s: Leaving directory `%s'\n", progname, curdir); +#ifdef USE_META + meta_finish(); +#endif Suff_End(); - Targ_End(); + Targ_End(); Arch_End(); Var_End(); Parse_End(); Dir_End(); Job_End(); Trace_End(); +} +/* Determine the exit code. */ +static int +main_Exit(Boolean outOfDate) +{ + if (opts.strict && (main_errors > 0 || Parse_GetFatals() > 0)) + return 2; /* Not 1 so -q can distinguish error */ return outOfDate ? 1 : 0; } -/*- - * ReadMakefile -- - * Open and parse the given makefile. +int +main(int argc, char **argv) +{ + Boolean outOfDate; + + main_Init(argc, argv); + main_ReadFiles(); + main_PrepareMaking(); + outOfDate = main_Run(); + main_CleanUp(); + return main_Exit(outOfDate); +} + +/* + * Open and parse the given makefile, with all its side effects. * * Results: * 0 if ok. -1 if couldn't open file. - * - * Side Effects: - * lots */ static int -ReadMakefile(const void *p, const void *q MAKE_ATTR_UNUSED) +ReadMakefile(const char *fname) { - const char *fname = p; /* makefile to read */ int fd; - size_t len = MAXPATHLEN; - char *name, *path = bmake_malloc(len); + char *name, *path = NULL; - if (!strcmp(fname, "-")) { + if (strcmp(fname, "-") == 0) { Parse_File(NULL /*stdin*/, -1); - Var_Set("MAKEFILE", "", VAR_INTERNAL, 0); + Var_Set(SCOPE_INTERNAL, "MAKEFILE", ""); } else { /* if we've chdir'd, rebuild the path name */ - if (strcmp(curdir, objdir) && *fname != '/') { - size_t plen = strlen(curdir) + strlen(fname) + 2; - if (len < plen) - path = bmake_realloc(path, len = 2 * plen); - - (void)snprintf(path, len, "%s/%s", curdir, fname); + if (strcmp(curdir, objdir) != 0 && *fname != '/') { + path = str_concat3(curdir, "/", fname); fd = open(path, O_RDONLY); if (fd != -1) { fname = path; goto found; } - + free(path); + /* If curdir failed, try objdir (ala .depend) */ - plen = strlen(objdir) + strlen(fname) + 2; - if (len < plen) - path = bmake_realloc(path, len = 2 * plen); - (void)snprintf(path, len, "%s/%s", objdir, fname); + path = str_concat3(objdir, "/", fname); fd = open(path, O_RDONLY); if (fd != -1) { fname = path; @@ -1447,14 +1717,15 @@ ReadMakefile(const void *p, const void *q MAKE_ATTR_UNUSED) } /* look in -I and system include directories. */ name = Dir_FindFile(fname, parseIncPath); - if (!name) - name = Dir_FindFile(fname, - Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath); - if (!name || (fd = open(name, O_RDONLY)) == -1) { - if (name) - free(name); + if (name == NULL) { + SearchPath *sysInc = Lst_IsEmpty(&sysIncPath->dirs) + ? defSysIncPath : sysIncPath; + name = Dir_FindFile(fname, sysInc); + } + if (name == NULL || (fd = open(name, O_RDONLY)) == -1) { + free(name); free(path); - return(-1); + return -1; } fname = name; /* @@ -1464,178 +1735,145 @@ ReadMakefile(const void *p, const void *q MAKE_ATTR_UNUSED) */ found: if (!doing_depend) - Var_Set("MAKEFILE", fname, VAR_INTERNAL, 0); + Var_Set(SCOPE_INTERNAL, "MAKEFILE", fname); Parse_File(fname, fd); } free(path); - return(0); + return 0; } - - -/*- +/* * Cmd_Exec -- * Execute the command in cmd, and return the output of that command - * in a string. + * in a string. In the output, newlines are replaced with spaces. * * Results: - * A string containing the output of the command, or the empty string - * If errnum is not NULL, it contains the reason for the command failure + * A string containing the output of the command, or the empty string. + * *errfmt returns a format string describing the command failure, + * if any, using a single %s conversion specification. * * Side Effects: * The string must be freed by the caller. */ char * -Cmd_Exec(const char *cmd, const char **errnum) +Cmd_Exec(const char *cmd, const char **errfmt) { - const char *args[4]; /* Args for invoking the shell */ - int fds[2]; /* Pipe streams */ - int cpid; /* Child PID */ - int pid; /* PID from wait() */ - char *res; /* result */ - int status; /* command exit status */ - Buffer buf; /* buffer to store the result */ - char *cp; - int cc; /* bytes read, or -1 */ - int savederr; /* saved errno */ + const char *args[4]; /* Args for invoking the shell */ + int pipefds[2]; + int cpid; /* Child PID */ + int pid; /* PID from wait() */ + int status; /* command exit status */ + Buffer buf; /* buffer to store the result */ + ssize_t bytes_read; + char *res; /* result */ + size_t res_len; + char *cp; + int savederr; /* saved errno */ + *errfmt = NULL; - *errnum = NULL; - - if (!shellName) - Shell_Init(); - /* - * Set up arguments for shell - */ - args[0] = shellName; - args[1] = "-c"; - args[2] = cmd; - args[3] = NULL; - - /* - * Open a pipe for fetching its output - */ - if (pipe(fds) == -1) { - *errnum = "Couldn't create pipe for \"%s\""; - goto bad; - } - - /* - * Fork - */ - switch (cpid = vFork()) { - case 0: + if (shellName == NULL) + Shell_Init(); /* - * Close input side of pipe + * Set up arguments for shell */ - (void)close(fds[0]); + args[0] = shellName; + args[1] = "-c"; + args[2] = cmd; + args[3] = NULL; /* - * Duplicate the output stream to the shell's output, then - * shut the extra thing down. Note we don't fetch the error - * stream...why not? Why? + * Open a pipe for fetching its output */ - (void)dup2(fds[1], 1); - (void)close(fds[1]); - - Var_ExportVars(); - - (void)execv(shellPath, UNCONST(args)); - _exit(1); - /*NOTREACHED*/ - - case -1: - *errnum = "Couldn't exec \"%s\""; - goto bad; - - default: - /* - * No need for the writing half - */ - (void)close(fds[1]); - - savederr = 0; - Buf_Init(&buf, 0); - - do { - char result[BUFSIZ]; - cc = read(fds[0], result, sizeof(result)); - if (cc > 0) - Buf_AddBytes(&buf, cc, result); + if (pipe(pipefds) == -1) { + *errfmt = "Couldn't create pipe for \"%s\""; + goto bad; } - while (cc > 0 || (cc == -1 && errno == EINTR)); - if (cc == -1) - savederr = errno; + + Var_ReexportVars(); /* - * Close the input side of the pipe. + * Fork */ - (void)close(fds[0]); + switch (cpid = vfork()) { + case 0: + (void)close(pipefds[0]); /* Close input side of pipe */ - /* - * Wait for the process to exit. - */ - while(((pid = waitpid(cpid, &status, 0)) != cpid) && (pid >= 0)) { - JobReapChild(pid, status, FALSE); - continue; + /* + * Duplicate the output stream to the shell's output, then + * shut the extra thing down. Note we don't fetch the error + * stream...why not? Why? + */ + (void)dup2(pipefds[1], 1); + (void)close(pipefds[1]); + + (void)execv(shellPath, UNCONST(args)); + _exit(1); + /*NOTREACHED*/ + + case -1: + *errfmt = "Couldn't exec \"%s\""; + goto bad; + + default: + (void)close(pipefds[1]); /* No need for the writing half */ + + savederr = 0; + Buf_Init(&buf); + + do { + char result[BUFSIZ]; + bytes_read = read(pipefds[0], result, sizeof result); + if (bytes_read > 0) + Buf_AddBytes(&buf, result, (size_t)bytes_read); + } while (bytes_read > 0 || + (bytes_read == -1 && errno == EINTR)); + if (bytes_read == -1) + savederr = errno; + + (void)close(pipefds[0]); /* Close the input side of the pipe. */ + + /* Wait for the process to exit. */ + while ((pid = waitpid(cpid, &status, 0)) != cpid && pid >= 0) + JobReapChild(pid, status, FALSE); + + res_len = buf.len; + res = Buf_DoneData(&buf); + + if (savederr != 0) + *errfmt = "Couldn't read shell's output for \"%s\""; + + if (WIFSIGNALED(status)) + *errfmt = "\"%s\" exited on a signal"; + else if (WEXITSTATUS(status) != 0) + *errfmt = "\"%s\" returned non-zero status"; + + /* Convert newlines to spaces. A final newline is just stripped */ + if (res_len > 0 && res[res_len - 1] == '\n') + res[res_len - 1] = '\0'; + for (cp = res; *cp != '\0'; cp++) + if (*cp == '\n') + *cp = ' '; + break; } - cc = Buf_Size(&buf); - res = Buf_Destroy(&buf, FALSE); - - if (savederr != 0) - *errnum = "Couldn't read shell's output for \"%s\""; - - if (WIFSIGNALED(status)) - *errnum = "\"%s\" exited on a signal"; - else if (WEXITSTATUS(status) != 0) - *errnum = "\"%s\" returned non-zero status"; - - /* - * Null-terminate the result, convert newlines to spaces and - * install it in the variable. - */ - res[cc] = '\0'; - cp = &res[cc]; - - if (cc > 0 && *--cp == '\n') { - /* - * A final newline is just stripped - */ - *cp-- = '\0'; - } - while (cp >= res) { - if (*cp == '\n') { - *cp = ' '; - } - cp--; - } - break; - } - return res; + return res; bad: - res = bmake_malloc(1); - *res = '\0'; - return res; + return bmake_strdup(""); } -/*- - * Error -- - * Print an error message given its format. +/* + * Print a printf-style error message. * - * Results: - * None. - * - * Side Effects: - * The message is printed. + * In default mode, this error message has no consequences, in particular it + * does not affect the exit status. Only in lint mode (-dL) it does. */ -/* VARARGS */ void Error(const char *fmt, ...) { va_list ap; FILE *err_file; - err_file = debug_file; + err_file = opts.debug_file; if (err_file == stdout) err_file = stderr; (void)fflush(stdout); @@ -1650,30 +1888,26 @@ Error(const char *fmt, ...) break; err_file = stderr; } + main_errors++; } -/*- - * Fatal -- - * Produce a Fatal error message. If jobs are running, waits for them - * to finish. +/* + * Wait for any running jobs to finish, then produce an error message, + * finally exit immediately. * - * Results: - * None - * - * Side Effects: - * The program exits + * Exiting immediately differs from Parse_Error, which exits only after the + * current top-level makefile has been parsed completely. */ -/* VARARGS */ void Fatal(const char *fmt, ...) { va_list ap; - va_start(ap, fmt); if (jobsRunning) Job_Wait(); (void)fflush(stdout); + va_start(ap, fmt); (void)vfprintf(stderr, fmt, ap); va_end(ap); (void)fprintf(stderr, "\n"); @@ -1683,22 +1917,14 @@ Fatal(const char *fmt, ...) if (DEBUG(GRAPH2) || DEBUG(GRAPH3)) Targ_PrintGraph(2); - Trace_Log(MAKEERROR, 0); + Trace_Log(MAKEERROR, NULL); exit(2); /* Not 1 so -q can distinguish error */ } /* - * Punt -- - * Major exception once jobs are being created. Kills all jobs, prints - * a message and exits. - * - * Results: - * None - * - * Side Effects: - * All children are killed indiscriminately and the program Lib_Exits + * Major exception once jobs are being created. + * Kills all jobs, prints a message and exits. */ -/* VARARGS */ void Punt(const char *fmt, ...) { @@ -1717,16 +1943,7 @@ Punt(const char *fmt, ...) DieHorribly(); } -/*- - * DieHorribly -- - * Exit without giving a message. - * - * Results: - * None - * - * Side Effects: - * A big one... - */ +/* Exit without giving a message. */ void DieHorribly(void) { @@ -1734,26 +1951,21 @@ DieHorribly(void) Job_AbortAll(); if (DEBUG(GRAPH2)) Targ_PrintGraph(2); - Trace_Log(MAKEERROR, 0); - exit(2); /* Not 1, so -q can distinguish error */ + Trace_Log(MAKEERROR, NULL); + exit(2); /* Not 1 so -q can distinguish error */ } /* - * Finish -- - * Called when aborting due to errors in child shell to signal - * abnormal exit. - * - * Results: - * None - * - * Side Effects: - * The program exits + * Called when aborting due to errors in child shell to signal abnormal exit. + * The program exits. + * Errors is the number of errors encountered in Make_Make. */ void -Finish(int errors) - /* number of errors encountered in Make_Make */ +Finish(int errs) { - Fatal("%d error%s", errors, errors == 1 ? "" : "s"); + if (shouldDieQuietly(NULL, -1)) + exit(2); + Fatal("%d error%s", errs, errs == 1 ? "" : "s"); } /* @@ -1775,223 +1987,276 @@ eunlink(const char *file) return unlink(file); } +static void +write_all(int fd, const void *data, size_t n) +{ + const char *mem = data; + + while (n > 0) { + ssize_t written = write(fd, mem, n); + if (written == -1 && errno == EAGAIN) + continue; + if (written == -1) + break; + mem += written; + n -= (size_t)written; + } +} + /* - * execError -- + * execDie -- * Print why exec failed, avoiding stdio. */ -void -execError(const char *af, const char *av) +void MAKE_ATTR_DEAD +execDie(const char *af, const char *av) { -#ifdef USE_IOVEC - int i = 0; - struct iovec iov[8]; -#define IOADD(s) \ - (void)(iov[i].iov_base = UNCONST(s), \ - iov[i].iov_len = strlen(iov[i].iov_base), \ - i++) -#else -#define IOADD(void)write(2, s, strlen(s)) -#endif + Buffer buf; - IOADD(progname); - IOADD(": "); - IOADD(af); - IOADD("("); - IOADD(av); - IOADD(") failed ("); - IOADD(strerror(errno)); - IOADD(")\n"); + Buf_Init(&buf); + Buf_AddStr(&buf, progname); + Buf_AddStr(&buf, ": "); + Buf_AddStr(&buf, af); + Buf_AddStr(&buf, "("); + Buf_AddStr(&buf, av); + Buf_AddStr(&buf, ") failed ("); + Buf_AddStr(&buf, strerror(errno)); + Buf_AddStr(&buf, ")\n"); -#ifdef USE_IOVEC - while (writev(2, iov, 8) == -1 && errno == EAGAIN) - continue; -#endif + write_all(STDERR_FILENO, buf.data, buf.len); + + Buf_Done(&buf); + _exit(1); +} + +/* purge any relative paths */ +static void +purge_relative_cached_realpaths(void) +{ + HashEntry *he, *nhe; + HashIter hi; + + HashIter_Init(&hi, &cached_realpaths); + he = HashIter_Next(&hi); + while (he != NULL) { + nhe = HashIter_Next(&hi); + if (he->key[0] != '/') { + DEBUG1(DIR, "cached_realpath: purging %s\n", he->key); + HashTable_DeleteEntry(&cached_realpaths, he); + /* XXX: What about the allocated he->value? Either + * free them or document why they cannot be freed. */ + } + he = nhe; + } +} + +char * +cached_realpath(const char *pathname, char *resolved) +{ + const char *rp; + + if (pathname == NULL || pathname[0] == '\0') + return NULL; + + rp = HashTable_FindValue(&cached_realpaths, pathname); + if (rp != NULL) { + /* a hit */ + strncpy(resolved, rp, MAXPATHLEN); + resolved[MAXPATHLEN - 1] = '\0'; + return resolved; + } + + rp = realpath(pathname, resolved); + if (rp != NULL) { + HashTable_Set(&cached_realpaths, pathname, bmake_strdup(rp)); + DEBUG2(DIR, "cached_realpath: %s -> %s\n", pathname, rp); + return resolved; + } + + /* should we negative-cache? */ + return NULL; } /* - * usage -- - * exit with usage message + * Return true if we should die without noise. + * For example our failing child was a sub-make or failure happened elsewhere. */ +Boolean +shouldDieQuietly(GNode *gn, int bf) +{ + static int quietly = -1; + + if (quietly < 0) { + if (DEBUG(JOB) || !GetBooleanVar(".MAKE.DIE_QUIETLY", TRUE)) + quietly = 0; + else if (bf >= 0) + quietly = bf; + else + quietly = (gn != NULL && (gn->type & OP_MAKE)) ? 1 : 0; + } + return quietly != 0; +} + static void -usage(void) +SetErrorVars(GNode *gn) { - char *p; - if ((p = strchr(progname, '[')) != NULL) - *p = '\0'; + StringListNode *ln; - (void)fprintf(stderr, -"usage: %s [-BeikNnqrstWwX] \n\ - [-C directory] [-D variable] [-d flags] [-f makefile]\n\ - [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]\n\ - [-V variable] [variable=value] [target ...]\n", progname); - exit(2); -} - - -int -PrintAddr(void *a, void *b) -{ - printf("%lx ", (unsigned long) a); - return b ? 0 : 0; -} - - - -void -PrintOnError(GNode *gn, const char *s) -{ - static GNode *en = NULL; - char tmp[64]; - char *cp; - - if (s) - printf("%s", s); - - printf("\n%s: stopped in %s\n", progname, curdir); - - if (en) - return; /* we've been here! */ - if (gn) { /* * We can print this even if there is no .ERROR target. */ - Var_Set(".ERROR_TARGET", gn->name, VAR_GLOBAL, 0); - } - strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}", - sizeof(tmp) - 1); - cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0); - if (cp) { - if (*cp) - printf("%s", cp); - free(cp); - } - /* - * Finally, see if there is a .ERROR target, and run it if so. - */ - en = Targ_FindNode(".ERROR", TARG_NOCREATE); - if (en) { - en->type |= OP_SPECIAL; - Compat_Make(en, en); - } + Global_Set(".ERROR_TARGET", gn->name); + Global_Delete(".ERROR_CMD"); + + for (ln = gn->commands.first; ln != NULL; ln = ln->next) { + const char *cmd = ln->datum; + + if (cmd == NULL) + break; + Global_Append(".ERROR_CMD", cmd); + } +} + +/* + * Print some helpful information in case of an error. + * The caller should exit soon after calling this function. + */ +void +PrintOnError(GNode *gn, const char *msg) +{ + static GNode *errorNode = NULL; + + if (DEBUG(HASH)) { + Targ_Stats(); + Var_Stats(); + } + + if (errorNode != NULL) + return; /* we've been here! */ + + if (msg != NULL) + printf("%s", msg); + printf("\n%s: stopped in %s\n", progname, curdir); + + /* we generally want to keep quiet if a sub-make died */ + if (shouldDieQuietly(gn, -1)) + return; + + if (gn != NULL) + SetErrorVars(gn); + + { + char *errorVarsValues; + (void)Var_Subst("${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}", + SCOPE_GLOBAL, VARE_WANTRES, &errorVarsValues); + /* TODO: handle errors */ + printf("%s", errorVarsValues); + free(errorVarsValues); + } + + fflush(stdout); + + /* + * Finally, see if there is a .ERROR target, and run it if so. + */ + errorNode = Targ_FindNode(".ERROR"); + if (errorNode != NULL) { + errorNode->type |= OP_SPECIAL; + Compat_Make(errorNode, errorNode); + } } void Main_ExportMAKEFLAGS(Boolean first) { - static int once = 1; - char tmp[64]; - char *s; + static Boolean once = TRUE; + const char *expr; + char *s; - if (once != first) - return; - once = 0; - - strncpy(tmp, "${.MAKEFLAGS} ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}", - sizeof(tmp)); - s = Var_Subst(NULL, tmp, VAR_CMD, 0); - if (s && *s) { + if (once != first) + return; + once = FALSE; + + expr = "${.MAKEFLAGS} ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}"; + (void)Var_Subst(expr, SCOPE_CMDLINE, VARE_WANTRES, &s); + /* TODO: handle errors */ + if (s[0] != '\0') { #ifdef POSIX - setenv("MAKEFLAGS", s, 1); + setenv("MAKEFLAGS", s, 1); #else - setenv("MAKE", s, 1); + setenv("MAKE", s, 1); #endif - } + } } char * getTmpdir(void) { - static char *tmpdir = NULL; - - if (!tmpdir) { + static char *tmpdir = NULL; struct stat st; - /* - * Honor $TMPDIR but only if it is valid. - * Ensure it ends with /. - */ - tmpdir = Var_Subst(NULL, "${TMPDIR:tA:U" _PATH_TMP "}/", VAR_GLOBAL, 0); + if (tmpdir != NULL) + return tmpdir; + + /* Honor $TMPDIR but only if it is valid. Ensure it ends with '/'. */ + (void)Var_Subst("${TMPDIR:tA:U" _PATH_TMP "}/", + SCOPE_GLOBAL, VARE_WANTRES, &tmpdir); + /* TODO: handle errors */ + if (stat(tmpdir, &st) < 0 || !S_ISDIR(st.st_mode)) { - free(tmpdir); - tmpdir = bmake_strdup(_PATH_TMP); + free(tmpdir); + tmpdir = bmake_strdup(_PATH_TMP); } - } - return tmpdir; + return tmpdir; } /* * Create and open a temp file using "pattern". - * If "fnamep" is provided set it to a copy of the filename created. + * If out_fname is provided, set it to a copy of the filename created. * Otherwise unlink the file once open. */ int -mkTempFile(const char *pattern, char **fnamep) +mkTempFile(const char *pattern, char *tfile, size_t tfile_sz) { - static char *tmpdir = NULL; - char tfile[MAXPATHLEN]; - int fd; - - if (!pattern) - pattern = TMPPAT; - if (!tmpdir) - tmpdir = getTmpdir(); - if (pattern[0] == '/') { - snprintf(tfile, sizeof(tfile), "%s", pattern); - } else { - snprintf(tfile, sizeof(tfile), "%s%s", tmpdir, pattern); - } - if ((fd = mkstemp(tfile)) < 0) - Punt("Could not create temporary file %s: %s", tfile, strerror(errno)); - if (fnamep) { - *fnamep = bmake_strdup(tfile); - } else { - unlink(tfile); /* we just want the descriptor */ - } - return fd; -} + static char *tmpdir = NULL; + char tbuf[MAXPATHLEN]; + int fd; + if (pattern == NULL) + pattern = TMPPAT; + if (tmpdir == NULL) + tmpdir = getTmpdir(); + if (tfile == NULL) { + tfile = tbuf; + tfile_sz = sizeof tbuf; + } + if (pattern[0] == '/') { + snprintf(tfile, tfile_sz, "%s", pattern); + } else { + snprintf(tfile, tfile_sz, "%s%s", tmpdir, pattern); + } + if ((fd = mkstemp(tfile)) < 0) + Punt("Could not create temporary file %s: %s", tfile, + strerror(errno)); + if (tfile == tbuf) { + unlink(tfile); /* we just want the descriptor */ + } + return fd; +} /* - * Return a Boolean based on setting of a knob. - * - * If the knob is not set, the supplied default is the return value. - * If set, anything that looks or smells like "No", "False", "Off", "0" etc, - * is FALSE, otherwise TRUE. + * Convert a string representation of a boolean into a boolean value. + * Anything that looks like "No", "False", "Off", "0" etc. is FALSE, + * the empty string is the fallback, everything else is TRUE. */ Boolean -getBoolean(const char *name, Boolean bf) +ParseBoolean(const char *s, Boolean fallback) { - char tmp[64]; - char *cp; - - if (snprintf(tmp, sizeof(tmp), "${%s:tl}", name) < (int)(sizeof(tmp))) { - cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0); - - if (cp) { - switch(*cp) { - case '\0': /* not set - the default wins */ - break; - case '0': - case 'f': - case 'n': - bf = FALSE; - break; - case 'o': - switch (cp[1]) { - case 'f': - bf = FALSE; - break; - default: - bf = TRUE; - break; - } - break; - default: - bf = TRUE; - break; - } - free(cp); - } - } - return (bf); + char ch = ch_tolower(s[0]); + if (ch == '\0') + return fallback; + if (ch == '0' || ch == 'f' || ch == 'n') + return FALSE; + if (ch == 'o') + return ch_tolower(s[1]) != 'f'; + return TRUE; } diff --git a/usr.bin/make/make.1 b/usr.bin/make/make.1 index 14725498a..c1bbcbeda 100644 --- a/usr.bin/make/make.1 +++ b/usr.bin/make/make.1 @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $ +.\" $NetBSD: make.1,v 1.296 2021/02/04 21:42:46 rillig Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd June 4, 2015 +.Dd December 22, 2020 .Dt MAKE 1 .Os .Sh NAME @@ -37,7 +37,7 @@ .Nd maintain program dependencies .Sh SYNOPSIS .Nm -.Op Fl BeikNnqrstWwX +.Op Fl BeikNnqrSstWwX .Op Fl C Ar directory .Op Fl D Ar variable .Op Fl d Ar flags @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -98,7 +99,7 @@ is equivalent to .It Fl D Ar variable Define .Ar variable -to be 1, in the global context. +to be 1, in the global scope. .It Fl d Ar [-]flags Turn on debugging, and specify which portions of .Nm @@ -165,8 +166,15 @@ Print the input graph after making everything, or before exiting on error. .It Ar "g3" Print the input graph before exiting on error. +.It Ar h +Print debugging information about hash table operations. .It Ar j Print debugging information about running multiple shells. +.It Ar L +Turn on lint checks. +This will throw errors for variable assignments that do not parse +correctly, at the time of assignment so the file and line number +are available. .It Ar l Print commands in Makefiles regardless of whether or not they are prefixed by .Ql @ @@ -206,7 +214,9 @@ Print debugging information about target list maintenance. .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -269,7 +279,7 @@ that do not depend on the target whose creation caused the error. .It Fl m Ar directory Specify a directory in which to search for sys.mk and makefiles included via the -.Ao Ar file Ac Ns -style +.Li \&< Ns Ar file Ns Li \&> Ns -style include statement. The .Fl m @@ -277,7 +287,7 @@ option can be used multiple times to form a search path. This path will override the default system include path: /usr/share/mk. Furthermore the system include path will be appended to the search path used for -.Qo Ar file Qc Ns -style +.Li \*q Ns Ar file Ns Li \*q Ns -style include statements (see the .Fl I option). @@ -293,7 +303,7 @@ then will search for the specified file or directory named in the remaining part of the argument string. The search starts with the current directory of -the Makefile and then works upward towards the root of the filesystem. +the Makefile and then works upward towards the root of the file system. If the search is successful, then the resulting directory replaces the .Qq \&.../ specification in the @@ -308,7 +318,8 @@ as an argument). .It Fl n Display the commands that would have been executed, but do not actually execute them unless the target depends on the .MAKE special -source (see below). +source (see below) or the command is prefixed with +.Ql Ic + . .It Fl N Display the commands which would have been executed, but do not actually execute any of them; useful for debugging top-level makefiles @@ -318,6 +329,10 @@ Do not execute any commands, but exit 0 if the specified targets are up-to-date and 1, otherwise. .It Fl r Do not use the built-in rules specified in the system makefile. +.It Fl S +Stop processing if an error is encountered. +This is the default behavior and the opposite of +.Fl k . .It Fl s Do not echo any commands as they are executed. Equivalent to specifying @@ -334,20 +349,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global scope after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -390,37 +424,44 @@ or more sources. This creates a relationship where the targets .Dq depend on the sources -and are usually created from them. -The exact relationship between the target and the source is determined -by the operator that separates them. -The three operators are as follows: +and are customarily created from them. +A target is considered out-of-date if it does not exist, or if its +modification time is less than that of any of its sources. +An out-of-date target will be re-created, but not until all sources +have been examined and themselves re-created as needed. +Three operators may be used: .Bl -tag -width flag .It Ic \&: -A target is considered out-of-date if its modification time is less than -those of any of its sources. -Sources for a target accumulate over dependency lines when this operator -is used. -The target is removed if +Many dependency lines may name this target but only one may have +attached shell commands. +All sources named in all dependency lines are considered together, +and if needed the attached shell commands are run to create or +re-create the target. +If .Nm -is interrupted. +is interrupted, the target is removed. .It Ic \&! -Targets are always re-created, but not until all sources have been -examined and re-created as necessary. -Sources for a target accumulate over dependency lines when this operator -is used. -The target is removed if -.Nm -is interrupted. +The same, but the target is always re-created whether or not it is out +of date. .It Ic \&:: -If no sources are specified, the target is always re-created. -Otherwise, a target is considered out-of-date if any of its sources has -been modified more recently than the target. -Sources for a target do not accumulate over dependency lines when this -operator is used. -The target will not be removed if +Any dependency line may have attached shell commands, but each one +is handled independently: its sources are considered and the attached +shell commands are run if the target is out of date with respect to +(only) those sources. +Thus, different groups of the attached shell commands may be run +depending on the circumstances. +Furthermore, unlike +.Ic \&:, +for dependency lines with no sources, the attached shell +commands are always run. +Also unlike +.Ic \&:, +the target will not be removed if .Nm is interrupted. .El +All dependency lines mentioning a particular target must use the same +operator. .Pp Targets and sources may contain the shell wildcard values .Ql \&? , @@ -586,7 +627,7 @@ This shorter form is not recommended. .Pp If the variable name contains a dollar, then the name itself is expanded first. This allows almost arbitrary variable names, however names containing dollar, -braces, parenthesis, or whitespace are really best avoided! +braces, parentheses, or whitespace are really best avoided! .Pp If the result of expanding a variable contains a dollar sign .Pq Ql \&$ @@ -657,7 +698,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +707,7 @@ In suffix-transformation rules, the name/path of the source from which the target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -685,12 +726,15 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -773,6 +817,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -843,7 +891,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -867,8 +915,19 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env -For debugging, it can be useful to inlcude the environment +For debugging, it can be useful to include the environment in the .meta file. .It Pa verbose If in "meta" mode, print a clue about the target being built. @@ -910,6 +969,12 @@ Provides a list of path prefixes that should be ignored; because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. +.It Va .MAKE.META.IGNORE_FILTER +Provides a list of variable modifiers to apply to each pathname. +Ignore if the expansion is an empty string. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -918,7 +983,7 @@ The default value is: This variable is used to record the names of variables assigned to on the command line, so that they may be exported as part of .Ql Ev MAKEFLAGS . -This behaviour can be disabled by assigning an empty value to +This behavior can be disabled by assigning an empty value to .Ql Va .MAKEOVERRIDES within a makefile. Extra variables can be exported from a makefile @@ -941,10 +1006,40 @@ The process-id of .It Va .MAKE.PPID The parent process-id of .Nm . +.It Va .MAKE.SAVE_DOLLARS +value should be a boolean that controls whether +.Ql $$ +are preserved when doing +.Ql := +assignments. +The default is true, for compatibility with other makes. +If set to false, +.Ql $$ +becomes +.Ql $ +per normal evaluation rules. +.It Va .MAKE.UID +The user-id running +.Nm . +.It Va .MAKE.GID +The group-id running +.Nm . .It Va MAKE_PRINT_VAR_ON_ERROR When .Nm -stops due to an error, it prints its name and the value of +stops due to an error, it sets +.Ql Va .ERROR_TARGET +to the name of the target that failed, +.Ql Va .ERROR_CMD +to the commands of the failed target, +and in "meta" mode, it also sets +.Ql Va .ERROR_CWD +to the +.Xr getcwd 3 , +and +.Ql Va .ERROR_META_FILE +to the path of the meta file (if any) describing the failed target. +It then prints its name and the value of .Ql Va .CURDIR as well as the value of any variables named in .Ql Va MAKE_PRINT_VAR_ON_ERROR . @@ -1004,6 +1099,15 @@ to the specified directory if it exists, and set and .Ql Ev PWD to that directory before executing any targets. +.Pp +Except in the case of an explicit +.Ql Ic .OBJDIR +target, +.Nm +will check that the specified directory is writable and ignore it if not. +This check can be skipped by setting the environment variable +.Ql Ev MAKE_OBJDIR_CHECK_WRITABLE +to "no". . .It Va .PARSEDIR A path to the directory of the current @@ -1044,7 +1148,7 @@ sets to the value of .Ql Ev PWD instead. -This behaviour is disabled if +This behavior is disabled if .Ql Ev MAKEOBJDIRPREFIX is set or .Ql Ev MAKEOBJDIR @@ -1055,6 +1159,9 @@ is set to the value of for all programs which .Nm executes. +.It Ev .SHELL +The pathname of the shell used to run target scripts. +It is read-only. .It Ev .TARGETS The list of targets explicitly specified on the command line, if any. .It Ev VPATH @@ -1100,7 +1207,7 @@ Replaces each word in the variable with its suffix. .It Cm \&:H Replaces each word in the variable with everything but the last component. .It Cm \&:M Ns Ar pattern -Select only those words that match +Selects only those words that match .Ar pattern . The standard shell wildcard characters .Pf ( Ql * , @@ -1114,7 +1221,7 @@ The wildcard characters may be escaped with a backslash As a consequence of the way values are split into words, matched, and then joined, a construct like .Dl ${VAR:M*} -will normalise the inter-word spacing, removing all leading and +will normalize the inter-word spacing, removing all leading and trailing space, and converting multiple consecutive spaces to single spaces. . @@ -1124,17 +1231,15 @@ This is identical to but selects all words which do not match .Ar pattern . .It Cm \&:O -Order every word in variable alphabetically. -To sort words in -reverse order use the -.Ql Cm \&:O:[-1..1] -combination of modifiers. +Orders every word in variable alphabetically. +.It Cm \&:Or +Orders every word in variable in reverse alphabetical order. .It Cm \&:Ox -Randomize words in variable. +Shuffles the words in variable. The results will be different each time you are referring to the modified variable; use the assignment with expansion .Pq Ql Cm \&:= -to prevent such behaviour. +to prevent such behavior. For example, .Bd -literal -offset indent LIST= uno due tre quattro @@ -1156,24 +1261,41 @@ due uno quattro tre .Ed .It Cm \&:Q Quotes every shell meta-character in the variable, so that it can be passed +safely to the shell. +.It Cm \&:q +Quotes every shell meta-character in the variable, and also doubles +.Sq $ +characters so that it can be passed safely through recursive invocations of .Nm . +This is equivalent to: +.Sq \&:S/\e\&$/&&/g:Q . .It Cm \&:R Replaces each word in the variable with everything but its suffix. -.It Cm \&:gmtime +.It Cm \&:range[=count] +The value is an integer sequence representing the words of the original +value, or the supplied +.Va count . +.It Cm \&:gmtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr gmtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:hash -Compute a 32bit hash of the value and encode it as hex digits. -.It Cm \&:localtime +Computes a 32-bit hash of the value and encode it as hex digits. +.It Cm \&:localtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr localtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:tA -Attempt to convert variable to an absolute path using +Attempts to convert variable to an absolute path using .Xr realpath 3 , if that fails, the value is unchanged. .It Cm \&:tl @@ -1185,7 +1307,7 @@ This modifier sets the separator to the character If .Ar c is omitted, then no separator is used. -The common escapes (including octal numeric codes), work as expected. +The common escapes (including octal numeric codes) work as expected. .It Cm \&:tu Converts variable to upper-case letters. .It Cm \&:tW @@ -1201,21 +1323,21 @@ See also .Sm off .It Cm \&:S No \&/ Ar old_string No \&/ Ar new_string No \&/ Op Cm 1gW .Sm on -Modify the first occurrence of +Modifies the first occurrence of .Ar old_string -in the variable's value, replacing it with +in each word of the variable's value, replacing it with .Ar new_string . If a .Ql g -is appended to the last slash of the pattern, all occurrences +is appended to the last delimiter of the pattern, all occurrences in each word are replaced. If a .Ql 1 -is appended to the last slash of the pattern, only the first word +is appended to the last delimiter of the pattern, only the first occurrence is affected. If a .Ql W -is appended to the last slash of the pattern, +is appended to the last delimiter of the pattern, then the value is treated as a single word (possibly containing embedded white space). If @@ -1232,7 +1354,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1284,13 +1406,6 @@ as occur in the word or words it is found in; the .Ql W modifier causes the value to be treated as a single word (possibly containing embedded white space). -Note that -.Ql 1 -and -.Ql g -are orthogonal; the former specifies whether multiple words are -potentially affected, the latter whether multiple substitutions can -potentially occur within each affected word. .Pp As for the .Cm \&:S @@ -1301,9 +1416,9 @@ and are subjected to variable expansion before being parsed as regular expressions. .It Cm \&:T -Replaces each word in the variable with its last component. +Replaces each word in the variable with its last path component. .It Cm \&:u -Remove adjacent duplicate words (like +Removes adjacent duplicate words (like .Xr uniq 1 ) . .Sm off .It Cm \&:\&? Ar true_string Cm \&: Ar false_string @@ -1319,7 +1434,7 @@ usually contain variable expansions. A common error is trying to use expressions like .Dl ${NUMBERS:M42:?match:no} which actually tests defined(NUMBERS), -to determine is any words match "42" you need to use something like: +to determine if any words match "42" you need to use something like: .Dl ${"${NUMBERS:M42}" != \&"\&":?match:no} . .It Ar :old_string=new_string This is the @@ -1341,6 +1456,29 @@ is the substring of .Ar old_string to be replaced in .Ar new_string . +If only +.Ar old_string +contains the pattern matching character +.Ar % , +and +.Ar old_string +matches, then the result is the +.Ar new_string . +If only the +.Ar new_string +contains the pattern matching character +.Ar % , +then it is not treated specially and it is printed as a literal +.Ar % +on match. +If there is more than one pattern matching character +.Ar ( % ) +in either the +.Ar new_string +or +.Ar old_string , +only the first instance is treated specially (as the pattern character); +all subsequent instances are treated as regular characters. .Pp Variable expansion occurs in the normal fashion inside both .Ar old_string @@ -1357,11 +1495,10 @@ This is the loop expansion mechanism from the OSF Development Environment (ODE) make. Unlike .Cm \&.for -loops expansion occurs at the time of -reference. -Assign +loops, expansion occurs at the time of reference. +Assigns .Ar temp -to each word in the variable and evaluate +to each word in the variable and evaluates .Ar string . The ODE convention is that .Ar temp @@ -1371,8 +1508,29 @@ For example. .Pp However a single character variable is often more readable: .Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} +.It Cm \&:_[=var] +Saves the current variable value in +.Ql $_ +or the named +.Va var +for later reference. +Example usage: +.Bd -literal -offset indent +M_cmpv.units = 1 1000 1000000 +M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \&\\ +\\* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh + +.Dv .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}} + +.Ed +Here +.Ql $_ +is used to save the result of the +.Ql :S +modifier which is later referenced using the index values from +.Ql :range . .It Cm \&:U Ns Ar newval -If the variable is undefined +If the variable is undefined, .Ar newval is the value. If the variable is defined, the existing value is returned. @@ -1382,7 +1540,7 @@ It is handy for setting per-target CFLAGS for instance: If a value is only required if the variable is undefined, use: .Dl ${VAR:D:Unewval} .It Cm \&:D Ns Ar newval -If the variable is defined +If the variable is defined, .Ar newval is the value. .It Cm \&:L @@ -1444,7 +1602,7 @@ value is divided into words. .Pp Ordinarily, a value is treated as a sequence of words delimited by white space. -Some modifiers suppress this behaviour, +Some modifiers suppress this behavior, causing a value to be treated as a single word (possibly containing embedded white space). An empty value, or a value that consists entirely of white-space, @@ -1482,6 +1640,11 @@ then the words are output in reverse order. For example, .Ql Cm \&:[-1..1] selects all the words from last to first. +If the list is already ordered, then this effectively reverses +the list, but it is more efficient to use +.Ql Cm \&:Or +instead of +.Ql Cm \&:O:[-1..1] . .\" :[*] .It Cm \&* Causes subsequent modifiers to treat the value as a single word @@ -1506,7 +1669,7 @@ Returns the number of words in the value. .El \" :[range] .El .Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS -Makefile inclusion, conditional structures and for loops reminiscent +Makefile inclusion, conditional structures and for loops reminiscent of the C programming language are provided in .Nm . All such structures are identified by a line beginning with a single @@ -1514,9 +1677,9 @@ dot .Pq Ql \&. character. Files are included with either -.Cm \&.include Aq Ar file +.Cm \&.include \&< Ns Ar file Ns Cm \&> or -.Cm \&.include Pf \*q Ar file Ns \*q . +.Cm \&.include \&\*q Ns Ar file Ns Cm \&\*q . Variables between the angle brackets or double quotes are expanded to form the file name. If angle brackets are used, the included makefile is expected to be in @@ -1530,12 +1693,20 @@ For compatibility with other versions of .Nm .Ql include file ... is also accepted. +.Pp If the include statement is written as .Cm .-include or as .Cm .sinclude then errors locating and/or opening include files are ignored. .Pp +If the include statement is written as +.Cm .dinclude +not only are errors locating and/or opening include files ignored, +but stale dependencies within the included file will be ignored +just like +.Va .MAKE.DEPENDFILE . +.Pp Conditional expressions are also preceded by a single dot as the first character of a line. The possible conditionals are as follows: @@ -1544,7 +1715,7 @@ The possible conditionals are as follows: The message is printed along with the name of the makefile and line number, then .Nm -will exit. +will exit immediately. .It Ic .export Ar variable ... Export the specified global variable. If no variable list is provided, all globals are exported @@ -1571,11 +1742,15 @@ This allows exporting a value to the environment which is different from that used by .Nm internally. +.It Ic .export-literal Ar variable ... +The same as +.Ql .export-env , +except that variables in the value are not expanded. .It Ic .info Ar message The message is printed along with the name of the makefile and line number. -.It Ic .undef Ar variable -Un-define the specified global variable. -Only global variables may be un-defined. +.It Ic .undef Ar variable ... +Un-define the specified global variables. +Only global variables can be un-defined. .It Ic .unexport Ar variable ... The opposite of .Ql .export . @@ -1663,7 +1838,7 @@ may be any one of the following: .Bl -tag -width "Cm XX" .It Cm \&|\&| Logical OR. -.It Cm \&\*[Am]\*[Am] +.It Cm \&&& Logical .Tn AND ; of higher precedence than @@ -1680,7 +1855,7 @@ The boolean operator may be used to logically negate an entire conditional. It is of higher precedence than -.Ql Ic \&\*[Am]\*[Am] . +.Ql Ic \&&& . .Pp The value of .Ar expression @@ -1715,7 +1890,7 @@ has been defined and has commands associated with it. .Ar Expression may also be an arithmetic or string comparison. Variable expansion is -performed on both sides of the comparison, after which the integral +performed on both sides of the comparison, after which the numerical values are compared. A value is interpreted as hexadecimal if it is preceded by 0x, otherwise it is decimal; octal numbers are not supported. @@ -1725,11 +1900,11 @@ variable expansion, either the left or right hand side of a .Ql Ic == or .Ql Ic "!=" -operator is not an integral value, then +operator is not a numerical value, then string comparison is performed between the expanded variables. If no relational operator is given, it is assumed that the expanded -variable is being compared against 0 or an empty string in the case +variable is being compared against 0, or an empty string in the case of a string comparison. .Pp When @@ -1751,7 +1926,8 @@ expression is applied. Similarly, if the form is .Ql Ic .ifmake or -.Ql Ic .ifnmake , the +.Ql Ic .ifnmake , +the .Dq make expression is applied. .Pp @@ -1769,7 +1945,7 @@ The syntax of a for loop is: .Pp .Bl -tag -compact -width Ds .It Ic \&.for Ar variable Oo Ar variable ... Oc Ic in Ar expression -.It Aq make-rules +.It Aq make-lines .It Ic \&.endfor .El .Pp @@ -1781,7 +1957,7 @@ On each iteration of the loop, one word is taken and assigned to each in order, and these .Ic variables are substituted into the -.Ic make-rules +.Ic make-lines inside the body of the for loop. The number of words must come out even; that is, if there are three iteration variables, the number of words provided must be a multiple @@ -1954,6 +2130,14 @@ variable of a target that inherits .Ic .DEFAULT Ns 's commands is set to the target's own name. +.It Ic .DELETE_ON_ERROR +If this target is present in the makefile, it globally causes make to +delete targets whose commands fail. +(By default, only targets whose commands are interrupted during +execution are deleted. +This is the historical behavior.) +This setting can be used to help prevent half-finished or malformed +targets from being left around and corrupting future rebuilds. .It Ic .END Any command lines attached to this target are executed after everything else is done. @@ -2068,7 +2252,7 @@ The sources are a set of pairs. .Bl -tag -width hasErrCtls .It Ar name -This is the minimal specification, used to select one of the builtin +This is the minimal specification, used to select one of the built-in shell specs; .Ar sh , .Ar ksh , @@ -2274,9 +2458,9 @@ file). .Sh BUGS The .Nm -syntax is difficult to parse without actually acting of the data. -For instance finding the end of a variable use should involve scanning each -the modifiers using the correct terminator for each field. +syntax is difficult to parse without actually acting on the data. +For instance, finding the end of a variable's use should involve scanning +each of the modifiers, using the correct terminator for each field. In many places .Nm just counts {} and () in order to find the end of a variable expansion. diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index fde185065..1cd7299a7 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.91 2014/10/18 08:33:30 snj Exp $ */ +/* $NetBSD: make.c,v 1.242 2021/02/05 05:15:12 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,1418 +68,1297 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: make.c,v 1.91 2014/10/18 08:33:30 snj Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: make.c,v 1.91 2014/10/18 08:33:30 snj Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * make.c -- - * The functions which perform the examination of targets and - * their suitability for creation +/* + * Examination of targets and their suitability for creation. * * Interface: - * Make_Run Initialize things for the module and recreate - * whatever needs recreating. Returns TRUE if - * work was (or would have been) done and FALSE - * otherwise. + * Make_Run Initialize things for the module. Returns TRUE if + * work was (or would have been) done. * - * Make_Update Update all parents of a given child. Performs - * various bookkeeping chores like the updating - * of the cmgn field of the parent, filling - * of the IMPSRC context variable, etc. It will - * place the parent on the toBeMade queue if it - * should be. + * Make_Update After a target is made, update all its parents. + * Perform various bookkeeping chores like the updating + * of the youngestChild field of the parent, filling + * of the IMPSRC variable, etc. Place the parent on the + * toBeMade queue if it should be. * - * Make_TimeStamp Function to set the parent's cmgn field - * based on a child's modification time. + * GNode_UpdateYoungestChild + * Update the node's youngestChild field based on the + * child's modification time. * - * Make_DoAllVar Set up the various local variables for a - * target, including the .ALLSRC variable, making - * sure that any variable that needs to exist - * at the very least has the empty value. + * Make_DoAllVar Set up the various local variables for a + * target, including the .ALLSRC variable, making + * sure that any variable that needs to exist + * at the very least has the empty value. * - * Make_OODate Determine if a target is out-of-date. + * GNode_IsOODate Determine if a target is out-of-date. * - * Make_HandleUse See if a child is a .USE node for a parent - * and perform the .USE actions if so. + * Make_HandleUse See if a child is a .USE node for a parent + * and perform the .USE actions if so. * - * Make_ExpandUse Expand .USE nodes + * Make_ExpandUse Expand .USE nodes */ -#include "make.h" -#include "hash.h" -#include "dir.h" -#include "job.h" +#include "make.h" +#include "dir.h" +#include "job.h" -static unsigned int checked = 1;/* Sequence # to detect recursion */ -static Lst toBeMade; /* The current fringe of the graph. These - * are nodes which await examination by - * MakeOODate. It is added to by - * Make_Update and subtracted from by - * MakeStartJobs */ +/* "@(#)make.c 8.1 (Berkeley) 6/6/93" */ +MAKE_RCSID("$NetBSD: make.c,v 1.242 2021/02/05 05:15:12 rillig Exp $"); -static int MakeAddChild(void *, void *); -static int MakeFindChild(void *, void *); -static int MakeUnmark(void *, void *); -static int MakeAddAllSrc(void *, void *); -static int MakeTimeStamp(void *, void *); -static int MakeHandleUse(void *, void *); -static Boolean MakeStartJobs(void); -static int MakePrintStatus(void *, void *); -static int MakeCheckOrder(void *, void *); -static int MakeBuildChild(void *, void *); -static int MakeBuildParent(void *, void *); +/* Sequence # to detect recursion. */ +static unsigned int checked_seqno = 1; -MAKE_ATTR_DEAD static void -make_abort(GNode *gn, int line) +/* + * The current fringe of the graph. + * These are nodes which await examination by MakeOODate. + * It is added to by Make_Update and subtracted from by MakeStartJobs + */ +static GNodeList toBeMade = LST_INIT; + + +void +debug_printf(const char *fmt, ...) { - static int two = 2; + va_list args; - fprintf(debug_file, "make_abort from line %d\n", line); - Targ_PrintNode(gn, &two); - Lst_ForEach(toBeMade, Targ_PrintNode, &two); - Targ_PrintGraph(3); - abort(); + va_start(args, fmt); + vfprintf(opts.debug_file, fmt, args); + va_end(args); } -/*- - *----------------------------------------------------------------------- - * Make_TimeStamp -- - * Set the cmgn field of a parent node based on the mtime stamp in its - * child. Called from MakeOODate via Lst_ForEach. - * - * Input: - * pgn the current parent - * cgn the child we've just examined - * - * Results: - * Always returns 0. - * - * Side Effects: - * The cmgn of the parent node will be changed if the mtime - * field of the child is greater than it. - *----------------------------------------------------------------------- - */ -int -Make_TimeStamp(GNode *pgn, GNode *cgn) +MAKE_ATTR_DEAD static void +make_abort(GNode *gn, int lineno) { - if (pgn->cmgn == NULL || cgn->mtime > pgn->cmgn->mtime) { - pgn->cmgn = cgn; - } - return (0); + + debug_printf("make_abort from line %d\n", lineno); + Targ_PrintNode(gn, 2); + Targ_PrintNodes(&toBeMade, 2); + Targ_PrintGraph(3); + abort(); +} + +ENUM_FLAGS_RTTI_31(GNodeType, + OP_DEPENDS, OP_FORCE, OP_DOUBLEDEP, +/* OP_OPMASK is omitted since it combines other flags */ + OP_OPTIONAL, OP_USE, OP_EXEC, OP_IGNORE, + OP_PRECIOUS, OP_SILENT, OP_MAKE, OP_JOIN, + OP_MADE, OP_SPECIAL, OP_USEBEFORE, OP_INVISIBLE, + OP_NOTMAIN, OP_PHONY, OP_NOPATH, OP_WAIT, + OP_NOMETA, OP_META, OP_NOMETA_CMP, OP_SUBMAKE, + OP_TRANSFORM, OP_MEMBER, OP_LIB, OP_ARCHV, + OP_HAS_COMMANDS, OP_SAVE_CMDS, OP_DEPS_FOUND, OP_MARK); + +ENUM_FLAGS_RTTI_9(GNodeFlags, + REMAKE, CHILDMADE, FORCE, DONE_WAIT, + DONE_ORDER, FROM_DEPEND, DONE_ALLSRC, CYCLE, + DONECYCLE); + +void +GNode_FprintDetails(FILE *f, const char *prefix, const GNode *gn, + const char *suffix) +{ + char type_buf[GNodeType_ToStringSize]; + char flags_buf[GNodeFlags_ToStringSize]; + + fprintf(f, "%s%s, type %s, flags %s%s", + prefix, + GNodeMade_Name(gn->made), + GNodeType_ToString(type_buf, gn->type), + GNodeFlags_ToString(flags_buf, gn->flags), + suffix); +} + +Boolean +GNode_ShouldExecute(GNode *gn) +{ + return !((gn->type & OP_MAKE) + ? opts.noRecursiveExecute + : opts.noExecute); +} + +/* Update the youngest child of the node, according to the given child. */ +void +GNode_UpdateYoungestChild(GNode *gn, GNode *cgn) +{ + if (gn->youngestChild == NULL || cgn->mtime > gn->youngestChild->mtime) + gn->youngestChild = cgn; +} + +static Boolean +IsOODateRegular(GNode *gn) +{ + /* These rules are inherited from the original Make. */ + + if (gn->youngestChild != NULL) { + if (gn->mtime < gn->youngestChild->mtime) { + DEBUG1(MAKE, "modified before source \"%s\"...", + GNode_Path(gn->youngestChild)); + return TRUE; + } + return FALSE; + } + + if (gn->mtime == 0 && !(gn->type & OP_OPTIONAL)) { + DEBUG0(MAKE, "nonexistent and no sources..."); + return TRUE; + } + + if (gn->type & OP_DOUBLEDEP) { + DEBUG0(MAKE, ":: operator and no sources..."); + return TRUE; + } + + return FALSE; } /* - * Input: - * pgn the current parent - * cgn the child we've just examined + * See if the node is out of date with respect to its sources. * - */ -static int -MakeTimeStamp(void *pgn, void *cgn) -{ - return Make_TimeStamp((GNode *)pgn, (GNode *)cgn); -} - -/*- - *----------------------------------------------------------------------- - * Make_OODate -- - * See if a given node is out of date with respect to its sources. - * Used by Make_Run when deciding which nodes to place on the - * toBeMade queue initially and by Make_Update to screen out USE and - * EXEC nodes. In the latter case, however, any other sort of node - * must be considered out-of-date since at least one of its children - * will have been recreated. + * Used by Make_Run when deciding which nodes to place on the + * toBeMade queue initially and by Make_Update to screen out .USE and + * .EXEC nodes. In the latter case, however, any other sort of node + * must be considered out-of-date since at least one of its children + * will have been recreated. * - * Input: - * gn the node to check - * - * Results: - * TRUE if the node is out of date. FALSE otherwise. - * - * Side Effects: - * The mtime field of the node and the cmgn field of its parents - * will/may be changed. - *----------------------------------------------------------------------- + * The mtime field of the node and the youngestChild field of its parents + * may be changed. */ Boolean -Make_OODate(GNode *gn) +GNode_IsOODate(GNode *gn) { - Boolean oodate; + Boolean oodate; - /* - * Certain types of targets needn't even be sought as their datedness - * doesn't depend on their modification time... - */ - if ((gn->type & (OP_JOIN|OP_USE|OP_USEBEFORE|OP_EXEC)) == 0) { - (void)Dir_MTime(gn, 1); - if (DEBUG(MAKE)) { - if (gn->mtime != 0) { - fprintf(debug_file, "modified %s...", Targ_FmtTime(gn->mtime)); - } else { - fprintf(debug_file, "non-existent..."); - } - } - } - - /* - * A target is remade in one of the following circumstances: - * its modification time is smaller than that of its youngest child - * and it would actually be run (has commands or type OP_NOP) - * it's the object of a force operator - * it has no children, was on the lhs of an operator and doesn't exist - * already. - * - * Libraries are only considered out-of-date if the archive module says - * they are. - * - * These weird rules are brought to you by Backward-Compatibility and - * the strange people who wrote 'Make'. - */ - if (gn->type & (OP_USE|OP_USEBEFORE)) { /* - * If the node is a USE node it is *never* out of date - * no matter *what*. + * Certain types of targets needn't even be sought as their datedness + * doesn't depend on their modification time... */ - if (DEBUG(MAKE)) { - fprintf(debug_file, ".USE node..."); - } - oodate = FALSE; - } else if ((gn->type & OP_LIB) && - ((gn->mtime==0) || Arch_IsLib(gn))) { - if (DEBUG(MAKE)) { - fprintf(debug_file, "library..."); + if (!(gn->type & (OP_JOIN | OP_USE | OP_USEBEFORE | OP_EXEC))) { + Dir_UpdateMTime(gn, TRUE); + if (DEBUG(MAKE)) { + if (gn->mtime != 0) + debug_printf("modified %s...", + Targ_FmtTime(gn->mtime)); + else + debug_printf("nonexistent..."); + } } /* - * always out of date if no children and :: target - * or non-existent. + * A target is remade in one of the following circumstances: + * + * its modification time is smaller than that of its youngest + * child and it would actually be run (has commands or is not + * GNode_IsTarget) + * + * it's the object of a force operator + * + * it has no children, was on the lhs of an operator and doesn't + * exist already. + * + * Libraries are only considered out-of-date if the archive module + * says they are. + * + * These weird rules are brought to you by Backward-Compatibility + * and the strange people who wrote 'Make'. */ - oodate = (gn->mtime == 0 || Arch_LibOODate(gn) || - (gn->cmgn == NULL && (gn->type & OP_DOUBLEDEP))); - } else if (gn->type & OP_JOIN) { - /* - * A target with the .JOIN attribute is only considered - * out-of-date if any of its children was out-of-date. - */ - if (DEBUG(MAKE)) { - fprintf(debug_file, ".JOIN node..."); + if (gn->type & (OP_USE | OP_USEBEFORE)) { + /* + * If the node is a USE node it is *never* out of date + * no matter *what*. + */ + DEBUG0(MAKE, ".USE node..."); + oodate = FALSE; + } else if ((gn->type & OP_LIB) && (gn->mtime == 0 || Arch_IsLib(gn))) { + DEBUG0(MAKE, "library..."); + + /* + * always out of date if no children and :: target + * or nonexistent. + */ + oodate = (gn->mtime == 0 || Arch_LibOODate(gn) || + (gn->youngestChild == NULL && + (gn->type & OP_DOUBLEDEP))); + } else if (gn->type & OP_JOIN) { + /* + * A target with the .JOIN attribute is only considered + * out-of-date if any of its children was out-of-date. + */ + DEBUG0(MAKE, ".JOIN node..."); + DEBUG1(MAKE, "source %smade...", + gn->flags & CHILDMADE ? "" : "not "); + oodate = (gn->flags & CHILDMADE) != 0; + } else if (gn->type & (OP_FORCE | OP_EXEC | OP_PHONY)) { + /* + * A node which is the object of the force (!) operator or + * which has the .EXEC attribute is always considered + * out-of-date. + */ + if (DEBUG(MAKE)) { + if (gn->type & OP_FORCE) { + debug_printf("! operator..."); + } else if (gn->type & OP_PHONY) { + debug_printf(".PHONY node..."); + } else { + debug_printf(".EXEC node..."); + } + } + oodate = TRUE; + } else if (IsOODateRegular(gn)) { + oodate = TRUE; + } else { + /* + * When a nonexistent child with no sources + * (such as a typically used FORCE source) has been made and + * the target of the child (usually a directory) has the same + * timestamp as the timestamp just given to the nonexistent + * child after it was considered made. + */ + if (DEBUG(MAKE)) { + if (gn->flags & FORCE) + debug_printf("non existing child..."); + } + oodate = (gn->flags & FORCE) != 0; } - if (DEBUG(MAKE)) { - fprintf(debug_file, "source %smade...", gn->flags & CHILDMADE ? "" : "not "); - } - oodate = (gn->flags & CHILDMADE) ? TRUE : FALSE; - } else if (gn->type & (OP_FORCE|OP_EXEC|OP_PHONY)) { - /* - * A node which is the object of the force (!) operator or which has - * the .EXEC attribute is always considered out-of-date. - */ - if (DEBUG(MAKE)) { - if (gn->type & OP_FORCE) { - fprintf(debug_file, "! operator..."); - } else if (gn->type & OP_PHONY) { - fprintf(debug_file, ".PHONY node..."); - } else { - fprintf(debug_file, ".EXEC node..."); - } - } - oodate = TRUE; - } else if ((gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) || - (gn->cmgn == NULL && - ((gn->mtime == 0 && !(gn->type & OP_OPTIONAL)) - || gn->type & OP_DOUBLEDEP))) - { - /* - * A node whose modification time is less than that of its - * youngest child or that has no children (cmgn == NULL) and - * either doesn't exist (mtime == 0) and it isn't optional - * or was the object of a * :: operator is out-of-date. - * Why? Because that's the way Make does it. - */ - if (DEBUG(MAKE)) { - if (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) { - fprintf(debug_file, "modified before source %s...", - gn->cmgn->path); - } else if (gn->mtime == 0) { - fprintf(debug_file, "non-existent and no sources..."); - } else { - fprintf(debug_file, ":: operator and no sources..."); - } - } - oodate = TRUE; - } else { - /* - * When a non-existing child with no sources - * (such as a typically used FORCE source) has been made and - * the target of the child (usually a directory) has the same - * timestamp as the timestamp just given to the non-existing child - * after it was considered made. - */ - if (DEBUG(MAKE)) { - if (gn->flags & FORCE) - fprintf(debug_file, "non existing child..."); - } - oodate = (gn->flags & FORCE) ? TRUE : FALSE; - } #ifdef USE_META - if (useMeta) { - oodate = meta_oodate(gn, oodate); - } + if (useMeta) { + oodate = meta_oodate(gn, oodate); + } #endif - /* - * If the target isn't out-of-date, the parents need to know its - * modification time. Note that targets that appear to be out-of-date - * but aren't, because they have no commands and aren't of type OP_NOP, - * have their mtime stay below their children's mtime to keep parents from - * thinking they're out-of-date. - */ - if (!oodate) { - Lst_ForEach(gn->parents, MakeTimeStamp, gn); - } + /* + * If the target isn't out-of-date, the parents need to know its + * modification time. Note that targets that appear to be out-of-date + * but aren't, because they have no commands and are GNode_IsTarget, + * have their mtime stay below their children's mtime to keep parents + * from thinking they're out-of-date. + */ + if (!oodate) { + GNodeListNode *ln; + for (ln = gn->parents.first; ln != NULL; ln = ln->next) + GNode_UpdateYoungestChild(ln->datum, gn); + } - return (oodate); + return oodate; } - -/*- - *----------------------------------------------------------------------- - * MakeAddChild -- - * Function used by Make_Run to add a child to the list l. - * It will only add the child if its make field is FALSE. - * - * Input: - * gnp the node to add - * lp the list to which to add it - * - * Results: - * Always returns 0 - * - * Side Effects: - * The given list is extended - *----------------------------------------------------------------------- - */ -static int -MakeAddChild(void *gnp, void *lp) + +static void +PretendAllChildrenAreMade(GNode *pgn) { - GNode *gn = (GNode *)gnp; - Lst l = (Lst) lp; + GNodeListNode *ln; - if ((gn->flags & REMAKE) == 0 && !(gn->type & (OP_USE|OP_USEBEFORE))) { - if (DEBUG(MAKE)) - fprintf(debug_file, "MakeAddChild: need to examine %s%s\n", - gn->name, gn->cohort_num); - (void)Lst_EnQueue(l, gn); - } - return (0); + for (ln = pgn->children.first; ln != NULL; ln = ln->next) { + GNode *cgn = ln->datum; + + /* This may also update cgn->path. */ + Dir_UpdateMTime(cgn, FALSE); + GNode_UpdateYoungestChild(pgn, cgn); + pgn->unmade--; + } } - -/*- - *----------------------------------------------------------------------- - * MakeFindChild -- - * Function used by Make_Run to find the pathname of a child - * that was already made. + +/* + * Called by Make_Run and SuffApplyTransform on the downward pass to handle + * .USE and transformation nodes, by copying the child node's commands, type + * flags and children to the parent node. + * + * A .USE node is much like an explicit transformation rule, except its + * commands are always added to the target node, even if the target already + * has commands. * * Input: - * gnp the node to find - * - * Results: - * Always returns 0 - * - * Side Effects: - * The path and mtime of the node and the cmgn of the parent are - * updated; the unmade children count of the parent is decremented. - *----------------------------------------------------------------------- - */ -static int -MakeFindChild(void *gnp, void *pgnp) -{ - GNode *gn = (GNode *)gnp; - GNode *pgn = (GNode *)pgnp; - - (void)Dir_MTime(gn, 0); - Make_TimeStamp(pgn, gn); - pgn->unmade--; - - return (0); -} - -/*- - *----------------------------------------------------------------------- - * Make_HandleUse -- - * Function called by Make_Run and SuffApplyTransform on the downward - * pass to handle .USE and transformation nodes. It implements the - * .USE and transformation functionality by copying the node's commands, - * type flags and children to the parent node. - * - * A .USE node is much like an explicit transformation rule, except - * its commands are always added to the target node, even if the - * target already has commands. - * - * Input: - * cgn The .USE node - * pgn The target of the .USE node - * - * Results: - * none - * - * Side Effects: - * Children and commands may be added to the parent and the parent's - * type may be changed. - * - *----------------------------------------------------------------------- + * cgn The source node, which is either a .USE/.USEBEFORE + * node or a transformation node (OP_TRANSFORM). + * pgn The target node */ void Make_HandleUse(GNode *cgn, GNode *pgn) { - LstNode ln; /* An element in the children list */ + GNodeListNode *ln; /* An element in the children list */ #ifdef DEBUG_SRC - if ((cgn->type & (OP_USE|OP_USEBEFORE|OP_TRANSFORM)) == 0) { - fprintf(debug_file, "Make_HandleUse: called for plain node %s\n", cgn->name); - return; - } + if (!(cgn->type & (OP_USE | OP_USEBEFORE | OP_TRANSFORM))) { + debug_printf("Make_HandleUse: called for plain node %s\n", + cgn->name); + /* XXX: debug mode should not affect control flow */ + return; + } #endif - if ((cgn->type & (OP_USE|OP_USEBEFORE)) || Lst_IsEmpty(pgn->commands)) { - if (cgn->type & OP_USEBEFORE) { - /* - * .USEBEFORE -- - * prepend the child's commands to the parent. - */ - Lst cmds = pgn->commands; - pgn->commands = Lst_Duplicate(cgn->commands, NULL); - (void)Lst_Concat(pgn->commands, cmds, LST_CONCNEW); - Lst_Destroy(cmds, NULL); - } else { - /* - * .USE or target has no commands -- - * append the child's commands to the parent. - */ - (void)Lst_Concat(pgn->commands, cgn->commands, LST_CONCNEW); - } - } - - if (Lst_Open(cgn->children) == SUCCESS) { - while ((ln = Lst_Next(cgn->children)) != NULL) { - GNode *tgn, *gn = (GNode *)Lst_Datum(ln); - - /* - * Expand variables in the .USE node's name - * and save the unexpanded form. - * We don't need to do this for commands. - * They get expanded properly when we execute. - */ - if (gn->uname == NULL) { - gn->uname = gn->name; - } else { - if (gn->name) - free(gn->name); - } - gn->name = Var_Subst(NULL, gn->uname, pgn, FALSE); - if (gn->name && gn->uname && strcmp(gn->name, gn->uname) != 0) { - /* See if we have a target for this node. */ - tgn = Targ_FindNode(gn->name, TARG_NOCREATE); - if (tgn != NULL) - gn = tgn; - } - - (void)Lst_AtEnd(pgn->children, gn); - (void)Lst_AtEnd(gn->parents, pgn); - pgn->unmade += 1; + if ((cgn->type & (OP_USE | OP_USEBEFORE)) || + Lst_IsEmpty(&pgn->commands)) { + if (cgn->type & OP_USEBEFORE) { + /* .USEBEFORE */ + Lst_PrependAll(&pgn->commands, &cgn->commands); + } else { + /* .USE, or target has no commands */ + Lst_AppendAll(&pgn->commands, &cgn->commands); + } } - Lst_Close(cgn->children); - } - pgn->type |= cgn->type & ~(OP_OPMASK|OP_USE|OP_USEBEFORE|OP_TRANSFORM); + for (ln = cgn->children.first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + + /* + * Expand variables in the .USE node's name + * and save the unexpanded form. + * We don't need to do this for commands. + * They get expanded properly when we execute. + */ + if (gn->uname == NULL) { + gn->uname = gn->name; + } else { + free(gn->name); + } + (void)Var_Subst(gn->uname, pgn, VARE_WANTRES, &gn->name); + /* TODO: handle errors */ + if (gn->uname != NULL && strcmp(gn->name, gn->uname) != 0) { + /* See if we have a target for this node. */ + GNode *tgn = Targ_FindNode(gn->name); + if (tgn != NULL) + gn = tgn; + } + + Lst_Append(&pgn->children, gn); + Lst_Append(&gn->parents, pgn); + pgn->unmade++; + } + + pgn->type |= + cgn->type & ~(OP_OPMASK | OP_USE | OP_USEBEFORE | OP_TRANSFORM); } -/*- - *----------------------------------------------------------------------- - * MakeHandleUse -- - * Callback function for Lst_ForEach, used by Make_Run on the downward - * pass to handle .USE nodes. Should be called before the children - * are enqueued to be looked at by MakeAddChild. - * This function calls Make_HandleUse to copy the .USE node's commands, - * type flags and children to the parent node. +/* + * Used by Make_Run on the downward pass to handle .USE nodes. Should be + * called before the children are enqueued to be looked at by MakeAddChild. + * + * For a .USE child, the commands, type flags and children are copied to the + * parent node, and since the relation to the .USE node is then no longer + * needed, that relation is removed. * * Input: - * cgnp the child we've just examined - * pgnp the current parent - * - * Results: - * returns 0. - * - * Side Effects: - * After expansion, .USE child nodes are removed from the parent - * - *----------------------------------------------------------------------- + * cgn the child, which may be a .USE node + * pgn the current parent */ -static int -MakeHandleUse(void *cgnp, void *pgnp) +static void +MakeHandleUse(GNode *cgn, GNode *pgn, GNodeListNode *ln) { - GNode *cgn = (GNode *)cgnp; - GNode *pgn = (GNode *)pgnp; - LstNode ln; /* An element in the children list */ - int unmarked; + Boolean unmarked; - unmarked = ((cgn->type & OP_MARK) == 0); - cgn->type |= OP_MARK; + unmarked = !(cgn->type & OP_MARK); + cgn->type |= OP_MARK; - if ((cgn->type & (OP_USE|OP_USEBEFORE)) == 0) - return (0); + if (!(cgn->type & (OP_USE | OP_USEBEFORE))) + return; - if (unmarked) - Make_HandleUse(cgn, pgn); + if (unmarked) + Make_HandleUse(cgn, pgn); - /* - * This child node is now "made", so we decrement the count of - * unmade children in the parent... We also remove the child - * from the parent's list to accurately reflect the number of decent - * children the parent has. This is used by Make_Run to decide - * whether to queue the parent or examine its children... - */ - if ((ln = Lst_Member(pgn->children, cgn)) != NULL) { - Lst_Remove(pgn->children, ln); + /* + * This child node is now "made", so we decrement the count of + * unmade children in the parent... We also remove the child + * from the parent's list to accurately reflect the number of decent + * children the parent has. This is used by Make_Run to decide + * whether to queue the parent or examine its children... + */ + Lst_Remove(&pgn->children, ln); pgn->unmade--; - } - return (0); +} + +static void +HandleUseNodes(GNode *gn) +{ + GNodeListNode *ln, *nln; + for (ln = gn->children.first; ln != NULL; ln = nln) { + nln = ln->next; + MakeHandleUse(ln->datum, gn, ln); + } } -/*- - *----------------------------------------------------------------------- - * Make_Recheck -- - * Check the modification time of a gnode, and update it as described - * in the comments below. - * - * Results: - * returns 0 if the gnode does not exist, or its filesystem - * time if it does. - * - * Side Effects: - * the gnode's modification time and path name are affected. - * - *----------------------------------------------------------------------- +/* + * Check the modification time of a gnode, and update it if necessary. + * Return 0 if the gnode does not exist, or its filesystem time if it does. */ time_t Make_Recheck(GNode *gn) { - time_t mtime = Dir_MTime(gn, 1); + time_t mtime; + + Dir_UpdateMTime(gn, TRUE); + mtime = gn->mtime; #ifndef RECHECK - /* - * We can't re-stat the thing, but we can at least take care of rules - * where a target depends on a source that actually creates the - * target, but only if it has changed, e.g. - * - * parse.h : parse.o - * - * parse.o : parse.y - * yacc -d parse.y - * cc -c y.tab.c - * mv y.tab.o parse.o - * cmp -s y.tab.h parse.h || mv y.tab.h parse.h - * - * In this case, if the definitions produced by yacc haven't changed - * from before, parse.h won't have been updated and gn->mtime will - * reflect the current modification time for parse.h. This is - * something of a kludge, I admit, but it's a useful one.. - * XXX: People like to use a rule like - * - * FRC: - * - * To force things that depend on FRC to be made, so we have to - * check for gn->children being empty as well... - */ - if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children)) { - gn->mtime = now; - } + /* + * We can't re-stat the thing, but we can at least take care of rules + * where a target depends on a source that actually creates the + * target, but only if it has changed, e.g. + * + * parse.h : parse.o + * + * parse.o : parse.y + * yacc -d parse.y + * cc -c y.tab.c + * mv y.tab.o parse.o + * cmp -s y.tab.h parse.h || mv y.tab.h parse.h + * + * In this case, if the definitions produced by yacc haven't changed + * from before, parse.h won't have been updated and gn->mtime will + * reflect the current modification time for parse.h. This is + * something of a kludge, I admit, but it's a useful one. + * + * XXX: People like to use a rule like "FRC:" to force things that + * depend on FRC to be made, so we have to check for gn->children + * being empty as well. + */ + if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children)) { + gn->mtime = now; + } #else - /* - * This is what Make does and it's actually a good thing, as it - * allows rules like - * - * cmp -s y.tab.h parse.h || cp y.tab.h parse.h - * - * to function as intended. Unfortunately, thanks to the stateless - * nature of NFS (by which I mean the loose coupling of two clients - * using the same file from a common server), there are times - * when the modification time of a file created on a remote - * machine will not be modified before the local stat() implied by - * the Dir_MTime occurs, thus leading us to believe that the file - * is unchanged, wreaking havoc with files that depend on this one. - * - * I have decided it is better to make too much than to make too - * little, so this stuff is commented out unless you're sure it's ok. - * -- ardeb 1/12/88 - */ - /* - * Christos, 4/9/92: If we are saving commands pretend that - * the target is made now. Otherwise archives with ... rules - * don't work! - */ - if (NoExecute(gn) || (gn->type & OP_SAVE_CMDS) || + /* + * This is what Make does and it's actually a good thing, as it + * allows rules like + * + * cmp -s y.tab.h parse.h || cp y.tab.h parse.h + * + * to function as intended. Unfortunately, thanks to the stateless + * nature of NFS (by which I mean the loose coupling of two clients + * using the same file from a common server), there are times when + * the modification time of a file created on a remote machine + * will not be modified before the local stat() implied by the + * Dir_UpdateMTime occurs, thus leading us to believe that the file + * is unchanged, wreaking havoc with files that depend on this one. + * + * I have decided it is better to make too much than to make too + * little, so this stuff is commented out unless you're sure it's ok. + * -- ardeb 1/12/88 + */ + /* + * Christos, 4/9/92: If we are saving commands, pretend that + * the target is made now. Otherwise archives with '...' rules + * don't work! + */ + if (!GNode_ShouldExecute(gn) || (gn->type & OP_SAVE_CMDS) || (mtime == 0 && !(gn->type & OP_WAIT))) { - if (DEBUG(MAKE)) { - fprintf(debug_file, " recheck(%s): update time from %s to now\n", - gn->name, Targ_FmtTime(gn->mtime)); + DEBUG2(MAKE, " recheck(%s): update time from %s to now\n", + gn->name, + gn->mtime == 0 ? "nonexistent" : Targ_FmtTime(gn->mtime)); + gn->mtime = now; + } else { + DEBUG2(MAKE, " recheck(%s): current update time: %s\n", + gn->name, Targ_FmtTime(gn->mtime)); } - gn->mtime = now; - } - else { - if (DEBUG(MAKE)) { - fprintf(debug_file, " recheck(%s): current update time: %s\n", - gn->name, Targ_FmtTime(gn->mtime)); - } - } #endif - return mtime; + + /* XXX: The returned mtime may differ from gn->mtime. + * Intentionally? */ + return mtime; } -/*- - *----------------------------------------------------------------------- - * Make_Update -- - * Perform update on the parents of a node. Used by JobFinish once - * a node has been dealt with and by MakeStartJobs if it finds an - * up-to-date node. +/* + * Set the .PREFIX and .IMPSRC variables for all the implied parents + * of this node. + */ +static void +UpdateImplicitParentsVars(GNode *cgn, const char *cname) +{ + GNodeListNode *ln; + const char *cpref = GNode_VarPrefix(cgn); + + for (ln = cgn->implicitParents.first; ln != NULL; ln = ln->next) { + GNode *pgn = ln->datum; + if (pgn->flags & REMAKE) { + Var_Set(pgn, IMPSRC, cname); + if (cpref != NULL) + Var_Set(pgn, PREFIX, cpref); + } + } +} + +/* See if a .ORDER rule stops us from building this node. */ +static Boolean +IsWaitingForOrder(GNode *gn) +{ + GNodeListNode *ln; + + for (ln = gn->order_pred.first; ln != NULL; ln = ln->next) { + GNode *ogn = ln->datum; + + if (GNode_IsDone(ogn) || !(ogn->flags & REMAKE)) + continue; + + DEBUG2(MAKE, + "IsWaitingForOrder: Waiting for .ORDER node \"%s%s\"\n", + ogn->name, ogn->cohort_num); + return TRUE; + } + return FALSE; +} + +static void MakeBuildParent(GNode *, GNodeListNode *); + +static void +ScheduleOrderSuccessors(GNode *gn) +{ + GNodeListNode *toBeMadeNext = toBeMade.first; + GNodeListNode *ln; + + for (ln = gn->order_succ.first; ln != NULL; ln = ln->next) + MakeBuildParent(ln->datum, toBeMadeNext); +} + +/* + * Perform update on the parents of a node. Used by JobFinish once + * a node has been dealt with and by MakeStartJobs if it finds an + * up-to-date node. * - * Input: - * cgn the child node + * The unmade field of pgn is decremented and pgn may be placed on + * the toBeMade queue if this field becomes 0. * - * Results: - * Always returns 0 + * If the child was made, the parent's flag CHILDMADE field will be + * set true. * - * Side Effects: - * The unmade field of pgn is decremented and pgn may be placed on - * the toBeMade queue if this field becomes 0. + * If the child is not up-to-date and still does not exist, + * set the FORCE flag on the parents. * - * If the child was made, the parent's flag CHILDMADE field will be - * set true. + * If the child wasn't made, the youngestChild field of the parent will be + * altered if the child's mtime is big enough. * - * If the child is not up-to-date and still does not exist, - * set the FORCE flag on the parents. - * - * If the child wasn't made, the cmgn field of the parent will be - * altered if the child's mtime is big enough. - * - * Finally, if the child is the implied source for the parent, the - * parent's IMPSRC variable is set appropriately. - * - *----------------------------------------------------------------------- + * Finally, if the child is the implied source for the parent, the + * parent's IMPSRC variable is set appropriately. */ void Make_Update(GNode *cgn) { - GNode *pgn; /* the parent node */ - char *cname; /* the child's name */ - LstNode ln; /* Element in parents and iParents lists */ - time_t mtime = -1; - char *p1; - Lst parents; - GNode *centurion; + const char *cname; /* the child's name */ + time_t mtime = -1; + GNodeList *parents; + GNodeListNode *ln; + GNode *centurion; - /* It is save to re-examine any nodes again */ - checked++; + /* It is save to re-examine any nodes again */ + checked_seqno++; - cname = Var_Value(TARGET, cgn, &p1); - if (p1) - free(p1); + cname = GNode_VarTarget(cgn); - if (DEBUG(MAKE)) - fprintf(debug_file, "Make_Update: %s%s\n", cgn->name, cgn->cohort_num); + DEBUG2(MAKE, "Make_Update: %s%s\n", cgn->name, cgn->cohort_num); - /* - * If the child was actually made, see what its modification time is - * now -- some rules won't actually update the file. If the file still - * doesn't exist, make its mtime now. - */ - if (cgn->made != UPTODATE) { - mtime = Make_Recheck(cgn); - } + /* + * If the child was actually made, see what its modification time is + * now -- some rules won't actually update the file. If the file + * still doesn't exist, make its mtime now. + */ + if (cgn->made != UPTODATE) { + mtime = Make_Recheck(cgn); + } - /* - * If this is a `::' node, we must consult its first instance - * which is where all parents are linked. - */ - if ((centurion = cgn->centurion) != NULL) { - if (!Lst_IsEmpty(cgn->parents)) - Punt("%s%s: cohort has parents", cgn->name, cgn->cohort_num); - centurion->unmade_cohorts -= 1; - if (centurion->unmade_cohorts < 0) - Error("Graph cycles through centurion %s", centurion->name); - } else { - centurion = cgn; - } - parents = centurion->parents; + /* + * If this is a `::' node, we must consult its first instance + * which is where all parents are linked. + */ + if ((centurion = cgn->centurion) != NULL) { + if (!Lst_IsEmpty(&cgn->parents)) + Punt("%s%s: cohort has parents", cgn->name, + cgn->cohort_num); + centurion->unmade_cohorts--; + if (centurion->unmade_cohorts < 0) + Error("Graph cycles through centurion %s", + centurion->name); + } else { + centurion = cgn; + } + parents = ¢urion->parents; - /* If this was a .ORDER node, schedule the RHS */ - Lst_ForEach(centurion->order_succ, MakeBuildParent, Lst_First(toBeMade)); + /* If this was a .ORDER node, schedule the RHS */ + ScheduleOrderSuccessors(centurion); - /* Now mark all the parents as having one less unmade child */ - if (Lst_Open(parents) == SUCCESS) { - while ((ln = Lst_Next(parents)) != NULL) { - pgn = (GNode *)Lst_Datum(ln); - if (DEBUG(MAKE)) - fprintf(debug_file, "inspect parent %s%s: flags %x, " - "type %x, made %d, unmade %d ", - pgn->name, pgn->cohort_num, pgn->flags, - pgn->type, pgn->made, pgn->unmade-1); + /* Now mark all the parents as having one less unmade child */ + for (ln = parents->first; ln != NULL; ln = ln->next) { + GNode *pgn = ln->datum; - if (!(pgn->flags & REMAKE)) { - /* This parent isn't needed */ - if (DEBUG(MAKE)) - fprintf(debug_file, "- not needed\n"); - continue; - } - if (mtime == 0 && !(cgn->type & OP_WAIT)) - pgn->flags |= FORCE; + if (DEBUG(MAKE)) { + debug_printf("inspect parent %s%s: ", pgn->name, + pgn->cohort_num); + GNode_FprintDetails(opts.debug_file, "", pgn, ""); + debug_printf(", unmade %d ", pgn->unmade - 1); + } - /* - * If the parent has the .MADE attribute, its timestamp got - * updated to that of its newest child, and its unmake - * child count got set to zero in Make_ExpandUse(). - * However other things might cause us to build one of its - * children - and so we mustn't do any processing here when - * the child build finishes. - */ - if (pgn->type & OP_MADE) { - if (DEBUG(MAKE)) - fprintf(debug_file, "- .MADE\n"); - continue; - } + if (!(pgn->flags & REMAKE)) { + /* This parent isn't needed */ + DEBUG0(MAKE, "- not needed\n"); + continue; + } + if (mtime == 0 && !(cgn->type & OP_WAIT)) + pgn->flags |= FORCE; - if ( ! (cgn->type & (OP_EXEC|OP_USE|OP_USEBEFORE))) { - if (cgn->made == MADE) - pgn->flags |= CHILDMADE; - (void)Make_TimeStamp(pgn, cgn); - } + /* + * If the parent has the .MADE attribute, its timestamp got + * updated to that of its newest child, and its unmade + * child count got set to zero in Make_ExpandUse(). + * However other things might cause us to build one of its + * children - and so we mustn't do any processing here when + * the child build finishes. + */ + if (pgn->type & OP_MADE) { + DEBUG0(MAKE, "- .MADE\n"); + continue; + } - /* - * A parent must wait for the completion of all instances - * of a `::' dependency. - */ - if (centurion->unmade_cohorts != 0 || centurion->made < MADE) { - if (DEBUG(MAKE)) - fprintf(debug_file, + if (!(cgn->type & (OP_EXEC | OP_USE | OP_USEBEFORE))) { + if (cgn->made == MADE) + pgn->flags |= CHILDMADE; + GNode_UpdateYoungestChild(pgn, cgn); + } + + /* + * A parent must wait for the completion of all instances + * of a `::' dependency. + */ + if (centurion->unmade_cohorts != 0 || + !GNode_IsDone(centurion)) { + DEBUG2(MAKE, "- centurion made %d, %d unmade cohorts\n", centurion->made, centurion->unmade_cohorts); - continue; - } - - /* One more child of this parent is now made */ - pgn->unmade -= 1; - if (pgn->unmade < 0) { - if (DEBUG(MAKE)) { - fprintf(debug_file, "Graph cycles through %s%s\n", - pgn->name, pgn->cohort_num); - Targ_PrintGraph(2); + continue; + } + + /* One more child of this parent is now made */ + pgn->unmade--; + if (pgn->unmade < 0) { + if (DEBUG(MAKE)) { + debug_printf("Graph cycles through %s%s\n", + pgn->name, pgn->cohort_num); + Targ_PrintGraph(2); + } + Error("Graph cycles through %s%s", pgn->name, + pgn->cohort_num); } - Error("Graph cycles through %s%s", pgn->name, pgn->cohort_num); - } - /* We must always rescan the parents of .WAIT and .ORDER nodes. */ - if (pgn->unmade != 0 && !(centurion->type & OP_WAIT) - && !(centurion->flags & DONE_ORDER)) { - if (DEBUG(MAKE)) - fprintf(debug_file, "- unmade children\n"); - continue; - } - if (pgn->made != DEFERRED) { /* - * Either this parent is on a different branch of the tree, - * or it on the RHS of a .WAIT directive - * or it is already on the toBeMade list. + * We must always rescan the parents of .WAIT and .ORDER + * nodes. */ - if (DEBUG(MAKE)) - fprintf(debug_file, "- not deferred\n"); - continue; - } - if (pgn->order_pred - && Lst_ForEach(pgn->order_pred, MakeCheckOrder, 0)) { - /* A .ORDER rule stops us building this */ - continue; - } - if (DEBUG(MAKE)) { - static int two = 2; - fprintf(debug_file, "- %s%s made, schedule %s%s (made %d)\n", - cgn->name, cgn->cohort_num, - pgn->name, pgn->cohort_num, pgn->made); - Targ_PrintNode(pgn, &two); - } - /* Ok, we can schedule the parent again */ - pgn->made = REQUESTED; - (void)Lst_EnQueue(toBeMade, pgn); - } - Lst_Close(parents); - } + if (pgn->unmade != 0 && !(centurion->type & OP_WAIT) + && !(centurion->flags & DONE_ORDER)) { + DEBUG0(MAKE, "- unmade children\n"); + continue; + } + if (pgn->made != DEFERRED) { + /* + * Either this parent is on a different branch of + * the tree, or it on the RHS of a .WAIT directive + * or it is already on the toBeMade list. + */ + DEBUG0(MAKE, "- not deferred\n"); + continue; + } - /* - * Set the .PREFIX and .IMPSRC variables for all the implied parents - * of this node. - */ - if (Lst_Open(cgn->iParents) == SUCCESS) { - char *cpref = Var_Value(PREFIX, cgn, &p1); + if (IsWaitingForOrder(pgn)) + continue; - while ((ln = Lst_Next(cgn->iParents)) != NULL) { - pgn = (GNode *)Lst_Datum(ln); - if (pgn->flags & REMAKE) { - Var_Set(IMPSRC, cname, pgn, 0); - if (cpref != NULL) - Var_Set(PREFIX, cpref, pgn, 0); - } + if (DEBUG(MAKE)) { + debug_printf("- %s%s made, schedule %s%s (made %d)\n", + cgn->name, cgn->cohort_num, + pgn->name, pgn->cohort_num, pgn->made); + Targ_PrintNode(pgn, 2); + } + /* Ok, we can schedule the parent again */ + pgn->made = REQUESTED; + Lst_Enqueue(&toBeMade, pgn); } - if (p1) - free(p1); - Lst_Close(cgn->iParents); - } + + UpdateImplicitParentsVars(cgn, cname); } - -/*- - *----------------------------------------------------------------------- - * MakeAddAllSrc -- - * Add a child's name to the ALLSRC and OODATE variables of the given - * node. Called from Make_DoAllVar via Lst_ForEach. A child is added only - * if it has not been given the .EXEC, .USE or .INVISIBLE attributes. - * .EXEC and .USE children are very rarely going to be files, so... - * If the child is a .JOIN node, its ALLSRC is propagated to the parent. - * - * A child is added to the OODATE variable if its modification time is - * later than that of its parent, as defined by Make, except if the - * parent is a .JOIN node. In that case, it is only added to the OODATE - * variable if it was actually made (since .JOIN nodes don't have - * modification times, the comparison is rather unfair...).. - * - * Results: - * Always returns 0 - * - * Side Effects: - * The ALLSRC variable for the given node is extended. - *----------------------------------------------------------------------- - */ -static int -MakeUnmark(void *cgnp, void *pgnp MAKE_ATTR_UNUSED) -{ - GNode *cgn = (GNode *)cgnp; - cgn->type &= ~OP_MARK; - return (0); +static void +UnmarkChildren(GNode *gn) +{ + GNodeListNode *ln; + + for (ln = gn->children.first; ln != NULL; ln = ln->next) { + GNode *child = ln->datum; + child->type &= ~OP_MARK; + } } /* - * Input: - * cgnp The child to add - * pgnp The parent to whose ALLSRC variable it should - * be added + * Add a child's name to the ALLSRC and OODATE variables of the given + * node, but only if it has not been given the .EXEC, .USE or .INVISIBLE + * attributes. .EXEC and .USE children are very rarely going to be files, + * so... * + * If the child is a .JOIN node, its ALLSRC is propagated to the parent. + * + * A child is added to the OODATE variable if its modification time is + * later than that of its parent, as defined by Make, except if the + * parent is a .JOIN node. In that case, it is only added to the OODATE + * variable if it was actually made (since .JOIN nodes don't have + * modification times, the comparison is rather unfair...).. + * + * Input: + * cgn The child to add + * pgn The parent to whose ALLSRC variable it should + * be added */ -static int -MakeAddAllSrc(void *cgnp, void *pgnp) +static void +MakeAddAllSrc(GNode *cgn, GNode *pgn) { - GNode *cgn = (GNode *)cgnp; - GNode *pgn = (GNode *)pgnp; + const char *child, *allsrc; - if (cgn->type & OP_MARK) - return (0); - cgn->type |= OP_MARK; + if (cgn->type & OP_MARK) + return; + cgn->type |= OP_MARK; - if ((cgn->type & (OP_EXEC|OP_USE|OP_USEBEFORE|OP_INVISIBLE)) == 0) { - char *child, *allsrc; - char *p1 = NULL, *p2 = NULL; + if (cgn->type & (OP_EXEC | OP_USE | OP_USEBEFORE | OP_INVISIBLE)) + return; if (cgn->type & OP_ARCHV) - child = Var_Value(MEMBER, cgn, &p1); + child = GNode_VarMember(cgn); else - child = cgn->path ? cgn->path : cgn->name; - if (cgn->type & OP_JOIN) { - allsrc = Var_Value(ALLSRC, cgn, &p2); - } else { - allsrc = child; - } + child = GNode_Path(cgn); + + if (cgn->type & OP_JOIN) + allsrc = GNode_VarAllsrc(cgn); + else + allsrc = child; + if (allsrc != NULL) - Var_Append(ALLSRC, allsrc, pgn); - if (p2) - free(p2); + Var_Append(pgn, ALLSRC, allsrc); + if (pgn->type & OP_JOIN) { - if (cgn->made == MADE) { - Var_Append(OODATE, child, pgn); - } + if (cgn->made == MADE) + Var_Append(pgn, OODATE, child); + } else if ((pgn->mtime < cgn->mtime) || - (cgn->mtime >= now && cgn->made == MADE)) - { - /* - * It goes in the OODATE variable if the parent is younger than the - * child or if the child has been modified more recently than - * the start of the make. This is to keep pmake from getting - * confused if something else updates the parent after the - * make starts (shouldn't happen, I know, but sometimes it - * does). In such a case, if we've updated the kid, the parent - * is likely to have a modification time later than that of - * the kid and anything that relies on the OODATE variable will - * be hosed. - * - * XXX: This will cause all made children to go in the OODATE - * variable, even if they're not touched, if RECHECK isn't defined, - * since cgn->mtime is set to now in Make_Update. According to - * some people, this is good... - */ - Var_Append(OODATE, child, pgn); + (cgn->mtime >= now && cgn->made == MADE)) { + /* + * It goes in the OODATE variable if the parent is + * younger than the child or if the child has been + * modified more recently than the start of the make. + * This is to keep pmake from getting confused if + * something else updates the parent after the make + * starts (shouldn't happen, I know, but sometimes it + * does). In such a case, if we've updated the child, + * the parent is likely to have a modification time + * later than that of the child and anything that + * relies on the OODATE variable will be hosed. + * + * XXX: This will cause all made children to go in + * the OODATE variable, even if they're not touched, + * if RECHECK isn't defined, since cgn->mtime is set + * to now in Make_Update. According to some people, + * this is good... + */ + Var_Append(pgn, OODATE, child); } - if (p1) - free(p1); - } - return (0); } - -/*- - *----------------------------------------------------------------------- - * Make_DoAllVar -- - * Set up the ALLSRC and OODATE variables. Sad to say, it must be - * done separately, rather than while traversing the graph. This is - * because Make defined OODATE to contain all sources whose modification - * times were later than that of the target, *not* those sources that - * were out-of-date. Since in both compatibility and native modes, - * the modification time of the parent isn't found until the child - * has been dealt with, we have to wait until now to fill in the - * variable. As for ALLSRC, the ordering is important and not - * guaranteed when in native mode, so it must be set here, too. + +/* + * Set up the ALLSRC and OODATE variables. Sad to say, it must be + * done separately, rather than while traversing the graph. This is + * because Make defined OODATE to contain all sources whose modification + * times were later than that of the target, *not* those sources that + * were out-of-date. Since in both compatibility and native modes, + * the modification time of the parent isn't found until the child + * has been dealt with, we have to wait until now to fill in the + * variable. As for ALLSRC, the ordering is important and not + * guaranteed when in native mode, so it must be set here, too. * - * Results: - * None - * - * Side Effects: - * The ALLSRC and OODATE variables of the given node is filled in. - * If the node is a .JOIN node, its TARGET variable will be set to - * match its ALLSRC variable. - *----------------------------------------------------------------------- + * If the node is a .JOIN node, its TARGET variable will be set to + * match its ALLSRC variable. */ void Make_DoAllVar(GNode *gn) { - if (gn->flags & DONE_ALLSRC) - return; - - Lst_ForEach(gn->children, MakeUnmark, gn); - Lst_ForEach(gn->children, MakeAddAllSrc, gn); + GNodeListNode *ln; - if (!Var_Exists (OODATE, gn)) { - Var_Set(OODATE, "", gn, 0); - } - if (!Var_Exists (ALLSRC, gn)) { - Var_Set(ALLSRC, "", gn, 0); - } + if (gn->flags & DONE_ALLSRC) + return; - if (gn->type & OP_JOIN) { - char *p1; - Var_Set(TARGET, Var_Value(ALLSRC, gn, &p1), gn, 0); - if (p1) - free(p1); - } - gn->flags |= DONE_ALLSRC; -} - -/*- - *----------------------------------------------------------------------- - * MakeStartJobs -- - * Start as many jobs as possible. - * - * Results: - * If the query flag was given to pmake, no job will be started, - * but as soon as an out-of-date target is found, this function - * returns TRUE. At all other times, this function returns FALSE. - * - * Side Effects: - * Nodes are removed from the toBeMade queue and job table slots - * are filled. - * - *----------------------------------------------------------------------- - */ + UnmarkChildren(gn); + for (ln = gn->children.first; ln != NULL; ln = ln->next) + MakeAddAllSrc(ln->datum, gn); -static int -MakeCheckOrder(void *v_bn, void *ignore MAKE_ATTR_UNUSED) -{ - GNode *bn = v_bn; + if (!Var_Exists(gn, OODATE)) + Var_Set(gn, OODATE, ""); + if (!Var_Exists(gn, ALLSRC)) + Var_Set(gn, ALLSRC, ""); - if (bn->made >= MADE || !(bn->flags & REMAKE)) - return 0; - if (DEBUG(MAKE)) - fprintf(debug_file, "MakeCheckOrder: Waiting for .ORDER node %s%s\n", - bn->name, bn->cohort_num); - return 1; -} - -static int -MakeBuildChild(void *v_cn, void *toBeMade_next) -{ - GNode *cn = v_cn; - - if (DEBUG(MAKE)) - fprintf(debug_file, "MakeBuildChild: inspect %s%s, made %d, type %x\n", - cn->name, cn->cohort_num, cn->made, cn->type); - if (cn->made > DEFERRED) - return 0; - - /* If this node is on the RHS of a .ORDER, check LHSs. */ - if (cn->order_pred && Lst_ForEach(cn->order_pred, MakeCheckOrder, 0)) { - /* Can't build this (or anything else in this child list) yet */ - cn->made = DEFERRED; - return 0; /* but keep looking */ - } - - if (DEBUG(MAKE)) - fprintf(debug_file, "MakeBuildChild: schedule %s%s\n", - cn->name, cn->cohort_num); - - cn->made = REQUESTED; - if (toBeMade_next == NULL) - Lst_AtEnd(toBeMade, cn); - else - Lst_InsertBefore(toBeMade, toBeMade_next, cn); - - if (cn->unmade_cohorts != 0) - Lst_ForEach(cn->cohorts, MakeBuildChild, toBeMade_next); - - /* - * If this node is a .WAIT node with unmade chlidren - * then don't add the next sibling. - */ - return cn->type & OP_WAIT && cn->unmade > 0; -} - -/* When a .ORDER LHS node completes we do this on each RHS */ -static int -MakeBuildParent(void *v_pn, void *toBeMade_next) -{ - GNode *pn = v_pn; - - if (pn->made != DEFERRED) - return 0; - - if (MakeBuildChild(pn, toBeMade_next) == 0) { - /* Mark so that when this node is built we reschedule its parents */ - pn->flags |= DONE_ORDER; - } - - return 0; + if (gn->type & OP_JOIN) + Var_Set(gn, TARGET, GNode_VarAllsrc(gn)); + gn->flags |= DONE_ALLSRC; } static Boolean -MakeStartJobs(void) +MakeBuildChild(GNode *cn, GNodeListNode *toBeMadeNext) { - GNode *gn; - int have_token = 0; - while (!Lst_IsEmpty (toBeMade)) { - /* Get token now to avoid cycling job-list when we only have 1 token */ - if (!have_token && !Job_TokenWithdraw()) - break; - have_token = 1; + if (DEBUG(MAKE)) { + debug_printf("MakeBuildChild: inspect %s%s, ", + cn->name, cn->cohort_num); + GNode_FprintDetails(opts.debug_file, "", cn, "\n"); + } + if (GNode_IsReady(cn)) + return FALSE; - gn = (GNode *)Lst_DeQueue(toBeMade); - if (DEBUG(MAKE)) - fprintf(debug_file, "Examining %s%s...\n", - gn->name, gn->cohort_num); - - if (gn->made != REQUESTED) { - if (DEBUG(MAKE)) - fprintf(debug_file, "state %d\n", gn->made); - - make_abort(gn, __LINE__); + /* If this node is on the RHS of a .ORDER, check LHSs. */ + if (IsWaitingForOrder(cn)) { + /* Can't build this (or anything else in this child list) yet */ + cn->made = DEFERRED; + return FALSE; /* but keep looking */ } - if (gn->checked == checked) { - /* We've already looked at this node since a job finished... */ - if (DEBUG(MAKE)) - fprintf(debug_file, "already checked %s%s\n", - gn->name, gn->cohort_num); - gn->made = DEFERRED; - continue; - } - gn->checked = checked; + DEBUG2(MAKE, "MakeBuildChild: schedule %s%s\n", + cn->name, cn->cohort_num); - if (gn->unmade != 0) { - /* - * We can't build this yet, add all unmade children to toBeMade, - * just before the current first element. - */ - gn->made = DEFERRED; - Lst_ForEach(gn->children, MakeBuildChild, Lst_First(toBeMade)); - /* and drop this node on the floor */ - if (DEBUG(MAKE)) - fprintf(debug_file, "dropped %s%s\n", gn->name, gn->cohort_num); - continue; - } + cn->made = REQUESTED; + if (toBeMadeNext == NULL) + Lst_Append(&toBeMade, cn); + else + Lst_InsertBefore(&toBeMade, toBeMadeNext, cn); - gn->made = BEINGMADE; - if (Make_OODate(gn)) { - if (DEBUG(MAKE)) { - fprintf(debug_file, "out-of-date\n"); - } - if (queryFlag) { - return (TRUE); - } - Make_DoAllVar(gn); - Job_Make(gn); - have_token = 0; - } else { - if (DEBUG(MAKE)) { - fprintf(debug_file, "up-to-date\n"); - } - gn->made = UPTODATE; - if (gn->type & OP_JOIN) { - /* - * Even for an up-to-date .JOIN node, we need it to have its - * context variables so references to it get the correct - * value for .TARGET when building up the context variables - * of its parent(s)... - */ - Make_DoAllVar(gn); - } - Make_Update(gn); - } - } + if (cn->unmade_cohorts != 0) { + ListNode *ln; - if (have_token) - Job_TokenReturn(); - - return (FALSE); -} - -/*- - *----------------------------------------------------------------------- - * MakePrintStatus -- - * Print the status of a top-level node, viz. it being up-to-date - * already or not created due to an error in a lower level. - * Callback function for Make_Run via Lst_ForEach. - * - * Input: - * gnp Node to examine - * cyclep True if gn->unmade being non-zero implies a - * cycle in the graph, not an error in an - * inferior. - * - * Results: - * Always returns 0. - * - * Side Effects: - * A message may be printed. - * - *----------------------------------------------------------------------- - */ -static int -MakePrintStatusOrder(void *ognp, void *gnp) -{ - GNode *ogn = ognp; - GNode *gn = gnp; - - if (!(ogn->flags & REMAKE) || ogn->made > REQUESTED) - /* not waiting for this one */ - return 0; - - printf(" `%s%s' has .ORDER dependency against %s%s " - "(made %d, flags %x, type %x)\n", - gn->name, gn->cohort_num, - ogn->name, ogn->cohort_num, ogn->made, ogn->flags, ogn->type); - if (DEBUG(MAKE) && debug_file != stdout) - fprintf(debug_file, " `%s%s' has .ORDER dependency against %s%s " - "(made %d, flags %x, type %x)\n", - gn->name, gn->cohort_num, - ogn->name, ogn->cohort_num, ogn->made, ogn->flags, ogn->type); - return 0; -} - -static int -MakePrintStatus(void *gnp, void *v_errors) -{ - GNode *gn = (GNode *)gnp; - int *errors = v_errors; - - if (gn->flags & DONECYCLE) - /* We've completely processed this node before, don't do it again. */ - return 0; - - if (gn->unmade == 0) { - gn->flags |= DONECYCLE; - switch (gn->made) { - case UPTODATE: - printf("`%s%s' is up to date.\n", gn->name, gn->cohort_num); - break; - case MADE: - break; - case UNMADE: - case DEFERRED: - case REQUESTED: - case BEINGMADE: - (*errors)++; - printf("`%s%s' was not built (made %d, flags %x, type %x)!\n", - gn->name, gn->cohort_num, gn->made, gn->flags, gn->type); - if (DEBUG(MAKE) && debug_file != stdout) - fprintf(debug_file, - "`%s%s' was not built (made %d, flags %x, type %x)!\n", - gn->name, gn->cohort_num, gn->made, gn->flags, gn->type); - /* Most likely problem is actually caused by .ORDER */ - Lst_ForEach(gn->order_pred, MakePrintStatusOrder, gn); - break; - default: - /* Errors - already counted */ - printf("`%s%s' not remade because of errors.\n", - gn->name, gn->cohort_num); - if (DEBUG(MAKE) && debug_file != stdout) - fprintf(debug_file, "`%s%s' not remade because of errors.\n", - gn->name, gn->cohort_num); - break; - } - return 0; - } - - if (DEBUG(MAKE)) - fprintf(debug_file, "MakePrintStatus: %s%s has %d unmade children\n", - gn->name, gn->cohort_num, gn->unmade); - /* - * If printing cycles and came to one that has unmade children, - * print out the cycle by recursing on its children. - */ - if (!(gn->flags & CYCLE)) { - /* Fist time we've seen this node, check all children */ - gn->flags |= CYCLE; - Lst_ForEach(gn->children, MakePrintStatus, errors); - /* Mark that this node needn't be processed again */ - gn->flags |= DONECYCLE; - return 0; - } - - /* Only output the error once per node */ - gn->flags |= DONECYCLE; - Error("Graph cycles through `%s%s'", gn->name, gn->cohort_num); - if ((*errors)++ > 100) - /* Abandon the whole error report */ - return 1; - - /* Reporting for our children will give the rest of the loop */ - Lst_ForEach(gn->children, MakePrintStatus, errors); - return 0; -} - - -/*- - *----------------------------------------------------------------------- - * Make_ExpandUse -- - * Expand .USE nodes and create a new targets list - * - * Input: - * targs the initial list of targets - * - * Side Effects: - *----------------------------------------------------------------------- - */ -void -Make_ExpandUse(Lst targs) -{ - GNode *gn; /* a temporary pointer */ - Lst examine; /* List of targets to examine */ - - examine = Lst_Duplicate(targs, NULL); - - /* - * Make an initial downward pass over the graph, marking nodes to be made - * as we go down. We call Suff_FindDeps to find where a node is and - * to get some children for it if it has none and also has no commands. - * If the node is a leaf, we stick it on the toBeMade queue to - * be looked at in a minute, otherwise we add its children to our queue - * and go on about our business. - */ - while (!Lst_IsEmpty (examine)) { - gn = (GNode *)Lst_DeQueue(examine); - - if (gn->flags & REMAKE) - /* We've looked at this one already */ - continue; - gn->flags |= REMAKE; - if (DEBUG(MAKE)) - fprintf(debug_file, "Make_ExpandUse: examine %s%s\n", - gn->name, gn->cohort_num); - - if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts)) { - /* Append all the 'cohorts' to the list of things to examine */ - Lst new; - new = Lst_Duplicate(gn->cohorts, NULL); - Lst_Concat(new, examine, LST_CONCLINK); - examine = new; + for (ln = cn->cohorts.first; ln != NULL; ln = ln->next) + if (MakeBuildChild(ln->datum, toBeMadeNext)) + break; } /* - * Apply any .USE rules before looking for implicit dependencies - * to make sure everything has commands that should... - * Make sure that the TARGET is set, so that we can make - * expansions. + * If this node is a .WAIT node with unmade children + * then don't add the next sibling. */ - if (gn->type & OP_ARCHV) { - char *eoa, *eon; - eoa = strchr(gn->name, '('); - eon = strchr(gn->name, ')'); - if (eoa == NULL || eon == NULL) - continue; - *eoa = '\0'; - *eon = '\0'; - Var_Set(MEMBER, eoa + 1, gn, 0); - Var_Set(ARCHIVE, gn->name, gn, 0); - *eoa = '('; - *eon = ')'; - } - - (void)Dir_MTime(gn, 0); - Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0); - Lst_ForEach(gn->children, MakeUnmark, gn); - Lst_ForEach(gn->children, MakeHandleUse, gn); - - if ((gn->type & OP_MADE) == 0) - Suff_FindDeps(gn); - else { - /* Pretend we made all this node's children */ - Lst_ForEach(gn->children, MakeFindChild, gn); - if (gn->unmade != 0) - printf("Warning: %s%s still has %d unmade children\n", - gn->name, gn->cohort_num, gn->unmade); - } - - if (gn->unmade != 0) - Lst_ForEach(gn->children, MakeAddChild, examine); - } - - Lst_Destroy(examine, NULL); + return cn->type & OP_WAIT && cn->unmade > 0; } -/*- - *----------------------------------------------------------------------- - * Make_ProcessWait -- - * Convert .WAIT nodes into dependencies - * - * Input: - * targs the initial list of targets - * - *----------------------------------------------------------------------- - */ - -static int -link_parent(void *cnp, void *pnp) +/* When a .ORDER LHS node completes, we do this on each RHS. */ +static void +MakeBuildParent(GNode *pn, GNodeListNode *toBeMadeNext) { - GNode *cn = cnp; - GNode *pn = pnp; + if (pn->made != DEFERRED) + return; - Lst_AtEnd(pn->children, cn); - Lst_AtEnd(cn->parents, pn); - pn->unmade++; - return 0; -} - -static int -add_wait_dep(void *v_cn, void *v_wn) -{ - GNode *cn = v_cn; - GNode *wn = v_wn; - - if (cn == wn) - return 1; - - if (cn == NULL || wn == NULL) { - printf("bad wait dep %p %p\n", cn, wn); - exit(4); - } - if (DEBUG(MAKE)) - fprintf(debug_file, ".WAIT: add dependency %s%s -> %s\n", - cn->name, cn->cohort_num, wn->name); - - Lst_AtEnd(wn->children, cn); - wn->unmade++; - Lst_AtEnd(cn->parents, wn); - return 0; + if (!MakeBuildChild(pn, toBeMadeNext)) { + /* When this node is built, reschedule its parents. */ + pn->flags |= DONE_ORDER; + } } static void -Make_ProcessWait(Lst targs) +MakeChildren(GNode *gn) { - GNode *pgn; /* 'parent' node we are examining */ - GNode *cgn; /* Each child in turn */ - LstNode owln; /* Previous .WAIT node */ - Lst examine; /* List of targets to examine */ - LstNode ln; + GNodeListNode *toBeMadeNext = toBeMade.first; + GNodeListNode *ln; - /* - * We need all the nodes to have a common parent in order for the - * .WAIT and .ORDER scheduling to work. - * Perhaps this should be done earlier... - */ - - pgn = Targ_NewGN(".MAIN"); - pgn->flags = REMAKE; - pgn->type = OP_PHONY | OP_DEPENDS; - /* Get it displayed in the diag dumps */ - Lst_AtFront(Targ_List(), pgn); - - Lst_ForEach(targs, link_parent, pgn); - - /* Start building with the 'dummy' .MAIN' node */ - MakeBuildChild(pgn, NULL); - - examine = Lst_Init(FALSE); - Lst_AtEnd(examine, pgn); - - while (!Lst_IsEmpty (examine)) { - pgn = Lst_DeQueue(examine); - - /* We only want to process each child-list once */ - if (pgn->flags & DONE_WAIT) - continue; - pgn->flags |= DONE_WAIT; - if (DEBUG(MAKE)) - fprintf(debug_file, "Make_ProcessWait: examine %s\n", pgn->name); - - if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (pgn->cohorts)) { - /* Append all the 'cohorts' to the list of things to examine */ - Lst new; - new = Lst_Duplicate(pgn->cohorts, NULL); - Lst_Concat(new, examine, LST_CONCLINK); - examine = new; - } - - owln = Lst_First(pgn->children); - Lst_Open(pgn->children); - for (; (ln = Lst_Next(pgn->children)) != NULL; ) { - cgn = Lst_Datum(ln); - if (cgn->type & OP_WAIT) { - /* Make the .WAIT node depend on the previous children */ - Lst_ForEachFrom(pgn->children, owln, add_wait_dep, cgn); - owln = ln; - } else { - Lst_AtEnd(examine, cgn); - } - } - Lst_Close(pgn->children); - } - - Lst_Destroy(examine, NULL); + for (ln = gn->children.first; ln != NULL; ln = ln->next) + if (MakeBuildChild(ln->datum, toBeMadeNext)) + break; } -/*- - *----------------------------------------------------------------------- - * Make_Run -- - * Initialize the nodes to remake and the list of nodes which are - * ready to be made by doing a breadth-first traversal of the graph - * starting from the nodes in the given list. Once this traversal - * is finished, all the 'leaves' of the graph are in the toBeMade - * queue. - * Using this queue and the Job module, work back up the graph, - * calling on MakeStartJobs to keep the job table as full as - * possible. +/* + * Start as many jobs as possible, taking them from the toBeMade queue. + * + * If the -q option was given, no job will be started, + * but as soon as an out-of-date target is found, this function + * returns TRUE. In all other cases, this function returns FALSE. + */ +static Boolean +MakeStartJobs(void) +{ + GNode *gn; + Boolean have_token = FALSE; + + while (!Lst_IsEmpty(&toBeMade)) { + /* + * Get token now to avoid cycling job-list when we only + * have 1 token + */ + if (!have_token && !Job_TokenWithdraw()) + break; + have_token = TRUE; + + gn = Lst_Dequeue(&toBeMade); + DEBUG2(MAKE, "Examining %s%s...\n", gn->name, gn->cohort_num); + + if (gn->made != REQUESTED) { + /* + * XXX: Replace %d with string representation; + * see made_name. + */ + DEBUG1(MAKE, "state %d\n", gn->made); + + make_abort(gn, __LINE__); + } + + if (gn->checked_seqno == checked_seqno) { + /* + * We've already looked at this node since a job + * finished... + */ + DEBUG2(MAKE, "already checked %s%s\n", gn->name, + gn->cohort_num); + gn->made = DEFERRED; + continue; + } + gn->checked_seqno = checked_seqno; + + if (gn->unmade != 0) { + /* + * We can't build this yet, add all unmade children + * to toBeMade, just before the current first element. + */ + gn->made = DEFERRED; + + MakeChildren(gn); + + /* and drop this node on the floor */ + DEBUG2(MAKE, "dropped %s%s\n", gn->name, + gn->cohort_num); + continue; + } + + gn->made = BEINGMADE; + if (GNode_IsOODate(gn)) { + DEBUG0(MAKE, "out-of-date\n"); + if (opts.queryFlag) + return TRUE; + Make_DoAllVar(gn); + Job_Make(gn); + have_token = FALSE; + } else { + DEBUG0(MAKE, "up-to-date\n"); + gn->made = UPTODATE; + if (gn->type & OP_JOIN) { + /* + * Even for an up-to-date .JOIN node, we + * need it to have its local variables so + * references to it get the correct value + * for .TARGET when building up the local + * variables of its parent(s)... + */ + Make_DoAllVar(gn); + } + Make_Update(gn); + } + } + + if (have_token) + Job_TokenReturn(); + + return FALSE; +} + +/* Print the status of a .ORDER node. */ +static void +MakePrintStatusOrderNode(GNode *ogn, GNode *gn) +{ + if (!GNode_IsWaitingFor(ogn)) + return; + + printf(" `%s%s' has .ORDER dependency against %s%s ", + gn->name, gn->cohort_num, ogn->name, ogn->cohort_num); + GNode_FprintDetails(stdout, "(", ogn, ")\n"); + + if (DEBUG(MAKE) && opts.debug_file != stdout) { + debug_printf(" `%s%s' has .ORDER dependency against %s%s ", + gn->name, gn->cohort_num, ogn->name, ogn->cohort_num); + GNode_FprintDetails(opts.debug_file, "(", ogn, ")\n"); + } +} + +static void +MakePrintStatusOrder(GNode *gn) +{ + GNodeListNode *ln; + for (ln = gn->order_pred.first; ln != NULL; ln = ln->next) + MakePrintStatusOrderNode(ln->datum, gn); +} + +static void MakePrintStatusList(GNodeList *, int *); + +/* + * Print the status of a top-level node, viz. it being up-to-date already + * or not created due to an error in a lower level. + */ +static Boolean +MakePrintStatus(GNode *gn, int *errors) +{ + if (gn->flags & DONECYCLE) { + /* + * We've completely processed this node before, don't do + * it again. + */ + return FALSE; + } + + if (gn->unmade == 0) { + gn->flags |= DONECYCLE; + switch (gn->made) { + case UPTODATE: + printf("`%s%s' is up to date.\n", gn->name, + gn->cohort_num); + break; + case MADE: + break; + case UNMADE: + case DEFERRED: + case REQUESTED: + case BEINGMADE: + (*errors)++; + printf("`%s%s' was not built", gn->name, + gn->cohort_num); + GNode_FprintDetails(stdout, " (", gn, ")!\n"); + if (DEBUG(MAKE) && opts.debug_file != stdout) { + debug_printf("`%s%s' was not built", gn->name, + gn->cohort_num); + GNode_FprintDetails(opts.debug_file, " (", gn, + ")!\n"); + } + /* Most likely problem is actually caused by .ORDER */ + MakePrintStatusOrder(gn); + break; + default: + /* Errors - already counted */ + printf("`%s%s' not remade because of errors.\n", + gn->name, gn->cohort_num); + if (DEBUG(MAKE) && opts.debug_file != stdout) + debug_printf( + "`%s%s' not remade because of errors.\n", + gn->name, gn->cohort_num); + break; + } + return FALSE; + } + + DEBUG3(MAKE, "MakePrintStatus: %s%s has %d unmade children\n", + gn->name, gn->cohort_num, gn->unmade); + /* + * If printing cycles and came to one that has unmade children, + * print out the cycle by recursing on its children. + */ + if (!(gn->flags & CYCLE)) { + /* First time we've seen this node, check all children */ + gn->flags |= CYCLE; + MakePrintStatusList(&gn->children, errors); + /* Mark that this node needn't be processed again */ + gn->flags |= DONECYCLE; + return FALSE; + } + + /* Only output the error once per node */ + gn->flags |= DONECYCLE; + Error("Graph cycles through `%s%s'", gn->name, gn->cohort_num); + if ((*errors)++ > 100) + /* Abandon the whole error report */ + return TRUE; + + /* Reporting for our children will give the rest of the loop */ + MakePrintStatusList(&gn->children, errors); + return FALSE; +} + +static void +MakePrintStatusList(GNodeList *gnodes, int *errors) +{ + GNodeListNode *ln; + + for (ln = gnodes->first; ln != NULL; ln = ln->next) + if (MakePrintStatus(ln->datum, errors)) + break; +} + +static void +ExamineLater(GNodeList *examine, GNodeList *toBeExamined) +{ + ListNode *ln; + + for (ln = toBeExamined->first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + + if (gn->flags & REMAKE) + continue; + if (gn->type & (OP_USE | OP_USEBEFORE)) + continue; + + DEBUG2(MAKE, "ExamineLater: need to examine \"%s%s\"\n", + gn->name, gn->cohort_num); + Lst_Enqueue(examine, gn); + } +} + +/* + * Expand .USE nodes and create a new targets list. + * + * Input: + * targs the initial list of targets + */ +void +Make_ExpandUse(GNodeList *targs) +{ + GNodeList examine = LST_INIT; /* Queue of targets to examine */ + Lst_AppendAll(&examine, targs); + + /* + * Make an initial downward pass over the graph, marking nodes to + * be made as we go down. + * + * We call Suff_FindDeps to find where a node is and to get some + * children for it if it has none and also has no commands. If the + * node is a leaf, we stick it on the toBeMade queue to be looked + * at in a minute, otherwise we add its children to our queue and + * go on about our business. + */ + while (!Lst_IsEmpty(&examine)) { + GNode *gn = Lst_Dequeue(&examine); + + if (gn->flags & REMAKE) + /* We've looked at this one already */ + continue; + gn->flags |= REMAKE; + DEBUG2(MAKE, "Make_ExpandUse: examine %s%s\n", + gn->name, gn->cohort_num); + + if (gn->type & OP_DOUBLEDEP) + Lst_PrependAll(&examine, &gn->cohorts); + + /* + * Apply any .USE rules before looking for implicit + * dependencies to make sure everything has commands that + * should. + * + * Make sure that the TARGET is set, so that we can make + * expansions. + */ + if (gn->type & OP_ARCHV) { + char *eoa = strchr(gn->name, '('); + char *eon = strchr(gn->name, ')'); + if (eoa == NULL || eon == NULL) + continue; + *eoa = '\0'; + *eon = '\0'; + Var_Set(gn, MEMBER, eoa + 1); + Var_Set(gn, ARCHIVE, gn->name); + *eoa = '('; + *eon = ')'; + } + + Dir_UpdateMTime(gn, FALSE); + Var_Set(gn, TARGET, GNode_Path(gn)); + UnmarkChildren(gn); + HandleUseNodes(gn); + + if (!(gn->type & OP_MADE)) + Suff_FindDeps(gn); + else { + PretendAllChildrenAreMade(gn); + if (gn->unmade != 0) { + printf( + "Warning: " + "%s%s still has %d unmade children\n", + gn->name, gn->cohort_num, gn->unmade); + } + } + + if (gn->unmade != 0) + ExamineLater(&examine, &gn->children); + } + + Lst_Done(&examine); +} + +/* Make the .WAIT node depend on the previous children */ +static void +add_wait_dependency(GNodeListNode *owln, GNode *wn) +{ + GNodeListNode *cln; + GNode *cn; + + for (cln = owln; (cn = cln->datum) != wn; cln = cln->next) { + DEBUG3(MAKE, ".WAIT: add dependency %s%s -> %s\n", + cn->name, cn->cohort_num, wn->name); + + /* XXX: This pattern should be factored out, it repeats often */ + Lst_Append(&wn->children, cn); + wn->unmade++; + Lst_Append(&cn->parents, wn); + } +} + +/* Convert .WAIT nodes into dependencies. */ +static void +Make_ProcessWait(GNodeList *targs) +{ + GNode *pgn; /* 'parent' node we are examining */ + GNodeListNode *owln; /* Previous .WAIT node */ + GNodeList examine; /* List of targets to examine */ + + /* + * We need all the nodes to have a common parent in order for the + * .WAIT and .ORDER scheduling to work. + * Perhaps this should be done earlier... + */ + + pgn = GNode_New(".MAIN"); + pgn->flags = REMAKE; + pgn->type = OP_PHONY | OP_DEPENDS; + /* Get it displayed in the diag dumps */ + Lst_Prepend(Targ_List(), pgn); + + { + GNodeListNode *ln; + for (ln = targs->first; ln != NULL; ln = ln->next) { + GNode *cgn = ln->datum; + + Lst_Append(&pgn->children, cgn); + Lst_Append(&cgn->parents, pgn); + pgn->unmade++; + } + } + + /* Start building with the 'dummy' .MAIN' node */ + MakeBuildChild(pgn, NULL); + + Lst_Init(&examine); + Lst_Append(&examine, pgn); + + while (!Lst_IsEmpty(&examine)) { + GNodeListNode *ln; + + pgn = Lst_Dequeue(&examine); + + /* We only want to process each child-list once */ + if (pgn->flags & DONE_WAIT) + continue; + pgn->flags |= DONE_WAIT; + DEBUG1(MAKE, "Make_ProcessWait: examine %s\n", pgn->name); + + if (pgn->type & OP_DOUBLEDEP) + Lst_PrependAll(&examine, &pgn->cohorts); + + owln = pgn->children.first; + for (ln = pgn->children.first; ln != NULL; ln = ln->next) { + GNode *cgn = ln->datum; + if (cgn->type & OP_WAIT) { + add_wait_dependency(owln, cgn); + owln = ln; + } else { + Lst_Append(&examine, cgn); + } + } + } + + Lst_Done(&examine); +} + +/* + * Initialize the nodes to remake and the list of nodes which are ready to + * be made by doing a breadth-first traversal of the graph starting from the + * nodes in the given list. Once this traversal is finished, all the 'leaves' + * of the graph are in the toBeMade queue. + * + * Using this queue and the Job module, work back up the graph, calling on + * MakeStartJobs to keep the job table as full as possible. * * Input: * targs the initial list of targets @@ -1491,71 +1370,70 @@ Make_ProcessWait(Lst targs) * The make field of all nodes involved in the creation of the given * targets is set to 1. The toBeMade list is set to contain all the * 'leaves' of these subgraphs. - *----------------------------------------------------------------------- */ Boolean -Make_Run(Lst targs) +Make_Run(GNodeList *targs) { - int errors; /* Number of errors the Job module reports */ + int errors; /* Number of errors the Job module reports */ - /* Start trying to make the current targets... */ - toBeMade = Lst_Init(FALSE); + /* Start trying to make the current targets... */ + Lst_Init(&toBeMade); - Make_ExpandUse(targs); - Make_ProcessWait(targs); + Make_ExpandUse(targs); + Make_ProcessWait(targs); - if (DEBUG(MAKE)) { - fprintf(debug_file, "#***# full graph\n"); - Targ_PrintGraph(1); - } - - if (queryFlag) { - /* - * We wouldn't do any work unless we could start some jobs in the - * next loop... (we won't actually start any, of course, this is just - * to see if any of the targets was out of date) - */ - return (MakeStartJobs()); - } - /* - * Initialization. At the moment, no jobs are running and until some - * get started, nothing will happen since the remaining upward - * traversal of the graph is performed by the routines in job.c upon - * the finishing of a job. So we fill the Job table as much as we can - * before going into our loop. - */ - (void)MakeStartJobs(); - - /* - * Main Loop: The idea here is that the ending of jobs will take - * care of the maintenance of data structures and the waiting for output - * will cause us to be idle most of the time while our children run as - * much as possible. Because the job table is kept as full as possible, - * the only time when it will be empty is when all the jobs which need - * running have been run, so that is the end condition of this loop. - * Note that the Job module will exit if there were any errors unless the - * keepgoing flag was given. - */ - while (!Lst_IsEmpty(toBeMade) || jobTokensRunning > 0) { - Job_CatchOutput(); - (void)MakeStartJobs(); - } - - errors = Job_Finish(); - - /* - * Print the final status of each target. E.g. if it wasn't made - * because some inferior reported an error. - */ - if (DEBUG(MAKE)) - fprintf(debug_file, "done: errors %d\n", errors); - if (errors == 0) { - Lst_ForEach(targs, MakePrintStatus, &errors); if (DEBUG(MAKE)) { - fprintf(debug_file, "done: errors %d\n", errors); - if (errors) - Targ_PrintGraph(4); + debug_printf("#***# full graph\n"); + Targ_PrintGraph(1); } - } - return errors != 0; + + if (opts.queryFlag) { + /* + * We wouldn't do any work unless we could start some jobs + * in the next loop... (we won't actually start any, of + * course, this is just to see if any of the targets was out + * of date) + */ + return MakeStartJobs(); + } + /* + * Initialization. At the moment, no jobs are running and until some + * get started, nothing will happen since the remaining upward + * traversal of the graph is performed by the routines in job.c upon + * the finishing of a job. So we fill the Job table as much as we can + * before going into our loop. + */ + (void)MakeStartJobs(); + + /* + * Main Loop: The idea here is that the ending of jobs will take + * care of the maintenance of data structures and the waiting for + * output will cause us to be idle most of the time while our + * children run as much as possible. Because the job table is kept + * as full as possible, the only time when it will be empty is when + * all the jobs which need running have been run, so that is the end + * condition of this loop. Note that the Job module will exit if + * there were any errors unless the keepgoing flag was given. + */ + while (!Lst_IsEmpty(&toBeMade) || jobTokensRunning > 0) { + Job_CatchOutput(); + (void)MakeStartJobs(); + } + + errors = Job_Finish(); + + /* + * Print the final status of each target. E.g. if it wasn't made + * because some inferior reported an error. + */ + DEBUG1(MAKE, "done: errors %d\n", errors); + if (errors == 0) { + MakePrintStatusList(targs, &errors); + if (DEBUG(MAKE)) { + debug_printf("done: errors %d\n", errors); + if (errors > 0) + Targ_PrintGraph(4); + } + } + return errors > 0; } diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index f162ef670..646673778 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.96 2015/09/21 21:50:16 pooka Exp $ */ +/* $NetBSD: make.h,v 1.256 2021/02/05 19:19:17 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -72,18 +72,22 @@ * from: @(#)make.h 8.3 (Berkeley) 6/13/95 */ -/*- +/* * make.h -- * The global definitions for pmake */ -#ifndef _MAKE_H_ -#define _MAKE_H_ +#ifndef MAKE_MAKE_H +#define MAKE_MAKE_H #include #include +#include +#include #include +#include +#include #include #include #include @@ -93,26 +97,30 @@ # include #endif +#ifndef FD_CLOEXEC +#define FD_CLOEXEC 1 +#endif + #if defined(__GNUC__) -#define MAKE_GNUC_PREREQ(x, y) \ +#define MAKE_GNUC_PREREQ(x, y) \ ((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || \ (__GNUC__ > (x))) #else /* defined(__GNUC__) */ -#define MAKE_GNUC_PREREQ(x, y) 0 +#define MAKE_GNUC_PREREQ(x, y) 0 #endif /* defined(__GNUC__) */ #if MAKE_GNUC_PREREQ(2, 7) -#define MAKE_ATTR_UNUSED __attribute__((__unused__)) +#define MAKE_ATTR_UNUSED __attribute__((__unused__)) #else -#define MAKE_ATTR_UNUSED /* delete */ +#define MAKE_ATTR_UNUSED /* delete */ #endif #if MAKE_GNUC_PREREQ(2, 5) -#define MAKE_ATTR_DEAD __attribute__((__noreturn__)) +#define MAKE_ATTR_DEAD __attribute__((__noreturn__)) #elif defined(__GNUC__) -#define MAKE_ATTR_DEAD __volatile +#define MAKE_ATTR_DEAD __volatile #else -#define MAKE_ATTR_DEAD /* delete */ +#define MAKE_ATTR_DEAD /* delete */ #endif #if MAKE_GNUC_PREREQ(2, 7) @@ -122,371 +130,643 @@ #define MAKE_ATTR_PRINTFLIKE(fmtarg, firstvararg) /* delete */ #endif -#include "sprite.h" +#define MAKE_INLINE static inline MAKE_ATTR_UNUSED + +/* + * A boolean type is defined as an integer, not an enum, for historic reasons. + * The only allowed values are the constants TRUE and FALSE (1 and 0). + */ +#if defined(lint) || defined(USE_C99_BOOLEAN) +#include +typedef bool Boolean; +#define FALSE false +#define TRUE true +#elif defined(USE_DOUBLE_BOOLEAN) +/* During development, to find type mismatches in function declarations. */ +typedef double Boolean; +#define TRUE 1.0 +#define FALSE 0.0 +#elif defined(USE_UCHAR_BOOLEAN) +/* + * During development, to find code that depends on the exact value of TRUE or + * that stores other values in Boolean variables. + */ +typedef unsigned char Boolean; +#define TRUE ((unsigned char)0xFF) +#define FALSE ((unsigned char)0x00) +#elif defined(USE_CHAR_BOOLEAN) +/* + * During development, to find code that uses a boolean as array index, via + * -Wchar-subscripts. + */ +typedef char Boolean; +#define TRUE ((char)-1) +#define FALSE ((char)0x00) +#elif defined(USE_ENUM_BOOLEAN) +typedef enum Boolean { FALSE, TRUE } Boolean; +#else +typedef int Boolean; +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif +#endif + #include "lst.h" +#include "enum.h" #include "hash.h" #include "config.h" #include "buf.h" #include "make_malloc.h" -/*- - * The structure for an individual graph node. Each node has several - * pieces of data associated with it. - * 1) the name of the target it describes - * 2) the location of the target file in the file system. - * 3) the type of operator used to define its sources (qv. parse.c) - * 4) whether it is involved in this invocation of make - * 5) whether the target has been remade - * 6) whether any of its children has been remade - * 7) the number of its children that are, as yet, unmade - * 8) its modification time - * 9) the modification time of its youngest child (qv. make.c) - * 10) a list of nodes for which this is a source (parents) - * 11) a list of nodes on which this depends (children) - * 12) a list of nodes that depend on this, as gleaned from the - * transformation rules (iParents) - * 13) a list of ancestor nodes, which includes parents, iParents, - * and recursive parents of parents - * 14) a list of nodes of the same name created by the :: operator - * 15) a list of nodes that must be made (if they're made) before - * this node can be, but that do not enter into the datedness of - * this node. - * 16) a list of nodes that must be made (if they're made) before - * this node or any child of this node can be, but that do not - * enter into the datedness of this node. - * 17) a list of nodes that must be made (if they're made) after - * this node is, but that do not depend on this node, in the - * normal sense. - * 18) a Lst of ``local'' variables that are specific to this target - * and this target only (qv. var.c [$@ $< $?, etc.]) - * 19) a Lst of strings that are commands to be given to a shell - * to create this target. +/* + * The typical flow of states is: + * + * The direct successful path: + * UNMADE -> BEINGMADE -> MADE. + * + * The direct error path: + * UNMADE -> BEINGMADE -> ERROR. + * + * The successful path when dependencies need to be made first: + * UNMADE -> DEFERRED -> REQUESTED -> BEINGMADE -> MADE. + * + * A node that has dependencies, and one of the dependencies cannot be made: + * UNMADE -> DEFERRED -> ABORTED. + * + * A node that turns out to be up-to-date: + * UNMADE -> BEINGMADE -> UPTODATE. */ -typedef struct GNode { - char *name; /* The target's name */ - char *uname; /* The unexpanded name of a .USE node */ - char *path; /* The full pathname of the file */ - int type; /* Its type (see the OP flags, below) */ +typedef enum GNodeMade { + /* Not examined yet. */ + UNMADE, + /* The node has been examined but is not yet ready since its + * dependencies have to be made first. */ + DEFERRED, - int flags; -#define REMAKE 0x1 /* this target needs to be (re)made */ -#define CHILDMADE 0x2 /* children of this target were made */ -#define FORCE 0x4 /* children don't exist, and we pretend made */ -#define DONE_WAIT 0x8 /* Set by Make_ProcessWait() */ -#define DONE_ORDER 0x10 /* Build requested by .ORDER processing */ -#define FROM_DEPEND 0x20 /* Node created from .depend */ -#define DONE_ALLSRC 0x40 /* We do it once only */ -#define CYCLE 0x1000 /* Used by MakePrintStatus */ -#define DONECYCLE 0x2000 /* Used by MakePrintStatus */ - enum enum_made { - UNMADE, DEFERRED, REQUESTED, BEINGMADE, - MADE, UPTODATE, ERROR, ABORTED - } made; /* Set to reflect the state of processing - * on this node: - * UNMADE - Not examined yet - * DEFERRED - Examined once (building child) - * REQUESTED - on toBeMade list - * BEINGMADE - Target is already being made. - * Indicates a cycle in the graph. - * MADE - Was out-of-date and has been made - * UPTODATE - Was already up-to-date - * ERROR - An error occurred while it was being - * made (used only in compat mode) - * ABORTED - The target was aborted due to - * an error making an inferior (compat). - */ - int unmade; /* The number of unmade children */ + /* The node is on the toBeMade list. */ + REQUESTED, - time_t mtime; /* Its modification time */ - struct GNode *cmgn; /* The youngest child */ + /* The node is already being made. Trying to build a node in this + * state indicates a cycle in the graph. */ + BEINGMADE, - Lst iParents; /* Links to parents for which this is an - * implied source, if any */ - Lst cohorts; /* Other nodes for the :: operator */ - Lst parents; /* Nodes that depend on this one */ - Lst children; /* Nodes on which this one depends */ - Lst order_pred; /* .ORDER nodes we need made */ - Lst order_succ; /* .ORDER nodes who need us */ - - char cohort_num[8]; /* #n for this cohort */ - int unmade_cohorts;/* # of unmade instances on the - cohorts list */ - struct GNode *centurion; /* Pointer to the first instance of a :: - node; only set when on a cohorts list */ - unsigned int checked; /* Last time we tried to makle this node */ - - Hash_Table context; /* The local variables */ - Lst commands; /* Creation commands */ - - struct _Suff *suffix; /* Suffix for the node (determined by - * Suff_FindDeps and opaque to everyone - * but the Suff module) */ - const char *fname; /* filename where the GNode got defined */ - int lineno; /* line number where the GNode got defined */ -} GNode; + /* Was out-of-date and has been made. */ + MADE, + /* Was already up-to-date, does not need to be made. */ + UPTODATE, + /* An error occurred while it was being made. + * Used only in compat mode. */ + ERROR, + /* The target was aborted due to an error making a dependency. + * Used only in compat mode. */ + ABORTED +} GNodeMade; /* * The OP_ constants are used when parsing a dependency line as a way of * communicating to other parts of the program the way in which a target - * should be made. These constants are bitwise-OR'ed together and - * placed in the 'type' field of each node. Any node that has - * a 'type' field which satisfies the OP_NOP function was never never on - * the lefthand side of an operator, though it may have been on the - * righthand side... + * should be made. + * + * Some of the OP_ constants can be combined, others cannot. */ -#define OP_DEPENDS 0x00000001 /* Execution of commands depends on - * kids (:) */ -#define OP_FORCE 0x00000002 /* Always execute commands (!) */ -#define OP_DOUBLEDEP 0x00000004 /* Execution of commands depends on kids - * per line (::) */ -#define OP_OPMASK (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP) +typedef enum GNodeType { + OP_NONE = 0, -#define OP_OPTIONAL 0x00000008 /* Don't care if the target doesn't - * exist and can't be created */ -#define OP_USE 0x00000010 /* Use associated commands for parents */ -#define OP_EXEC 0x00000020 /* Target is never out of date, but always - * execute commands anyway. Its time - * doesn't matter, so it has none...sort - * of */ -#define OP_IGNORE 0x00000040 /* Ignore errors when creating the node */ -#define OP_PRECIOUS 0x00000080 /* Don't remove the target when - * interrupted */ -#define OP_SILENT 0x00000100 /* Don't echo commands when executed */ -#define OP_MAKE 0x00000200 /* Target is a recursive make so its - * commands should always be executed when - * it is out of date, regardless of the - * state of the -n or -t flags */ -#define OP_JOIN 0x00000400 /* Target is out-of-date only if any of its - * children was out-of-date */ -#define OP_MADE 0x00000800 /* Assume the children of the node have - * been already made */ -#define OP_SPECIAL 0x00001000 /* Special .BEGIN, .END, .INTERRUPT */ -#define OP_USEBEFORE 0x00002000 /* Like .USE, only prepend commands */ -#define OP_INVISIBLE 0x00004000 /* The node is invisible to its parents. - * I.e. it doesn't show up in the parents's - * local variables. */ -#define OP_NOTMAIN 0x00008000 /* The node is exempt from normal 'main - * target' processing in parse.c */ -#define OP_PHONY 0x00010000 /* Not a file target; run always */ -#define OP_NOPATH 0x00020000 /* Don't search for file in the path */ -#define OP_WAIT 0x00040000 /* .WAIT phony node */ -#define OP_NOMETA 0x00080000 /* .NOMETA do not create a .meta file */ -#define OP_META 0x00100000 /* .META we _do_ want a .meta file */ -#define OP_NOMETA_CMP 0x00200000 /* Do not compare commands in .meta file */ -#define OP_SUBMAKE 0x00400000 /* Possibly a submake node */ -/* Attributes applied by PMake */ -#define OP_TRANSFORM 0x80000000 /* The node is a transformation rule */ -#define OP_MEMBER 0x40000000 /* Target is a member of an archive */ -#define OP_LIB 0x20000000 /* Target is a library */ -#define OP_ARCHV 0x10000000 /* Target is an archive construct */ -#define OP_HAS_COMMANDS 0x08000000 /* Target has all the commands it should. - * Used when parsing to catch multiple - * commands for a target */ -#define OP_SAVE_CMDS 0x04000000 /* Saving commands on .END (Compat) */ -#define OP_DEPS_FOUND 0x02000000 /* Already processed by Suff_FindDeps */ -#define OP_MARK 0x01000000 /* Node found while expanding .ALLSRC */ + /* The dependency operator ':' is the most common one. The commands + * of this node are executed if any child is out-of-date. */ + OP_DEPENDS = 1 << 0, + /* The dependency operator '!' always executes its commands, even if + * its children are up-to-date. */ + OP_FORCE = 1 << 1, + /* The dependency operator '::' behaves like ':', except that it + * allows multiple dependency groups to be defined. Each of these + * groups is executed on its own, independently from the others. + * Each individual dependency group is called a cohort. */ + OP_DOUBLEDEP = 1 << 2, -#define NoExecute(gn) ((gn->type & OP_MAKE) ? noRecursiveExecute : noExecute) -/* - * OP_NOP will return TRUE if the node with the given type was not the - * object of a dependency operator - */ -#define OP_NOP(t) (((t) & OP_OPMASK) == 0x00000000) + /* Matches the dependency operators ':', '!' and '::'. */ + OP_OPMASK = OP_DEPENDS | OP_FORCE | OP_DOUBLEDEP, -#define OP_NOTARGET (OP_NOTMAIN|OP_USE|OP_EXEC|OP_TRANSFORM) + /* Don't care if the target doesn't exist and can't be created. */ + OP_OPTIONAL = 1 << 3, + /* Use associated commands for parents. */ + OP_USE = 1 << 4, + /* Target is never out of date, but always execute commands anyway. + * Its time doesn't matter, so it has none...sort of. */ + OP_EXEC = 1 << 5, + /* Ignore non-zero exit status from shell commands when creating the + * node. */ + OP_IGNORE = 1 << 6, + /* Don't remove the target when interrupted. */ + OP_PRECIOUS = 1 << 7, + /* Don't echo commands when executed. */ + OP_SILENT = 1 << 8, + /* Target is a recursive make so its commands should always be + * executed when it is out of date, regardless of the state of the + * -n or -t flags. */ + OP_MAKE = 1 << 9, + /* Target is out-of-date only if any of its children was out-of-date. */ + OP_JOIN = 1 << 10, + /* Assume the children of the node have been already made. */ + OP_MADE = 1 << 11, + /* Special .BEGIN, .END or .INTERRUPT. */ + OP_SPECIAL = 1 << 12, + /* Like .USE, only prepend commands. */ + OP_USEBEFORE = 1 << 13, + /* The node is invisible to its parents. I.e. it doesn't show up in + * the parents' local variables (.IMPSRC, .ALLSRC). */ + OP_INVISIBLE = 1 << 14, + /* The node does not become the main target, even if it is the first + * target in the first makefile. */ + OP_NOTMAIN = 1 << 15, + /* Not a file target; run always. */ + OP_PHONY = 1 << 16, + /* Don't search for the file in the path. */ + OP_NOPATH = 1 << 17, + /* In a dependency line "target: source1 .WAIT source2", source1 is + * made first, including its children. Once that is finished, + * source2 is made, including its children. The .WAIT keyword may + * appear more than once in a single dependency declaration. */ + OP_WAIT = 1 << 18, + /* .NOMETA do not create a .meta file */ + OP_NOMETA = 1 << 19, + /* .META we _do_ want a .meta file */ + OP_META = 1 << 20, + /* Do not compare commands in .meta file */ + OP_NOMETA_CMP = 1 << 21, + /* Possibly a submake node */ + OP_SUBMAKE = 1 << 22, + + /* Attributes applied by PMake */ + + /* The node is a transformation rule, such as ".c.o". */ + OP_TRANSFORM = 1 << 30, + /* Target is a member of an archive */ + /* XXX: How does this differ from OP_ARCHV? */ + OP_MEMBER = 1 << 29, + /* The node is a library, + * its name has the form "-l" */ + OP_LIB = 1 << 28, + /* The node is an archive member, + * its name has the form "archive(member)" */ + /* XXX: How does this differ from OP_MEMBER? */ + OP_ARCHV = 1 << 27, + /* Target has all the commands it should. Used when parsing to catch + * multiple command groups for a target. Only applies to the + * dependency operators ':' and '!', but not to '::'. */ + OP_HAS_COMMANDS = 1 << 26, + /* The special command "..." has been seen. All further commands from + * this node will be saved on the .END node instead, to be executed at + * the very end. */ + OP_SAVE_CMDS = 1 << 25, + /* Already processed by Suff_FindDeps, to find dependencies from + * suffix transformation rules. */ + OP_DEPS_FOUND = 1 << 24, + /* Node found while expanding .ALLSRC */ + OP_MARK = 1 << 23, + + OP_NOTARGET = OP_NOTMAIN | OP_USE | OP_EXEC | OP_TRANSFORM +} GNodeType; + +typedef enum GNodeFlags { + GNF_NONE = 0, + /* this target needs to be (re)made */ + REMAKE = 1 << 0, + /* children of this target were made */ + CHILDMADE = 1 << 1, + /* children don't exist, and we pretend made */ + FORCE = 1 << 2, + /* Set by Make_ProcessWait() */ + DONE_WAIT = 1 << 3, + /* Build requested by .ORDER processing */ + DONE_ORDER = 1 << 4, + /* Node created from .depend */ + FROM_DEPEND = 1 << 5, + /* We do it once only */ + DONE_ALLSRC = 1 << 6, + /* Used by MakePrintStatus */ + CYCLE = 1 << 12, + /* Used by MakePrintStatus */ + DONECYCLE = 1 << 13 +} GNodeFlags; + +typedef struct List StringList; +typedef struct ListNode StringListNode; + +typedef struct List GNodeList; +typedef struct ListNode GNodeListNode; + +typedef struct SearchPath { + List /* of CachedDir */ dirs; +} SearchPath; /* - * The TARG_ constants are used when calling the Targ_FindNode and - * Targ_FindList functions in targ.c. They simply tell the functions what to - * do if the desired node(s) is (are) not found. If the TARG_CREATE constant - * is given, a new, empty node will be created for the target, placed in the - * table of all targets and its address returned. If TARG_NOCREATE is given, - * a NULL pointer will be returned. + * A graph node represents a target that can possibly be made, including its + * relation to other targets and a lot of other details. */ -#define TARG_NOCREATE 0x00 /* don't create it */ -#define TARG_CREATE 0x01 /* create node if not found */ -#define TARG_NOHASH 0x02 /* don't look in/add to hash table */ +typedef struct GNode { + /* The target's name, such as "clean" or "make.c" */ + char *name; + /* The unexpanded name of a .USE node */ + char *uname; + /* The full pathname of the file belonging to the target. + * XXX: What about .PHONY targets? These don't have an associated + * path. */ + char *path; + + /* The type of operator used to define the sources (see the OP flags + * below). + * XXX: This looks like a wild mixture of type and flags. */ + GNodeType type; + GNodeFlags flags; + + /* The state of processing on this node */ + GNodeMade made; + /* The number of unmade children */ + int unmade; + + /* The modification time; 0 means the node does not have a + * corresponding file; see GNode_IsOODate. */ + time_t mtime; + struct GNode *youngestChild; + + /* The GNodes for which this node is an implied source. May be empty. + * For example, when there is an inference rule for .c.o, the node for + * file.c has the node for file.o in this list. */ + GNodeList implicitParents; + + /* The nodes that depend on this one, or in other words, the nodes for + * which this is a source. */ + GNodeList parents; + /* The nodes on which this one depends. */ + GNodeList children; + + /* .ORDER nodes we need made. The nodes that must be made (if they're + * made) before this node can be made, but that do not enter into the + * datedness of this node. */ + GNodeList order_pred; + /* .ORDER nodes who need us. The nodes that must be made (if they're + * made at all) after this node is made, but that do not depend on + * this node, in the normal sense. */ + GNodeList order_succ; + + /* + * Other nodes of the same name, for targets that were defined using + * the '::' dependency operator (OP_DOUBLEDEP). + */ + GNodeList cohorts; + /* The "#n" suffix for this cohort, or "" for other nodes */ + char cohort_num[8]; + /* The number of unmade instances on the cohorts list */ + int unmade_cohorts; + /* Pointer to the first instance of a '::' node; only set when on a + * cohorts list */ + struct GNode *centurion; + + /* Last time (sequence number) we tried to make this node */ + unsigned int checked_seqno; + + /* + * The "local" variables that are specific to this target and this + * target only, such as $@, $<, $?. + * + * Also used for the global variable scopes SCOPE_GLOBAL, + * SCOPE_CMDLINE, SCOPE_INTERNAL, which contain variables with + * arbitrary names. + */ + HashTable /* of Var pointer */ vars; + + /* The commands to be given to a shell to create this target. */ + StringList commands; + + /* Suffix for the node (determined by Suff_FindDeps and opaque to + * everyone but the Suff module) */ + struct Suffix *suffix; + + /* Filename where the GNode got defined */ + /* XXX: What is the lifetime of this string? */ + const char *fname; + /* Line number where the GNode got defined */ + int lineno; +} GNode; + +/* Error levels for diagnostics during parsing. */ +typedef enum ParseErrorLevel { + /* Exit when the current top-level makefile has been parsed + * completely. */ + PARSE_FATAL = 1, + /* Print "warning"; may be upgraded to fatal by the -w option. */ + PARSE_WARNING, + /* Informational, mainly used during development of makefiles. */ + PARSE_INFO +} ParseErrorLevel; /* - * These constants are all used by the Str_Concat function to decide how the - * final string should look. If STR_ADDSPACE is given, a space will be - * placed between the two strings. If STR_ADDSLASH is given, a '/' will - * be used instead of a space. If neither is given, no intervening characters - * will be placed between the two strings in the final output. If the - * STR_DOFREE bit is set, the two input strings will be freed before - * Str_Concat returns. + * Values returned by Cond_EvalLine and Cond_EvalCondition. */ -#define STR_ADDSPACE 0x01 /* add a space when Str_Concat'ing */ -#define STR_ADDSLASH 0x02 /* add a slash when Str_Concat'ing */ +typedef enum CondEvalResult { + COND_PARSE, /* Parse the next lines */ + COND_SKIP, /* Skip the next lines */ + COND_INVALID /* Not a conditional statement */ +} CondEvalResult; -/* - * Error levels for parsing. PARSE_FATAL means the process cannot continue - * once the makefile has been parsed. PARSE_WARNING means it can. Passed - * as the first argument to Parse_Error. - */ -#define PARSE_WARNING 2 -#define PARSE_FATAL 1 - -/* - * Values returned by Cond_Eval. - */ -#define COND_PARSE 0 /* Parse the next lines */ -#define COND_SKIP 1 /* Skip the next lines */ -#define COND_INVALID 2 /* Not a conditional statement */ - -/* - * Definitions for the "local" variables. Used only for clarity. - */ -#define TARGET "@" /* Target of dependency */ -#define OODATE "?" /* All out-of-date sources */ -#define ALLSRC ">" /* All sources */ -#define IMPSRC "<" /* Source implied by transformation */ -#define PREFIX "*" /* Common prefix */ -#define ARCHIVE "!" /* Archive in "archive(member)" syntax */ -#define MEMBER "%" /* Member in "archive(member)" syntax */ - -#define FTARGET "@F" /* file part of TARGET */ -#define DTARGET "@D" /* directory part of TARGET */ -#define FIMPSRC "" /* All sources */ +#define IMPSRC "<" /* Source implied by transformation */ +#define PREFIX "*" /* Common prefix */ +#define ARCHIVE "!" /* Archive in "archive(member)" syntax */ +#define MEMBER "%" /* Member in "archive(member)" syntax */ /* * Global Variables */ -extern Lst create; /* The list of target names specified on the - * command line. used to resolve #if - * make(...) statements */ -extern Lst dirSearchPath; /* The list of directories to search when - * looking for targets */ -extern Boolean compatMake; /* True if we are make compatible */ -extern Boolean ignoreErrors; /* True if should ignore all errors */ -extern Boolean beSilent; /* True if should print no commands */ -extern Boolean noExecute; /* True if should execute nothing */ -extern Boolean noRecursiveExecute; /* True if should execute nothing */ -extern Boolean allPrecious; /* True if every target is precious */ -extern Boolean keepgoing; /* True if should continue on unaffected - * portions of the graph when have an error - * in one portion */ -extern Boolean touchFlag; /* TRUE if targets should just be 'touched' - * if out of date. Set by the -t flag */ -extern Boolean queryFlag; /* TRUE if we aren't supposed to really make - * anything, just see if the targets are out- - * of-date */ -extern Boolean doing_depend; /* TRUE if processing .depend */ - -extern Boolean checkEnvFirst; /* TRUE if environment should be searched for - * variables before the global context */ -extern Boolean jobServer; /* a jobServer already exists */ - -extern Boolean parseWarnFatal; /* TRUE if makefile parsing warnings are - * treated as errors */ - -extern Boolean varNoExportEnv; /* TRUE if we should not export variables - * set on the command line to the env. */ - -extern GNode *DEFAULT; /* .DEFAULT rule */ - -extern GNode *VAR_INTERNAL; /* Variables defined internally by make - * which should not override those set by - * makefiles. - */ -extern GNode *VAR_GLOBAL; /* Variables defined in a global context, e.g - * in the Makefile itself */ -extern GNode *VAR_CMD; /* Variables defined on the command line */ -extern GNode *VAR_FOR; /* Iteration variables */ -extern char var_Error[]; /* Value returned by Var_Parse when an error - * is encountered. It actually points to - * an empty string, so naive callers needn't - * worry about it. */ - -extern time_t now; /* The time at the start of this whole - * process */ - -extern Boolean oldVars; /* Do old-style variable substitution */ - -extern Lst sysIncPath; /* The system include path. */ -extern Lst defIncPath; /* The default include path. */ - -extern char curdir[]; /* Startup directory */ -extern char *progname; /* The program name */ -extern char *makeDependfile; /* .depend */ -extern char **savedEnv; /* if we replaced environ this will be non-NULL */ +/* True if every target is precious */ +extern Boolean allPrecious; +/* True if failed targets should be deleted */ +extern Boolean deleteOnError; +/* TRUE while processing .depend */ +extern Boolean doing_depend; +/* .DEFAULT rule */ +extern GNode *defaultNode; /* - * We cannot vfork() in a child of vfork(). - * Most systems do not enforce this but some do. + * Variables defined internally by make which should not override those set + * by makefiles. */ -#define vFork() ((getpid() == myPid) ? vfork() : fork()) -extern pid_t myPid; +extern GNode *SCOPE_INTERNAL; +/* Variables defined in a global scope, e.g in the makefile itself. */ +extern GNode *SCOPE_GLOBAL; +/* Variables defined on the command line. */ +extern GNode *SCOPE_CMDLINE; -#define MAKEFLAGS ".MAKEFLAGS" -#define MAKEOVERRIDES ".MAKEOVERRIDES" -#define MAKE_JOB_PREFIX ".MAKE.JOB.PREFIX" /* prefix for job target output */ -#define MAKE_EXPORTED ".MAKE.EXPORTED" /* variables we export */ -#define MAKE_MAKEFILES ".MAKE.MAKEFILES" /* all the makefiles we read */ -#define MAKE_LEVEL ".MAKE.LEVEL" /* recursion level */ -#define MAKEFILE_PREFERENCE ".MAKE.MAKEFILE_PREFERENCE" -#define MAKE_DEPENDFILE ".MAKE.DEPENDFILE" /* .depend */ +/* + * Value returned by Var_Parse when an error is encountered. It actually + * points to an empty string, so naive callers needn't worry about it. + */ +extern char var_Error[]; + +/* The time at the start of this whole process */ +extern time_t now; + +/* + * The list of directories to search when looking for targets (set by the + * special target .PATH). + */ +extern SearchPath dirSearchPath; +/* Used for .include "...". */ +extern SearchPath *parseIncPath; +/* + * Used for .include <...>, for the built-in sys.mk and for makefiles from + * the command line arguments. + */ +extern SearchPath *sysIncPath; +/* The default for sysIncPath. */ +extern SearchPath *defSysIncPath; + +/* Startup directory */ +extern char curdir[]; +/* The basename of the program name, suffixed with [n] for sub-makes. */ +extern const char *progname; +extern int makelevel; +/* Name of the .depend makefile */ +extern char *makeDependfile; +/* If we replaced environ, this will be non-NULL. */ +extern char **savedEnv; + +extern pid_t myPid; + +#define MAKEFLAGS ".MAKEFLAGS" +#define MAKEOVERRIDES ".MAKEOVERRIDES" +/* prefix when printing the target of a job */ +#define MAKE_JOB_PREFIX ".MAKE.JOB.PREFIX" +#define MAKE_EXPORTED ".MAKE.EXPORTED" /* exported variables */ +#define MAKE_MAKEFILES ".MAKE.MAKEFILES" /* all loaded makefiles */ +#define MAKE_LEVEL ".MAKE.LEVEL" /* recursion level */ +#define MAKE_MAKEFILE_PREFERENCE ".MAKE.MAKEFILE_PREFERENCE" +#define MAKE_DEPENDFILE ".MAKE.DEPENDFILE" /* .depend */ #define MAKE_MODE ".MAKE.MODE" #ifndef MAKE_LEVEL_ENV # define MAKE_LEVEL_ENV "MAKELEVEL" #endif -/* - * debug control: - * There is one bit per module. It is up to the module what debug - * information to print. - */ -FILE *debug_file; /* Output written here - default stdout */ -extern int debug; -#define DEBUG_ARCH 0x00001 -#define DEBUG_COND 0x00002 -#define DEBUG_DIR 0x00004 -#define DEBUG_GRAPH1 0x00008 -#define DEBUG_GRAPH2 0x00010 -#define DEBUG_JOB 0x00020 -#define DEBUG_MAKE 0x00040 -#define DEBUG_SUFF 0x00080 -#define DEBUG_TARG 0x00100 -#define DEBUG_VAR 0x00200 -#define DEBUG_FOR 0x00400 -#define DEBUG_SHELL 0x00800 -#define DEBUG_ERROR 0x01000 -#define DEBUG_LOUD 0x02000 -#define DEBUG_META 0x04000 +typedef enum DebugFlags { + DEBUG_NONE = 0, + DEBUG_ARCH = 1 << 0, + DEBUG_COND = 1 << 1, + DEBUG_CWD = 1 << 2, + DEBUG_DIR = 1 << 3, + DEBUG_ERROR = 1 << 4, + DEBUG_FOR = 1 << 5, + DEBUG_GRAPH1 = 1 << 6, + DEBUG_GRAPH2 = 1 << 7, + DEBUG_GRAPH3 = 1 << 8, + DEBUG_HASH = 1 << 9, + DEBUG_JOB = 1 << 10, + DEBUG_LOUD = 1 << 11, + DEBUG_MAKE = 1 << 12, + DEBUG_META = 1 << 13, + DEBUG_PARSE = 1 << 14, + DEBUG_SCRIPT = 1 << 15, + DEBUG_SHELL = 1 << 16, + DEBUG_SUFF = 1 << 17, + DEBUG_TARG = 1 << 18, + DEBUG_VAR = 1 << 19, + DEBUG_ALL = (1 << 20) - 1 +} DebugFlags; -#define DEBUG_GRAPH3 0x10000 -#define DEBUG_SCRIPT 0x20000 -#define DEBUG_PARSE 0x40000 -#define DEBUG_CWD 0x80000 +#define CONCAT(a, b) a##b -#define CONCAT(a,b) a##b +#define DEBUG(module) ((opts.debug & CONCAT(DEBUG_, module)) != 0) -#define DEBUG(module) (debug & CONCAT(DEBUG_,module)) +void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); + +#define DEBUG_IMPL(module, args) \ + do { \ + if (DEBUG(module)) \ + debug_printf args; \ + } while (/*CONSTCOND*/FALSE) + +#define DEBUG0(module, text) \ + DEBUG_IMPL(module, ("%s", text)) +#define DEBUG1(module, fmt, arg1) \ + DEBUG_IMPL(module, (fmt, arg1)) +#define DEBUG2(module, fmt, arg1, arg2) \ + DEBUG_IMPL(module, (fmt, arg1, arg2)) +#define DEBUG3(module, fmt, arg1, arg2, arg3) \ + DEBUG_IMPL(module, (fmt, arg1, arg2, arg3)) +#define DEBUG4(module, fmt, arg1, arg2, arg3, arg4) \ + DEBUG_IMPL(module, (fmt, arg1, arg2, arg3, arg4)) +#define DEBUG5(module, fmt, arg1, arg2, arg3, arg4, arg5) \ + DEBUG_IMPL(module, (fmt, arg1, arg2, arg3, arg4, arg5)) + +typedef enum PrintVarsMode { + PVM_NONE, + PVM_UNEXPANDED, + PVM_EXPANDED +} PrintVarsMode; + +/* Command line options */ +typedef struct CmdOpts { + /* -B: whether we are make compatible */ + Boolean compatMake; + + /* -d: debug control: There is one bit per module. It is up to the + * module what debug information to print. */ + DebugFlags debug; + + /* -df: debug output is written here - default stderr */ + FILE *debug_file; + + /* -dL: lint mode + * + * Runs make in strict mode, with additional checks and better error + * handling. */ + Boolean strict; + + /* -dV: for the -V option, print unexpanded variable values */ + Boolean debugVflag; + + /* -e: check environment variables before global variables */ + Boolean checkEnvFirst; + + /* -f: the makefiles to read */ + StringList makefiles; + + /* -i: if true, ignore all errors from shell commands */ + Boolean ignoreErrors; + + /* -j: the maximum number of jobs that can run in parallel; + * this is coordinated with the submakes */ + int maxJobs; + + /* -k: if true and an error occurs while making a node, continue + * making nodes that do not depend on the erroneous node */ + Boolean keepgoing; + + /* -N: execute no commands from the targets */ + Boolean noRecursiveExecute; + + /* -n: execute almost no commands from the targets */ + Boolean noExecute; + + /* + * -q: if true, do not really make anything, just see if the targets + * are out-of-date + */ + Boolean queryFlag; + + /* -r: raw mode, do not load the builtin rules. */ + Boolean noBuiltins; + + /* -s: don't echo the shell commands before executing them */ + Boolean beSilent; + + /* -t: touch the targets if they are out-of-date, but don't actually + * make them */ + Boolean touchFlag; + + /* -[Vv]: print expanded or unexpanded selected variables */ + PrintVarsMode printVars; + /* -[Vv]: the variables to print */ + StringList variables; + + /* -W: if true, makefile parsing warnings are treated as errors */ + Boolean parseWarnFatal; + + /* -w: print 'Entering' and 'Leaving' for submakes */ + Boolean enterFlag; + + /* -X: if true, do not export variables set on the command line to the + * environment. */ + Boolean varNoExportEnv; + + /* The target names specified on the command line. + * Used to resolve .if make(...) statements. */ + StringList create; + +} CmdOpts; + +extern CmdOpts opts; #include "nonints.h" -int Make_TimeStamp(GNode *, GNode *); -Boolean Make_OODate(GNode *); -void Make_ExpandUse(Lst); +void GNode_UpdateYoungestChild(GNode *, GNode *); +Boolean GNode_IsOODate(GNode *); +void Make_ExpandUse(GNodeList *); time_t Make_Recheck(GNode *); void Make_HandleUse(GNode *, GNode *); void Make_Update(GNode *); void Make_DoAllVar(GNode *); -Boolean Make_Run(Lst); -char * Check_Cwd_Cmd(const char *); -void Check_Cwd(const char **); +Boolean Make_Run(GNodeList *); +Boolean shouldDieQuietly(GNode *, int); void PrintOnError(GNode *, const char *); void Main_ExportMAKEFLAGS(Boolean); -Boolean Main_SetObjdir(const char *); -int mkTempFile(const char *, char **); -int str2Lst_Append(Lst, char *, const char *); +Boolean Main_SetObjdir(Boolean, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); +int mkTempFile(const char *, char *, size_t); +int str2Lst_Append(StringList *, char *); +void GNode_FprintDetails(FILE *, const char *, const GNode *, const char *); +Boolean GNode_ShouldExecute(GNode *gn); + +/* See if the node was seen on the left-hand side of a dependency operator. */ +MAKE_INLINE Boolean +GNode_IsTarget(const GNode *gn) +{ + return (gn->type & OP_OPMASK) != 0; +} + +MAKE_INLINE const char * +GNode_Path(const GNode *gn) +{ + return gn->path != NULL ? gn->path : gn->name; +} + +MAKE_INLINE Boolean +GNode_IsWaitingFor(const GNode *gn) +{ + return (gn->flags & REMAKE) && gn->made <= REQUESTED; +} + +MAKE_INLINE Boolean +GNode_IsReady(const GNode *gn) +{ + return gn->made > DEFERRED; +} + +MAKE_INLINE Boolean +GNode_IsDone(const GNode *gn) +{ + return gn->made >= MADE; +} + +MAKE_INLINE Boolean +GNode_IsError(const GNode *gn) +{ + return gn->made == ERROR || gn->made == ABORTED; +} + +MAKE_INLINE const char * +GNode_VarTarget(GNode *gn) { return GNode_ValueDirect(gn, TARGET); } +MAKE_INLINE const char * +GNode_VarOodate(GNode *gn) { return GNode_ValueDirect(gn, OODATE); } +MAKE_INLINE const char * +GNode_VarAllsrc(GNode *gn) { return GNode_ValueDirect(gn, ALLSRC); } +MAKE_INLINE const char * +GNode_VarImpsrc(GNode *gn) { return GNode_ValueDirect(gn, IMPSRC); } +MAKE_INLINE const char * +GNode_VarPrefix(GNode *gn) { return GNode_ValueDirect(gn, PREFIX); } +MAKE_INLINE const char * +GNode_VarArchive(GNode *gn) { return GNode_ValueDirect(gn, ARCHIVE); } +MAKE_INLINE const char * +GNode_VarMember(GNode *gn) { return GNode_ValueDirect(gn, MEMBER); } #ifdef __GNUC__ -#define UNCONST(ptr) ({ \ +#define UNCONST(ptr) ({ \ union __unconst { \ const void *__cp; \ void *__p; \ @@ -496,13 +776,6 @@ int str2Lst_Append(Lst, char *, const char *); #define UNCONST(ptr) (void *)(ptr) #endif -#ifndef MIN -#define MIN(a, b) ((a < b) ? a : b) -#endif -#ifndef MAX -#define MAX(a, b) ((a > b) ? a : b) -#endif - /* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */ #include #ifndef MAXPATHLEN @@ -512,4 +785,68 @@ int str2Lst_Append(Lst, char *, const char *); #define PATH_MAX MAXPATHLEN #endif -#endif /* _MAKE_H_ */ +#if defined(SYSV) +#define KILLPG(pid, sig) kill(-(pid), (sig)) +#else +#define KILLPG(pid, sig) killpg((pid), (sig)) +#endif + +MAKE_INLINE Boolean +ch_isalnum(char ch) { return isalnum((unsigned char)ch) != 0; } +MAKE_INLINE Boolean +ch_isalpha(char ch) { return isalpha((unsigned char)ch) != 0; } +MAKE_INLINE Boolean +ch_isdigit(char ch) { return isdigit((unsigned char)ch) != 0; } +MAKE_INLINE Boolean +ch_isspace(char ch) { return isspace((unsigned char)ch) != 0; } +MAKE_INLINE Boolean +ch_isupper(char ch) { return isupper((unsigned char)ch) != 0; } +MAKE_INLINE char +ch_tolower(char ch) { return (char)tolower((unsigned char)ch); } +MAKE_INLINE char +ch_toupper(char ch) { return (char)toupper((unsigned char)ch); } + +MAKE_INLINE void +cpp_skip_whitespace(const char **pp) +{ + while (ch_isspace(**pp)) + (*pp)++; +} + +MAKE_INLINE void +cpp_skip_hspace(const char **pp) +{ + while (**pp == ' ' || **pp == '\t') + (*pp)++; +} + +MAKE_INLINE void +pp_skip_whitespace(char **pp) +{ + while (ch_isspace(**pp)) + (*pp)++; +} + +MAKE_INLINE void +pp_skip_hspace(char **pp) +{ + while (**pp == ' ' || **pp == '\t') + (*pp)++; +} + +#if defined(lint) +# define MAKE_RCSID(id) extern void do_not_define_rcsid(void) +#elif defined(MAKE_NATIVE) +# include +# define MAKE_RCSID(id) __RCSID(id) +#elif defined(MAKE_ALL_IN_ONE) && defined(__COUNTER__) +# define MAKE_RCSID_CONCAT(x, y) CONCAT(x, y) +# define MAKE_RCSID(id) static volatile char \ + MAKE_RCSID_CONCAT(rcsid_, __COUNTER__)[] = id +#elif defined(MAKE_ALL_IN_ONE) +# define MAKE_RCSID(id) extern void do_not_define_rcsid(void) +#else +# define MAKE_RCSID(id) static volatile char rcsid[] = id +#endif + +#endif /* MAKE_MAKE_H */ diff --git a/usr.bin/make/make_malloc.c b/usr.bin/make/make_malloc.c index b8ac23f84..42a69f437 100644 --- a/usr.bin/make/make_malloc.c +++ b/usr.bin/make/make_malloc.c @@ -1,6 +1,6 @@ -/* $NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $ */ +/* $NetBSD: make_malloc.c,v 1.25 2021/01/19 20:51:46 rillig Exp $ */ -/*- +/* * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. * @@ -26,36 +26,23 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifdef MAKE_NATIVE -#include -__RCSID("$NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $"); -#endif - -#include -#include -#include #include #include "make.h" -#ifndef USE_EMALLOC -static void enomem(void) MAKE_ATTR_DEAD; +MAKE_RCSID("$NetBSD: make_malloc.c,v 1.25 2021/01/19 20:51:46 rillig Exp $"); -/* - * enomem -- - * die when out of memory. - */ -static void +#ifndef USE_EMALLOC + +/* die when out of memory. */ +static MAKE_ATTR_DEAD void enomem(void) { (void)fprintf(stderr, "%s: %s.\n", progname, strerror(ENOMEM)); exit(2); } -/* - * bmake_malloc -- - * malloc, but die on error. - */ +/* malloc, but die on error. */ void * bmake_malloc(size_t len) { @@ -63,13 +50,10 @@ bmake_malloc(size_t len) if ((p = malloc(len)) == NULL) enomem(); - return(p); + return p; } -/* - * bmake_strdup -- - * strdup, but die on error. - */ +/* strdup, but die on error. */ char * bmake_strdup(const char *str) { @@ -77,43 +61,33 @@ bmake_strdup(const char *str) char *p; len = strlen(str) + 1; - if ((p = malloc(len)) == NULL) - enomem(); + p = bmake_malloc(len); return memcpy(p, str, len); } -/* - * bmake_strndup -- - * strndup, but die on error. - */ +/* Allocate a string starting from str with exactly len characters. */ char * -bmake_strndup(const char *str, size_t max_len) +bmake_strldup(const char *str, size_t len) { - size_t len; - char *p; - - if (str == NULL) - return NULL; - - len = strlen(str); - if (len > max_len) - len = max_len; - p = bmake_malloc(len + 1); + char *p = bmake_malloc(len + 1); memcpy(p, str, len); p[len] = '\0'; - - return(p); + return p; } -/* - * bmake_realloc -- - * realloc, but die on error. - */ +/* realloc, but die on error. */ void * bmake_realloc(void *ptr, size_t size) { if ((ptr = realloc(ptr, size)) == NULL) enomem(); - return(ptr); + return ptr; } #endif + +/* Allocate a string from start up to but excluding end. */ +char * +bmake_strsedup(const char *start, const char *end) +{ + return bmake_strldup(start, (size_t)(end - start)); +} diff --git a/usr.bin/make/make_malloc.h b/usr.bin/make/make_malloc.h index 36d3eff3c..72f6c11fd 100644 --- a/usr.bin/make/make_malloc.h +++ b/usr.bin/make/make_malloc.h @@ -1,6 +1,6 @@ -/* $NetBSD: make_malloc.h,v 1.4 2009/01/24 14:43:29 dsl Exp $ */ +/* $NetBSD: make_malloc.h,v 1.16 2021/01/19 20:51:46 rillig Exp $ */ -/*- +/* * Copyright (c) 2009 The NetBSD Foundation, Inc. * All rights reserved. * @@ -30,12 +30,27 @@ void *bmake_malloc(size_t); void *bmake_realloc(void *, size_t); char *bmake_strdup(const char *); -char *bmake_strndup(const char *, size_t); +char *bmake_strldup(const char *, size_t); #else #include -#define bmake_malloc(x) emalloc(x) -#define bmake_realloc(x,y) erealloc(x,y) -#define bmake_strdup(x) estrdup(x) -#define bmake_strndup(x,y) estrndup(x,y) +#define bmake_malloc(n) emalloc(n) +#define bmake_realloc(p, n) erealloc(p, n) +#define bmake_strdup(s) estrdup(s) +#define bmake_strldup(s, n) estrndup(s, n) #endif +char *bmake_strsedup(const char *, const char *); + +/* + * Thin wrapper around free(3) to avoid the extra function call in case + * p is NULL, to save a few machine instructions. + * + * The case of a NULL pointer happens especially often after Var_Value, + * since only environment variables need to be freed, but not others. + */ +MAKE_INLINE void +bmake_free(void *p) +{ + if (p != NULL) + free(p); +} diff --git a/usr.bin/make/meta.c b/usr.bin/make/meta.c index 5b2a7257f..ff02fc38e 100644 --- a/usr.bin/make/meta.c +++ b/usr.bin/make/meta.c @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.39 2015/10/10 03:58:59 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.179 2021/03/15 12:15:03 rillig Exp $ */ /* * Implement 'meta' mode. @@ -6,18 +6,18 @@ * --sjg */ /* - * Copyright (c) 2009-2010, Juniper Networks, Inc. + * Copyright (c) 2009-2016, Juniper Networks, Inc. * Portions Copyright (c) 2009, John Birrell. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions + * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * + * documentation and/or other materials provided with the distribution. + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -28,7 +28,7 @@ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(USE_META) @@ -36,8 +36,6 @@ # include "config.h" #endif #include -#include -#include #include #include #if !defined(HAVE_CONFIG_H) || defined(HAVE_ERR_H) @@ -45,37 +43,46 @@ #endif #include "make.h" +#include "dir.h" #include "job.h" -#ifdef HAVE_FILEMON_H -# include -#endif -#if !defined(USE_FILEMON) && defined(FILEMON_SET_FD) -# define USE_FILEMON +#ifdef USE_FILEMON +#include "filemon/filemon.h" #endif static BuildMon Mybm; /* for compat */ -static Lst metaBailiwick; /* our scope of control */ -static Lst metaIgnorePaths; /* paths we deliberately ignore */ +static StringList metaBailiwick = LST_INIT; /* our scope of control */ +static char *metaBailiwickStr; /* string storage for the list */ +static StringList metaIgnorePaths = LST_INIT; /* paths we deliberately ignore */ +static char *metaIgnorePathsStr; /* string storage for the list */ #ifndef MAKE_META_IGNORE_PATHS #define MAKE_META_IGNORE_PATHS ".MAKE.META.IGNORE_PATHS" #endif +#ifndef MAKE_META_IGNORE_PATTERNS +#define MAKE_META_IGNORE_PATTERNS ".MAKE.META.IGNORE_PATTERNS" +#endif +#ifndef MAKE_META_IGNORE_FILTER +#define MAKE_META_IGNORE_FILTER ".MAKE.META.IGNORE_FILTER" +#endif Boolean useMeta = FALSE; static Boolean useFilemon = FALSE; static Boolean writeMeta = FALSE; +static Boolean metaMissing = FALSE; /* oodate if missing */ +static Boolean filemonMissing = FALSE; /* oodate if missing */ static Boolean metaEnv = FALSE; /* don't save env unless asked */ static Boolean metaVerbose = FALSE; static Boolean metaIgnoreCMDs = FALSE; /* ignore CMDs in .meta files */ +static Boolean metaIgnorePatterns = FALSE; /* do we need to do pattern matches */ +static Boolean metaIgnoreFilter = FALSE; /* do we have more complex filtering? */ static Boolean metaCurdirOk = FALSE; /* write .meta in .CURDIR Ok? */ static Boolean metaSilent = FALSE; /* if we have a .meta be SILENT */ extern Boolean forceJobs; -extern Boolean comatMake; extern char **environ; -#define MAKE_META_PREFIX ".MAKE.META.PREFIX" +#define MAKE_META_PREFIX ".MAKE.META.PREFIX" #ifndef N2U # define N2U(n, u) (((n) + ((u) - 1)) / (u)) @@ -85,7 +92,7 @@ extern char **environ; #endif #if !defined(HAVE_STRSEP) -# define strsep(s, d) stresep((s), (d), 0) +# define strsep(s, d) stresep((s), (d), '\0') #endif /* @@ -102,34 +109,28 @@ extern char **environ; * * See meta_oodate below - we mainly care about 'E' and 'R'. * - * We can still use meta mode without filemon, but + * We can still use meta mode without filemon, but * the benefits are more limited. */ #ifdef USE_FILEMON -# ifndef _PATH_FILEMON -# define _PATH_FILEMON "/dev/filemon" -# endif /* * Open the filemon device. */ static void -filemon_open(BuildMon *pbm) +meta_open_filemon(BuildMon *pbm) { - int retry; - - pbm->mon_fd = pbm->filemon_fd = -1; - if (!useFilemon) + int dupfd; + + pbm->mon_fd = -1; + pbm->filemon = NULL; + if (!useFilemon || pbm->mfp == NULL) return; - for (retry = 5; retry >= 0; retry--) { - if ((pbm->filemon_fd = open(_PATH_FILEMON, O_RDWR)) >= 0) - break; - } - - if (pbm->filemon_fd < 0) { + pbm->filemon = filemon_open(); + if (pbm->filemon == NULL) { useFilemon = FALSE; - warn("Could not open %s", _PATH_FILEMON); + warn("Could not open filemon %s", filemon_path()); return; } @@ -139,41 +140,57 @@ filemon_open(BuildMon *pbm) * cwd causing getcwd to do a lot more work. * We only care about the descriptor. */ - pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL); - if (ioctl(pbm->filemon_fd, FILEMON_SET_FD, &pbm->mon_fd) < 0) { + if (!opts.compatMake) + pbm->mon_fd = Job_TempFile("filemon.XXXXXX", NULL, 0); + else + pbm->mon_fd = mkTempFile("filemon.XXXXXX", NULL, 0); + if ((dupfd = dup(pbm->mon_fd)) == -1) { + err(1, "Could not dup filemon output!"); + } + (void)fcntl(dupfd, F_SETFD, FD_CLOEXEC); + if (filemon_setfd(pbm->filemon, dupfd) == -1) { err(1, "Could not set filemon file descriptor!"); } /* we don't need these once we exec */ - (void)fcntl(pbm->mon_fd, F_SETFD, 1); - (void)fcntl(pbm->filemon_fd, F_SETFD, 1); + (void)fcntl(pbm->mon_fd, F_SETFD, FD_CLOEXEC); } /* * Read the build monitor output file and write records to the target's * metadata file. */ -static void +static int filemon_read(FILE *mfp, int fd) { char buf[BUFSIZ]; - int n; + int error; /* Check if we're not writing to a meta data file.*/ if (mfp == NULL) { if (fd >= 0) close(fd); /* not interested */ - return; + return 0; } /* rewind */ - (void)lseek(fd, (off_t)0, SEEK_SET); + if (lseek(fd, (off_t)0, SEEK_SET) < 0) { + error = errno; + warn("Could not rewind filemon"); + fprintf(mfp, "\n"); + } else { + ssize_t n; - fprintf(mfp, "\n-- filemon acquired metadata --\n"); + error = 0; + fprintf(mfp, "\n-- filemon acquired metadata --\n"); - while ((n = read(fd, buf, sizeof(buf))) > 0) { - fwrite(buf, 1, n, mfp); + while ((n = read(fd, buf, sizeof buf)) > 0) { + if ((ssize_t)fwrite(buf, 1, (size_t)n, mfp) < n) + error = EIO; + } } fflush(mfp); - close(fd); + if (close(fd) < 0) + error = errno; + return error; } #endif @@ -201,10 +218,10 @@ eat_dots(char *buf, size_t bufsz, int dots) default: return; } - + do { cp = strstr(buf, eat); - if (cp) { + if (cp != NULL) { cp2 = cp + eatlen; if (dots == 2 && cp > buf) { do { @@ -212,35 +229,26 @@ eat_dots(char *buf, size_t bufsz, int dots) } while (cp > buf && *cp != '/'); } if (*cp == '/') { - strlcpy(cp, cp2, bufsz - (cp - buf)); + strlcpy(cp, cp2, bufsz - (size_t)(cp - buf)); } else { return; /* can't happen? */ } } - } while (cp); + } while (cp != NULL); } static char * -meta_name(struct GNode *gn, char *mname, size_t mnamelen, +meta_name(char *mname, size_t mnamelen, const char *dname, - const char *tname) + const char *tname, + const char *cwd) { char buf[MAXPATHLEN]; - char cwd[MAXPATHLEN]; char *rp; char *cp; char *tp; - char *p[4]; /* >= number of possible uses */ - int i; - - i = 0; - if (!dname) - dname = Var_Value(".OBJDIR", gn, &p[i++]); - if (!tname) - tname = Var_Value(TARGET, gn, &p[i++]); - - if (realpath(dname, cwd)) - dname = cwd; + char *dtp; + size_t ldname; /* * Weed out relative paths from the target file name. @@ -249,13 +257,13 @@ meta_name(struct GNode *gn, char *mname, size_t mnamelen, * So we use realpath() just to get the dirname, and leave the * basename as given to us. */ - if ((cp = strrchr(tname, '/'))) { - if (realpath(tname, buf)) { - if ((rp = strrchr(buf, '/'))) { + if ((cp = strrchr(tname, '/')) != NULL) { + if (cached_realpath(tname, buf) != NULL) { + if ((rp = strrchr(buf, '/')) != NULL) { rp++; cp++; if (strcmp(cp, rp) != 0) - strlcpy(rp, cp, sizeof(buf) - (rp - buf)); + strlcpy(rp, cp, sizeof buf - (size_t)(rp - buf)); } tname = buf; } else { @@ -266,21 +274,26 @@ meta_name(struct GNode *gn, char *mname, size_t mnamelen, * next time through. */ if (tname[0] == '/') { - strlcpy(buf, tname, sizeof(buf)); + strlcpy(buf, tname, sizeof buf); } else { - snprintf(buf, sizeof(buf), "%s/%s", cwd, tname); + snprintf(buf, sizeof buf, "%s/%s", cwd, tname); } - eat_dots(buf, sizeof(buf), 1); /* ./ */ - eat_dots(buf, sizeof(buf), 2); /* ../ */ + eat_dots(buf, sizeof buf, 1); /* ./ */ + eat_dots(buf, sizeof buf, 2); /* ../ */ tname = buf; } } /* on some systems dirname may modify its arg */ tp = bmake_strdup(tname); - if (strcmp(dname, dirname(tp)) == 0) + dtp = dirname(tp); + if (strcmp(dname, dtp) == 0) snprintf(mname, mnamelen, "%s.meta", tname); else { - snprintf(mname, mnamelen, "%s/%s.meta", dname, tname); + ldname = strlen(dname); + if (strncmp(dname, dtp, ldname) == 0 && dtp[ldname] == '/') + snprintf(mname, mnamelen, "%s/%s.meta", dname, &tname[ldname+1]); + else + snprintf(mname, mnamelen, "%s/%s.meta", dname, tname); /* * Replace path separators in the file name after the @@ -295,115 +308,121 @@ meta_name(struct GNode *gn, char *mname, size_t mnamelen, } } free(tp); - for (i--; i >= 0; i--) { - if (p[i]) - free(p[i]); - } - return (mname); + return mname; } /* * Return true if running ${.MAKE} * Bypassed if target is flagged .MAKE */ -static int -is_submake(void *cmdp, void *gnp) +static Boolean +is_submake(const char *cmd, GNode *gn) { - static char *p_make = NULL; - static int p_len; - char *cmd = cmdp; - GNode *gn = gnp; + static const char *p_make = NULL; + static size_t p_len; char *mp = NULL; char *cp; char *cp2; - int rc = 0; /* keep looking */ + Boolean rc = FALSE; - if (!p_make) { - p_make = Var_Value(".MAKE", gn, &cp); + if (p_make == NULL) { + p_make = Var_Value(gn, ".MAKE").str; p_len = strlen(p_make); } cp = strchr(cmd, '$'); - if ((cp)) { - mp = Var_Subst(NULL, cmd, gn, FALSE); + if (cp != NULL) { + (void)Var_Subst(cmd, gn, VARE_WANTRES, &mp); + /* TODO: handle errors */ cmd = mp; } cp2 = strstr(cmd, p_make); - if ((cp2)) { + if (cp2 != NULL) { switch (cp2[p_len]) { case '\0': case ' ': case '\t': case '\n': - rc = 1; + rc = TRUE; break; } - if (cp2 > cmd && rc > 0) { + if (cp2 > cmd && rc) { switch (cp2[-1]) { case ' ': case '\t': case '\n': break; default: - rc = 0; /* no match */ + rc = FALSE; /* no match */ break; } } } - if (mp) - free(mp); - return (rc); + free(mp); + return rc; } -typedef struct meta_file_s { - FILE *fp; - GNode *gn; -} meta_file_t; - -static int -printCMD(void *cmdp, void *mfpp) +static Boolean +any_is_submake(GNode *gn) { - meta_file_t *mfp = mfpp; - char *cmd = cmdp; - char *cp = NULL; + StringListNode *ln; - if (strchr(cmd, '$')) { - cmd = cp = Var_Subst(NULL, cmd, mfp->gn, FALSE); + for (ln = gn->commands.first; ln != NULL; ln = ln->next) + if (is_submake(ln->datum, gn)) + return TRUE; + return FALSE; +} + +static void +printCMD(const char *ucmd, FILE *fp, GNode *gn) +{ + FStr xcmd = FStr_InitRefer(ucmd); + + if (strchr(ucmd, '$') != NULL) { + char *expanded; + (void)Var_Subst(ucmd, gn, VARE_WANTRES, &expanded); + /* TODO: handle errors */ + xcmd = FStr_InitOwn(expanded); } - fprintf(mfp->fp, "CMD %s\n", cmd); - if (cp) - free(cp); - return 0; + + fprintf(fp, "CMD %s\n", xcmd.str); + FStr_Done(&xcmd); +} + +static void +printCMDs(GNode *gn, FILE *fp) +{ + StringListNode *ln; + + for (ln = gn->commands.first; ln != NULL; ln = ln->next) + printCMD(ln->datum, fp, gn); } /* * Certain node types never get a .meta file */ #define SKIP_META_TYPE(_type) do { \ - if ((gn->type & __CONCAT(OP_, _type))) { \ - if (DEBUG(META)) { \ - fprintf(debug_file, "Skipping meta for %s: .%s\n", \ - gn->name, __STRING(_type)); \ + if ((gn->type & __CONCAT(OP_, _type))) { \ + if (verbose) { \ + debug_printf("Skipping meta for %s: .%s\n", \ + gn->name, __STRING(_type)); \ } \ - return (NULL); \ + return FALSE; \ } \ -} while (0) +} while (/*CONSTCOND*/FALSE) -static FILE * -meta_create(BuildMon *pbm, GNode *gn) + +/* + * Do we need/want a .meta file ? + */ +static Boolean +meta_needed(GNode *gn, const char *dname, + char *objdir_realpath, Boolean verbose) { - meta_file_t mf; - char buf[MAXPATHLEN]; - char objdir[MAXPATHLEN]; - char **ptr; - const char *dname; - const char *tname; - char *fname; - const char *cp; - char *p[4]; /* >= possible uses */ - int i; - struct stat fs; + struct cached_stat cst; + + if (verbose) + verbose = DEBUG(META); - /* This may be a phony node which we don't want meta data for... */ /* Skip .meta for .BEGIN, .END, .ERROR etc as well. */ /* Or it may be explicitly flagged as .NOMETA */ @@ -415,116 +434,122 @@ meta_create(BuildMon *pbm, GNode *gn) SKIP_META_TYPE(MAKE); } - mf.fp = NULL; - - i = 0; - - dname = Var_Value(".OBJDIR", gn, &p[i++]); - tname = Var_Value(TARGET, gn, &p[i++]); - - /* The object directory may not exist. Check it.. */ - if (stat(dname, &fs) != 0) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: no .OBJDIR\n", - gn->name); - goto out; - } /* Check if there are no commands to execute. */ - if (Lst_IsEmpty(gn->commands)) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: no commands\n", - gn->name); - goto out; + if (Lst_IsEmpty(&gn->commands)) { + if (verbose) + debug_printf("Skipping meta for %s: no commands\n", gn->name); + return FALSE; + } + if ((gn->type & (OP_META|OP_SUBMAKE)) == OP_SUBMAKE) { + /* OP_SUBMAKE is a bit too aggressive */ + if (any_is_submake(gn)) { + DEBUG1(META, "Skipping meta for %s: .SUBMAKE\n", gn->name); + return FALSE; + } + } + + /* The object directory may not exist. Check it.. */ + if (cached_stat(dname, &cst) != 0) { + if (verbose) + debug_printf("Skipping meta for %s: no .OBJDIR\n", gn->name); + return FALSE; } /* make sure these are canonical */ - if (realpath(dname, objdir)) - dname = objdir; + if (cached_realpath(dname, objdir_realpath) != NULL) + dname = objdir_realpath; /* If we aren't in the object directory, don't create a meta file. */ if (!metaCurdirOk && strcmp(curdir, dname) == 0) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: .OBJDIR == .CURDIR\n", - gn->name); + if (verbose) + debug_printf("Skipping meta for %s: .OBJDIR == .CURDIR\n", + gn->name); + return FALSE; + } + return TRUE; +} + + +static FILE * +meta_create(BuildMon *pbm, GNode *gn) +{ + FILE *fp; + char buf[MAXPATHLEN]; + char objdir_realpath[MAXPATHLEN]; + char **ptr; + FStr dname; + const char *tname; + char *fname; + const char *cp; + + fp = NULL; + + dname = Var_Value(gn, ".OBJDIR"); + tname = GNode_VarTarget(gn); + + /* if this succeeds objdir_realpath is realpath of dname */ + if (!meta_needed(gn, dname.str, objdir_realpath, TRUE)) goto out; - } - if (!(gn->type & OP_META)) { - /* We do not generate .meta files for sub-makes */ - if (Lst_ForEach(gn->commands, is_submake, gn)) { - if (DEBUG(META)) - fprintf(debug_file, "Skipping meta for %s: .MAKE\n", - gn->name); - goto out; - } - } + dname.str = objdir_realpath; if (metaVerbose) { char *mp; /* Describe the target we are building */ - mp = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", gn, 0); - if (*mp) + (void)Var_Subst("${" MAKE_META_PREFIX "}", gn, VARE_WANTRES, &mp); + /* TODO: handle errors */ + if (mp[0] != '\0') fprintf(stdout, "%s\n", mp); free(mp); } /* Get the basename of the target */ - if ((cp = strrchr(tname, '/')) == NULL) { - cp = tname; - } else { - cp++; - } + cp = str_basename(tname); fflush(stdout); - if (strcmp(cp, makeDependfile) == 0) - goto out; - if (!writeMeta) /* Don't create meta data. */ goto out; - fname = meta_name(gn, pbm->meta_fname, sizeof(pbm->meta_fname), - dname, tname); + fname = meta_name(pbm->meta_fname, sizeof pbm->meta_fname, + dname.str, tname, objdir_realpath); #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_create: %s\n", fname); + DEBUG1(META, "meta_create: %s\n", fname); #endif - if ((mf.fp = fopen(fname, "w")) == NULL) + if ((fp = fopen(fname, "w")) == NULL) err(1, "Could not open meta file '%s'", fname); - fprintf(mf.fp, "# Meta data file %s\n", fname); + fprintf(fp, "# Meta data file %s\n", fname); - mf.gn = gn; - - Lst_ForEach(gn->commands, printCMD, &mf); - - fprintf(mf.fp, "CWD %s\n", getcwd(buf, sizeof(buf))); - fprintf(mf.fp, "TARGET %s\n", tname); + printCMDs(gn, fp); + fprintf(fp, "CWD %s\n", getcwd(buf, sizeof buf)); + fprintf(fp, "TARGET %s\n", tname); + cp = GNode_VarOodate(gn); + if (cp != NULL && *cp != '\0') { + fprintf(fp, "OODATE %s\n", cp); + } if (metaEnv) { for (ptr = environ; *ptr != NULL; ptr++) - fprintf(mf.fp, "ENV %s\n", *ptr); + fprintf(fp, "ENV %s\n", *ptr); } - fprintf(mf.fp, "-- command output --\n"); - fflush(mf.fp); + fprintf(fp, "-- command output --\n"); + fflush(fp); - Var_Append(".MAKE.META.FILES", fname, VAR_GLOBAL); - Var_Append(".MAKE.META.CREATED", fname, VAR_GLOBAL); + Global_Append(".MAKE.META.FILES", fname); + Global_Append(".MAKE.META.CREATED", fname); gn->type |= OP_META; /* in case anyone wants to know */ if (metaSilent) { gn->type |= OP_SILENT; } out: - for (i--; i >= 0; i--) { - if (p[i]) - free(p[i]); - } + FStr_Done(&dname); - return (mf.fp); + return fp; } static Boolean @@ -549,76 +574,89 @@ meta_init(void) { #ifdef USE_FILEMON /* this allows makefiles to test if we have filemon support */ - Var_Set(".MAKE.PATH_FILEMON", _PATH_FILEMON, VAR_GLOBAL, 0); + Global_Set(".MAKE.PATH_FILEMON", filemon_path()); #endif } +#define get_mode_bf(bf, token) \ + if ((cp = strstr(make_mode, token)) != NULL) \ + bf = boolValue(cp + sizeof (token) - 1) + /* * Initialization we need after reading makefiles. */ void meta_mode_init(const char *make_mode) { - static int once = 0; + static Boolean once = FALSE; char *cp; + FStr value; useMeta = TRUE; useFilemon = TRUE; writeMeta = TRUE; - if (make_mode) { - if (strstr(make_mode, "env")) + if (make_mode != NULL) { + if (strstr(make_mode, "env") != NULL) metaEnv = TRUE; - if (strstr(make_mode, "verb")) + if (strstr(make_mode, "verb") != NULL) metaVerbose = TRUE; - if (strstr(make_mode, "read")) + if (strstr(make_mode, "read") != NULL) writeMeta = FALSE; - if (strstr(make_mode, "nofilemon")) + if (strstr(make_mode, "nofilemon") != NULL) useFilemon = FALSE; - if ((cp = strstr(make_mode, "curdirok="))) { - metaCurdirOk = boolValue(&cp[9]); - } - if ((cp = strstr(make_mode, "silent="))) { - metaSilent = boolValue(&cp[7]); - } - if (strstr(make_mode, "ignore-cmd")) + if (strstr(make_mode, "ignore-cmd") != NULL) metaIgnoreCMDs = TRUE; - /* for backwards compatability */ - Var_Set(".MAKE.META_CREATED", "${.MAKE.META.CREATED}", VAR_GLOBAL, 0); - Var_Set(".MAKE.META_FILES", "${.MAKE.META.FILES}", VAR_GLOBAL, 0); + if (useFilemon) + get_mode_bf(filemonMissing, "missing-filemon="); + get_mode_bf(metaCurdirOk, "curdirok="); + get_mode_bf(metaMissing, "missing-meta="); + get_mode_bf(metaSilent, "silent="); } - if (metaVerbose && !Var_Exists(MAKE_META_PREFIX, VAR_GLOBAL)) { + if (metaVerbose && !Var_Exists(SCOPE_GLOBAL, MAKE_META_PREFIX)) { /* * The default value for MAKE_META_PREFIX * prints the absolute path of the target. * This works be cause :H will generate '.' if there is no / * and :tA will resolve that to cwd. */ - Var_Set(MAKE_META_PREFIX, "Building ${.TARGET:H:tA}/${.TARGET:T}", VAR_GLOBAL, 0); + Global_Set(MAKE_META_PREFIX, + "Building ${.TARGET:H:tA}/${.TARGET:T}"); } if (once) return; - once = 1; - memset(&Mybm, 0, sizeof(Mybm)); + once = TRUE; + memset(&Mybm, 0, sizeof Mybm); /* * We consider ourselves master of all within ${.MAKE.META.BAILIWICK} */ - metaBailiwick = Lst_Init(FALSE); - cp = Var_Subst(NULL, "${.MAKE.META.BAILIWICK:O:u:tA}", VAR_GLOBAL, 0); - if (cp) { - str2Lst_Append(metaBailiwick, cp, NULL); - } + (void)Var_Subst("${.MAKE.META.BAILIWICK:O:u:tA}", + SCOPE_GLOBAL, VARE_WANTRES, &metaBailiwickStr); + /* TODO: handle errors */ + str2Lst_Append(&metaBailiwick, metaBailiwickStr); /* * We ignore any paths that start with ${.MAKE.META.IGNORE_PATHS} */ - metaIgnorePaths = Lst_Init(FALSE); - Var_Append(MAKE_META_IGNORE_PATHS, - "/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}", VAR_GLOBAL); - cp = Var_Subst(NULL, - "${" MAKE_META_IGNORE_PATHS ":O:u:tA}", VAR_GLOBAL, 0); - if (cp) { - str2Lst_Append(metaIgnorePaths, cp, NULL); + Global_Append(MAKE_META_IGNORE_PATHS, + "/dev /etc /proc /tmp /var/run /var/tmp ${TMPDIR}"); + (void)Var_Subst("${" MAKE_META_IGNORE_PATHS ":O:u:tA}", + SCOPE_GLOBAL, VARE_WANTRES, &metaIgnorePathsStr); + /* TODO: handle errors */ + str2Lst_Append(&metaIgnorePaths, metaIgnorePathsStr); + + /* + * We ignore any paths that match ${.MAKE.META.IGNORE_PATTERNS} + */ + value = Var_Value(SCOPE_GLOBAL, MAKE_META_IGNORE_PATTERNS); + if (value.str != NULL) { + metaIgnorePatterns = TRUE; + FStr_Done(&value); + } + value = Var_Value(SCOPE_GLOBAL, MAKE_META_IGNORE_FILTER); + if (value.str != NULL) { + metaIgnoreFilter = TRUE; + FStr_Done(&value); } } @@ -643,9 +681,10 @@ meta_job_start(Job *job, GNode *gn) #endif #ifdef USE_FILEMON if (pbm->mfp != NULL && useFilemon) { - filemon_open(pbm); + meta_open_filemon(pbm); } else { - pbm->mon_fd = pbm->filemon_fd = -1; + pbm->mon_fd = -1; + pbm->filemon = NULL; } #endif } @@ -667,11 +706,11 @@ meta_job_child(Job *job) } if (pbm->mfp != NULL) { close(fileno(pbm->mfp)); - if (useFilemon) { + if (useFilemon && pbm->filemon != NULL) { pid_t pid; pid = getpid(); - if (ioctl(pbm->filemon_fd, FILEMON_SET_PID, &pid) < 0) { + if (filemon_setpid_child(pbm->filemon, pid) == -1) { err(1, "Could not set filemon pid!"); } } @@ -680,31 +719,81 @@ meta_job_child(Job *job) } void -meta_job_error(Job *job, GNode *gn, int flags, int status) +meta_job_parent(Job *job, pid_t pid) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + BuildMon *pbm; + + if (job != NULL) { + pbm = &job->bm; + } else { + pbm = &Mybm; + } + if (useFilemon && pbm->filemon != NULL) { + filemon_setpid_parent(pbm->filemon, pid); + } +#endif +} + +int +meta_job_fd(Job *job) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + BuildMon *pbm; + + if (job != NULL) { + pbm = &job->bm; + } else { + pbm = &Mybm; + } + if (useFilemon && pbm->filemon != NULL) { + return filemon_readfd(pbm->filemon); + } +#endif + return -1; +} + +int +meta_job_event(Job *job) +{ +#if defined(USE_FILEMON) && !defined(USE_FILEMON_DEV) + BuildMon *pbm; + + if (job != NULL) { + pbm = &job->bm; + } else { + pbm = &Mybm; + } + if (useFilemon && pbm->filemon != NULL) { + return filemon_process(pbm->filemon); + } +#endif + return 0; +} + +void +meta_job_error(Job *job, GNode *gn, Boolean ignerr, int status) { char cwd[MAXPATHLEN]; BuildMon *pbm; if (job != NULL) { pbm = &job->bm; - } else { - if (!gn) + if (gn == NULL) gn = job->node; + } else { pbm = &Mybm; } if (pbm->mfp != NULL) { - fprintf(pbm->mfp, "*** Error code %d%s\n", - status, - (flags & JOB_IGNERR) ? - "(ignored)" : ""); + fprintf(pbm->mfp, "\n*** Error code %d%s\n", + status, ignerr ? "(ignored)" : ""); } - if (gn) { - Var_Set(".ERROR_TARGET", gn->path ? gn->path : gn->name, VAR_GLOBAL, 0); - } - getcwd(cwd, sizeof(cwd)); - Var_Set(".ERROR_CWD", cwd, VAR_GLOBAL, 0); - if (pbm && pbm->meta_fname[0]) { - Var_Set(".ERROR_META_FILE", pbm->meta_fname, VAR_GLOBAL, 0); + if (gn != NULL) + Global_Set(".ERROR_TARGET", GNode_Path(gn)); + getcwd(cwd, sizeof cwd); + Global_Set(".ERROR_CWD", cwd); + if (pbm->meta_fname[0] != '\0') { + Global_Set(".ERROR_META_FILE", pbm->meta_fname); } meta_job_finish(job); } @@ -713,7 +802,7 @@ void meta_job_output(Job *job, char *cp, const char *nl) { BuildMon *pbm; - + if (job != NULL) { pbm = &job->bm; } else { @@ -722,48 +811,67 @@ meta_job_output(Job *job, char *cp, const char *nl) if (pbm->mfp != NULL) { if (metaVerbose) { static char *meta_prefix = NULL; - static int meta_prefix_len; + static size_t meta_prefix_len; - if (!meta_prefix) { + if (meta_prefix == NULL) { char *cp2; - meta_prefix = Var_Subst(NULL, "${" MAKE_META_PREFIX "}", VAR_GLOBAL, 0); - if ((cp2 = strchr(meta_prefix, '$'))) - meta_prefix_len = cp2 - meta_prefix; + (void)Var_Subst("${" MAKE_META_PREFIX "}", + SCOPE_GLOBAL, VARE_WANTRES, &meta_prefix); + /* TODO: handle errors */ + if ((cp2 = strchr(meta_prefix, '$')) != NULL) + meta_prefix_len = (size_t)(cp2 - meta_prefix); else meta_prefix_len = strlen(meta_prefix); } if (strncmp(cp, meta_prefix, meta_prefix_len) == 0) { - cp = strchr(cp+1, '\n'); - if (!cp++) + cp = strchr(cp + 1, '\n'); + if (cp == NULL) return; + cp++; } } fprintf(pbm->mfp, "%s%s", cp, nl); } } -void +int meta_cmd_finish(void *pbmp) { -#ifdef USE_FILEMON + int error = 0; BuildMon *pbm = pbmp; +#ifdef USE_FILEMON + int x; +#endif - if (!pbm) + if (pbm == NULL) pbm = &Mybm; - if (pbm->filemon_fd >= 0) { - close(pbm->filemon_fd); - filemon_read(pbm->mfp, pbm->mon_fd); - pbm->filemon_fd = pbm->mon_fd = -1; +#ifdef USE_FILEMON + if (pbm->filemon != NULL) { + while (filemon_process(pbm->filemon) > 0) + continue; + if (filemon_close(pbm->filemon) == -1) + error = errno; + x = filemon_read(pbm->mfp, pbm->mon_fd); + if (error == 0 && x != 0) + error = x; + pbm->mon_fd = -1; + pbm->filemon = NULL; + return error; } #endif + + fprintf(pbm->mfp, "\n"); /* ensure end with newline */ + return error; } -void +int meta_job_finish(Job *job) { BuildMon *pbm; + int error = 0; + int x; if (job != NULL) { pbm = &job->bm; @@ -771,18 +879,30 @@ meta_job_finish(Job *job) pbm = &Mybm; } if (pbm->mfp != NULL) { - meta_cmd_finish(pbm); - fclose(pbm->mfp); + error = meta_cmd_finish(pbm); + x = fclose(pbm->mfp); + if (error == 0 && x != 0) + error = errno; pbm->mfp = NULL; pbm->meta_fname[0] = '\0'; } + return error; +} + +void +meta_finish(void) +{ + Lst_Done(&metaBailiwick); + free(metaBailiwickStr); + Lst_Done(&metaIgnorePaths); + free(metaIgnorePathsStr); } /* * Fetch a full line from fp - growing bufp if needed * Return length in bufp. */ -static int +static int fgetLine(char **bufp, size_t *szp, int o, FILE *fp) { char *buf = *bufp; @@ -790,9 +910,9 @@ fgetLine(char **bufp, size_t *szp, int o, FILE *fp) struct stat fs; int x; - if (fgets(&buf[o], bufsz - o, fp) != NULL) { + if (fgets(&buf[o], (int)bufsz - o, fp) != NULL) { check_newline: - x = o + strlen(&buf[o]); + x = o + (int)strlen(&buf[o]); if (buf[x - 1] == '\n') return x; /* @@ -803,45 +923,117 @@ fgetLine(char **bufp, size_t *szp, int o, FILE *fp) size_t newsz; char *p; - newsz = ROUNDUP((fs.st_size / 2), BUFSIZ); + newsz = ROUNDUP(((size_t)fs.st_size / 2), BUFSIZ); if (newsz <= bufsz) - newsz = ROUNDUP(fs.st_size, BUFSIZ); - if (DEBUG(META)) - fprintf(debug_file, "growing buffer %zu -> %zu\n", - bufsz, newsz); + newsz = ROUNDUP((size_t)fs.st_size, BUFSIZ); + if (newsz <= bufsz) + return x; /* truncated */ + DEBUG2(META, "growing buffer %u -> %u\n", + (unsigned)bufsz, (unsigned)newsz); p = bmake_realloc(buf, newsz); - if (p) { - *bufp = buf = p; - *szp = bufsz = newsz; - /* fetch the rest */ - if (!fgets(&buf[x], bufsz - x, fp)) - return x; /* truncated! */ - goto check_newline; - } + *bufp = buf = p; + *szp = bufsz = newsz; + /* fetch the rest */ + if (fgets(&buf[x], (int)bufsz - x, fp) == NULL) + return x; /* truncated! */ + goto check_newline; } } return 0; } -static int -prefix_match(void *p, void *q) +static Boolean +prefix_match(const char *prefix, const char *path) { - const char *prefix = p; - const char *path = q; size_t n = strlen(prefix); - return (0 == strncmp(path, prefix, n)); + return strncmp(path, prefix, n) == 0; } -static int -string_match(const void *p, const void *q) +static Boolean +has_any_prefix(const char *path, StringList *prefixes) { - const char *p1 = p; - const char *p2 = q; + StringListNode *ln; - return strcmp(p1, p2); + for (ln = prefixes->first; ln != NULL; ln = ln->next) + if (prefix_match(ln->datum, path)) + return TRUE; + return FALSE; } +/* See if the path equals prefix or starts with "prefix/". */ +static Boolean +path_starts_with(const char *path, const char *prefix) +{ + size_t n = strlen(prefix); + + if (strncmp(path, prefix, n) != 0) + return FALSE; + return path[n] == '\0' || path[n] == '/'; +} + +static Boolean +meta_ignore(GNode *gn, const char *p) +{ + char fname[MAXPATHLEN]; + + if (p == NULL) + return TRUE; + + if (*p == '/') { + cached_realpath(p, fname); /* clean it up */ + if (has_any_prefix(fname, &metaIgnorePaths)) { +#ifdef DEBUG_META_MODE + DEBUG1(META, "meta_oodate: ignoring path: %s\n", p); +#endif + return TRUE; + } + } + + if (metaIgnorePatterns) { + const char *expr; + char *pm; + + /* + * XXX: This variable is set on a target GNode but is not one of + * the usual local variables. It should be deleted afterwards. + * Ideally it would not be created in the first place, just like + * in a .for loop. + */ + Var_Set(gn, ".p.", p); + expr = "${" MAKE_META_IGNORE_PATTERNS ":@m@${.p.:M$m}@}"; + (void)Var_Subst(expr, gn, VARE_WANTRES, &pm); + /* TODO: handle errors */ + if (pm[0] != '\0') { +#ifdef DEBUG_META_MODE + DEBUG1(META, "meta_oodate: ignoring pattern: %s\n", p); +#endif + free(pm); + return TRUE; + } + free(pm); + } + + if (metaIgnoreFilter) { + char *fm; + + /* skip if filter result is empty */ + snprintf(fname, sizeof fname, + "${%s:L:${%s:ts:}}", + p, MAKE_META_IGNORE_FILTER); + (void)Var_Subst(fname, gn, VARE_WANTRES, &fm); + /* TODO: handle errors */ + if (*fm == '\0') { +#ifdef DEBUG_META_MODE + DEBUG1(META, "meta_oodate: ignoring filtered: %s\n", p); +#endif + free(fm); + return TRUE; + } + free(fm); + } + return FALSE; +} /* * When running with 'meta' functionality, a target can be out-of-date @@ -856,7 +1048,7 @@ string_match(const void *p, const void *q) * if we detect this we want to reproduce it. * Setting oodate TRUE will have that effect. */ -#define CHECK_VALID_META(p) if (!(p && *p)) { \ +#define CHECK_VALID_META(p) if (!(p != NULL && *p != '\0')) { \ warnx("%s: %d: malformed", fname, lineno); \ oodate = TRUE; \ continue; \ @@ -865,10 +1057,21 @@ string_match(const void *p, const void *q) #define DEQUOTE(p) if (*p == '\'') { \ char *ep; \ p++; \ - if ((ep = strchr(p, '\''))) \ + if ((ep = strchr(p, '\'')) != NULL) \ *ep = '\0'; \ } +static void +append_if_new(StringList *list, const char *str) +{ + StringListNode *ln; + + for (ln = list->first; ln != NULL; ln = ln->next) + if (strcmp(ln->datum, str) == 0) + return; + Lst_Append(list, bmake_strdup(str)); +} + Boolean meta_oodate(GNode *gn, Boolean oodate) { @@ -882,20 +1085,30 @@ meta_oodate(GNode *gn, Boolean oodate) char fname1[MAXPATHLEN]; char fname2[MAXPATHLEN]; char fname3[MAXPATHLEN]; + FStr dname; + const char *tname; char *p; - char *cp; char *link_src; char *move_target; static size_t cwdlen = 0; static size_t tmplen = 0; FILE *fp; Boolean needOODATE = FALSE; - Lst missingFiles; - + StringList missingFiles; + Boolean have_filemon = FALSE; + if (oodate) return oodate; /* we're done */ - missingFiles = Lst_Init(FALSE); + dname = Var_Value(gn, ".OBJDIR"); + tname = GNode_VarTarget(gn); + + /* if this succeeds fname3 is realpath of dname */ + if (!meta_needed(gn, dname.str, fname3, FALSE)) + goto oodate_out; + dname.str = fname3; + + Lst_Init(&missingFiles); /* * We need to check if the target is out-of-date. This includes @@ -905,11 +1118,10 @@ meta_oodate(GNode *gn, Boolean oodate) */ Make_DoAllVar(gn); - meta_name(gn, fname, sizeof(fname), NULL, NULL); + meta_name(fname, sizeof fname, dname.str, tname, dname.str); #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: %s\n", fname); + DEBUG1(META, "meta_oodate: %s\n", fname); #endif if ((fp = fopen(fname, "r")) != NULL) { @@ -918,33 +1130,32 @@ meta_oodate(GNode *gn, Boolean oodate) int lineno = 0; int lastpid = 0; int pid; - int f = 0; int x; - LstNode ln; - struct stat fs; + StringListNode *cmdNode; + struct cached_stat cst; - if (!buf) { + if (buf == NULL) { bufsz = 8 * BUFSIZ; buf = bmake_malloc(bufsz); } - if (!cwdlen) { - if (getcwd(cwd, sizeof(cwd)) == NULL) + if (cwdlen == 0) { + if (getcwd(cwd, sizeof cwd) == NULL) err(1, "Could not get current working directory"); cwdlen = strlen(cwd); } - strlcpy(lcwd, cwd, sizeof(lcwd)); - strlcpy(latestdir, cwd, sizeof(latestdir)); + strlcpy(lcwd, cwd, sizeof lcwd); + strlcpy(latestdir, cwd, sizeof latestdir); - if (!tmpdir) { + if (tmpdir == NULL) { tmpdir = getTmpdir(); tmplen = strlen(tmpdir); } /* we want to track all the .meta we read */ - Var_Append(".MAKE.META.FILES", fname, VAR_GLOBAL); + Global_Append(".MAKE.META.FILES", fname); - ln = Lst_First(gn->commands); + cmdNode = gn->commands.first; while (!oodate && (x = fgetLine(&buf, &bufsz, 0, fp)) > 0) { lineno++; if (buf[x - 1] == '\n') @@ -957,25 +1168,24 @@ meta_oodate(GNode *gn, Boolean oodate) link_src = NULL; move_target = NULL; /* Find the start of the build monitor section. */ - if (!f) { + if (!have_filemon) { if (strncmp(buf, "-- filemon", 10) == 0) { - f = 1; + have_filemon = TRUE; continue; } if (strncmp(buf, "# buildmon", 10) == 0) { - f = 1; + have_filemon = TRUE; continue; } - } + } /* Delimit the record type. */ p = buf; #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: %s\n", fname, lineno, buf); + DEBUG3(META, "%s: %d: %s\n", fname, lineno, buf); #endif strsep(&p, " "); - if (f) { + if (have_filemon) { /* * We are in the 'filemon' output section. * Each record from filemon follows the general form: @@ -995,7 +1205,7 @@ meta_oodate(GNode *gn, Boolean oodate) /* * We need to track pathnames per-process. * - * Each process run by make, starts off in the 'CWD' + * Each process run by make starts off in the 'CWD' * recorded in the .meta file, if it chdirs ('C') * elsewhere we need to track that - but only for * that process. If it forks ('F'), we initialize @@ -1014,28 +1224,25 @@ meta_oodate(GNode *gn, Boolean oodate) CHECK_VALID_META(p); pid = atoi(p); if (pid > 0 && pid != lastpid) { - char *ldir; - char *tp; - + FStr ldir; + if (lastpid > 0) { /* We need to remember these. */ - Var_Set(lcwd_vname, lcwd, VAR_GLOBAL, 0); - Var_Set(ldir_vname, latestdir, VAR_GLOBAL, 0); + Global_SetExpand(lcwd_vname, lcwd); + Global_SetExpand(ldir_vname, latestdir); } - snprintf(lcwd_vname, sizeof(lcwd_vname), LCWD_VNAME_FMT, pid); - snprintf(ldir_vname, sizeof(ldir_vname), LDIR_VNAME_FMT, pid); + snprintf(lcwd_vname, sizeof lcwd_vname, LCWD_VNAME_FMT, pid); + snprintf(ldir_vname, sizeof ldir_vname, LDIR_VNAME_FMT, pid); lastpid = pid; - ldir = Var_Value(ldir_vname, VAR_GLOBAL, &tp); - if (ldir) { - strlcpy(latestdir, ldir, sizeof(latestdir)); - if (tp) - free(tp); + ldir = Var_Value(SCOPE_GLOBAL, ldir_vname); + if (ldir.str != NULL) { + strlcpy(latestdir, ldir.str, sizeof latestdir); + FStr_Done(&ldir); } - ldir = Var_Value(lcwd_vname, VAR_GLOBAL, &tp); - if (ldir) { - strlcpy(lcwd, ldir, sizeof(lcwd)); - if (tp) - free(tp); + ldir = Var_Value(SCOPE_GLOBAL, lcwd_vname); + if (ldir.str != NULL) { + strlcpy(lcwd, ldir.str, sizeof lcwd); + FStr_Done(&ldir); } } /* Skip past the pid. */ @@ -1043,9 +1250,9 @@ meta_oodate(GNode *gn, Boolean oodate) continue; #ifdef DEBUG_META_MODE if (DEBUG(META)) - fprintf(debug_file, "%s: %d: %d: %c: cwd=%s lcwd=%s ldir=%s\n", - fname, lineno, - pid, buf[0], cwd, lcwd, latestdir); + debug_printf("%s: %d: %d: %c: cwd=%s lcwd=%s ldir=%s\n", + fname, lineno, + pid, buf[0], cwd, lcwd, latestdir); #endif break; } @@ -1055,8 +1262,8 @@ meta_oodate(GNode *gn, Boolean oodate) /* Process according to record type. */ switch (buf[0]) { case 'X': /* eXit */ - Var_Delete(lcwd_vname, VAR_GLOBAL); - Var_Delete(ldir_vname, VAR_GLOBAL); + Var_DeleteExpand(SCOPE_GLOBAL, lcwd_vname); + Var_DeleteExpand(SCOPE_GLOBAL, ldir_vname); lastpid = 0; /* no need to save ldir_vname */ break; @@ -1067,15 +1274,16 @@ meta_oodate(GNode *gn, Boolean oodate) child = atoi(p); if (child > 0) { - snprintf(cldir, sizeof(cldir), LCWD_VNAME_FMT, child); - Var_Set(cldir, lcwd, VAR_GLOBAL, 0); - snprintf(cldir, sizeof(cldir), LDIR_VNAME_FMT, child); - Var_Set(cldir, latestdir, VAR_GLOBAL, 0); + snprintf(cldir, sizeof cldir, LCWD_VNAME_FMT, child); + Global_SetExpand(cldir, lcwd); + snprintf(cldir, sizeof cldir, LDIR_VNAME_FMT, child); + Global_SetExpand(cldir, latestdir); #ifdef DEBUG_META_MODE if (DEBUG(META)) - fprintf(debug_file, "%s: %d: %d: cwd=%s lcwd=%s ldir=%s\n", - fname, lineno, - child, cwd, lcwd, latestdir); + debug_printf( + "%s: %d: %d: cwd=%s lcwd=%s ldir=%s\n", + fname, lineno, + child, cwd, lcwd, latestdir); #endif } } @@ -1083,13 +1291,13 @@ meta_oodate(GNode *gn, Boolean oodate) case 'C': /* Chdir */ /* Update lcwd and latest directory. */ - strlcpy(latestdir, p, sizeof(latestdir)); - strlcpy(lcwd, p, sizeof(lcwd)); - Var_Set(lcwd_vname, lcwd, VAR_GLOBAL, 0); - Var_Set(ldir_vname, lcwd, VAR_GLOBAL, 0); + strlcpy(latestdir, p, sizeof latestdir); + strlcpy(lcwd, p, sizeof lcwd); + Global_SetExpand(lcwd_vname, lcwd); + Global_SetExpand(ldir_vname, lcwd); #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: cwd=%s ldir=%s\n", fname, lineno, cwd, lcwd); + DEBUG4(META, "%s: %d: cwd=%s ldir=%s\n", + fname, lineno, cwd, lcwd); #endif break; @@ -1099,33 +1307,37 @@ meta_oodate(GNode *gn, Boolean oodate) * the src as for 'R'ead * and the target as for 'W'rite. */ - cp = p; /* save this for a second */ - /* now get target */ - if (strsep(&p, " ") == NULL) - continue; - CHECK_VALID_META(p); - move_target = p; - p = cp; + { + char *cp = p; /* save this for a second */ + /* now get target */ + if (strsep(&p, " ") == NULL) + continue; + CHECK_VALID_META(p); + move_target = p; + p = cp; + } /* 'L' and 'M' put single quotes around the args */ DEQUOTE(p); DEQUOTE(move_target); /* FALLTHROUGH */ case 'D': /* unlink */ - if (*p == '/' && !Lst_IsEmpty(missingFiles)) { - /* remove p from the missingFiles list if present */ - if ((ln = Lst_Find(missingFiles, p, string_match)) != NULL) { - char *tp = Lst_Datum(ln); - Lst_Remove(missingFiles, ln); - free(tp); - ln = NULL; /* we're done with it */ + if (*p == '/') { + /* remove any missingFiles entries that match p */ + StringListNode *ln = missingFiles.first; + while (ln != NULL) { + StringListNode *next = ln->next; + if (path_starts_with(ln->datum, p)) { + free(ln->datum); + Lst_Remove(&missingFiles, ln); + } + ln = next; } } if (buf[0] == 'M') { /* the target of the mv is a file 'W'ritten */ #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: M %s -> %s\n", - p, move_target); + DEBUG2(META, "meta_oodate: M %s -> %s\n", + p, move_target); #endif p = move_target; goto check_write; @@ -1146,9 +1358,7 @@ meta_oodate(GNode *gn, Boolean oodate) DEQUOTE(p); DEQUOTE(link_src); #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: L %s -> %s\n", - link_src, p); + DEBUG2(META, "meta_oodate: L %s -> %s\n", link_src, p); #endif /* FALLTHROUGH */ case 'W': /* Write */ @@ -1156,20 +1366,20 @@ meta_oodate(GNode *gn, Boolean oodate) /* * If a file we generated within our bailiwick * but outside of .OBJDIR is missing, - * we need to do it again. + * we need to do it again. */ /* ignore non-absolute paths */ if (*p != '/') break; - if (Lst_IsEmpty(metaBailiwick)) + if (Lst_IsEmpty(&metaBailiwick)) break; /* ignore cwd - normal dependencies handle those */ if (strncmp(p, cwd, cwdlen) == 0) break; - if (!Lst_ForEach(metaBailiwick, prefix_match, p)) + if (!has_any_prefix(p, &metaBailiwick)) break; /* tmpdir might be within */ @@ -1177,19 +1387,21 @@ meta_oodate(GNode *gn, Boolean oodate) break; /* ignore anything containing the string "tmp" */ - if ((strstr("tmp", p))) + /* XXX: The arguments to strstr must be swapped. */ + if (strstr("tmp", p) != NULL) break; - if (stat(p, &fs) < 0) { - Lst_AtEnd(missingFiles, bmake_strdup(p)); + if ((link_src != NULL && cached_lstat(p, &cst) < 0) || + (link_src == NULL && cached_stat(p, &cst) < 0)) { + if (!meta_ignore(gn, p)) + append_if_new(&missingFiles, p); } break; check_link_src: p = link_src; link_src = NULL; #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: L src %s\n", p); + DEBUG1(META, "meta_oodate: L src %s\n", p); #endif /* FALLTHROUGH */ case 'R': /* Read */ @@ -1199,15 +1411,8 @@ meta_oodate(GNode *gn, Boolean oodate) * be part of the dependencies because * they are _expected_ to change. */ - if (*p == '/' && - Lst_ForEach(metaIgnorePaths, prefix_match, p)) { -#ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "meta_oodate: ignoring: %s\n", - p); -#endif + if (meta_ignore(gn, p)) break; - } /* * The rest of the record is the file name. @@ -1217,54 +1422,54 @@ meta_oodate(GNode *gn, Boolean oodate) char *sdirs[4]; char **sdp; int sdx = 0; - int found = 0; + Boolean found = FALSE; if (*p == '/') { sdirs[sdx++] = p; /* done */ } else { if (strcmp(".", p) == 0) - continue; /* no point */ + continue; /* no point */ /* Check vs latestdir */ - snprintf(fname1, sizeof(fname1), "%s/%s", latestdir, p); + snprintf(fname1, sizeof fname1, "%s/%s", latestdir, p); sdirs[sdx++] = fname1; if (strcmp(latestdir, lcwd) != 0) { /* Check vs lcwd */ - snprintf(fname2, sizeof(fname2), "%s/%s", lcwd, p); + snprintf(fname2, sizeof fname2, "%s/%s", lcwd, p); sdirs[sdx++] = fname2; } if (strcmp(lcwd, cwd) != 0) { /* Check vs cwd */ - snprintf(fname3, sizeof(fname3), "%s/%s", cwd, p); + snprintf(fname3, sizeof fname3, "%s/%s", cwd, p); sdirs[sdx++] = fname3; } } sdirs[sdx++] = NULL; - for (sdp = sdirs; *sdp && !found; sdp++) { + for (sdp = sdirs; *sdp != NULL && !found; sdp++) { #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: looking for: %s\n", fname, lineno, *sdp); + DEBUG3(META, "%s: %d: looking for: %s\n", + fname, lineno, *sdp); #endif - if (stat(*sdp, &fs) == 0) { - found = 1; + if (cached_stat(*sdp, &cst) == 0) { + found = TRUE; p = *sdp; } } if (found) { #ifdef DEBUG_META_MODE - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: found: %s\n", fname, lineno, p); + DEBUG3(META, "%s: %d: found: %s\n", + fname, lineno, p); #endif - if (!S_ISDIR(fs.st_mode) && - fs.st_mtime > gn->mtime) { - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: file '%s' is newer than the target...\n", fname, lineno, p); + if (!S_ISDIR(cst.cst_mode) && + cst.cst_mtime > gn->mtime) { + DEBUG3(META, "%s: %d: file '%s' is newer than the target...\n", + fname, lineno, p); oodate = TRUE; - } else if (S_ISDIR(fs.st_mode)) { + } else if (S_ISDIR(cst.cst_mode)) { /* Update the latest directory. */ - realpath(p, latestdir); + cached_realpath(p, latestdir); } } else if (errno == ENOENT && *p == '/' && strncmp(p, cwd, cwdlen) != 0) { @@ -1272,14 +1477,12 @@ meta_oodate(GNode *gn, Boolean oodate) * A referenced file outside of CWD is missing. * We cannot catch every eventuality here... */ - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: file '%s' may have moved?...\n", fname, lineno, p); - oodate = TRUE; + append_if_new(&missingFiles, p); } } if (buf[0] == 'E') { /* previous latestdir is no longer relevant */ - strlcpy(latestdir, lcwd, sizeof(latestdir)); + strlcpy(latestdir, lcwd, sizeof latestdir); } break; default: @@ -1292,29 +1495,31 @@ meta_oodate(GNode *gn, Boolean oodate) * Compare the current command with the one in the * meta data file. */ - if (ln == NULL) { - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: there were more build commands in the meta data file than there are now...\n", fname, lineno); + if (cmdNode == NULL) { + DEBUG2(META, "%s: %d: there were more build commands in the meta data file than there are now...\n", + fname, lineno); oodate = TRUE; } else { - char *cmd = (char *)Lst_Datum(ln); + const char *cp; + char *cmd = cmdNode->datum; Boolean hasOODATE = FALSE; - if (strstr(cmd, "$?")) + if (strstr(cmd, "$?") != NULL) hasOODATE = TRUE; - else if ((cp = strstr(cmd, ".OODATE"))) { + else if ((cp = strstr(cmd, ".OODATE")) != NULL) { /* check for $[{(].OODATE[:)}] */ if (cp > cmd + 2 && cp[-2] == '$') hasOODATE = TRUE; } if (hasOODATE) { needOODATE = TRUE; - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: cannot compare command using .OODATE\n", fname, lineno); + DEBUG2(META, "%s: %d: cannot compare command using .OODATE\n", + fname, lineno); } - cmd = Var_Subst(NULL, cmd, gn, TRUE); + (void)Var_Subst(cmd, gn, VARE_UNDEFERR, &cmd); + /* TODO: handle errors */ - if ((cp = strchr(cmd, '\n'))) { + if ((cp = strchr(cmd, '\n')) != NULL) { int n; /* @@ -1334,66 +1539,85 @@ meta_oodate(GNode *gn, Boolean oodate) warnx("%s: %d: line truncated at %u", fname, lineno, x); break; } - cp = strchr(++cp, '\n'); - } while (cp); + cp = strchr(cp + 1, '\n'); + } while (cp != NULL); if (buf[x - 1] == '\n') buf[x - 1] = '\0'; } - if (!hasOODATE && + if (p != NULL && + !hasOODATE && !(gn->type & OP_NOMETA_CMP) && - strcmp(p, cmd) != 0) { - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: a build command has changed\n%s\nvs\n%s\n", fname, lineno, p, cmd); + (strcmp(p, cmd) != 0)) { + DEBUG4(META, "%s: %d: a build command has changed\n%s\nvs\n%s\n", + fname, lineno, p, cmd); if (!metaIgnoreCMDs) oodate = TRUE; } free(cmd); - ln = Lst_Succ(ln); + cmdNode = cmdNode->next; } } else if (strcmp(buf, "CWD") == 0) { /* * Check if there are extra commands now * that weren't in the meta data file. */ - if (!oodate && ln != NULL) { - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: there are extra build commands now that weren't in the meta data file\n", fname, lineno); + if (!oodate && cmdNode != NULL) { + DEBUG2(META, "%s: %d: there are extra build commands now that weren't in the meta data file\n", + fname, lineno); oodate = TRUE; } + CHECK_VALID_META(p); if (strcmp(p, cwd) != 0) { - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: the current working directory has changed from '%s' to '%s'\n", fname, lineno, p, curdir); + DEBUG4(META, "%s: %d: the current working directory has changed from '%s' to '%s'\n", + fname, lineno, p, curdir); oodate = TRUE; } } } fclose(fp); - if (!Lst_IsEmpty(missingFiles)) { - if (DEBUG(META)) - fprintf(debug_file, "%s: missing files: %s...\n", - fname, (char *)Lst_Datum(Lst_First(missingFiles))); + if (!Lst_IsEmpty(&missingFiles)) { + DEBUG2(META, "%s: missing files: %s...\n", + fname, (char *)missingFiles.first->datum); + oodate = TRUE; + } + if (!oodate && !have_filemon && filemonMissing) { + DEBUG1(META, "%s: missing filemon data\n", fname); oodate = TRUE; - Lst_Destroy(missingFiles, (FreeProc *)free); } } else { - if ((gn->type & OP_META)) { - if (DEBUG(META)) - fprintf(debug_file, "%s: required but missing\n", fname); - oodate = TRUE; + if (writeMeta && (metaMissing || (gn->type & OP_META))) { + const char *cp = NULL; + + /* if target is in .CURDIR we do not need a meta file */ + if (gn->path != NULL && (cp = strrchr(gn->path, '/')) != NULL && + (cp > gn->path)) { + if (strncmp(curdir, gn->path, (size_t)(cp - gn->path)) != 0) { + cp = NULL; /* not in .CURDIR */ + } + } + if (cp == NULL) { + DEBUG1(META, "%s: required but missing\n", fname); + oodate = TRUE; + needOODATE = TRUE; /* assume the worst */ + } } } + + Lst_DoneCall(&missingFiles, free); + if (oodate && needOODATE) { /* * Target uses .OODATE which is empty; or we wouldn't be here. * We have decided it is oodate, so .OODATE needs to be set. * All we can sanely do is set it to .ALLSRC. */ - Var_Delete(OODATE, gn); - Var_Set(OODATE, Var_Value(ALLSRC, gn, &cp), gn, 0); - if (cp) - free(cp); + Var_Delete(gn, OODATE); + Var_Set(gn, OODATE, GNode_VarAllsrc(gn)); } + + oodate_out: + FStr_Done(&dname); return oodate; } @@ -1409,44 +1633,85 @@ meta_compat_start(void) * We need to re-open filemon for each cmd. */ BuildMon *pbm = &Mybm; - + if (pbm->mfp != NULL && useFilemon) { - filemon_open(pbm); + meta_open_filemon(pbm); } else { - pbm->mon_fd = pbm->filemon_fd = -1; + pbm->mon_fd = -1; + pbm->filemon = NULL; } #endif if (pipe(childPipe) < 0) Punt("Cannot create pipe: %s", strerror(errno)); /* Set close-on-exec flag for both */ - (void)fcntl(childPipe[0], F_SETFD, 1); - (void)fcntl(childPipe[1], F_SETFD, 1); + (void)fcntl(childPipe[0], F_SETFD, FD_CLOEXEC); + (void)fcntl(childPipe[1], F_SETFD, FD_CLOEXEC); } void meta_compat_child(void) { meta_job_child(NULL); - if (dup2(childPipe[1], 1) < 0 || - dup2(1, 2) < 0) { - execError("dup2", "pipe"); - _exit(1); - } + if (dup2(childPipe[1], 1) < 0 || dup2(1, 2) < 0) + execDie("dup2", "pipe"); } void -meta_compat_parent(void) +meta_compat_parent(pid_t child) { - FILE *fp; - char buf[BUFSIZ]; - + int outfd, metafd, maxfd, nfds; + char buf[BUFSIZ+1]; + fd_set readfds; + + meta_job_parent(NULL, child); close(childPipe[1]); /* child side */ - fp = fdopen(childPipe[0], "r"); - while (fgets(buf, sizeof(buf), fp)) { - meta_job_output(NULL, buf, ""); - printf("%s", buf); + outfd = childPipe[0]; +#ifdef USE_FILEMON + metafd = Mybm.filemon != NULL ? filemon_readfd(Mybm.filemon) : -1; +#else + metafd = -1; +#endif + maxfd = -1; + if (outfd > maxfd) + maxfd = outfd; + if (metafd > maxfd) + maxfd = metafd; + + while (outfd != -1 || metafd != -1) { + FD_ZERO(&readfds); + if (outfd != -1) { + FD_SET(outfd, &readfds); + } + if (metafd != -1) { + FD_SET(metafd, &readfds); + } + nfds = select(maxfd + 1, &readfds, NULL, NULL, NULL); + if (nfds == -1) { + if (errno == EINTR) + continue; + err(1, "select"); + } + + if (outfd != -1 && FD_ISSET(outfd, &readfds) != 0) do { + /* XXX this is not line-buffered */ + ssize_t nread = read(outfd, buf, sizeof buf - 1); + if (nread == -1) + err(1, "read"); + if (nread == 0) { + close(outfd); + outfd = -1; + break; + } + fwrite(buf, 1, (size_t)nread, stdout); + fflush(stdout); + buf[nread] = '\0'; + meta_job_output(NULL, buf, ""); + } while (/*CONSTCOND*/FALSE); + if (metafd != -1 && FD_ISSET(metafd, &readfds) != 0) { + if (meta_job_event(NULL) <= 0) + metafd = -1; + } } - fclose(fp); } -#endif /* USE_META */ +#endif /* USE_META */ diff --git a/usr.bin/make/meta.h b/usr.bin/make/meta.h index 57c73ca9b..1fc8910d3 100644 --- a/usr.bin/make/meta.h +++ b/usr.bin/make/meta.h @@ -1,23 +1,23 @@ -/* $NetBSD: meta.h,v 1.3 2013/03/23 05:31:29 sjg Exp $ */ +/* $NetBSD: meta.h,v 1.9 2020/12/10 20:49:11 rillig Exp $ */ /* * Things needed for 'meta' mode. */ /* * Copyright (c) 2009-2010, Juniper Networks, Inc. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * modification, are permitted provided that the following conditions + * are met: * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * + * from this software without specific prior written permission. + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -28,28 +28,33 @@ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ typedef struct BuildMon { char meta_fname[MAXPATHLEN]; - int filemon_fd; + struct filemon *filemon; int mon_fd; FILE *mfp; } BuildMon; -extern Boolean useMeta; +struct Job; -struct Job; /* not defined yet */ void meta_init(void); +void meta_finish(void); void meta_mode_init(const char *); void meta_job_start(struct Job *, GNode *); void meta_job_child(struct Job *); -void meta_job_error(struct Job *, GNode *, int, int); +void meta_job_parent(struct Job *, pid_t); +int meta_job_fd(struct Job *); +int meta_job_event(struct Job *); +void meta_job_error(struct Job *, GNode *, Boolean, int); void meta_job_output(struct Job *, char *, const char *); -void meta_cmd_finish(void *); -void meta_job_finish(struct Job *); +int meta_cmd_finish(void *); +int meta_job_finish(struct Job *); Boolean meta_oodate(GNode *, Boolean); void meta_compat_start(void); void meta_compat_child(void); -void meta_compat_parent(void); +void meta_compat_parent(pid_t); + +extern Boolean useMeta; diff --git a/usr.bin/make/metachar.c b/usr.bin/make/metachar.c index 49603383e..dcb049dff 100644 --- a/usr.bin/make/metachar.c +++ b/usr.bin/make/metachar.c @@ -1,6 +1,6 @@ -/* $NetBSD: metachar.c,v 1.5 2015/06/19 08:03:35 mlelstv Exp $ */ +/* $NetBSD: metachar.c,v 1.9 2021/01/19 20:51:46 rillig Exp $ */ -/*- +/* * Copyright (c) 2015 The NetBSD Foundation, Inc. * All rights reserved. * @@ -37,52 +37,48 @@ #include #endif -#if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: metachar.c,v 1.5 2015/06/19 08:03:35 mlelstv Exp $"); -#endif - #include "metachar.h" + +MAKE_RCSID("$NetBSD: metachar.c,v 1.9 2021/01/19 20:51:46 rillig Exp $"); + /* * The following array is used to make a fast determination of which * characters are interpreted specially by the shell. If a command * contains any of these characters, it is executed by the shell, not * directly by us. - * - * perhaps move it to ctype? */ unsigned char _metachar[128] = { -// nul soh stx etx eot enq ack bel +/* nul soh stx etx eot enq ack bel */ 1, 0, 0, 0, 0, 0, 0, 0, -// bs ht nl vt np cr so si +/* bs ht nl vt np cr so si */ 0, 0, 1, 0, 0, 0, 0, 0, -// dle dc1 dc2 dc3 dc4 nak syn etb +/* dle dc1 dc2 dc3 dc4 nak syn etb */ 0, 0, 0, 0, 0, 0, 0, 0, -// can em sub esc fs gs rs us +/* can em sub esc fs gs rs us */ 0, 0, 0, 0, 0, 0, 0, 0, -// sp ! " # $ % & ' +/* sp ! " # $ % & ' */ 0, 1, 1, 1, 1, 0, 1, 1, -// ( ) * + , - . / +/* ( ) * + , - . / */ 1, 1, 1, 0, 0, 0, 0, 0, -// 0 1 2 3 4 5 6 7 +/* 0 1 2 3 4 5 6 7 */ 0, 0, 0, 0, 0, 0, 0, 0, -// 8 9 : ; < = > ? +/* 8 9 : ; < = > ? */ 0, 0, 0, 1, 1, 0, 1, 1, -// @ A B C D E F G +/* @ A B C D E F G */ 0, 0, 0, 0, 0, 0, 0, 0, -// H I J K L M N O +/* H I J K L M N O */ 0, 0, 0, 0, 0, 0, 0, 0, -// P Q R S T U V W +/* P Q R S T U V W */ 0, 0, 0, 0, 0, 0, 0, 0, -// X Y Z [ \ ] ^ _ +/* X Y Z [ \ ] ^ _ */ 0, 0, 0, 1, 1, 1, 1, 0, -// ` a b c d e f g +/* ` a b c d e f g */ 1, 0, 0, 0, 0, 0, 0, 0, -// h i j k l m n o +/* h i j k l m n o */ 0, 0, 0, 0, 0, 0, 0, 0, -// p q r s t u v w +/* p q r s t u v w */ 0, 0, 0, 0, 0, 0, 0, 0, -// x y z { | } ~ del +/* x y z { | } ~ del */ 0, 0, 0, 1, 1, 1, 1, 0, }; - diff --git a/usr.bin/make/metachar.h b/usr.bin/make/metachar.h index db88d6710..04f967229 100644 --- a/usr.bin/make/metachar.h +++ b/usr.bin/make/metachar.h @@ -1,6 +1,6 @@ -/* $NetBSD: metachar.h,v 1.4 2015/06/21 20:26:02 christos Exp $ */ +/* $NetBSD: metachar.h,v 1.15 2021/01/19 20:51:46 rillig Exp $ */ -/*- +/* * Copyright (c) 2015 The NetBSD Foundation, Inc. * All rights reserved. * @@ -28,34 +28,21 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _METACHAR_H -#define _METACHAR_H +#ifndef MAKE_METACHAR_H +#define MAKE_METACHAR_H -#include +#include "make.h" extern unsigned char _metachar[]; -#define ismeta(c) _metachar[(c) & 0x7f] +#define is_shell_metachar(c) (_metachar[(c) & 0x7f] != 0) -static inline int -hasmeta(const char *cmd) +MAKE_INLINE Boolean +needshell(const char *cmd) { - while (!ismeta(*cmd)) + while (!is_shell_metachar(*cmd) && *cmd != ':' && *cmd != '=') cmd++; - return *cmd != '\0'; } -static inline int -needshell(const char *cmd, int white) -{ - while (!ismeta(*cmd) && *cmd != ':' && *cmd != '=') { - if (white && isspace((unsigned char)*cmd)) - break; - cmd++; - } - - return *cmd != '\0'; -} - -#endif /* _METACHAR_H */ +#endif /* MAKE_METACHAR_H */ diff --git a/usr.bin/make/nonints.h b/usr.bin/make/nonints.h index 742d3f057..863e51b41 100644 --- a/usr.bin/make/nonints.h +++ b/usr.bin/make/nonints.h @@ -1,6 +1,6 @@ -/* $NetBSD: nonints.h,v 1.68 2015/05/05 21:51:09 sjg Exp $ */ +/* $NetBSD: nonints.h,v 1.206 2021/03/15 15:39:13 rillig Exp $ */ -/*- +/* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. * @@ -34,7 +34,7 @@ * from: @(#)nonints.h 8.3 (Berkeley) 3/19/94 */ -/*- +/* * Copyright (c) 1989 by Berkeley Softworks * All rights reserved. * @@ -73,32 +73,51 @@ */ /* arch.c */ -ReturnStatus Arch_ParseArchive(char **, Lst, GNode *); -void Arch_Touch(GNode *); -void Arch_TouchLib(GNode *); -time_t Arch_MTime(GNode *); -time_t Arch_MemMTime(GNode *); -void Arch_FindLib(GNode *, Lst); -Boolean Arch_LibOODate(GNode *); void Arch_Init(void); void Arch_End(void); -int Arch_IsLib(GNode *); + +Boolean Arch_ParseArchive(char **, GNodeList *, GNode *); +void Arch_Touch(GNode *); +void Arch_TouchLib(GNode *); +void Arch_UpdateMTime(GNode *gn); +void Arch_UpdateMemberMTime(GNode *gn); +void Arch_FindLib(GNode *, SearchPath *); +Boolean Arch_LibOODate(GNode *); +Boolean Arch_IsLib(GNode *); /* compat.c */ -int CompatRunCommand(void *, void *); -void Compat_Run(Lst); -int Compat_Make(void *, void *); +int Compat_RunCommand(const char *, GNode *, StringListNode *); +void Compat_Run(GNodeList *); +void Compat_Make(GNode *, GNode *); /* cond.c */ -struct If; -int Cond_EvalExpression(const struct If *, char *, Boolean *, int, Boolean); -int Cond_Eval(char *); +CondEvalResult Cond_EvalCondition(const char *, Boolean *); +CondEvalResult Cond_EvalLine(const char *); void Cond_restore_depth(unsigned int); unsigned int Cond_save_depth(void); +/* dir.c; see also dir.h */ + +MAKE_INLINE const char * +str_basename(const char *pathname) +{ + const char *lastSlash = strrchr(pathname, '/'); + return lastSlash != NULL ? lastSlash + 1 : pathname; +} + +MAKE_INLINE SearchPath * +SearchPath_New(void) +{ + SearchPath *path = bmake_malloc(sizeof *path); + Lst_Init(&path->dirs); + return path; +} + +void SearchPath_Free(SearchPath *); + /* for.c */ -int For_Eval(char *); -int For_Accum(char *); +int For_Eval(const char *); +Boolean For_Accum(const char *); void For_Run(int); /* job.c */ @@ -106,92 +125,301 @@ void JobReapChild(pid_t, int, Boolean); /* main.c */ void Main_ParseArgLine(const char *); -void MakeMode(const char *); -int main(int, char **); char *Cmd_Exec(const char *, const char **); void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; void DieHorribly(void) MAKE_ATTR_DEAD; -int PrintAddr(void *, void *); void Finish(int) MAKE_ATTR_DEAD; int eunlink(const char *); -void execError(const char *, const char *); +void execDie(const char *, const char *); char *getTmpdir(void); -Boolean getBoolean(const char *, Boolean); +Boolean ParseBoolean(const char *, Boolean); +char *cached_realpath(const char *, char *); /* parse.c */ -void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); -Boolean Parse_AnyExport(void); -Boolean Parse_IsVar(char *); -void Parse_DoVar(char *, GNode *); -void Parse_AddIncludeDir(char *); -void Parse_File(const char *, int); void Parse_Init(void); void Parse_End(void); -void Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *); -Lst Parse_MainName(void); + +typedef enum VarAssignOp { + VAR_NORMAL, /* = */ + VAR_SUBST, /* := */ + VAR_SHELL, /* != or :sh= */ + VAR_APPEND, /* += */ + VAR_DEFAULT /* ?= */ +} VarAssignOp; + +typedef struct VarAssign { + char *varname; /* unexpanded */ + VarAssignOp op; + const char *value; /* unexpanded */ +} VarAssign; + +typedef char *(*ReadMoreProc)(void *, size_t *); + +void Parse_Error(ParseErrorLevel, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); +Boolean Parse_IsVar(const char *, VarAssign *out_var); +void Parse_DoVar(VarAssign *, GNode *); +void Parse_AddIncludeDir(const char *); +void Parse_File(const char *, int); +void Parse_SetInput(const char *, int, int, ReadMoreProc, void *); +void Parse_MainName(GNodeList *); +int Parse_GetFatals(void); /* str.c */ -char *str_concat(const char *, const char *, int); -char **brk_string(const char *, int *, Boolean, char **); -char *Str_FindSubstring(const char *, const char *); -int Str_Match(const char *, const char *); -char *Str_SYSVMatch(const char *, const char *, int *len); -void Str_SYSVSubst(Buffer *, char *, char *, int); + +/* A read-only string that may need to be freed after use. */ +typedef struct FStr { + const char *str; + void *freeIt; +} FStr; + +/* A modifiable string that may need to be freed after use. */ +typedef struct MFStr { + char *str; + void *freeIt; +} MFStr; + +typedef struct Words { + char **words; + size_t len; + void *freeIt; +} Words; + +/* Return a string that is the sole owner of str. */ +MAKE_INLINE FStr +FStr_InitOwn(char *str) +{ + return (FStr){ str, str }; +} + +/* Return a string that refers to the shared str. */ +MAKE_INLINE FStr +FStr_InitRefer(const char *str) +{ + return (FStr){ str, NULL }; +} + +MAKE_INLINE void +FStr_Done(FStr *fstr) +{ + free(fstr->freeIt); +#ifdef CLEANUP + fstr->str = NULL; + fstr->freeIt = NULL; +#endif +} + +/* Return a string that is the sole owner of str. */ +MAKE_INLINE MFStr +MFStr_InitOwn(char *str) +{ + return (MFStr){ str, str }; +} + +/* Return a string that refers to the shared str. */ +MAKE_INLINE MFStr +MFStr_InitRefer(char *str) +{ + return (MFStr){ str, NULL }; +} + +MAKE_INLINE void +MFStr_Done(MFStr *mfstr) +{ + free(mfstr->freeIt); +#ifdef CLEANUP + mfstr->str = NULL; + mfstr->freeIt = NULL; +#endif +} + +Words Str_Words(const char *, Boolean); +MAKE_INLINE void +Words_Free(Words w) +{ + free(w.words); + free(w.freeIt); +} + +char *str_concat2(const char *, const char *); +char *str_concat3(const char *, const char *, const char *); +char *str_concat4(const char *, const char *, const char *, const char *); +Boolean Str_Match(const char *, const char *); /* suff.c */ -void Suff_ClearSuffixes(void); -Boolean Suff_IsTransform(char *); -GNode *Suff_AddTransform(char *); -int Suff_EndTransform(void *, void *); -void Suff_AddSuffix(char *, GNode **); -Lst Suff_GetPath(char *); -void Suff_DoPaths(void); -void Suff_AddInclude(char *); -void Suff_AddLib(char *); -void Suff_FindDeps(GNode *); -Lst Suff_FindPath(GNode *); -void Suff_SetNull(char *); void Suff_Init(void); void Suff_End(void); + +void Suff_ClearSuffixes(void); +Boolean Suff_IsTransform(const char *); +GNode *Suff_AddTransform(const char *); +void Suff_EndTransform(GNode *); +void Suff_AddSuffix(const char *, GNode **); +SearchPath *Suff_GetPath(const char *); +void Suff_DoPaths(void); +void Suff_AddInclude(const char *); +void Suff_AddLib(const char *); +void Suff_FindDeps(GNode *); +SearchPath *Suff_FindPath(GNode *); +void Suff_SetNull(const char *); void Suff_PrintAll(void); /* targ.c */ void Targ_Init(void); void Targ_End(void); -Lst Targ_List(void); -GNode *Targ_NewGN(const char *); -GNode *Targ_FindNode(const char *, int); -Lst Targ_FindList(Lst, int); -Boolean Targ_Ignore(GNode *); -Boolean Targ_Silent(GNode *); -Boolean Targ_Precious(GNode *); + +void Targ_Stats(void); +GNodeList *Targ_List(void); +GNode *GNode_New(const char *); +GNode *Targ_FindNode(const char *); +GNode *Targ_GetNode(const char *); +GNode *Targ_NewInternalNode(const char *); +GNode *Targ_GetEndNode(void); +void Targ_FindList(GNodeList *, StringList *); +Boolean Targ_Precious(const GNode *); void Targ_SetMain(GNode *); -int Targ_PrintCmd(void *, void *); -int Targ_PrintNode(void *, void *); -char *Targ_FmtTime(time_t); +void Targ_PrintCmds(GNode *); +void Targ_PrintNode(GNode *, int); +void Targ_PrintNodes(GNodeList *, int); +const char *Targ_FmtTime(time_t); void Targ_PrintType(int); void Targ_PrintGraph(int); void Targ_Propagate(void); -void Targ_Propagate_Wait(void); +const char *GNodeMade_Name(GNodeMade); /* var.c */ -void Var_Delete(const char *, GNode *); -void Var_Set(const char *, const char *, GNode *, int); -void Var_Append(const char *, const char *, GNode *); -Boolean Var_Exists(const char *, GNode *); -char *Var_Value(const char *, GNode *, char **); -char *Var_Parse(const char *, GNode *, Boolean, int *, void **); -char *Var_Subst(const char *, const char *, GNode *, Boolean); -char *Var_GetTail(const char *); -char *Var_GetHead(const char *); void Var_Init(void); void Var_End(void); + +typedef struct VarEvalFlags { + + /* + * Expand and evaluate variables during parsing. + * + * Without this flag, the expression is only parsed, without + * evaluating any part of it. + * + * TODO: Document what Var_Parse and Var_Subst return when this flag + * is not set. As of 2021-03-15, they return unspecified, + * inconsistent results. + */ + Boolean wantRes: 1; + + /* + * Treat undefined variables as errors. + * Must only be used in combination with wantRes. + */ + Boolean undefErr: 1; + + /* + * Keep '$$' as '$$' instead of reducing it to a single '$'. + * + * Used in variable assignments using the ':=' operator. It allows + * multiple such assignments to be chained without accidentally + * expanding '$$file' to '$file' in the first assignment and + * interpreting it as '${f}' followed by 'ile' in the next assignment. + */ + Boolean keepDollar: 1; + + /* + * Keep undefined variables as-is instead of expanding them to an + * empty string. + * + * Example for a ':=' assignment: + * CFLAGS = $(.INCLUDES) + * CFLAGS := -I.. $(CFLAGS) + * # If .INCLUDES (an undocumented special variable, by the + * # way) is still undefined, the updated CFLAGS becomes + * # "-I.. $(.INCLUDES)". + */ + Boolean keepUndef: 1; + + /* + * Without this padding, GCC 9.3.0 on NetBSD 9.99.80 generates larger + * code than necessary (1.2 kB), masking out the unused bits from the + * int (since that is the default representation of Boolean in make), + * even for initializers consisting entirely of constants. + */ + Boolean : 0; +} VarEvalFlags; + +#define VARE_PARSE_ONLY (VarEvalFlags) { FALSE, FALSE, FALSE, FALSE } +#define VARE_WANTRES (VarEvalFlags) { TRUE, FALSE, FALSE, FALSE } +#define VARE_UNDEFERR (VarEvalFlags) { TRUE, TRUE, FALSE, FALSE } +#define VARE_KEEP_DOLLAR_UNDEF (VarEvalFlags) { TRUE, FALSE, TRUE, TRUE } + +typedef enum VarSetFlags { + VAR_SET_NONE = 0, + + /* do not export */ + VAR_SET_NO_EXPORT = 1 << 0, + + /* Make the variable read-only. No further modification is possible, + * except for another call to Var_Set with the same flag. */ + VAR_SET_READONLY = 1 << 1 +} VarSetFlags; + +/* The state of error handling returned by Var_Parse. */ +typedef enum VarParseResult { + + /* Both parsing and evaluation succeeded. */ + VPR_OK, + + /* Parsing or evaluating failed, with an error message. */ + VPR_ERR, + + /* + * Parsing succeeded, undefined expressions are allowed and the + * expression was still undefined after applying all modifiers. + * No error message is printed in this case. + * + * Some callers handle this case differently, so return this + * information to them, for now. + * + * TODO: Instead of having this special return value, rather ensure + * that VarEvalFlags.keepUndef is processed properly. + */ + VPR_UNDEF + +} VarParseResult; + +typedef enum VarExportMode { + /* .export-env */ + VEM_ENV, + /* .export: Initial export or update an already exported variable. */ + VEM_PLAIN, + /* .export-literal: Do not expand the variable value. */ + VEM_LITERAL +} VarExportMode; + +void Var_Delete(GNode *, const char *); +void Var_DeleteExpand(GNode *, const char *); +void Var_Undef(const char *); +void Var_Set(GNode *, const char *, const char *); +void Var_SetExpand(GNode *, const char *, const char *); +void Var_SetWithFlags(GNode *, const char *, const char *, VarSetFlags); +void Var_SetExpandWithFlags(GNode *, const char *, const char *, VarSetFlags); +void Var_Append(GNode *, const char *, const char *); +void Var_AppendExpand(GNode *, const char *, const char *); +Boolean Var_Exists(GNode *, const char *); +Boolean Var_ExistsExpand(GNode *, const char *); +FStr Var_Value(GNode *, const char *); +const char *GNode_ValueDirect(GNode *, const char *); +VarParseResult Var_Parse(const char **, GNode *, VarEvalFlags, FStr *); +VarParseResult Var_Subst(const char *, GNode *, VarEvalFlags, char **); +void Var_Stats(void); void Var_Dump(GNode *); -void Var_ExportVars(void); -void Var_Export(char *, int); -void Var_UnExport(char *); +void Var_ReexportVars(void); +void Var_Export(VarExportMode, const char *); +void Var_ExportVars(const char *); +void Var_UnExport(Boolean, const char *); + +void Global_Set(const char *, const char *); +void Global_SetExpand(const char *, const char *); +void Global_Append(const char *, const char *); +void Global_Delete(const char *); /* util.c */ -void (*bmake_signal(int, void (*)(int)))(int); +typedef void (*SignalProc)(int); +SignalProc bmake_signal(int, SignalProc); diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 204073ae4..b46cb0758 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.204 2014/09/18 08:06:13 dholland Exp $ */ +/* $NetBSD: parse.c,v 1.552 2021/03/15 12:15:03 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,163 +68,119 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.204 2014/09/18 08:06:13 dholland Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; -#else -__RCSID("$NetBSD: parse.c,v 1.204 2014/09/18 08:06:13 dholland Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * parse.c -- - * Functions to parse a makefile. +/* + * Parsing of makefiles. * - * One function, Parse_Init, must be called before any functions - * in this module are used. After that, the function Parse_File is the - * main entry point and controls most of the other functions in this - * module. + * Parse_File is the main entry point and controls most of the other + * functions in this module. * - * Most important structures are kept in Lsts. Directories for - * the .include "..." function are kept in the 'parseIncPath' Lst, while - * those for the .include <...> are kept in the 'sysIncPath' Lst. The - * targets currently being defined are kept in the 'targets' Lst. - * - * The variables 'fname' and 'lineno' are used to track the name - * of the current file and the line number in that file so that error - * messages can be more meaningful. + * The directories for the .include "..." directive are kept in + * 'parseIncPath', while those for .include <...> are kept in 'sysIncPath'. + * The targets currently being defined are kept in 'targets'. * * Interface: - * Parse_Init Initialization function which must be - * called before anything else in this module - * is used. + * Parse_Init Initialize the module * - * Parse_End Cleanup the module + * Parse_End Clean up the module * - * Parse_File Function used to parse a makefile. It must - * be given the name of the file, which should - * already have been opened, and a function - * to call to read a character from the file. + * Parse_File Parse a top-level makefile. Included files are + * handled by IncludeFile instead. * - * Parse_IsVar Returns TRUE if the given line is a - * variable assignment. Used by MainParseArgs - * to determine if an argument is a target - * or a variable assignment. Used internally - * for pretty much the same thing... + * Parse_IsVar Return TRUE if the given line is a variable + * assignment. Used by MainParseArgs to determine if + * an argument is a target or a variable assignment. + * Used internally for pretty much the same thing. * - * Parse_Error Function called when an error occurs in - * parsing. Used by the variable and - * conditional modules. - * Parse_MainName Returns a Lst of the main target to create. + * Parse_Error Report a parse error, a warning or an informational + * message. + * + * Parse_MainName Returns a list of the main target to create. */ #include -#include #include -#include -#include #include -#include #include -#include - -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif -#ifndef MAP_COPY -#define MAP_COPY MAP_PRIVATE -#endif +#include #include "make.h" -#include "hash.h" #include "dir.h" #include "job.h" -#include "buf.h" #include "pathnames.h" -//////////////////////////////////////////////////////////// -// types and constants +/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ +MAKE_RCSID("$NetBSD: parse.c,v 1.552 2021/03/15 12:15:03 rillig Exp $"); + +/* types and constants */ /* * Structure for a file being read ("included file") */ typedef struct IFile { - char *fname; /* name of file */ - int lineno; /* current line number in file */ - int first_lineno; /* line number of start of text */ - int cond_depth; /* 'if' nesting when file opened */ - char *P_str; /* point to base of string buffer */ - char *P_ptr; /* point to next char of string buffer */ - char *P_end; /* point to the end of string buffer */ - char *(*nextbuf)(void *, size_t *); /* Function to get more data */ - void *nextbuf_arg; /* Opaque arg for nextbuf() */ - struct loadedfile *lf; /* loadedfile object, if any */ + char *fname; /* name of file (relative? absolute?) */ + Boolean fromForLoop; /* simulated .include by the .for loop */ + int lineno; /* current line number in file */ + int first_lineno; /* line number of start of text */ + unsigned int cond_depth; /* 'if' nesting when file opened */ + Boolean depending; /* state of doing_depend on EOF */ + + /* The buffer from which the file's content is read. */ + char *buf_freeIt; + char *buf_ptr; /* next char to be read */ + char *buf_end; + + /* Function to read more data, with a single opaque argument. */ + ReadMoreProc readMore; + void *readMoreArg; + + struct loadedfile *lf; /* loadedfile object, if any */ } IFile; - -/* - * These values are returned by ParseEOF to tell Parse_File whether to - * CONTINUE parsing, i.e. it had only reached the end of an include file, - * or if it's DONE. - */ -#define CONTINUE 1 -#define DONE 0 - /* * Tokens for target attributes */ -typedef enum { - Begin, /* .BEGIN */ - Default, /* .DEFAULT */ - End, /* .END */ - dotError, /* .ERROR */ - Ignore, /* .IGNORE */ - Includes, /* .INCLUDES */ - Interrupt, /* .INTERRUPT */ - Libs, /* .LIBS */ - Meta, /* .META */ - MFlags, /* .MFLAGS or .MAKEFLAGS */ - Main, /* .MAIN and we don't have anything user-specified to - * make */ - NoExport, /* .NOEXPORT */ - NoMeta, /* .NOMETA */ - NoMetaCmp, /* .NOMETA_CMP */ - NoPath, /* .NOPATH */ - Not, /* Not special */ - NotParallel, /* .NOTPARALLEL */ - Null, /* .NULL */ - ExObjdir, /* .OBJDIR */ - Order, /* .ORDER */ - Parallel, /* .PARALLEL */ - ExPath, /* .PATH */ - Phony, /* .PHONY */ +typedef enum ParseSpecial { + SP_ATTRIBUTE, /* Generic attribute */ + SP_BEGIN, /* .BEGIN */ + SP_DEFAULT, /* .DEFAULT */ + SP_DELETE_ON_ERROR, /* .DELETE_ON_ERROR */ + SP_END, /* .END */ + SP_ERROR, /* .ERROR */ + SP_IGNORE, /* .IGNORE */ + SP_INCLUDES, /* .INCLUDES; not mentioned in the manual page */ + SP_INTERRUPT, /* .INTERRUPT */ + SP_LIBS, /* .LIBS; not mentioned in the manual page */ + /* .MAIN and we don't have anything user-specified to make */ + SP_MAIN, + SP_META, /* .META */ + SP_MFLAGS, /* .MFLAGS or .MAKEFLAGS */ + SP_NOMETA, /* .NOMETA */ + SP_NOMETA_CMP, /* .NOMETA_CMP */ + SP_NOPATH, /* .NOPATH */ + SP_NOT, /* Not special */ + SP_NOTPARALLEL, /* .NOTPARALLEL or .NO_PARALLEL */ + SP_NULL, /* .NULL; not mentioned in the manual page */ + SP_OBJDIR, /* .OBJDIR */ + SP_ORDER, /* .ORDER */ + SP_PARALLEL, /* .PARALLEL; not mentioned in the manual page */ + SP_PATH, /* .PATH or .PATH.suffix */ + SP_PHONY, /* .PHONY */ #ifdef POSIX - Posix, /* .POSIX */ + SP_POSIX, /* .POSIX; not mentioned in the manual page */ #endif - Precious, /* .PRECIOUS */ - ExShell, /* .SHELL */ - Silent, /* .SILENT */ - SingleShell, /* .SINGLESHELL */ - Stale, /* .STALE */ - Suffixes, /* .SUFFIXES */ - Wait, /* .WAIT */ - Attribute /* Generic attribute */ + SP_PRECIOUS, /* .PRECIOUS */ + SP_SHELL, /* .SHELL */ + SP_SILENT, /* .SILENT */ + SP_SINGLESHELL, /* .SINGLESHELL; not mentioned in the manual page */ + SP_STALE, /* .STALE */ + SP_SUFFIXES, /* .SUFFIXES */ + SP_WAIT /* .WAIT */ } ParseSpecial; -/* - * Other tokens - */ -#define LPAREN '(' -#define RPAREN ')' +typedef List SearchPathList; +typedef ListNode SearchPathListNode; - -//////////////////////////////////////////////////////////// -// result data +/* result data */ /* * The main target to create. This is the first target on the first @@ -232,36 +188,34 @@ typedef enum { */ static GNode *mainNode; -//////////////////////////////////////////////////////////// -// eval state - -/* targets we're working on */ -static Lst targets; - -#ifdef CLEANUP -/* command lines for targets */ -static Lst targCmds; -#endif +/* eval state */ /* - * specType contains the SPECial TYPE of the current target. It is - * Not if the target is unspecial. If it *is* special, however, the children - * are linked as children of the parent but not vice versa. This variable is - * set in ParseDoDependency + * During parsing, the targets from the left-hand side of the currently + * active dependency line, or NULL if the current line does not belong to a + * dependency line, for example because it is a variable assignment. + * + * See unit-tests/deptgt.mk, keyword "parse.c:targets". */ -static ParseSpecial specType; +static GNodeList *targets; + +#ifdef CLEANUP +/* + * All shell commands for all targets, in no particular order and possibly + * with duplicates. Kept in a separate list since the commands from .USE or + * .USEBEFORE nodes are shared with other GNodes, thereby giving up the + * easily understandable ownership over the allocated strings. + */ +static StringList targCmds = LST_INIT; +#endif /* * Predecessor node for handling .ORDER. Initialized to NULL when .ORDER * seen, then set to each successive source on the line. */ -static GNode *predecessor; +static GNode *order_pred; -//////////////////////////////////////////////////////////// -// parser state - -/* true if currently in a dependency line or its commands */ -static Boolean inLine; +/* parser state */ /* number of fatal errors */ static int fatals = 0; @@ -270,133 +224,113 @@ static int fatals = 0; * Variables for doing includes */ -/* current file being read */ -static IFile *curFile; +/* + * The include chain of makefiles. At index 0 is the top-level makefile from + * the command line, followed by the included files or .for loops, up to and + * including the current file. + * + * See PrintStackTrace for how to interpret the data. + */ +static Vector /* of IFile */ includes; -/* stack of IFiles generated by .includes */ -static Lst includes; +static IFile * +GetInclude(size_t i) +{ + return Vector_Get(&includes, i); +} -/* include paths (lists of directories) */ -Lst parseIncPath; /* dirs for "..." includes */ -Lst sysIncPath; /* dirs for <...> includes */ -Lst defIncPath; /* default for sysIncPath */ +/* The file that is currently being read. */ +static IFile * +CurFile(void) +{ + return GetInclude(includes.len - 1); +} -//////////////////////////////////////////////////////////// -// parser tables +/* include paths */ +SearchPath *parseIncPath; /* directories for "..." includes */ +SearchPath *sysIncPath; /* directories for <...> includes */ +SearchPath *defSysIncPath; /* default for sysIncPath */ + +/* parser tables */ /* * The parseKeywords table is searched using binary search when deciding * if a target or source is special. The 'spec' field is the ParseSpecial - * type of the keyword ("Not" if the keyword isn't special as a target) while + * type of the keyword (SP_NOT if the keyword isn't special as a target) while * the 'op' field is the operator to apply to the list of targets if the * keyword is used as a source ("0" if the keyword isn't special as a source) */ static const struct { - const char *name; /* Name of keyword */ - ParseSpecial spec; /* Type when used as a target */ - int op; /* Operator when used as a source */ + const char *name; /* Name of keyword */ + ParseSpecial spec; /* Type when used as a target */ + GNodeType op; /* Operator when used as a source */ } parseKeywords[] = { -{ ".BEGIN", Begin, 0 }, -{ ".DEFAULT", Default, 0 }, -{ ".END", End, 0 }, -{ ".ERROR", dotError, 0 }, -{ ".EXEC", Attribute, OP_EXEC }, -{ ".IGNORE", Ignore, OP_IGNORE }, -{ ".INCLUDES", Includes, 0 }, -{ ".INTERRUPT", Interrupt, 0 }, -{ ".INVISIBLE", Attribute, OP_INVISIBLE }, -{ ".JOIN", Attribute, OP_JOIN }, -{ ".LIBS", Libs, 0 }, -{ ".MADE", Attribute, OP_MADE }, -{ ".MAIN", Main, 0 }, -{ ".MAKE", Attribute, OP_MAKE }, -{ ".MAKEFLAGS", MFlags, 0 }, -{ ".META", Meta, OP_META }, -{ ".MFLAGS", MFlags, 0 }, -{ ".NOMETA", NoMeta, OP_NOMETA }, -{ ".NOMETA_CMP", NoMetaCmp, OP_NOMETA_CMP }, -{ ".NOPATH", NoPath, OP_NOPATH }, -{ ".NOTMAIN", Attribute, OP_NOTMAIN }, -{ ".NOTPARALLEL", NotParallel, 0 }, -{ ".NO_PARALLEL", NotParallel, 0 }, -{ ".NULL", Null, 0 }, -{ ".OBJDIR", ExObjdir, 0 }, -{ ".OPTIONAL", Attribute, OP_OPTIONAL }, -{ ".ORDER", Order, 0 }, -{ ".PARALLEL", Parallel, 0 }, -{ ".PATH", ExPath, 0 }, -{ ".PHONY", Phony, OP_PHONY }, + { ".BEGIN", SP_BEGIN, OP_NONE }, + { ".DEFAULT", SP_DEFAULT, OP_NONE }, + { ".DELETE_ON_ERROR", SP_DELETE_ON_ERROR, OP_NONE }, + { ".END", SP_END, OP_NONE }, + { ".ERROR", SP_ERROR, OP_NONE }, + { ".EXEC", SP_ATTRIBUTE, OP_EXEC }, + { ".IGNORE", SP_IGNORE, OP_IGNORE }, + { ".INCLUDES", SP_INCLUDES, OP_NONE }, + { ".INTERRUPT", SP_INTERRUPT, OP_NONE }, + { ".INVISIBLE", SP_ATTRIBUTE, OP_INVISIBLE }, + { ".JOIN", SP_ATTRIBUTE, OP_JOIN }, + { ".LIBS", SP_LIBS, OP_NONE }, + { ".MADE", SP_ATTRIBUTE, OP_MADE }, + { ".MAIN", SP_MAIN, OP_NONE }, + { ".MAKE", SP_ATTRIBUTE, OP_MAKE }, + { ".MAKEFLAGS", SP_MFLAGS, OP_NONE }, + { ".META", SP_META, OP_META }, + { ".MFLAGS", SP_MFLAGS, OP_NONE }, + { ".NOMETA", SP_NOMETA, OP_NOMETA }, + { ".NOMETA_CMP", SP_NOMETA_CMP, OP_NOMETA_CMP }, + { ".NOPATH", SP_NOPATH, OP_NOPATH }, + { ".NOTMAIN", SP_ATTRIBUTE, OP_NOTMAIN }, + { ".NOTPARALLEL", SP_NOTPARALLEL, OP_NONE }, + { ".NO_PARALLEL", SP_NOTPARALLEL, OP_NONE }, + { ".NULL", SP_NULL, OP_NONE }, + { ".OBJDIR", SP_OBJDIR, OP_NONE }, + { ".OPTIONAL", SP_ATTRIBUTE, OP_OPTIONAL }, + { ".ORDER", SP_ORDER, OP_NONE }, + { ".PARALLEL", SP_PARALLEL, OP_NONE }, + { ".PATH", SP_PATH, OP_NONE }, + { ".PHONY", SP_PHONY, OP_PHONY }, #ifdef POSIX -{ ".POSIX", Posix, 0 }, + { ".POSIX", SP_POSIX, OP_NONE }, #endif -{ ".PRECIOUS", Precious, OP_PRECIOUS }, -{ ".RECURSIVE", Attribute, OP_MAKE }, -{ ".SHELL", ExShell, 0 }, -{ ".SILENT", Silent, OP_SILENT }, -{ ".SINGLESHELL", SingleShell, 0 }, -{ ".STALE", Stale, 0 }, -{ ".SUFFIXES", Suffixes, 0 }, -{ ".USE", Attribute, OP_USE }, -{ ".USEBEFORE", Attribute, OP_USEBEFORE }, -{ ".WAIT", Wait, 0 }, + { ".PRECIOUS", SP_PRECIOUS, OP_PRECIOUS }, + { ".RECURSIVE", SP_ATTRIBUTE, OP_MAKE }, + { ".SHELL", SP_SHELL, OP_NONE }, + { ".SILENT", SP_SILENT, OP_SILENT }, + { ".SINGLESHELL", SP_SINGLESHELL, OP_NONE }, + { ".STALE", SP_STALE, OP_NONE }, + { ".SUFFIXES", SP_SUFFIXES, OP_NONE }, + { ".USE", SP_ATTRIBUTE, OP_USE }, + { ".USEBEFORE", SP_ATTRIBUTE, OP_USEBEFORE }, + { ".WAIT", SP_WAIT, OP_NONE }, }; -//////////////////////////////////////////////////////////// -// local functions - -static int ParseIsEscaped(const char *, const char *); -static void ParseErrorInternal(const char *, size_t, int, const char *, ...) - MAKE_ATTR_PRINTFLIKE(4,5); -static void ParseVErrorInternal(FILE *, const char *, size_t, int, const char *, va_list) - MAKE_ATTR_PRINTFLIKE(5, 0); -static int ParseFindKeyword(const char *); -static int ParseLinkSrc(void *, void *); -static int ParseDoOp(void *, void *); -static void ParseDoSrc(int, const char *); -static int ParseFindMain(void *, void *); -static int ParseAddDir(void *, void *); -static int ParseClearPath(void *, void *); -static void ParseDoDependency(char *); -static int ParseAddCmd(void *, void *); -static void ParseHasCommands(void *); -static void ParseDoInclude(char *); -static void ParseSetParseFile(const char *); -static void ParseSetIncludedFile(void); -#ifdef SYSVINCLUDE -static void ParseTraditionalInclude(char *); -#endif -#ifdef GMAKEEXPORT -static void ParseGmakeExport(char *); -#endif -static int ParseEOF(void); -static char *ParseReadLine(void); -static void ParseFinishLine(void); -static void ParseMark(GNode *); - -//////////////////////////////////////////////////////////// -// file loader +/* file loader */ struct loadedfile { - const char *path; /* name, for error reports */ - char *buf; /* contents buffer */ - size_t len; /* length of contents */ - size_t maplen; /* length of mmap area, or 0 */ - Boolean used; /* XXX: have we used the data yet */ + /* XXX: What is the lifetime of this path? Who manages the memory? */ + const char *path; /* name, for error reports */ + char *buf; /* contents buffer */ + size_t len; /* length of contents */ + Boolean used; /* XXX: have we used the data yet */ }; -/* - * Constructor/destructor for loadedfile - */ +/* XXX: What is the lifetime of the path? Who manages the memory? */ static struct loadedfile * -loadedfile_create(const char *path) +loadedfile_create(const char *path, char *buf, size_t buflen) { struct loadedfile *lf; - lf = bmake_malloc(sizeof(*lf)); - lf->path = (path == NULL ? "(stdin)" : path); - lf->buf = NULL; - lf->len = 0; - lf->maplen = 0; + lf = bmake_malloc(sizeof *lf); + lf->path = path == NULL ? "(stdin)" : path; + lf->buf = buf; + lf->len = buflen; lf->used = FALSE; return lf; } @@ -404,28 +338,22 @@ loadedfile_create(const char *path) static void loadedfile_destroy(struct loadedfile *lf) { - if (lf->buf != NULL) { - if (lf->maplen > 0) { - munmap(lf->buf, lf->maplen); - } else { - free(lf->buf); - } - } + free(lf->buf); free(lf); } /* - * nextbuf() operation for loadedfile, as needed by the weird and twisted - * logic below. Once that's cleaned up, we can get rid of lf->used... + * readMore() operation for loadedfile, as needed by the weird and twisted + * logic below. Once that's cleaned up, we can get rid of lf->used. */ static char * -loadedfile_nextbuf(void *x, size_t *len) +loadedfile_readMore(void *x, size_t *len) { struct loadedfile *lf = x; - if (lf->used) { + if (lf->used) return NULL; - } + lf->used = TRUE; *len = lf->len; return lf->buf; @@ -434,34 +362,31 @@ loadedfile_nextbuf(void *x, size_t *len) /* * Try to get the size of a file. */ -static ReturnStatus +static Boolean load_getsize(int fd, size_t *ret) { struct stat st; - if (fstat(fd, &st) < 0) { - return FAILURE; - } + if (fstat(fd, &st) < 0) + return FALSE; - if (!S_ISREG(st.st_mode)) { - return FAILURE; - } + if (!S_ISREG(st.st_mode)) + return FALSE; /* * st_size is an off_t, which is 64 bits signed; *ret is * size_t, which might be 32 bits unsigned or 64 bits * unsigned. Rather than being elaborate, just punt on - * files that are more than 2^31 bytes. We should never - * see a makefile that size in practice... + * files that are more than 1 GiB. We should never + * see a makefile that size in practice. * * While we're at it reject negative sizes too, just in case. */ - if (st.st_size < 0 || st.st_size > 0x7fffffff) { - return FAILURE; - } + if (st.st_size < 0 || st.st_size > 0x3fffffff) + return FALSE; - *ret = (size_t) st.st_size; - return SUCCESS; + *ret = (size_t)st.st_size; + return TRUE; } /* @@ -471,287 +396,274 @@ load_getsize(int fd, size_t *ret) * being in the caller in another source file, we need to have the fd * passed in already open. Bleh. * - * If the path is NULL use stdin and (to insure against fd leaks) - * assert that the caller passed in -1. + * If the path is NULL, use stdin. */ static struct loadedfile * loadfile(const char *path, int fd) { - struct loadedfile *lf; - long pagesize; - ssize_t result; - size_t bufpos; + ssize_t n; + Buffer buf; + size_t filesize; - lf = loadedfile_create(path); if (path == NULL) { assert(fd == -1); fd = STDIN_FILENO; - } else { -#if 0 /* notyet */ - fd = open(path, O_RDONLY); - if (fd < 0) { - ... - Error("%s: %s", path, strerror(errno)); - exit(1); - } -#endif } - if (load_getsize(fd, &lf->len) == SUCCESS) { - /* found a size, try mmap */ - pagesize = sysconf(_SC_PAGESIZE); - if (pagesize <= 0) { - pagesize = 0x1000; - } - /* round size up to a page */ - lf->maplen = pagesize * ((lf->len + pagesize - 1)/pagesize); - + if (load_getsize(fd, &filesize)) { /* - * XXX hack for dealing with empty files; remove when - * we're no longer limited by interfacing to the old - * logic elsewhere in this file. + * Avoid resizing the buffer later for no reason. + * + * At the same time leave space for adding a final '\n', + * just in case it is missing in the file. */ - if (lf->maplen == 0) { - lf->maplen = pagesize; - } + filesize++; + } else + filesize = 1024; + Buf_InitSize(&buf, filesize); - /* - * FUTURE: remove PROT_WRITE when the parser no longer - * needs to scribble on the input. - */ - lf->buf = mmap(NULL, lf->maplen, PROT_READ|PROT_WRITE, - MAP_FILE|MAP_COPY, fd, 0); - if (lf->buf != MAP_FAILED) { - /* succeeded */ - if (lf->len == lf->maplen && lf->buf[lf->len - 1] != '\n') { - char *b = malloc(lf->len + 1); - b[lf->len] = '\n'; - memcpy(b, lf->buf, lf->len++); - munmap(lf->buf, lf->maplen); - lf->maplen = 0; - lf->buf = b; + for (;;) { + assert(buf.len <= buf.cap); + if (buf.len == buf.cap) { + if (buf.cap > 0x1fffffff) { + errno = EFBIG; + Error("%s: file too large", path); + exit(2); /* Not 1 so -q can distinguish error */ } - goto done; + Buf_Expand(&buf); } - } - - /* cannot mmap; load the traditional way */ - - lf->maplen = 0; - lf->len = 1024; - lf->buf = bmake_malloc(lf->len); - - bufpos = 0; - while (1) { - assert(bufpos <= lf->len); - if (bufpos == lf->len) { - lf->len *= 2; - lf->buf = bmake_realloc(lf->buf, lf->len); - } - result = read(fd, lf->buf + bufpos, lf->len - bufpos); - if (result < 0) { + assert(buf.len < buf.cap); + n = read(fd, buf.data + buf.len, buf.cap - buf.len); + if (n < 0) { Error("%s: read error: %s", path, strerror(errno)); - exit(1); + exit(2); /* Not 1 so -q can distinguish error */ } - if (result == 0) { + if (n == 0) break; - } - bufpos += result; - } - assert(bufpos <= lf->len); - lf->len = bufpos; - /* truncate malloc region to actual length (maybe not useful) */ - if (lf->len > 0) { - lf->buf = bmake_realloc(lf->buf, lf->len); + buf.len += (size_t)n; } + assert(buf.len <= buf.cap); -done: - if (path != NULL) { + if (!Buf_EndsWith(&buf, '\n')) + Buf_AddByte(&buf, '\n'); + + if (path != NULL) close(fd); + + { + struct loadedfile *lf = loadedfile_create(path, + buf.data, buf.len); + Buf_DoneData(&buf); + return lf; } - return lf; } -//////////////////////////////////////////////////////////// -// old code +static void +PrintStackTrace(void) +{ + const IFile *entries; + size_t i, n; -/*- - *---------------------------------------------------------------------- - * ParseIsEscaped -- - * Check if the current character is escaped on the current line - * - * Results: - * 0 if the character is not backslash escaped, 1 otherwise - * - * Side Effects: - * None - *---------------------------------------------------------------------- - */ -static int + if (!(DEBUG(PARSE))) + return; + + entries = GetInclude(0); + n = includes.len; + if (n == 0) + return; + n--; /* This entry is already in the diagnostic. */ + + /* + * For the IFiles with fromForLoop, lineno seems to be sorted + * backwards. This is because lineno is the number of completely + * parsed lines, which for a .for loop is right after the + * corresponding .endfor. The intuitive line number comes from + * first_lineno instead, which points at the start of the .for loop. + * + * To make the stack trace intuitive, the entry below each chain of + * .for loop entries must be ignored completely since neither its + * lineno nor its first_lineno is useful. Instead, the topmost of + * each chain of .for loop entries needs to be printed twice, once + * with its first_lineno and once with its lineno. + */ + + for (i = n; i-- > 0;) { + const IFile *entry = entries + i; + const char *fname = entry->fname; + Boolean printLineno; + char dirbuf[MAXPATHLEN + 1]; + + if (fname[0] != '/' && strcmp(fname, "(stdin)") != 0) + fname = realpath(fname, dirbuf); + + printLineno = !entry->fromForLoop; + if (i + 1 < n && entries[i + 1].fromForLoop == printLineno) + printLineno = entry->fromForLoop; + + if (printLineno) + debug_printf("\tin .include from %s:%d\n", + fname, entry->lineno); + if (entry->fromForLoop) + debug_printf("\tin .for loop from %s:%d\n", + fname, entry->first_lineno); + } +} + +/* Check if the current character is escaped on the current line. */ +static Boolean ParseIsEscaped(const char *line, const char *c) { - int active = 0; - for (;;) { - if (line == c) - return active; - if (*--c != '\\') - return active; - active = !active; - } + Boolean active = FALSE; + for (;;) { + if (line == c) + return active; + if (*--c != '\\') + return active; + active = !active; + } } -/*- - *---------------------------------------------------------------------- - * ParseFindKeyword -- - * Look in the table of keywords for one matching the given string. - * - * Input: - * str String to find - * - * Results: - * The index of the keyword, or -1 if it isn't there. - * - * Side Effects: - * None - *---------------------------------------------------------------------- +/* + * Add the filename and lineno to the GNode so that we remember where it + * was first defined. + */ +static void +ParseMark(GNode *gn) +{ + IFile *curFile = CurFile(); + gn->fname = curFile->fname; + gn->lineno = curFile->lineno; +} + +/* + * Look in the table of keywords for one matching the given string. + * Return the index of the keyword, or -1 if it isn't there. */ static int ParseFindKeyword(const char *str) { - int start, end, cur; - int diff; + int start = 0; + int end = sizeof parseKeywords / sizeof parseKeywords[0] - 1; - start = 0; - end = (sizeof(parseKeywords)/sizeof(parseKeywords[0])) - 1; + do { + int curr = start + (end - start) / 2; + int diff = strcmp(str, parseKeywords[curr].name); - do { - cur = start + ((end - start) / 2); - diff = strcmp(str, parseKeywords[cur].name); + if (diff == 0) + return curr; + if (diff < 0) + end = curr - 1; + else + start = curr + 1; + } while (start <= end); - if (diff == 0) { - return (cur); - } else if (diff < 0) { - end = cur - 1; - } else { - start = cur + 1; - } - } while (start <= end); - return (-1); + return -1; } -/*- - * ParseVErrorInternal -- - * Error message abort function for parsing. Prints out the context - * of the error (line number and file) as well as the message with - * two optional arguments. - * - * Results: - * None - * - * Side Effects: - * "fatals" is incremented if the level is PARSE_FATAL. - */ -/* VARARGS */ static void -ParseVErrorInternal(FILE *f, const char *cfname, size_t clineno, int type, - const char *fmt, va_list ap) +PrintLocation(FILE *f, const char *fname, size_t lineno) +{ + char dirbuf[MAXPATHLEN + 1]; + FStr dir, base; + + if (*fname == '/' || strcmp(fname, "(stdin)") == 0) { + (void)fprintf(f, "\"%s\" line %u: ", fname, (unsigned)lineno); + return; + } + + /* Find out which makefile is the culprit. + * We try ${.PARSEDIR} and apply realpath(3) if not absolute. */ + + dir = Var_Value(SCOPE_GLOBAL, ".PARSEDIR"); + if (dir.str == NULL) + dir.str = "."; + if (dir.str[0] != '/') + dir.str = realpath(dir.str, dirbuf); + + base = Var_Value(SCOPE_GLOBAL, ".PARSEFILE"); + if (base.str == NULL) + base.str = str_basename(fname); + + (void)fprintf(f, "\"%s/%s\" line %u: ", + dir.str, base.str, (unsigned)lineno); + + FStr_Done(&base); + FStr_Done(&dir); +} + +static void +ParseVErrorInternal(FILE *f, const char *fname, size_t lineno, + ParseErrorLevel type, const char *fmt, va_list ap) { static Boolean fatal_warning_error_printed = FALSE; (void)fprintf(f, "%s: ", progname); - if (cfname != NULL) { - (void)fprintf(f, "\""); - if (*cfname != '/' && strcmp(cfname, "(stdin)") != 0) { - char *cp; - const char *dir; - - /* - * Nothing is more annoying than not knowing - * which Makefile is the culprit. - */ - dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp); - if (dir == NULL || *dir == '\0' || - (*dir == '.' && dir[1] == '\0')) - dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp); - if (dir == NULL) - dir = "."; - - (void)fprintf(f, "%s/%s", dir, cfname); - } else - (void)fprintf(f, "%s", cfname); - - (void)fprintf(f, "\" line %d: ", (int)clineno); - } + if (fname != NULL) + PrintLocation(f, fname, lineno); if (type == PARSE_WARNING) (void)fprintf(f, "warning: "); (void)vfprintf(f, fmt, ap); (void)fprintf(f, "\n"); (void)fflush(f); - if (type == PARSE_FATAL || parseWarnFatal) - fatals += 1; - if (parseWarnFatal && !fatal_warning_error_printed) { + + if (type == PARSE_INFO) + goto print_stack_trace; + if (type == PARSE_WARNING && !opts.parseWarnFatal) + goto print_stack_trace; + fatals++; + if (type == PARSE_WARNING && !fatal_warning_error_printed) { Error("parsing warnings being treated as errors"); fatal_warning_error_printed = TRUE; } + +print_stack_trace: + PrintStackTrace(); } -/*- - * ParseErrorInternal -- - * Error function - * - * Results: - * None - * - * Side Effects: - * None - */ -/* VARARGS */ static void -ParseErrorInternal(const char *cfname, size_t clineno, int type, - const char *fmt, ...) +ParseErrorInternal(const char *fname, size_t lineno, + ParseErrorLevel type, const char *fmt, ...) { va_list ap; - va_start(ap, fmt); (void)fflush(stdout); - ParseVErrorInternal(stderr, cfname, clineno, type, fmt, ap); + va_start(ap, fmt); + ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap); va_end(ap); - if (debug_file != stderr && debug_file != stdout) { + if (opts.debug_file != stderr && opts.debug_file != stdout) { va_start(ap, fmt); - ParseVErrorInternal(debug_file, cfname, clineno, type, fmt, ap); + ParseVErrorInternal(opts.debug_file, fname, lineno, type, + fmt, ap); va_end(ap); } } -/*- - * Parse_Error -- - * External interface to ParseErrorInternal; uses the default filename - * Line number. +/* + * Print a parse error message, including location information. * - * Results: - * None + * If the level is PARSE_FATAL, continue parsing until the end of the + * current top-level makefile, then exit (see Parse_File). * - * Side Effects: - * None + * Fmt is given without a trailing newline. */ -/* VARARGS */ void -Parse_Error(int type, const char *fmt, ...) +Parse_Error(ParseErrorLevel type, const char *fmt, ...) { va_list ap; const char *fname; size_t lineno; - if (curFile == NULL) { + if (includes.len == 0) { fname = NULL; lineno = 0; } else { + IFile *curFile = CurFile(); fname = curFile->fname; - lineno = curFile->lineno; + lineno = (size_t)curFile->lineno; } va_start(ap, fmt); @@ -759,2500 +671,2619 @@ Parse_Error(int type, const char *fmt, ...) ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap); va_end(ap); - if (debug_file != stderr && debug_file != stdout) { + if (opts.debug_file != stderr && opts.debug_file != stdout) { va_start(ap, fmt); - ParseVErrorInternal(debug_file, fname, lineno, type, fmt, ap); + ParseVErrorInternal(opts.debug_file, fname, lineno, type, + fmt, ap); va_end(ap); } } /* - * ParseMessage - * Parse a .info .warning or .error directive - * - * The input is the line minus the ".". We substitute - * variables, print the message and exit(1) (for .error) or just print - * a warning if the directive is malformed. - */ -static Boolean -ParseMessage(char *line) -{ - int mtype; - - switch(*line) { - case 'i': - mtype = 0; - break; - case 'w': - mtype = PARSE_WARNING; - break; - case 'e': - mtype = PARSE_FATAL; - break; - default: - Parse_Error(PARSE_WARNING, "invalid syntax: \".%s\"", line); - return FALSE; - } - - while (isalpha((u_char)*line)) - line++; - if (!isspace((u_char)*line)) - return FALSE; /* not for us */ - while (isspace((u_char)*line)) - line++; - - line = Var_Subst(NULL, line, VAR_CMD, 0); - Parse_Error(mtype, "%s", line); - free(line); - - if (mtype == PARSE_FATAL) { - /* Terminate immediately. */ - exit(1); - } - return TRUE; -} - -/*- - *--------------------------------------------------------------------- - * ParseLinkSrc -- - * Link the parent node to its new child. Used in a Lst_ForEach by - * ParseDoDependency. If the specType isn't 'Not', the parent - * isn't linked as a parent of the child. - * - * Input: - * pgnp The parent node - * cgpn The child node - * - * Results: - * Always = 0 - * - * Side Effects: - * New elements are added to the parents list of cgn and the - * children list of cgn. the unmade field of pgn is updated - * to reflect the additional child. - *--------------------------------------------------------------------- - */ -static int -ParseLinkSrc(void *pgnp, void *cgnp) -{ - GNode *pgn = (GNode *)pgnp; - GNode *cgn = (GNode *)cgnp; - - if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (pgn->cohorts)) - pgn = (GNode *)Lst_Datum(Lst_Last(pgn->cohorts)); - (void)Lst_AtEnd(pgn->children, cgn); - if (specType == Not) - (void)Lst_AtEnd(cgn->parents, pgn); - pgn->unmade += 1; - if (DEBUG(PARSE)) { - fprintf(debug_file, "# %s: added child %s - %s\n", __func__, - pgn->name, cgn->name); - Targ_PrintNode(pgn, 0); - Targ_PrintNode(cgn, 0); - } - return (0); -} - -/*- - *--------------------------------------------------------------------- - * ParseDoOp -- - * Apply the parsed operator to the given target node. Used in a - * Lst_ForEach call by ParseDoDependency once all targets have - * been found and their operator parsed. If the previous and new - * operators are incompatible, a major error is taken. - * - * Input: - * gnp The node to which the operator is to be applied - * opp The operator to apply - * - * Results: - * Always 0 - * - * Side Effects: - * The type field of the node is altered to reflect any new bits in - * the op. - *--------------------------------------------------------------------- - */ -static int -ParseDoOp(void *gnp, void *opp) -{ - GNode *gn = (GNode *)gnp; - int op = *(int *)opp; - /* - * If the dependency mask of the operator and the node don't match and - * the node has actually had an operator applied to it before, and - * the operator actually has some dependency information in it, complain. - */ - if (((op & OP_OPMASK) != (gn->type & OP_OPMASK)) && - !OP_NOP(gn->type) && !OP_NOP(op)) - { - Parse_Error(PARSE_FATAL, "Inconsistent operator for %s", gn->name); - return (1); - } - - if ((op == OP_DOUBLEDEP) && ((gn->type & OP_OPMASK) == OP_DOUBLEDEP)) { - /* - * If the node was the object of a :: operator, we need to create a - * new instance of it for the children and commands on this dependency - * line. The new instance is placed on the 'cohorts' list of the - * initial one (note the initial one is not on its own cohorts list) - * and the new instance is linked to all parents of the initial - * instance. - */ - GNode *cohort; - - /* - * Propagate copied bits to the initial node. They'll be propagated - * back to the rest of the cohorts later. - */ - gn->type |= op & ~OP_OPMASK; - - cohort = Targ_FindNode(gn->name, TARG_NOHASH); - if (doing_depend) - ParseMark(cohort); - /* - * Make the cohort invisible as well to avoid duplicating it into - * other variables. True, parents of this target won't tend to do - * anything with their local variables, but better safe than - * sorry. (I think this is pointless now, since the relevant list - * traversals will no longer see this node anyway. -mycroft) - */ - cohort->type = op | OP_INVISIBLE; - (void)Lst_AtEnd(gn->cohorts, cohort); - cohort->centurion = gn; - gn->unmade_cohorts += 1; - snprintf(cohort->cohort_num, sizeof cohort->cohort_num, "#%d", - gn->unmade_cohorts); - } else { - /* - * We don't want to nuke any previous flags (whatever they were) so we - * just OR the new operator into the old - */ - gn->type |= op; - } - - return (0); -} - -/*- - *--------------------------------------------------------------------- - * ParseDoSrc -- - * Given the name of a source, figure out if it is an attribute - * and apply it to the targets if it is. Else decide if there is - * some attribute which should be applied *to* the source because - * of some special target and apply it if so. Otherwise, make the - * source be a child of the targets in the list 'targets' - * - * Input: - * tOp operator (if any) from special targets - * src name of the source to handle - * - * Results: - * None - * - * Side Effects: - * Operator bits may be added to the list of targets or to the source. - * The targets may have a new source added to their lists of children. - *--------------------------------------------------------------------- + * Parse and handle an .info, .warning or .error directive. + * For an .error directive, immediately exit. */ static void -ParseDoSrc(int tOp, const char *src) +ParseMessage(ParseErrorLevel level, const char *levelName, const char *umsg) { - GNode *gn = NULL; - static int wait_number = 0; - char wait_src[16]; + char *xmsg; - if (*src == '.' && isupper ((unsigned char)src[1])) { - int keywd = ParseFindKeyword(src); - if (keywd != -1) { - int op = parseKeywords[keywd].op; - if (op != 0) { - Lst_ForEach(targets, ParseDoOp, &op); + if (umsg[0] == '\0') { + Parse_Error(PARSE_FATAL, "Missing argument for \".%s\"", + levelName); return; - } - if (parseKeywords[keywd].spec == Wait) { - /* - * We add a .WAIT node in the dependency list. - * After any dynamic dependencies (and filename globbing) - * have happened, it is given a dependency on the each - * previous child back to and previous .WAIT node. - * The next child won't be scheduled until the .WAIT node - * is built. - * We give each .WAIT node a unique name (mainly for diag). - */ - snprintf(wait_src, sizeof wait_src, ".WAIT_%u", ++wait_number); - gn = Targ_FindNode(wait_src, TARG_NOHASH); - if (doing_depend) - ParseMark(gn); - gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN; - Lst_ForEach(targets, ParseLinkSrc, gn); - return; - } } - } - switch (specType) { - case Main: + (void)Var_Subst(umsg, SCOPE_CMDLINE, VARE_WANTRES, &xmsg); + /* TODO: handle errors */ + + Parse_Error(level, "%s", xmsg); + free(xmsg); + + if (level == PARSE_FATAL) { + PrintOnError(NULL, NULL); + exit(1); + } +} + +/* + * Add the child to the parent's children. + * + * Additionally, add the parent to the child's parents, but only if the + * target is not special. An example for such a special target is .END, + * which does not need to be informed once the child target has been made. + */ +static void +LinkSource(GNode *pgn, GNode *cgn, Boolean isSpecial) +{ + if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(&pgn->cohorts)) + pgn = pgn->cohorts.last->datum; + + Lst_Append(&pgn->children, cgn); + pgn->unmade++; + + /* Special targets like .END don't need any children. */ + if (!isSpecial) + Lst_Append(&cgn->parents, pgn); + + if (DEBUG(PARSE)) { + debug_printf("# %s: added child %s - %s\n", + __func__, pgn->name, cgn->name); + Targ_PrintNode(pgn, 0); + Targ_PrintNode(cgn, 0); + } +} + +/* Add the node to each target from the current dependency group. */ +static void +LinkToTargets(GNode *gn, Boolean isSpecial) +{ + GNodeListNode *ln; + + for (ln = targets->first; ln != NULL; ln = ln->next) + LinkSource(ln->datum, gn, isSpecial); +} + +static Boolean +TryApplyDependencyOperator(GNode *gn, GNodeType op) +{ /* - * If we have noted the existence of a .MAIN, it means we need - * to add the sources of said target to the list of things - * to create. The string 'src' is likely to be free, so we - * must make a new copy of it. Note that this will only be - * invoked if the user didn't specify a target on the command - * line. This is to allow #ifmake's to succeed, or something... + * If the node occurred on the left-hand side of a dependency and the + * operator also defines a dependency, they must match. */ - (void)Lst_AtEnd(create, bmake_strdup(src)); + if ((op & OP_OPMASK) && (gn->type & OP_OPMASK) && + ((op & OP_OPMASK) != (gn->type & OP_OPMASK))) { + Parse_Error(PARSE_FATAL, "Inconsistent operator for %s", + gn->name); + return FALSE; + } + + if (op == OP_DOUBLEDEP && (gn->type & OP_OPMASK) == OP_DOUBLEDEP) { + /* + * If the node was of the left-hand side of a '::' operator, + * we need to create a new instance of it for the children + * and commands on this dependency line since each of these + * dependency groups has its own attributes and commands, + * separate from the others. + * + * The new instance is placed on the 'cohorts' list of the + * initial one (note the initial one is not on its own + * cohorts list) and the new instance is linked to all + * parents of the initial instance. + */ + GNode *cohort; + + /* + * Propagate copied bits to the initial node. They'll be + * propagated back to the rest of the cohorts later. + */ + gn->type |= op & ~OP_OPMASK; + + cohort = Targ_NewInternalNode(gn->name); + if (doing_depend) + ParseMark(cohort); + /* + * Make the cohort invisible as well to avoid duplicating it + * into other variables. True, parents of this target won't + * tend to do anything with their local variables, but better + * safe than sorry. + * + * (I think this is pointless now, since the relevant list + * traversals will no longer see this node anyway. -mycroft) + */ + cohort->type = op | OP_INVISIBLE; + Lst_Append(&gn->cohorts, cohort); + cohort->centurion = gn; + gn->unmade_cohorts++; + snprintf(cohort->cohort_num, sizeof cohort->cohort_num, "#%d", + (unsigned int)gn->unmade_cohorts % 1000000); + } else { + /* + * We don't want to nuke any previous flags (whatever they + * were) so we just OR the new operator into the old. + */ + gn->type |= op; + } + + return TRUE; +} + +static void +ApplyDependencyOperator(GNodeType op) +{ + GNodeListNode *ln; + + for (ln = targets->first; ln != NULL; ln = ln->next) + if (!TryApplyDependencyOperator(ln->datum, op)) + break; +} + +/* + * We add a .WAIT node in the dependency list. After any dynamic dependencies + * (and filename globbing) have happened, it is given a dependency on each + * previous child, back until the previous .WAIT node. The next child won't + * be scheduled until the .WAIT node is built. + * + * We give each .WAIT node a unique name (mainly for diagnostics). + */ +static void +ParseDependencySourceWait(Boolean isSpecial) +{ + static int wait_number = 0; + char wait_src[16]; + GNode *gn; + + snprintf(wait_src, sizeof wait_src, ".WAIT_%u", ++wait_number); + gn = Targ_NewInternalNode(wait_src); + if (doing_depend) + ParseMark(gn); + gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN; + LinkToTargets(gn, isSpecial); + +} + +static Boolean +ParseDependencySourceKeyword(const char *src, ParseSpecial specType) +{ + int keywd; + GNodeType op; + + if (*src != '.' || !ch_isupper(src[1])) + return FALSE; + + keywd = ParseFindKeyword(src); + if (keywd == -1) + return FALSE; + + op = parseKeywords[keywd].op; + if (op != OP_NONE) { + ApplyDependencyOperator(op); + return TRUE; + } + if (parseKeywords[keywd].spec == SP_WAIT) { + ParseDependencySourceWait(specType != SP_NOT); + return TRUE; + } + return FALSE; +} + +static void +ParseDependencySourceMain(const char *src) +{ + /* + * In a line like ".MAIN: source1 source2", add all sources to the + * list of things to create, but only if the user didn't specify a + * target on the command line and .MAIN occurs for the first time. + * + * See ParseDoDependencyTargetSpecial, branch SP_MAIN. + * See unit-tests/cond-func-make-main.mk. + */ + Lst_Append(&opts.create, bmake_strdup(src)); /* * Add the name to the .TARGETS variable as well, so the user can * employ that, if desired. */ - Var_Append(".TARGETS", src, VAR_GLOBAL); - return; + Global_Append(".TARGETS", src); +} - case Order: +static void +ParseDependencySourceOrder(const char *src) +{ + GNode *gn; /* * Create proper predecessor/successor links between the previous * source and the current one. */ - gn = Targ_FindNode(src, TARG_CREATE); + gn = Targ_GetNode(src); if (doing_depend) - ParseMark(gn); - if (predecessor != NULL) { - (void)Lst_AtEnd(predecessor->order_succ, gn); - (void)Lst_AtEnd(gn->order_pred, predecessor); - if (DEBUG(PARSE)) { - fprintf(debug_file, "# %s: added Order dependency %s - %s\n", - __func__, predecessor->name, gn->name); - Targ_PrintNode(predecessor, 0); - Targ_PrintNode(gn, 0); - } + ParseMark(gn); + if (order_pred != NULL) { + Lst_Append(&order_pred->order_succ, gn); + Lst_Append(&gn->order_pred, order_pred); + if (DEBUG(PARSE)) { + debug_printf("# %s: added Order dependency %s - %s\n", + __func__, order_pred->name, gn->name); + Targ_PrintNode(order_pred, 0); + Targ_PrintNode(gn, 0); + } } /* * The current source now becomes the predecessor for the next one. */ - predecessor = gn; - break; + order_pred = gn; +} + +static void +ParseDependencySourceOther(const char *src, GNodeType tOp, + ParseSpecial specType) +{ + GNode *gn; - default: /* - * If the source is not an attribute, we need to find/create - * a node for it. After that we can apply any operator to it - * from a special target or link it to its parents, as - * appropriate. + * The source is not an attribute, so find/create a node for it. + * After that, apply any operator to it from a special target or + * link it to its parents, as appropriate. * - * In the case of a source that was the object of a :: operator, + * In the case of a source that was the object of a '::' operator, * the attribute is applied to all of its instances (as kept in * the 'cohorts' list of the node) or all the cohorts are linked * to all the targets. */ /* Find/create the 'src' node and attach to all targets */ - gn = Targ_FindNode(src, TARG_CREATE); + gn = Targ_GetNode(src); if (doing_depend) - ParseMark(gn); - if (tOp) { - gn->type |= tOp; - } else { - Lst_ForEach(targets, ParseLinkSrc, gn); - } - break; - } + ParseMark(gn); + if (tOp != OP_NONE) + gn->type |= tOp; + else + LinkToTargets(gn, specType != SP_NOT); } -/*- - *----------------------------------------------------------------------- - * ParseFindMain -- - * Find a real target in the list and set it to be the main one. - * Called by ParseDoDependency when a main target hasn't been found - * yet. +/* + * Given the name of a source in a dependency line, figure out if it is an + * attribute (such as .SILENT) and apply it to the targets if it is. Else + * decide if there is some attribute which should be applied *to* the source + * because of some special target (such as .PHONY) and apply it if so. + * Otherwise, make the source a child of the targets in the list 'targets'. * * Input: - * gnp Node to examine - * - * Results: - * 0 if main not found yet, 1 if it is. - * - * Side Effects: - * mainNode is changed and Targ_SetMain is called. - * - *----------------------------------------------------------------------- - */ -static int -ParseFindMain(void *gnp, void *dummy) -{ - GNode *gn = (GNode *)gnp; - if ((gn->type & OP_NOTARGET) == 0) { - mainNode = gn; - Targ_SetMain(gn); - return (dummy ? 1 : 1); - } else { - return (dummy ? 0 : 0); - } -} - -/*- - *----------------------------------------------------------------------- - * ParseAddDir -- - * Front-end for Dir_AddDir to make sure Lst_ForEach keeps going - * - * Results: - * === 0 - * - * Side Effects: - * See Dir_AddDir. - * - *----------------------------------------------------------------------- - */ -static int -ParseAddDir(void *path, void *name) -{ - (void)Dir_AddDir((Lst) path, (char *)name); - return(0); -} - -/*- - *----------------------------------------------------------------------- - * ParseClearPath -- - * Front-end for Dir_ClearPath to make sure Lst_ForEach keeps going - * - * Results: - * === 0 - * - * Side Effects: - * See Dir_ClearPath - * - *----------------------------------------------------------------------- - */ -static int -ParseClearPath(void *path, void *dummy) -{ - Dir_ClearPath((Lst) path); - return(dummy ? 0 : 0); -} - -/*- - *--------------------------------------------------------------------- - * ParseDoDependency -- - * Parse the dependency line in line. - * - * Input: - * line the line to parse - * - * Results: - * None - * - * Side Effects: - * The nodes of the sources are linked as children to the nodes of the - * targets. Some nodes may be created. - * - * We parse a dependency line by first extracting words from the line and - * finding nodes in the list of all targets with that name. This is done - * until a character is encountered which is an operator character. Currently - * these are only ! and :. At this point the operator is parsed and the - * pointer into the line advanced until the first source is encountered. - * The parsed operator is applied to each node in the 'targets' list, - * which is where the nodes found for the targets are kept, by means of - * the ParseDoOp function. - * The sources are read in much the same way as the targets were except - * that now they are expanded using the wildcarding scheme of the C-Shell - * and all instances of the resulting words in the list of all targets - * are found. Each of the resulting nodes is then linked to each of the - * targets as one of its children. - * Certain targets are handled specially. These are the ones detailed - * by the specType variable. - * The storing of transformation rules is also taken care of here. - * A target is recognized as a transformation rule by calling - * Suff_IsTransform. If it is a transformation rule, its node is gotten - * from the suffix module via Suff_AddTransform rather than the standard - * Targ_FindNode in the target module. - *--------------------------------------------------------------------- + * tOp operator (if any) from special targets + * src name of the source to handle */ static void -ParseDoDependency(char *line) +ParseDependencySource(GNodeType tOp, const char *src, ParseSpecial specType) { - char *cp; /* our current position */ - GNode *gn = NULL; /* a general purpose temporary node */ - int op; /* the operator on the line */ - char savec; /* a place to save a character */ - Lst paths; /* List of search paths to alter when parsing - * a list of .PATH targets */ - int tOp; /* operator from special target */ - Lst sources; /* list of archive source names after - * expansion */ - Lst curTargs; /* list of target names to be found and added - * to the targets list */ - char *lstart = line; + if (ParseDependencySourceKeyword(src, specType)) + return; - if (DEBUG(PARSE)) - fprintf(debug_file, "ParseDoDependency(%s)\n", line); - tOp = 0; + if (specType == SP_MAIN) + ParseDependencySourceMain(src); + else if (specType == SP_ORDER) + ParseDependencySourceOrder(src); + else + ParseDependencySourceOther(src, tOp, specType); +} - specType = Not; - paths = NULL; +/* + * If we have yet to decide on a main target to make, in the absence of any + * user input, we want the first target on the first dependency line that is + * actually a real target (i.e. isn't a .USE or .EXEC rule) to be made. + */ +static void +FindMainTarget(void) +{ + GNodeListNode *ln; - curTargs = Lst_Init(FALSE); + if (mainNode != NULL) + return; - /* - * First, grind through the targets. - */ - - do { - /* - * Here LINE points to the beginning of the next word, and - * LSTART points to the actual beginning of the line. - */ - - /* Find the end of the next word. */ - for (cp = line; *cp && (ParseIsEscaped(lstart, cp) || - !(isspace((unsigned char)*cp) || - *cp == '!' || *cp == ':' || *cp == LPAREN)); - cp++) { - if (*cp == '$') { - /* - * Must be a dynamic source (would have been expanded - * otherwise), so call the Var module to parse the puppy - * so we can safely advance beyond it...There should be - * no errors in this, as they would have been discovered - * in the initial Var_Subst and we wouldn't be here. - */ - int length; - void *freeIt; - - (void)Var_Parse(cp, VAR_CMD, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); - cp += length-1; - } + for (ln = targets->first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + if (!(gn->type & OP_NOTARGET)) { + DEBUG1(MAKE, "Setting main node to \"%s\"\n", gn->name); + mainNode = gn; + Targ_SetMain(gn); + return; + } } +} - /* - * If the word is followed by a left parenthesis, it's the - * name of an object file inside an archive (ar file). - */ - if (!ParseIsEscaped(lstart, cp) && *cp == LPAREN) { - /* - * Archives must be handled specially to make sure the OP_ARCHV - * flag is set in their 'type' field, for one thing, and because - * things like "archive(file1.o file2.o file3.o)" are permissible. - * Arch_ParseArchive will set 'line' to be the first non-blank - * after the archive-spec. It creates/finds nodes for the members - * and places them on the given list, returning SUCCESS if all - * went well and FAILURE if there was an error in the - * specification. On error, line should remain untouched. - */ - if (Arch_ParseArchive(&line, targets, VAR_CMD) != SUCCESS) { - Parse_Error(PARSE_FATAL, - "Error in archive specification: \"%s\"", line); - goto out; - } else { - /* Done with this word; on to the next. */ - continue; - } - } - - if (!*cp) { - /* - * We got to the end of the line while we were still - * looking at targets. - * - * Ending a dependency line without an operator is a Bozo - * no-no. As a heuristic, this is also often triggered by - * undetected conflicts from cvs/rcs merges. - */ - if ((strncmp(line, "<<<<<<", 6) == 0) || - (strncmp(line, "======", 6) == 0) || - (strncmp(line, ">>>>>>", 6) == 0)) +/* + * We got to the end of the line while we were still looking at targets. + * + * Ending a dependency line without an operator is a Bozo no-no. As a + * heuristic, this is also often triggered by undetected conflicts from + * cvs/rcs merges. + */ +static void +ParseErrorNoDependency(const char *lstart) +{ + if ((strncmp(lstart, "<<<<<<", 6) == 0) || + (strncmp(lstart, "======", 6) == 0) || + (strncmp(lstart, ">>>>>>", 6) == 0)) Parse_Error(PARSE_FATAL, "Makefile appears to contain unresolved cvs/rcs/??? merge conflicts"); - else - Parse_Error(PARSE_FATAL, lstart[0] == '.' ? "Unknown directive" - : "Need an operator"); - goto out; + else if (lstart[0] == '.') { + const char *dirstart = lstart + 1; + const char *dirend; + cpp_skip_whitespace(&dirstart); + dirend = dirstart; + while (ch_isalnum(*dirend) || *dirend == '-') + dirend++; + Parse_Error(PARSE_FATAL, "Unknown directive \"%.*s\"", + (int)(dirend - dirstart), dirstart); + } else + Parse_Error(PARSE_FATAL, "Invalid line type"); +} + +static void +ParseDependencyTargetWord(const char **pp, const char *lstart) +{ + const char *cp = *pp; + + while (*cp != '\0') { + if ((ch_isspace(*cp) || *cp == '!' || *cp == ':' || + *cp == '(') && + !ParseIsEscaped(lstart, cp)) + break; + + if (*cp == '$') { + /* + * Must be a dynamic source (would have been expanded + * otherwise), so call the Var module to parse the + * puppy so we can safely advance beyond it. + * + * There should be no errors in this, as they would + * have been discovered in the initial Var_Subst and + * we wouldn't be here. + */ + const char *nested_p = cp; + FStr nested_val; + + (void)Var_Parse(&nested_p, SCOPE_CMDLINE, + VARE_PARSE_ONLY, &nested_val); + /* TODO: handle errors */ + FStr_Done(&nested_val); + cp += nested_p - cp; + } else + cp++; } - /* Insert a null terminator. */ - savec = *cp; - *cp = '\0'; - - /* - * Got the word. See if it's a special target and if so set - * specType to match it. - */ - if (*line == '.' && isupper ((unsigned char)line[1])) { - /* - * See if the target is a special target that must have it - * or its sources handled specially. - */ - int keywd = ParseFindKeyword(line); - if (keywd != -1) { - if (specType == ExPath && parseKeywords[keywd].spec != ExPath) { - Parse_Error(PARSE_FATAL, "Mismatched special targets"); - goto out; - } - - specType = parseKeywords[keywd].spec; - tOp = parseKeywords[keywd].op; + *pp = cp; +} +/* Handle special targets like .PATH, .DEFAULT, .BEGIN, .ORDER. */ +static void +ParseDoDependencyTargetSpecial(ParseSpecial *inout_specType, + const char *targetName, + SearchPathList **inout_paths) +{ + switch (*inout_specType) { + case SP_PATH: + if (*inout_paths == NULL) + *inout_paths = Lst_New(); + Lst_Append(*inout_paths, &dirSearchPath); + break; + case SP_MAIN: /* - * Certain special targets have special semantics: - * .PATH Have to set the dirSearchPath - * variable too - * .MAIN Its sources are only used if - * nothing has been specified to - * create. - * .DEFAULT Need to create a node to hang - * commands on, but we don't want - * it in the graph, nor do we want - * it to be the Main Target, so we - * create it, set OP_NOTMAIN and - * add it to the list, setting - * DEFAULT to the new node for - * later use. We claim the node is - * A transformation rule to make - * life easier later, when we'll - * use Make_HandleUse to actually - * apply the .DEFAULT commands. - * .PHONY The list of targets - * .NOPATH Don't search for file in the path - * .STALE - * .BEGIN - * .END - * .ERROR - * .INTERRUPT Are not to be considered the - * main target. - * .NOTPARALLEL Make only one target at a time. - * .SINGLESHELL Create a shell for each command. - * .ORDER Must set initial predecessor to NULL + * Allow targets from the command line to override the + * .MAIN node. */ - switch (specType) { - case ExPath: - if (paths == NULL) { - paths = Lst_Init(FALSE); - } - (void)Lst_AtEnd(paths, dirSearchPath); - break; - case Main: - if (!Lst_IsEmpty(create)) { - specType = Not; - } - break; - case Begin: - case End: - case Stale: - case dotError: - case Interrupt: - gn = Targ_FindNode(line, TARG_CREATE); - if (doing_depend) + if (!Lst_IsEmpty(&opts.create)) + *inout_specType = SP_NOT; + break; + case SP_BEGIN: + case SP_END: + case SP_STALE: + case SP_ERROR: + case SP_INTERRUPT: { + GNode *gn = Targ_GetNode(targetName); + if (doing_depend) ParseMark(gn); - gn->type |= OP_NOTMAIN|OP_SPECIAL; - (void)Lst_AtEnd(targets, gn); - break; - case Default: - gn = Targ_NewGN(".DEFAULT"); - gn->type |= (OP_NOTMAIN|OP_TRANSFORM); - (void)Lst_AtEnd(targets, gn); - DEFAULT = gn; - break; - case NotParallel: - maxJobs = 1; - break; - case SingleShell: - compatMake = TRUE; - break; - case Order: - predecessor = NULL; - break; - default: - break; - } - } else if (strncmp(line, ".PATH", 5) == 0) { + gn->type |= OP_NOTMAIN | OP_SPECIAL; + Lst_Append(targets, gn); + break; + } + case SP_DEFAULT: { /* - * .PATH has to be handled specially. - * Call on the suffix module to give us a path to - * modify. + * Need to create a node to hang commands on, but we don't + * want it in the graph, nor do we want it to be the Main + * Target. We claim the node is a transformation rule to make + * life easier later, when we'll use Make_HandleUse to + * actually apply the .DEFAULT commands. */ - Lst path; + GNode *gn = GNode_New(".DEFAULT"); + gn->type |= OP_NOTMAIN | OP_TRANSFORM; + Lst_Append(targets, gn); + defaultNode = gn; + break; + } + case SP_DELETE_ON_ERROR: + deleteOnError = TRUE; + break; + case SP_NOTPARALLEL: + opts.maxJobs = 1; + break; + case SP_SINGLESHELL: + opts.compatMake = TRUE; + break; + case SP_ORDER: + order_pred = NULL; + break; + default: + break; + } +} - specType = ExPath; - path = Suff_GetPath(&line[5]); - if (path == NULL) { - Parse_Error(PARSE_FATAL, - "Suffix '%s' not defined (yet)", - &line[5]); - goto out; - } else { - if (paths == NULL) { - paths = Lst_Init(FALSE); - } - (void)Lst_AtEnd(paths, path); - } - } +/* + * .PATH has to be handled specially. + * Call on the suffix module to give us a path to modify. + */ +static Boolean +ParseDoDependencyTargetPath(const char *suffixName, + SearchPathList **inout_paths) +{ + SearchPath *path; + + path = Suff_GetPath(suffixName); + if (path == NULL) { + Parse_Error(PARSE_FATAL, + "Suffix '%s' not defined (yet)", suffixName); + return FALSE; } + if (*inout_paths == NULL) + *inout_paths = Lst_New(); + Lst_Append(*inout_paths, path); + + return TRUE; +} + +/* + * See if it's a special target and if so set specType to match it. + */ +static Boolean +ParseDoDependencyTarget(const char *targetName, + ParseSpecial *inout_specType, + GNodeType *out_tOp, SearchPathList **inout_paths) +{ + int keywd; + + if (!(targetName[0] == '.' && ch_isupper(targetName[1]))) + return TRUE; + /* - * Have word in line. Get or create its node and stick it at - * the end of the targets list + * See if the target is a special target that must have it + * or its sources handled specially. */ - if ((specType == Not) && (*line != '\0')) { - if (Dir_HasWildcards(line)) { + keywd = ParseFindKeyword(targetName); + if (keywd != -1) { + if (*inout_specType == SP_PATH && + parseKeywords[keywd].spec != SP_PATH) { + Parse_Error(PARSE_FATAL, "Mismatched special targets"); + return FALSE; + } + + *inout_specType = parseKeywords[keywd].spec; + *out_tOp = parseKeywords[keywd].op; + + ParseDoDependencyTargetSpecial(inout_specType, targetName, + inout_paths); + + } else if (strncmp(targetName, ".PATH", 5) == 0) { + *inout_specType = SP_PATH; + if (!ParseDoDependencyTargetPath(targetName + 5, inout_paths)) + return FALSE; + } + return TRUE; +} + +static void +ParseDoDependencyTargetMundane(char *targetName, StringList *curTargs) +{ + if (Dir_HasWildcards(targetName)) { /* * Targets are to be sought only in the current directory, * so create an empty path for the thing. Note we need to * use Dir_Destroy in the destruction of the path as the * Dir module could have added a directory to the path... */ - Lst emptyPath = Lst_Init(FALSE); + SearchPath *emptyPath = SearchPath_New(); - Dir_Expand(line, emptyPath, curTargs); + SearchPath_Expand(emptyPath, targetName, curTargs); - Lst_Destroy(emptyPath, Dir_Destroy); - } else { + SearchPath_Free(emptyPath); + } else { /* * No wildcards, but we want to avoid code duplication, * so create a list with the word on it. */ - (void)Lst_AtEnd(curTargs, line); - } + Lst_Append(curTargs, targetName); + } - /* Apply the targets. */ + /* Apply the targets. */ - while(!Lst_IsEmpty(curTargs)) { - char *targName = (char *)Lst_DeQueue(curTargs); - - if (!Suff_IsTransform (targName)) { - gn = Targ_FindNode(targName, TARG_CREATE); - } else { - gn = Suff_AddTransform(targName); - } + while (!Lst_IsEmpty(curTargs)) { + char *targName = Lst_Dequeue(curTargs); + GNode *gn = Suff_IsTransform(targName) + ? Suff_AddTransform(targName) + : Targ_GetNode(targName); if (doing_depend) - ParseMark(gn); + ParseMark(gn); - (void)Lst_AtEnd(targets, gn); - } - } else if (specType == ExPath && *line != '.' && *line != '\0') { - Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", line); + Lst_Append(targets, gn); } +} - /* Don't need the inserted null terminator any more. */ - *cp = savec; +static void +ParseDoDependencyTargetExtraWarn(char **pp, const char *lstart) +{ + Boolean warning = FALSE; + char *cp = *pp; - /* - * If it is a special type and not .PATH, it's the only target we - * allow on this line... - */ - if (specType != Not && specType != ExPath) { - Boolean warning = FALSE; - - while (*cp && (ParseIsEscaped(lstart, cp) || - ((*cp != '!') && (*cp != ':')))) { - if (ParseIsEscaped(lstart, cp) || - (*cp != ' ' && *cp != '\t')) { - warning = TRUE; - } + while (*cp != '\0') { + if (!ParseIsEscaped(lstart, cp) && (*cp == '!' || *cp == ':')) + break; + if (ParseIsEscaped(lstart, cp) || (*cp != ' ' && *cp != '\t')) + warning = TRUE; cp++; - } - if (warning) { + } + if (warning) Parse_Error(PARSE_WARNING, "Extra target ignored"); - } - } else { - while (*cp && isspace ((unsigned char)*cp)) { - cp++; - } - } - line = cp; - } while (*line && (ParseIsEscaped(lstart, line) || - ((*line != '!') && (*line != ':')))); - /* - * Don't need the list of target names anymore... - */ - Lst_Destroy(curTargs, NULL); - curTargs = NULL; + *pp = cp; +} - if (!Lst_IsEmpty(targets)) { - switch(specType) { - default: - Parse_Error(PARSE_WARNING, "Special and mundane targets don't mix. Mundane ones ignored"); - break; - case Default: - case Stale: - case Begin: - case End: - case dotError: - case Interrupt: - /* - * These four create nodes on which to hang commands, so - * targets shouldn't be empty... - */ - case Not: - /* - * Nothing special here -- targets can be empty if it wants. - */ - break; - } - } - - /* - * Have now parsed all the target names. Must parse the operator next. The - * result is left in op . - */ - if (*cp == '!') { - op = OP_FORCE; - } else if (*cp == ':') { - if (cp[1] == ':') { - op = OP_DOUBLEDEP; - cp++; - } else { - op = OP_DEPENDS; - } - } else { - Parse_Error(PARSE_FATAL, lstart[0] == '.' ? "Unknown directive" - : "Missing dependency operator"); - goto out; - } - - /* Advance beyond the operator */ - cp++; - - /* - * Apply the operator to the target. This is how we remember which - * operator a target was defined with. It fails if the operator - * used isn't consistent across all references. - */ - Lst_ForEach(targets, ParseDoOp, &op); - - /* - * Onward to the sources. - * - * LINE will now point to the first source word, if any, or the - * end of the string if not. - */ - while (*cp && isspace ((unsigned char)*cp)) { - cp++; - } - line = cp; - - /* - * Several special targets take different actions if present with no - * sources: - * a .SUFFIXES line with no sources clears out all old suffixes - * a .PRECIOUS line makes all targets precious - * a .IGNORE line ignores errors for all targets - * a .SILENT line creates silence when making all targets - * a .PATH removes all directories from the search path(s). - */ - if (!*line) { +static void +ParseDoDependencyCheckSpec(ParseSpecial specType) +{ switch (specType) { - case Suffixes: + default: + Parse_Error(PARSE_WARNING, + "Special and mundane targets don't mix. " + "Mundane ones ignored"); + break; + case SP_DEFAULT: + case SP_STALE: + case SP_BEGIN: + case SP_END: + case SP_ERROR: + case SP_INTERRUPT: + /* + * These create nodes on which to hang commands, so targets + * shouldn't be empty. + */ + case SP_NOT: + /* Nothing special here -- targets can be empty if it wants. */ + break; + } +} + +static Boolean +ParseDoDependencyParseOp(char **pp, const char *lstart, GNodeType *out_op) +{ + const char *cp = *pp; + + if (*cp == '!') { + *out_op = OP_FORCE; + (*pp)++; + return TRUE; + } + + if (*cp == ':') { + if (cp[1] == ':') { + *out_op = OP_DOUBLEDEP; + (*pp) += 2; + } else { + *out_op = OP_DEPENDS; + (*pp)++; + } + return TRUE; + } + + { + const char *msg = lstart[0] == '.' + ? "Unknown directive" : "Missing dependency operator"; + Parse_Error(PARSE_FATAL, "%s", msg); + return FALSE; + } +} + +static void +ClearPaths(SearchPathList *paths) +{ + if (paths != NULL) { + SearchPathListNode *ln; + for (ln = paths->first; ln != NULL; ln = ln->next) + SearchPath_Clear(ln->datum); + } + + Dir_SetPATH(); +} + +static void +ParseDoDependencySourcesEmpty(ParseSpecial specType, SearchPathList *paths) +{ + switch (specType) { + case SP_SUFFIXES: Suff_ClearSuffixes(); break; - case Precious: + case SP_PRECIOUS: allPrecious = TRUE; break; - case Ignore: - ignoreErrors = TRUE; + case SP_IGNORE: + opts.ignoreErrors = TRUE; break; - case Silent: - beSilent = TRUE; + case SP_SILENT: + opts.beSilent = TRUE; break; - case ExPath: - Lst_ForEach(paths, ParseClearPath, NULL); - Dir_SetPATH(); + case SP_PATH: + ClearPaths(paths); break; #ifdef POSIX - case Posix: - Var_Set("%POSIX", "1003.2", VAR_GLOBAL, 0); - break; + case SP_POSIX: + Global_Set("%POSIX", "1003.2"); + break; #endif - default: + default: break; } - } else if (specType == MFlags) { +} + +static void +AddToPaths(const char *dir, SearchPathList *paths) +{ + if (paths != NULL) { + SearchPathListNode *ln; + for (ln = paths->first; ln != NULL; ln = ln->next) + (void)SearchPath_Add(ln->datum, dir); + } +} + +/* + * If the target was one that doesn't take files as its sources + * but takes something like suffixes, we take each + * space-separated word on the line as a something and deal + * with it accordingly. + * + * If the target was .SUFFIXES, we take each source as a + * suffix and add it to the list of suffixes maintained by the + * Suff module. + * + * If the target was a .PATH, we add the source as a directory + * to search on the search path. + * + * If it was .INCLUDES, the source is taken to be the suffix of + * files which will be #included and whose search path should + * be present in the .INCLUDES variable. + * + * If it was .LIBS, the source is taken to be the suffix of + * files which are considered libraries and whose search path + * should be present in the .LIBS variable. + * + * If it was .NULL, the source is the suffix to use when a file + * has no valid suffix. + * + * If it was .OBJDIR, the source is a new definition for .OBJDIR, + * and will cause make to do a new chdir to that path. + */ +static void +ParseDoDependencySourceSpecial(ParseSpecial specType, char *word, + SearchPathList *paths) +{ + switch (specType) { + case SP_SUFFIXES: + Suff_AddSuffix(word, &mainNode); + break; + case SP_PATH: + AddToPaths(word, paths); + break; + case SP_INCLUDES: + Suff_AddInclude(word); + break; + case SP_LIBS: + Suff_AddLib(word); + break; + case SP_NULL: + Suff_SetNull(word); + break; + case SP_OBJDIR: + Main_SetObjdir(FALSE, "%s", word); + break; + default: + break; + } +} + +static Boolean +ParseDoDependencyTargets(char **inout_cp, + char **inout_line, + const char *lstart, + ParseSpecial *inout_specType, + GNodeType *inout_tOp, + SearchPathList **inout_paths, + StringList *curTargs) +{ + char *cp; + char *tgt = *inout_line; + char savec; + const char *p; + + for (;;) { + /* + * Here LINE points to the beginning of the next word, and + * LSTART points to the actual beginning of the line. + */ + + /* Find the end of the next word. */ + cp = tgt; + p = cp; + ParseDependencyTargetWord(&p, lstart); + cp += p - cp; + + /* + * If the word is followed by a left parenthesis, it's the + * name of an object file inside an archive (ar file). + */ + if (!ParseIsEscaped(lstart, cp) && *cp == '(') { + /* + * Archives must be handled specially to make sure the + * OP_ARCHV flag is set in their 'type' field, for one + * thing, and because things like "archive(file1.o + * file2.o file3.o)" are permissible. + * + * Arch_ParseArchive will set 'line' to be the first + * non-blank after the archive-spec. It creates/finds + * nodes for the members and places them on the given + * list, returning TRUE if all went well and FALSE if + * there was an error in the specification. On error, + * line should remain untouched. + */ + if (!Arch_ParseArchive(&tgt, targets, SCOPE_CMDLINE)) { + Parse_Error(PARSE_FATAL, + "Error in archive specification: \"%s\"", + tgt); + return FALSE; + } + + cp = tgt; + continue; + } + + if (*cp == '\0') { + ParseErrorNoDependency(lstart); + return FALSE; + } + + /* Insert a null terminator. */ + savec = *cp; + *cp = '\0'; + + if (!ParseDoDependencyTarget(tgt, inout_specType, inout_tOp, + inout_paths)) + return FALSE; + + /* + * Have word in line. Get or create its node and stick it at + * the end of the targets list + */ + if (*inout_specType == SP_NOT && *tgt != '\0') + ParseDoDependencyTargetMundane(tgt, curTargs); + else if (*inout_specType == SP_PATH && *tgt != '.' && + *tgt != '\0') + Parse_Error(PARSE_WARNING, "Extra target (%s) ignored", + tgt); + + /* Don't need the inserted null terminator any more. */ + *cp = savec; + + /* + * If it is a special type and not .PATH, it's the only target + * we allow on this line. + */ + if (*inout_specType != SP_NOT && *inout_specType != SP_PATH) + ParseDoDependencyTargetExtraWarn(&cp, lstart); + else + pp_skip_whitespace(&cp); + + tgt = cp; + if (*tgt == '\0') + break; + if ((*tgt == '!' || *tgt == ':') && + !ParseIsEscaped(lstart, tgt)) + break; + } + + *inout_cp = cp; + *inout_line = tgt; + return TRUE; +} + +static void +ParseDoDependencySourcesSpecial(char *start, char *end, + ParseSpecial specType, SearchPathList *paths) +{ + char savec; + + while (*start != '\0') { + while (*end != '\0' && !ch_isspace(*end)) + end++; + savec = *end; + *end = '\0'; + ParseDoDependencySourceSpecial(specType, start, paths); + *end = savec; + if (savec != '\0') + end++; + pp_skip_whitespace(&end); + start = end; + } +} + +static Boolean +ParseDoDependencySourcesMundane(char *start, char *end, + ParseSpecial specType, GNodeType tOp) +{ + while (*start != '\0') { + /* + * The targets take real sources, so we must beware of archive + * specifications (i.e. things with left parentheses in them) + * and handle them accordingly. + */ + for (; *end != '\0' && !ch_isspace(*end); end++) { + if (*end == '(' && end > start && end[-1] != '$') { + /* + * Only stop for a left parenthesis if it + * isn't at the start of a word (that'll be + * for variable changes later) and isn't + * preceded by a dollar sign (a dynamic + * source). + */ + break; + } + } + + if (*end == '(') { + GNodeList sources = LST_INIT; + if (!Arch_ParseArchive(&start, &sources, + SCOPE_CMDLINE)) { + Parse_Error(PARSE_FATAL, + "Error in source archive spec \"%s\"", + start); + return FALSE; + } + + while (!Lst_IsEmpty(&sources)) { + GNode *gn = Lst_Dequeue(&sources); + ParseDependencySource(tOp, gn->name, specType); + } + Lst_Done(&sources); + end = start; + } else { + if (*end != '\0') { + *end = '\0'; + end++; + } + + ParseDependencySource(tOp, start, specType); + } + pp_skip_whitespace(&end); + start = end; + } + return TRUE; +} + +/* + * Parse a dependency line consisting of targets, followed by a dependency + * operator, optionally followed by sources. + * + * The nodes of the sources are linked as children to the nodes of the + * targets. Nodes are created as necessary. + * + * The operator is applied to each node in the global 'targets' list, + * which is where the nodes found for the targets are kept, by means of + * the ParseDoOp function. + * + * The sources are parsed in much the same way as the targets, except + * that they are expanded using the wildcarding scheme of the C-Shell, + * and a target is created for each expanded word. Each of the resulting + * nodes is then linked to each of the targets as one of its children. + * + * Certain targets and sources such as .PHONY or .PRECIOUS are handled + * specially. These are the ones detailed by the specType variable. + * + * The storing of transformation rules such as '.c.o' is also taken care of + * here. A target is recognized as a transformation rule by calling + * Suff_IsTransform. If it is a transformation rule, its node is gotten + * from the suffix module via Suff_AddTransform rather than the standard + * Targ_FindNode in the target module. + * + * Upon return, the value of the line is unspecified. + */ +static void +ParseDoDependency(char *line) +{ + char *cp; /* our current position */ + GNodeType op; /* the operator on the line */ + SearchPathList *paths; /* search paths to alter when parsing + * a list of .PATH targets */ + GNodeType tOp; /* operator from special target */ + /* target names to be found and added to the targets list */ + StringList curTargs = LST_INIT; + char *lstart = line; + /* - * Call on functions in main.c to deal with these arguments and - * set the initial character to a null-character so the loop to - * get sources won't get anything + * specType contains the SPECial TYPE of the current target. It is + * SP_NOT if the target is unspecial. If it *is* special, however, the + * children are linked as children of the parent but not vice versa. */ - Main_ParseArgLine(line); - *line = '\0'; - } else if (specType == ExShell) { - if (Job_ParseShell(line) != SUCCESS) { - Parse_Error(PARSE_FATAL, "improper shell specification"); - goto out; - } - *line = '\0'; - } else if ((specType == NotParallel) || (specType == SingleShell)) { - *line = '\0'; - } + ParseSpecial specType = SP_NOT; - /* - * NOW GO FOR THE SOURCES - */ - if ((specType == Suffixes) || (specType == ExPath) || - (specType == Includes) || (specType == Libs) || - (specType == Null) || (specType == ExObjdir)) - { - while (*line) { - /* - * If the target was one that doesn't take files as its sources - * but takes something like suffixes, we take each - * space-separated word on the line as a something and deal - * with it accordingly. - * - * If the target was .SUFFIXES, we take each source as a - * suffix and add it to the list of suffixes maintained by the - * Suff module. - * - * If the target was a .PATH, we add the source as a directory - * to search on the search path. - * - * If it was .INCLUDES, the source is taken to be the suffix of - * files which will be #included and whose search path should - * be present in the .INCLUDES variable. - * - * If it was .LIBS, the source is taken to be the suffix of - * files which are considered libraries and whose search path - * should be present in the .LIBS variable. - * - * If it was .NULL, the source is the suffix to use when a file - * has no valid suffix. - * - * If it was .OBJDIR, the source is a new definition for .OBJDIR, - * and will cause make to do a new chdir to that path. - */ - while (*cp && !isspace ((unsigned char)*cp)) { - cp++; - } - savec = *cp; - *cp = '\0'; - switch (specType) { - case Suffixes: - Suff_AddSuffix(line, &mainNode); - break; - case ExPath: - Lst_ForEach(paths, ParseAddDir, line); - break; - case Includes: - Suff_AddInclude(line); - break; - case Libs: - Suff_AddLib(line); - break; - case Null: - Suff_SetNull(line); - break; - case ExObjdir: - Main_SetObjdir(line); - break; - default: - break; - } - *cp = savec; - if (savec != '\0') { - cp++; - } - while (*cp && isspace ((unsigned char)*cp)) { - cp++; - } - line = cp; - } - if (paths) { - Lst_Destroy(paths, NULL); - } - if (specType == ExPath) - Dir_SetPATH(); - } else { - while (*line) { - /* - * The targets take real sources, so we must beware of archive - * specifications (i.e. things with left parentheses in them) - * and handle them accordingly. - */ - for (; *cp && !isspace ((unsigned char)*cp); cp++) { - if ((*cp == LPAREN) && (cp > line) && (cp[-1] != '$')) { - /* - * Only stop for a left parenthesis if it isn't at the - * start of a word (that'll be for variable changes - * later) and isn't preceded by a dollar sign (a dynamic - * source). - */ - break; - } - } + DEBUG1(PARSE, "ParseDoDependency(%s)\n", line); + tOp = OP_NONE; - if (*cp == LPAREN) { - sources = Lst_Init(FALSE); - if (Arch_ParseArchive(&line, sources, VAR_CMD) != SUCCESS) { - Parse_Error(PARSE_FATAL, - "Error in source archive spec \"%s\"", line); - goto out; - } + paths = NULL; - while (!Lst_IsEmpty (sources)) { - gn = (GNode *)Lst_DeQueue(sources); - ParseDoSrc(tOp, gn->name); - } - Lst_Destroy(sources, NULL); - cp = line; - } else { - if (*cp) { - *cp = '\0'; - cp += 1; - } - - ParseDoSrc(tOp, line); - } - while (*cp && isspace ((unsigned char)*cp)) { - cp++; - } - line = cp; - } - } - - if (mainNode == NULL) { /* - * If we have yet to decide on a main target to make, in the - * absence of any user input, we want the first target on - * the first dependency line that is actually a real target - * (i.e. isn't a .USE or .EXEC rule) to be made. + * First, grind through the targets. */ - Lst_ForEach(targets, ParseFindMain, NULL); - } + /* XXX: don't use line as an iterator variable */ + if (!ParseDoDependencyTargets(&cp, &line, lstart, &specType, &tOp, + &paths, &curTargs)) + goto out; + + /* + * Don't need the list of target names anymore. + * The targets themselves are now in the global variable 'targets'. + */ + Lst_Done(&curTargs); + Lst_Init(&curTargs); + + if (!Lst_IsEmpty(targets)) + ParseDoDependencyCheckSpec(specType); + + /* + * Have now parsed all the target names. Must parse the operator next. + */ + if (!ParseDoDependencyParseOp(&cp, lstart, &op)) + goto out; + + /* + * Apply the operator to the target. This is how we remember which + * operator a target was defined with. It fails if the operator + * used isn't consistent across all references. + */ + ApplyDependencyOperator(op); + + /* + * Onward to the sources. + * + * LINE will now point to the first source word, if any, or the + * end of the string if not. + */ + pp_skip_whitespace(&cp); + line = cp; /* XXX: 'line' is an inappropriate name */ + + /* + * Several special targets take different actions if present with no + * sources: + * a .SUFFIXES line with no sources clears out all old suffixes + * a .PRECIOUS line makes all targets precious + * a .IGNORE line ignores errors for all targets + * a .SILENT line creates silence when making all targets + * a .PATH removes all directories from the search path(s). + */ + if (line[0] == '\0') { + ParseDoDependencySourcesEmpty(specType, paths); + } else if (specType == SP_MFLAGS) { + /* + * Call on functions in main.c to deal with these arguments and + * set the initial character to a null-character so the loop to + * get sources won't get anything + */ + Main_ParseArgLine(line); + *line = '\0'; + } else if (specType == SP_SHELL) { + if (!Job_ParseShell(line)) { + Parse_Error(PARSE_FATAL, + "improper shell specification"); + goto out; + } + *line = '\0'; + } else if (specType == SP_NOTPARALLEL || specType == SP_SINGLESHELL || + specType == SP_DELETE_ON_ERROR) { + *line = '\0'; + } + + /* Now go for the sources. */ + if (specType == SP_SUFFIXES || specType == SP_PATH || + specType == SP_INCLUDES || specType == SP_LIBS || + specType == SP_NULL || specType == SP_OBJDIR) { + ParseDoDependencySourcesSpecial(line, cp, specType, paths); + if (paths != NULL) { + Lst_Free(paths); + paths = NULL; + } + if (specType == SP_PATH) + Dir_SetPATH(); + } else { + assert(paths == NULL); + if (!ParseDoDependencySourcesMundane(line, cp, specType, tOp)) + goto out; + } + + FindMainTarget(); out: - if (curTargs) - Lst_Destroy(curTargs, NULL); + if (paths != NULL) + Lst_Free(paths); + Lst_Done(&curTargs); } -/*- - *--------------------------------------------------------------------- - * Parse_IsVar -- - * Return TRUE if the passed line is a variable assignment. A variable - * assignment consists of a single word followed by optional whitespace - * followed by either a += or an = operator. - * This function is used both by the Parse_File function and main when - * parsing the command-line arguments. +typedef struct VarAssignParsed { + const char *nameStart; /* unexpanded */ + const char *nameEnd; /* before operator adjustment */ + const char *eq; /* the '=' of the assignment operator */ +} VarAssignParsed; + +/* + * Determine the assignment operator and adjust the end of the variable + * name accordingly. + */ +static void +AdjustVarassignOp(const VarAssignParsed *pvar, const char *value, + VarAssign *out_var) +{ + const char *op = pvar->eq; + const char *const name = pvar->nameStart; + VarAssignOp type; + + if (op > name && op[-1] == '+') { + type = VAR_APPEND; + op--; + + } else if (op > name && op[-1] == '?') { + op--; + type = VAR_DEFAULT; + + } else if (op > name && op[-1] == ':') { + op--; + type = VAR_SUBST; + + } else if (op > name && op[-1] == '!') { + op--; + type = VAR_SHELL; + + } else { + type = VAR_NORMAL; +#ifdef SUNSHCMD + while (op > name && ch_isspace(op[-1])) + op--; + + if (op >= name + 3 && op[-3] == ':' && op[-2] == 's' && + op[-1] == 'h') { + type = VAR_SHELL; + op -= 3; + } +#endif + } + + { + const char *nameEnd = pvar->nameEnd < op ? pvar->nameEnd : op; + out_var->varname = bmake_strsedup(pvar->nameStart, nameEnd); + out_var->op = type; + out_var->value = value; + } +} + +/* + * Parse a variable assignment, consisting of a single-word variable name, + * optional whitespace, an assignment operator, optional whitespace and the + * variable value. * - * Input: - * line the line to check + * Note: There is a lexical ambiguity with assignment modifier characters + * in variable names. This routine interprets the character before the = + * as a modifier. Therefore, an assignment like + * C++=/usr/bin/CC + * is interpreted as "C+ +=" instead of "C++ =". * - * Results: - * TRUE if it is. FALSE if it ain't - * - * Side Effects: - * none - *--------------------------------------------------------------------- + * Used for both lines in a file and command line arguments. */ Boolean -Parse_IsVar(char *line) +Parse_IsVar(const char *p, VarAssign *out_var) { - Boolean wasSpace = FALSE; /* set TRUE if found a space */ - char ch; - int level = 0; -#define ISEQOPERATOR(c) \ - (((c) == '+') || ((c) == ':') || ((c) == '?') || ((c) == '!')) + VarAssignParsed pvar; + const char *firstSpace = NULL; + int level = 0; - /* - * Skip to variable name - */ - for (;(*line == ' ') || (*line == '\t'); line++) - continue; + cpp_skip_hspace(&p); /* Skip to variable name */ - /* Scan for one of the assignment operators outside a variable expansion */ - while ((ch = *line++) != 0) { - if (ch == '(' || ch == '{') { - level++; - continue; - } - if (ch == ')' || ch == '}') { - level--; - continue; - } - if (level != 0) - continue; - while (ch == ' ' || ch == '\t') { - ch = *line++; - wasSpace = TRUE; - } -#ifdef SUNSHCMD - if (ch == ':' && strncmp(line, "sh", 2) == 0) { - line += 2; - continue; - } + /* + * During parsing, the '+' of the '+=' operator is initially parsed + * as part of the variable name. It is later corrected, as is the + * ':sh' modifier. Of these two (nameEnd and op), the earlier one + * determines the actual end of the variable name. + */ + pvar.nameStart = p; +#ifdef CLEANUP + pvar.nameEnd = NULL; + pvar.eq = NULL; #endif - if (ch == '=') - return TRUE; - if (*line == '=' && ISEQOPERATOR(ch)) - return TRUE; - if (wasSpace) - return FALSE; - } - return FALSE; + /* + * Scan for one of the assignment operators outside a variable + * expansion. + */ + while (*p != '\0') { + char ch = *p++; + if (ch == '(' || ch == '{') { + level++; + continue; + } + if (ch == ')' || ch == '}') { + level--; + continue; + } + + if (level != 0) + continue; + + if (ch == ' ' || ch == '\t') + if (firstSpace == NULL) + firstSpace = p - 1; + while (ch == ' ' || ch == '\t') + ch = *p++; + +#ifdef SUNSHCMD + if (ch == ':' && p[0] == 's' && p[1] == 'h') { + p += 2; + continue; + } +#endif + if (ch == '=') { + pvar.eq = p - 1; + pvar.nameEnd = firstSpace != NULL ? firstSpace : p - 1; + cpp_skip_whitespace(&p); + AdjustVarassignOp(&pvar, p, out_var); + return TRUE; + } + if (*p == '=' && + (ch == '+' || ch == ':' || ch == '?' || ch == '!')) { + pvar.eq = p; + pvar.nameEnd = firstSpace != NULL ? firstSpace : p; + p++; + cpp_skip_whitespace(&p); + AdjustVarassignOp(&pvar, p, out_var); + return TRUE; + } + if (firstSpace != NULL) + return FALSE; + } + + return FALSE; } -/*- - *--------------------------------------------------------------------- - * Parse_DoVar -- - * Take the variable assignment in the passed line and do it in the - * global context. - * - * Note: There is a lexical ambiguity with assignment modifier characters - * in variable names. This routine interprets the character before the = - * as a modifier. Therefore, an assignment like - * C++=/usr/bin/CC - * is interpreted as "C+ +=" instead of "C++ =". - * - * Input: - * line a line guaranteed to be a variable assignment. - * This reduces error checks - * ctxt Context in which to do the assignment - * - * Results: - * none - * - * Side Effects: - * the variable structure of the given variable name is altered in the - * global context. - *--------------------------------------------------------------------- +/* + * Check for syntax errors such as unclosed expressions or unknown modifiers. */ -void -Parse_DoVar(char *line, GNode *ctxt) +static void +VarCheckSyntax(VarAssignOp type, const char *uvalue, GNode *scope) { - char *cp; /* pointer into line */ - enum { - VAR_SUBST, VAR_APPEND, VAR_SHELL, VAR_NORMAL - } type; /* Type of assignment */ - char *opc; /* ptr to operator character to - * null-terminate the variable name */ - Boolean freeCp = FALSE; /* TRUE if cp needs to be freed, - * i.e. if any variable expansion was - * performed */ - int depth; + if (opts.strict) { + if (type != VAR_SUBST && strchr(uvalue, '$') != NULL) { + char *expandedValue; - /* - * Skip to variable name - */ - while ((*line == ' ') || (*line == '\t')) { - line++; - } - - /* - * Skip to operator character, nulling out whitespace as we go - * XXX Rather than counting () and {} we should look for $ and - * then expand the variable. - */ - for (depth = 0, cp = line + 1; depth != 0 || *cp != '='; cp++) { - if (*cp == '(' || *cp == '{') { - depth++; - continue; + (void)Var_Subst(uvalue, scope, VARE_PARSE_ONLY, + &expandedValue); + /* TODO: handle errors */ + free(expandedValue); + } } - if (*cp == ')' || *cp == '}') { - depth--; - continue; - } - if (depth == 0 && isspace ((unsigned char)*cp)) { - *cp = '\0'; - } - } - opc = cp-1; /* operator is the previous character */ - *cp++ = '\0'; /* nuke the = */ +} - /* - * Check operator type - */ - switch (*opc) { - case '+': - type = VAR_APPEND; - *opc = '\0'; - break; - - case '?': - /* - * If the variable already has a value, we don't do anything. - */ - *opc = '\0'; - if (Var_Exists(line, ctxt)) { - return; - } else { - type = VAR_NORMAL; - } - break; - - case ':': - type = VAR_SUBST; - *opc = '\0'; - break; - - case '!': - type = VAR_SHELL; - *opc = '\0'; - break; - - default: -#ifdef SUNSHCMD - while (opc > line && *opc != ':') - opc--; - - if (strncmp(opc, ":sh", 3) == 0) { - type = VAR_SHELL; - *opc = '\0'; - break; - } -#endif - type = VAR_NORMAL; - break; - } - - while (isspace ((unsigned char)*cp)) { - cp++; - } - - if (type == VAR_APPEND) { - Var_Append(line, cp, ctxt); - } else if (type == VAR_SUBST) { - /* - * Allow variables in the old value to be undefined, but leave their - * invocation alone -- this is done by forcing oldVars to be false. - * XXX: This can cause recursive variables, but that's not hard to do, - * and this allows someone to do something like - * - * CFLAGS = $(.INCLUDES) - * CFLAGS := -I.. $(CFLAGS) - * - * And not get an error. - */ - Boolean oldOldVars = oldVars; - - oldVars = FALSE; +static void +VarAssign_EvalSubst(GNode *scope, const char *name, const char *uvalue, + FStr *out_avalue) +{ + char *evalue; /* * make sure that we set the variable the first time to nothing - * so that it gets substituted! + * so that it gets substituted. + * + * TODO: Add a test that demonstrates why this code is needed, + * apart from making the debug log longer. */ - if (!Var_Exists(line, ctxt)) - Var_Set(line, "", ctxt, 0); + if (!Var_ExistsExpand(scope, name)) + Var_SetExpand(scope, name, ""); - cp = Var_Subst(NULL, cp, ctxt, FALSE); - oldVars = oldOldVars; - freeCp = TRUE; + (void)Var_Subst(uvalue, scope, VARE_KEEP_DOLLAR_UNDEF, &evalue); + /* TODO: handle errors */ - Var_Set(line, cp, ctxt, 0); - } else if (type == VAR_SHELL) { - char *res; - const char *error; + Var_SetExpand(scope, name, evalue); - if (strchr(cp, '$') != NULL) { - /* - * There's a dollar sign in the command, so perform variable - * expansion on the whole thing. The resulting string will need - * freeing when we're done, so set freeCmd to TRUE. - */ - cp = Var_Subst(NULL, cp, VAR_CMD, TRUE); - freeCp = TRUE; + *out_avalue = FStr_InitOwn(evalue); +} + +static void +VarAssign_EvalShell(const char *name, const char *uvalue, GNode *scope, + FStr *out_avalue) +{ + FStr cmd; + const char *errfmt; + char *cmdOut; + + cmd = FStr_InitRefer(uvalue); + if (strchr(cmd.str, '$') != NULL) { + char *expanded; + (void)Var_Subst(cmd.str, SCOPE_CMDLINE, VARE_UNDEFERR, + &expanded); + /* TODO: handle errors */ + cmd = FStr_InitOwn(expanded); } - res = Cmd_Exec(cp, &error); - Var_Set(line, res, ctxt, 0); - free(res); + cmdOut = Cmd_Exec(cmd.str, &errfmt); + Var_SetExpand(scope, name, cmdOut); + *out_avalue = FStr_InitOwn(cmdOut); - if (error) - Parse_Error(PARSE_WARNING, error, cp); - } else { - /* - * Normal assignment -- just do it. - */ - Var_Set(line, cp, ctxt, 0); - } - if (strcmp(line, MAKEOVERRIDES) == 0) - Main_ExportMAKEFLAGS(FALSE); /* re-export MAKEFLAGS */ - else if (strcmp(line, ".CURDIR") == 0) { - /* - * Somone is being (too?) clever... - * Let's pretend they know what they are doing and - * re-initialize the 'cur' Path. - */ - Dir_InitCur(cp); - Dir_SetPATH(); - } else if (strcmp(line, MAKE_JOB_PREFIX) == 0) { - Job_SetPrefix(); - } else if (strcmp(line, MAKE_EXPORTED) == 0) { - Var_Export(cp, 0); - } - if (freeCp) - free(cp); + if (errfmt != NULL) + Parse_Error(PARSE_WARNING, errfmt, cmd.str); + + FStr_Done(&cmd); +} + +/* + * Perform a variable assignment. + * + * The actual value of the variable is returned in *out_TRUE_avalue. + * Especially for VAR_SUBST and VAR_SHELL this can differ from the literal + * value. + * + * Return whether the assignment was actually performed, which is usually + * the case. It is only skipped if the operator is '?=' and the variable + * already exists. + */ +static Boolean +VarAssign_Eval(const char *name, VarAssignOp op, const char *uvalue, + GNode *scope, FStr *out_TRUE_avalue) +{ + FStr avalue = FStr_InitRefer(uvalue); + + if (op == VAR_APPEND) + Var_AppendExpand(scope, name, uvalue); + else if (op == VAR_SUBST) + VarAssign_EvalSubst(scope, name, uvalue, &avalue); + else if (op == VAR_SHELL) + VarAssign_EvalShell(name, uvalue, scope, &avalue); + else { + if (op == VAR_DEFAULT && Var_ExistsExpand(scope, name)) + return FALSE; + + /* Normal assignment -- just do it. */ + Var_SetExpand(scope, name, uvalue); + } + + *out_TRUE_avalue = avalue; + return TRUE; +} + +static void +VarAssignSpecial(const char *name, const char *avalue) +{ + if (strcmp(name, MAKEOVERRIDES) == 0) + Main_ExportMAKEFLAGS(FALSE); /* re-export MAKEFLAGS */ + else if (strcmp(name, ".CURDIR") == 0) { + /* + * Someone is being (too?) clever... + * Let's pretend they know what they are doing and + * re-initialize the 'cur' CachedDir. + */ + Dir_InitCur(avalue); + Dir_SetPATH(); + } else if (strcmp(name, MAKE_JOB_PREFIX) == 0) + Job_SetPrefix(); + else if (strcmp(name, MAKE_EXPORTED) == 0) + Var_ExportVars(avalue); +} + +/* Perform the variable variable assignment in the given scope. */ +void +Parse_DoVar(VarAssign *var, GNode *scope) +{ + FStr avalue; /* actual value (maybe expanded) */ + + VarCheckSyntax(var->op, var->value, scope); + if (VarAssign_Eval(var->varname, var->op, var->value, scope, &avalue)) { + VarAssignSpecial(var->varname, avalue.str); + FStr_Done(&avalue); + } + + free(var->varname); } /* - * ParseMaybeSubMake -- - * Scan the command string to see if it a possible submake node - * Input: - * cmd the command to scan - * Results: - * TRUE if the command is possibly a submake, FALSE if not. + * See if the command possibly calls a sub-make by using the variable + * expressions ${.MAKE}, ${MAKE} or the plain word "make". */ static Boolean -ParseMaybeSubMake(const char *cmd) +MaybeSubMake(const char *cmd) { - size_t i; - static struct { - const char *name; - size_t len; - } vals[] = { -#define MKV(A) { A, sizeof(A) - 1 } - MKV("${MAKE}"), - MKV("${.MAKE}"), - MKV("$(MAKE)"), - MKV("$(.MAKE)"), - MKV("make"), - }; - for (i = 0; i < sizeof(vals)/sizeof(vals[0]); i++) { - char *ptr; - if ((ptr = strstr(cmd, vals[i].name)) == NULL) - continue; - if ((ptr == cmd || !isalnum((unsigned char)ptr[-1])) - && !isalnum((unsigned char)ptr[vals[i].len])) - return TRUE; - } - return FALSE; + const char *start; + + for (start = cmd; *start != '\0'; start++) { + const char *p = start; + char endc; + + /* XXX: What if progname != "make"? */ + if (p[0] == 'm' && p[1] == 'a' && p[2] == 'k' && p[3] == 'e') + if (start == cmd || !ch_isalnum(p[-1])) + if (!ch_isalnum(p[4])) + return TRUE; + + if (*p != '$') + continue; + p++; + + if (*p == '{') + endc = '}'; + else if (*p == '(') + endc = ')'; + else + continue; + p++; + + if (*p == '.') /* Accept either ${.MAKE} or ${MAKE}. */ + p++; + + if (p[0] == 'M' && p[1] == 'A' && p[2] == 'K' && p[3] == 'E') + if (p[4] == endc) + return TRUE; + } + return FALSE; } -/*- - * ParseAddCmd -- - * Lst_ForEach function to add a command line to all targets +/* + * Append the command to the target node. * - * Input: - * gnp the node to which the command is to be added - * cmd the command to add - * - * Results: - * Always 0 - * - * Side Effects: - * A new element is added to the commands list of the node, - * and the node can be marked as a submake node if the command is - * determined to be that. - */ -static int -ParseAddCmd(void *gnp, void *cmd) -{ - GNode *gn = (GNode *)gnp; - - /* Add to last (ie current) cohort for :: targets */ - if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts)) - gn = (GNode *)Lst_Datum(Lst_Last(gn->cohorts)); - - /* if target already supplied, ignore commands */ - if (!(gn->type & OP_HAS_COMMANDS)) { - (void)Lst_AtEnd(gn->commands, cmd); - if (ParseMaybeSubMake(cmd)) - gn->type |= OP_SUBMAKE; - ParseMark(gn); - } else { -#ifdef notyet - /* XXX: We cannot do this until we fix the tree */ - (void)Lst_AtEnd(gn->commands, cmd); - Parse_Error(PARSE_WARNING, - "overriding commands for target \"%s\"; " - "previous commands defined at %s: %d ignored", - gn->name, gn->fname, gn->lineno); -#else - Parse_Error(PARSE_WARNING, - "duplicate script for target \"%s\" ignored", - gn->name); - ParseErrorInternal(gn->fname, gn->lineno, PARSE_WARNING, - "using previous script for \"%s\" defined here", - gn->name); -#endif - } - return(0); -} - -/*- - *----------------------------------------------------------------------- - * ParseHasCommands -- - * Callback procedure for Parse_File when destroying the list of - * targets on the last dependency line. Marks a target as already - * having commands if it does, to keep from having shell commands - * on multiple dependency lines. - * - * Input: - * gnp Node to examine - * - * Results: - * None - * - * Side Effects: - * OP_HAS_COMMANDS may be set for the target. - * - *----------------------------------------------------------------------- + * The node may be marked as a submake node if the command is determined to + * be that. */ static void -ParseHasCommands(void *gnp) +ParseAddCmd(GNode *gn, char *cmd) { - GNode *gn = (GNode *)gnp; - if (!Lst_IsEmpty(gn->commands)) { - gn->type |= OP_HAS_COMMANDS; - } + /* Add to last (ie current) cohort for :: targets */ + if ((gn->type & OP_DOUBLEDEP) && gn->cohorts.last != NULL) + gn = gn->cohorts.last->datum; + + /* if target already supplied, ignore commands */ + if (!(gn->type & OP_HAS_COMMANDS)) { + Lst_Append(&gn->commands, cmd); + if (MaybeSubMake(cmd)) + gn->type |= OP_SUBMAKE; + ParseMark(gn); + } else { +#if 0 + /* XXX: We cannot do this until we fix the tree */ + Lst_Append(&gn->commands, cmd); + Parse_Error(PARSE_WARNING, + "overriding commands for target \"%s\"; " + "previous commands defined at %s: %d ignored", + gn->name, gn->fname, gn->lineno); +#else + Parse_Error(PARSE_WARNING, + "duplicate script for target \"%s\" ignored", + gn->name); + ParseErrorInternal(gn->fname, (size_t)gn->lineno, PARSE_WARNING, + "using previous script for \"%s\" defined here", + gn->name); +#endif + } } -/*- - *----------------------------------------------------------------------- - * Parse_AddIncludeDir -- - * Add a directory to the path searched for included makefiles - * bracketed by double-quotes. Used by functions in main.c - * - * Input: - * dir The name of the directory to add - * - * Results: - * None. - * - * Side Effects: - * The directory is appended to the list. - * - *----------------------------------------------------------------------- +/* + * Add a directory to the path searched for included makefiles bracketed + * by double-quotes. */ void -Parse_AddIncludeDir(char *dir) +Parse_AddIncludeDir(const char *dir) { - (void)Dir_AddDir(parseIncPath, dir); + (void)SearchPath_Add(parseIncPath, dir); } -/*- - *--------------------------------------------------------------------- - * ParseDoInclude -- - * Push to another file. +/* + * Handle one of the .[-ds]include directives by remembering the current file + * and pushing the included file on the stack. After the included file has + * finished, parsing continues with the including file; see Parse_SetInput + * and ParseEOF. * - * The input is the line minus the `.'. A file spec is a string - * enclosed in <> or "". The former is looked for only in sysIncPath. - * The latter in . and the directories specified by -I command line - * options - * - * Results: - * None - * - * Side Effects: - * A structure is added to the includes Lst and readProc, lineno, - * fname and curFILE are altered for the new file - *--------------------------------------------------------------------- + * System includes are looked up in sysIncPath, any other includes are looked + * up in the parsedir and then in the directories specified by the -I command + * line options. */ - static void -Parse_include_file(char *file, Boolean isSystem, int silent) +IncludeFile(char *file, Boolean isSystem, Boolean depinc, Boolean silent) { - struct loadedfile *lf; - char *fullname; /* full pathname of file */ - char *newName; - char *prefEnd, *incdir; - int fd; - int i; + struct loadedfile *lf; + char *fullname; /* full pathname of file */ + char *newName; + char *slash, *incdir; + int fd; + int i; - /* - * Now we know the file's name and its search path, we attempt to - * find the durn thing. A return of NULL indicates the file don't - * exist. - */ - fullname = file[0] == '/' ? bmake_strdup(file) : NULL; + fullname = file[0] == '/' ? bmake_strdup(file) : NULL; - if (fullname == NULL && !isSystem) { - /* - * Include files contained in double-quotes are first searched for - * relative to the including file's location. We don't want to - * cd there, of course, so we just tack on the old file's - * leading path components and call Dir_FindFile to see if - * we can locate the beast. - */ + if (fullname == NULL && !isSystem) { + /* + * Include files contained in double-quotes are first searched + * relative to the including file's location. We don't want to + * cd there, of course, so we just tack on the old file's + * leading path components and call Dir_FindFile to see if + * we can locate the file. + */ - incdir = bmake_strdup(curFile->fname); - prefEnd = strrchr(incdir, '/'); - if (prefEnd != NULL) { - *prefEnd = '\0'; - /* Now do lexical processing of leading "../" on the filename */ - for (i = 0; strncmp(file + i, "../", 3) == 0; i += 3) { - prefEnd = strrchr(incdir + 1, '/'); - if (prefEnd == NULL || strcmp(prefEnd, "/..") == 0) - break; - *prefEnd = '\0'; - } - newName = str_concat(incdir, file + i, STR_ADDSLASH); - fullname = Dir_FindFile(newName, parseIncPath); - if (fullname == NULL) - fullname = Dir_FindFile(newName, dirSearchPath); - free(newName); + incdir = bmake_strdup(CurFile()->fname); + slash = strrchr(incdir, '/'); + if (slash != NULL) { + *slash = '\0'; + /* + * Now do lexical processing of leading "../" on the + * filename. + */ + for (i = 0; strncmp(file + i, "../", 3) == 0; i += 3) { + slash = strrchr(incdir + 1, '/'); + if (slash == NULL || strcmp(slash, "/..") == 0) + break; + *slash = '\0'; + } + newName = str_concat3(incdir, "/", file + i); + fullname = Dir_FindFile(newName, parseIncPath); + if (fullname == NULL) + fullname = Dir_FindFile(newName, + &dirSearchPath); + free(newName); + } + free(incdir); + + if (fullname == NULL) { + /* + * Makefile wasn't found in same directory as included + * makefile. + * + * Search for it first on the -I search path, then on + * the .PATH search path, if not found in a -I + * directory. If we have a suffix-specific path, we + * should use that. + */ + const char *suff; + SearchPath *suffPath = NULL; + + if ((suff = strrchr(file, '.')) != NULL) { + suffPath = Suff_GetPath(suff); + if (suffPath != NULL) + fullname = Dir_FindFile(file, suffPath); + } + if (fullname == NULL) { + fullname = Dir_FindFile(file, parseIncPath); + if (fullname == NULL) + fullname = Dir_FindFile(file, + &dirSearchPath); + } + } + } + + /* Looking for a system file or file still not found */ + if (fullname == NULL) { + /* + * Look for it on the system path + */ + SearchPath *path = Lst_IsEmpty(&sysIncPath->dirs) + ? defSysIncPath : sysIncPath; + fullname = Dir_FindFile(file, path); } - free(incdir); if (fullname == NULL) { - /* - * Makefile wasn't found in same directory as included makefile. - * Search for it first on the -I search path, - * then on the .PATH search path, if not found in a -I directory. - * If we have a suffix specific path we should use that. - */ - char *suff; - Lst suffPath = NULL; - - if ((suff = strrchr(file, '.'))) { - suffPath = Suff_GetPath(suff); - if (suffPath != NULL) { - fullname = Dir_FindFile(file, suffPath); - } - } - if (fullname == NULL) { - fullname = Dir_FindFile(file, parseIncPath); - if (fullname == NULL) { - fullname = Dir_FindFile(file, dirSearchPath); - } - } + if (!silent) + Parse_Error(PARSE_FATAL, "Could not find %s", file); + return; + } + + /* Actually open the file... */ + fd = open(fullname, O_RDONLY); + if (fd == -1) { + if (!silent) + Parse_Error(PARSE_FATAL, "Cannot open %s", fullname); + free(fullname); + return; + } + + /* load it */ + lf = loadfile(fullname, fd); + + /* Start reading from this file next */ + Parse_SetInput(fullname, 0, -1, loadedfile_readMore, lf); + CurFile()->lf = lf; + if (depinc) + doing_depend = depinc; /* only turn it on */ +} + +static void +ParseDoInclude(char *directive) +{ + char endc; /* the character which ends the file spec */ + char *cp; /* current position in file spec */ + Boolean silent = directive[0] != 'i'; + char *file = directive + (silent ? 8 : 7); + + /* Skip to delimiter character so we know where to look */ + pp_skip_hspace(&file); + + if (*file != '"' && *file != '<') { + Parse_Error(PARSE_FATAL, + ".include filename must be delimited by '\"' or '<'"); + return; } - } - /* Looking for a system file or file still not found */ - if (fullname == NULL) { /* - * Look for it on the system path + * Set the search path on which to find the include file based on the + * characters which bracket its name. Angle-brackets imply it's + * a system Makefile while double-quotes imply it's a user makefile */ - fullname = Dir_FindFile(file, - Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath); - } + if (*file == '<') + endc = '>'; + else + endc = '"'; - if (fullname == NULL) { - if (!silent) - Parse_Error(PARSE_FATAL, "Could not find %s", file); - return; - } + /* Skip to matching delimiter */ + for (cp = ++file; *cp != '\0' && *cp != endc; cp++) + continue; - /* Actually open the file... */ - fd = open(fullname, O_RDONLY); - if (fd == -1) { - if (!silent) - Parse_Error(PARSE_FATAL, "Cannot open %s", fullname); - free(fullname); - return; - } + if (*cp != endc) { + Parse_Error(PARSE_FATAL, + "Unclosed .include filename. '%c' expected", endc); + return; + } - /* load it */ - lf = loadfile(fullname, fd); + *cp = '\0'; - ParseSetIncludedFile(); - /* Start reading from this file next */ - Parse_SetInput(fullname, 0, -1, loadedfile_nextbuf, lf); - curFile->lf = lf; + /* + * Substitute for any variables in the filename before trying to + * find the file. + */ + (void)Var_Subst(file, SCOPE_CMDLINE, VARE_WANTRES, &file); + /* TODO: handle errors */ + + IncludeFile(file, endc == '>', directive[0] == 'd', silent); + free(file); } -static void -ParseDoInclude(char *line) -{ - char endc; /* the character which ends the file spec */ - char *cp; /* current position in file spec */ - int silent = (*line != 'i') ? 1 : 0; - char *file = &line[7 + silent]; - - /* Skip to delimiter character so we know where to look */ - while (*file == ' ' || *file == '\t') - file++; - - if (*file != '"' && *file != '<') { - Parse_Error(PARSE_FATAL, - ".include filename must be delimited by '\"' or '<'"); - return; - } - - /* - * Set the search path on which to find the include file based on the - * characters which bracket its name. Angle-brackets imply it's - * a system Makefile while double-quotes imply it's a user makefile - */ - if (*file == '<') { - endc = '>'; - } else { - endc = '"'; - } - - /* Skip to matching delimiter */ - for (cp = ++file; *cp && *cp != endc; cp++) - continue; - - if (*cp != endc) { - Parse_Error(PARSE_FATAL, - "Unclosed %cinclude filename. '%c' expected", - '.', endc); - return; - } - *cp = '\0'; - - /* - * Substitute for any variables in the file name before trying to - * find the thing. - */ - file = Var_Subst(NULL, file, VAR_CMD, FALSE); - - Parse_include_file(file, endc == '>', silent); - free(file); -} - - -/*- - *--------------------------------------------------------------------- - * ParseSetIncludedFile -- - * Set the .INCLUDEDFROMFILE variable to the contents of .PARSEFILE - * and the .INCLUDEDFROMDIR variable to the contents of .PARSEDIR - * - * Results: - * None - * - * Side Effects: - * The .INCLUDEDFROMFILE variable is overwritten by the contents - * of .PARSEFILE and the .INCLUDEDFROMDIR variable is overwriten - * by the contents of .PARSEDIR - *--------------------------------------------------------------------- +/* + * Split filename into dirname + basename, then assign these to the + * given variables. */ static void -ParseSetIncludedFile(void) +SetFilenameVars(const char *filename, const char *dirvar, const char *filevar) { - char *pf, *fp = NULL; - char *pd, *dp = NULL; + const char *slash, *basename; + FStr dirname; - pf = Var_Value(".PARSEFILE", VAR_GLOBAL, &fp); - Var_Set(".INCLUDEDFROMFILE", pf, VAR_GLOBAL, 0); - pd = Var_Value(".PARSEDIR", VAR_GLOBAL, &dp); - Var_Set(".INCLUDEDFROMDIR", pd, VAR_GLOBAL, 0); + slash = strrchr(filename, '/'); + if (slash == NULL) { + dirname = FStr_InitRefer(curdir); + basename = filename; + } else { + dirname = FStr_InitOwn(bmake_strsedup(filename, slash)); + basename = slash + 1; + } - if (DEBUG(PARSE)) - fprintf(debug_file, "%s: ${.INCLUDEDFROMDIR} = `%s' " - "${.INCLUDEDFROMFILE} = `%s'\n", __func__, pd, pf); + Global_SetExpand(dirvar, dirname.str); + Global_SetExpand(filevar, basename); - if (fp) - free(fp); - if (dp) - free(dp); + DEBUG5(PARSE, "%s: ${%s} = `%s' ${%s} = `%s'\n", + __func__, dirvar, dirname.str, filevar, basename); + FStr_Done(&dirname); } -/*- - *--------------------------------------------------------------------- - * ParseSetParseFile -- - * Set the .PARSEDIR and .PARSEFILE variables to the dirname and - * basename of the given filename + +/* + * Return the immediately including file. * - * Results: - * None - * - * Side Effects: - * The .PARSEDIR and .PARSEFILE variables are overwritten by the - * dirname and basename of the given filename. - *--------------------------------------------------------------------- + * This is made complicated since the .for loop is implemented as a special + * kind of .include; see For_Run. */ +static const char * +GetActuallyIncludingFile(void) +{ + size_t i; + const IFile *incs = GetInclude(0); + + for (i = includes.len; i >= 2; i--) + if (!incs[i - 1].fromForLoop) + return incs[i - 2].fname; + return NULL; +} + +/* Set .PARSEDIR, .PARSEFILE, .INCLUDEDFROMDIR and .INCLUDEDFROMFILE. */ static void ParseSetParseFile(const char *filename) { - char *slash, *dirname; - const char *pd, *pf; - int len; + const char *including; - slash = strrchr(filename, '/'); - if (slash == NULL) { - Var_Set(".PARSEDIR", pd = curdir, VAR_GLOBAL, 0); - Var_Set(".PARSEFILE", pf = filename, VAR_GLOBAL, 0); - dirname= NULL; - } else { - len = slash - filename; - dirname = bmake_malloc(len + 1); - memcpy(dirname, filename, len); - dirname[len] = '\0'; - Var_Set(".PARSEDIR", pd = dirname, VAR_GLOBAL, 0); - Var_Set(".PARSEFILE", pf = slash + 1, VAR_GLOBAL, 0); - } - if (DEBUG(PARSE)) - fprintf(debug_file, "%s: ${.PARSEDIR} = `%s' ${.PARSEFILE} = `%s'\n", - __func__, pd, pf); - free(dirname); + SetFilenameVars(filename, ".PARSEDIR", ".PARSEFILE"); + + including = GetActuallyIncludingFile(); + if (including != NULL) { + SetFilenameVars(including, + ".INCLUDEDFROMDIR", ".INCLUDEDFROMFILE"); + } else { + Global_Delete(".INCLUDEDFROMDIR"); + Global_Delete(".INCLUDEDFROMFILE"); + } +} + +static Boolean +StrContainsWord(const char *str, const char *word) +{ + size_t strLen = strlen(str); + size_t wordLen = strlen(word); + const char *p, *end; + + if (strLen < wordLen) + return FALSE; /* str is too short to contain word */ + + end = str + strLen - wordLen; + for (p = str; p != NULL; p = strchr(p, ' ')) { + if (*p == ' ') + p++; + if (p > end) + return FALSE; /* cannot contain word */ + + if (memcmp(p, word, wordLen) == 0 && + (p[wordLen] == '\0' || p[wordLen] == ' ')) + return TRUE; + } + return FALSE; } /* - * Track the makefiles we read - so makefiles can - * set dependencies on them. - * Avoid adding anything more than once. + * XXX: Searching through a set of words with this linear search is + * inefficient for variables that contain thousands of words. + * + * XXX: The paths in this list don't seem to be normalized in any way. */ +static Boolean +VarContainsWord(const char *varname, const char *word) +{ + FStr val = Var_Value(SCOPE_GLOBAL, varname); + Boolean found = val.str != NULL && StrContainsWord(val.str, word); + FStr_Done(&val); + return found; +} +/* + * Track the makefiles we read - so makefiles can set dependencies on them. + * Avoid adding anything more than once. + * + * Time complexity: O(n) per call, in total O(n^2), where n is the number + * of makefiles that have been loaded. + */ static void ParseTrackInput(const char *name) { - char *old; - char *fp = NULL; - size_t name_len = strlen(name); - - old = Var_Value(MAKE_MAKEFILES, VAR_GLOBAL, &fp); - if (old) { - /* does it contain name? */ - for (; old != NULL; old = strchr(old, ' ')) { - if (*old == ' ') - old++; - if (memcmp(old, name, name_len) == 0 - && (old[name_len] == 0 || old[name_len] == ' ')) - goto cleanup; - } - } - Var_Append (MAKE_MAKEFILES, name, VAR_GLOBAL); - cleanup: - if (fp) { - free(fp); - } + if (!VarContainsWord(MAKE_MAKEFILES, name)) + Global_Append(MAKE_MAKEFILES, name); } -/*- - *--------------------------------------------------------------------- - * Parse_setInput -- - * Start Parsing from the given source +/* + * Start parsing from the given source. * - * Results: - * None - * - * Side Effects: - * A structure is added to the includes Lst and readProc, lineno, - * fname and curFile are altered for the new file - *--------------------------------------------------------------------- + * The given file is added to the includes stack. */ void -Parse_SetInput(const char *name, int line, int fd, - char *(*nextbuf)(void *, size_t *), void *arg) +Parse_SetInput(const char *name, int lineno, int fd, + ReadMoreProc readMore, void *readMoreArg) { - char *buf; - size_t len; + IFile *curFile; + char *buf; + size_t len; + Boolean fromForLoop = name == NULL; - if (name == NULL) - name = curFile->fname; - else - ParseTrackInput(name); + if (fromForLoop) + name = CurFile()->fname; + else + ParseTrackInput(name); - if (DEBUG(PARSE)) - fprintf(debug_file, "%s: file %s, line %d, fd %d, nextbuf %p, arg %p\n", - __func__, name, line, fd, nextbuf, arg); + DEBUG3(PARSE, "Parse_SetInput: %s %s, line %d\n", + readMore == loadedfile_readMore ? "file" : ".for loop in", + name, lineno); - if (fd == -1 && nextbuf == NULL) - /* sanity */ - return; + if (fd == -1 && readMore == NULL) + /* sanity */ + return; - if (curFile != NULL) - /* Save exiting file info */ - Lst_AtFront(includes, curFile); + curFile = Vector_Push(&includes); + curFile->fname = bmake_strdup(name); + curFile->fromForLoop = fromForLoop; + curFile->lineno = lineno; + curFile->first_lineno = lineno; + curFile->readMore = readMore; + curFile->readMoreArg = readMoreArg; + curFile->lf = NULL; + curFile->depending = doing_depend; /* restore this on EOF */ - /* Allocate and fill in new structure */ - curFile = bmake_malloc(sizeof *curFile); + assert(readMore != NULL); - /* - * Once the previous state has been saved, we can get down to reading - * the new file. We set up the name of the file to be the absolute - * name of the include file so error messages refer to the right - * place. - */ - curFile->fname = bmake_strdup(name); - curFile->lineno = line; - curFile->first_lineno = line; - curFile->nextbuf = nextbuf; - curFile->nextbuf_arg = arg; - curFile->lf = NULL; + /* Get first block of input data */ + buf = curFile->readMore(curFile->readMoreArg, &len); + if (buf == NULL) { + /* Was all a waste of time ... */ + if (curFile->fname != NULL) + free(curFile->fname); + free(curFile); + return; + } + curFile->buf_freeIt = buf; + curFile->buf_ptr = buf; + curFile->buf_end = buf + len; - assert(nextbuf != NULL); - - /* Get first block of input data */ - buf = curFile->nextbuf(curFile->nextbuf_arg, &len); - if (buf == NULL) { - /* Was all a waste of time ... */ - if (curFile->fname) - free(curFile->fname); - free(curFile); - return; - } - curFile->P_str = buf; - curFile->P_ptr = buf; - curFile->P_end = buf+len; - - curFile->cond_depth = Cond_save_depth(); - ParseSetParseFile(name); + curFile->cond_depth = Cond_save_depth(); + ParseSetParseFile(name); } +/* Check if the directive is an include directive. */ +static Boolean +IsInclude(const char *dir, Boolean sysv) +{ + if (dir[0] == 's' || dir[0] == '-' || (dir[0] == 'd' && !sysv)) + dir++; + + if (strncmp(dir, "include", 7) != 0) + return FALSE; + + /* Space is not mandatory for BSD .include */ + return !sysv || ch_isspace(dir[7]); +} + + #ifdef SYSVINCLUDE -/*- - *--------------------------------------------------------------------- - * ParseTraditionalInclude -- - * Push to another file. - * - * The input is the current line. The file name(s) are - * following the "include". - * - * Results: - * None - * - * Side Effects: - * A structure is added to the includes Lst and readProc, lineno, - * fname and curFILE are altered for the new file - *--------------------------------------------------------------------- - */ +/* Check if the line is a SYSV include directive. */ +static Boolean +IsSysVInclude(const char *line) +{ + const char *p; + + if (!IsInclude(line, TRUE)) + return FALSE; + + /* Avoid interpreting a dependency line as an include */ + for (p = line; (p = strchr(p, ':')) != NULL;) { + + /* end of line -> it's a dependency */ + if (*++p == '\0') + return FALSE; + + /* '::' operator or ': ' -> it's a dependency */ + if (*p == ':' || ch_isspace(*p)) + return FALSE; + } + return TRUE; +} + +/* Push to another file. The line points to the word "include". */ static void ParseTraditionalInclude(char *line) { - char *cp; /* current position in file spec */ - int done = 0; - int silent = (line[0] != 'i') ? 1 : 0; - char *file = &line[silent + 7]; - char *all_files; + char *cp; /* current position in file spec */ + Boolean done = FALSE; + Boolean silent = line[0] != 'i'; + char *file = line + (silent ? 8 : 7); + char *all_files; - if (DEBUG(PARSE)) { - fprintf(debug_file, "%s: %s\n", __func__, file); - } + DEBUG2(PARSE, "%s: %s\n", __func__, file); - /* - * Skip over whitespace - */ - while (isspace((unsigned char)*file)) - file++; + pp_skip_whitespace(&file); - /* - * Substitute for any variables in the file name before trying to - * find the thing. - */ - all_files = Var_Subst(NULL, file, VAR_CMD, FALSE); + /* + * Substitute for any variables in the file name before trying to + * find the thing. + */ + (void)Var_Subst(file, SCOPE_CMDLINE, VARE_WANTRES, &all_files); + /* TODO: handle errors */ - if (*file == '\0') { - Parse_Error(PARSE_FATAL, - "Filename missing from \"include\""); - return; - } + if (*file == '\0') { + Parse_Error(PARSE_FATAL, "Filename missing from \"include\""); + goto out; + } - for (file = all_files; !done; file = cp + 1) { - /* Skip to end of line or next whitespace */ - for (cp = file; *cp && !isspace((unsigned char) *cp); cp++) - continue; + for (file = all_files; !done; file = cp + 1) { + /* Skip to end of line or next whitespace */ + for (cp = file; *cp != '\0' && !ch_isspace(*cp); cp++) + continue; - if (*cp) - *cp = '\0'; - else - done = 1; + if (*cp != '\0') + *cp = '\0'; + else + done = TRUE; - Parse_include_file(file, FALSE, silent); - } - free(all_files); + IncludeFile(file, FALSE, FALSE, silent); + } +out: + free(all_files); } #endif #ifdef GMAKEEXPORT -/*- - *--------------------------------------------------------------------- - * ParseGmakeExport -- - * Parse export = - * - * And set the environment with it. - * - * Results: - * None - * - * Side Effects: - * None - *--------------------------------------------------------------------- - */ +/* Parse "export =", and actually export it. */ static void ParseGmakeExport(char *line) { - char *variable = &line[6]; - char *value; + char *variable = line + 6; + char *value; - if (DEBUG(PARSE)) { - fprintf(debug_file, "%s: %s\n", __func__, variable); - } + DEBUG2(PARSE, "%s: %s\n", __func__, variable); - /* - * Skip over whitespace - */ - while (isspace((unsigned char)*variable)) - variable++; + pp_skip_whitespace(&variable); - for (value = variable; *value && *value != '='; value++) - continue; + for (value = variable; *value != '\0' && *value != '='; value++) + continue; - if (*value != '=') { - Parse_Error(PARSE_FATAL, - "Variable/Value missing from \"export\""); - return; - } - *value++ = '\0'; /* terminate variable */ + if (*value != '=') { + Parse_Error(PARSE_FATAL, + "Variable/Value missing from \"export\""); + return; + } + *value++ = '\0'; /* terminate variable */ - /* - * Expand the value before putting it in the environment. - */ - value = Var_Subst(NULL, value, VAR_CMD, FALSE); - setenv(variable, value, 1); + /* + * Expand the value before putting it in the environment. + */ + (void)Var_Subst(value, SCOPE_CMDLINE, VARE_WANTRES, &value); + /* TODO: handle errors */ + + setenv(variable, value, 1); + free(value); } #endif -/*- - *--------------------------------------------------------------------- - * ParseEOF -- - * Called when EOF is reached in the current file. If we were reading - * an include file, the includes stack is popped and things set up - * to go back to reading the previous file at the previous location. +/* + * Called when EOF is reached in the current file. If we were reading an + * include file or a .for loop, the includes stack is popped and things set + * up to go back to reading the previous file at the previous location. * * Results: - * CONTINUE if there's more to do. DONE if not. - * - * Side Effects: - * The old curFILE, is closed. The includes list is shortened. - * lineno, curFILE, and fname are changed if CONTINUE is returned. - *--------------------------------------------------------------------- + * TRUE to continue parsing, i.e. it had only reached the end of an + * included file, FALSE if the main file has been parsed completely. */ -static int +static Boolean ParseEOF(void) { - char *ptr; - size_t len; + char *ptr; + size_t len; + IFile *curFile = CurFile(); - assert(curFile->nextbuf != NULL); + assert(curFile->readMore != NULL); - /* get next input buffer, if any */ - ptr = curFile->nextbuf(curFile->nextbuf_arg, &len); - curFile->P_ptr = ptr; - curFile->P_str = ptr; - curFile->P_end = ptr + len; - curFile->lineno = curFile->first_lineno; - if (ptr != NULL) { - /* Iterate again */ - return CONTINUE; - } + doing_depend = curFile->depending; /* restore this */ + /* get next input buffer, if any */ + ptr = curFile->readMore(curFile->readMoreArg, &len); + curFile->buf_ptr = ptr; + curFile->buf_freeIt = ptr; + curFile->buf_end = ptr == NULL ? NULL : ptr + len; + curFile->lineno = curFile->first_lineno; + if (ptr != NULL) + return TRUE; /* Iterate again */ - /* Ensure the makefile (or loop) didn't have mismatched conditionals */ - Cond_restore_depth(curFile->cond_depth); + /* Ensure the makefile (or loop) didn't have mismatched conditionals */ + Cond_restore_depth(curFile->cond_depth); - if (curFile->lf != NULL) { - loadedfile_destroy(curFile->lf); - curFile->lf = NULL; - } + if (curFile->lf != NULL) { + loadedfile_destroy(curFile->lf); + curFile->lf = NULL; + } - /* Dispose of curFile info */ - /* Leak curFile->fname because all the gnodes have pointers to it */ - free(curFile->P_str); - free(curFile); + /* Dispose of curFile info */ + /* Leak curFile->fname because all the GNodes have pointers to it. */ + free(curFile->buf_freeIt); + Vector_Pop(&includes); - curFile = Lst_DeQueue(includes); + if (includes.len == 0) { + /* We've run out of input */ + Global_Delete(".PARSEDIR"); + Global_Delete(".PARSEFILE"); + Global_Delete(".INCLUDEDFROMDIR"); + Global_Delete(".INCLUDEDFROMFILE"); + return FALSE; + } - if (curFile == NULL) { - /* We've run out of input */ - Var_Delete(".PARSEDIR", VAR_GLOBAL); - Var_Delete(".PARSEFILE", VAR_GLOBAL); - Var_Delete(".INCLUDEDFROMDIR", VAR_GLOBAL); - Var_Delete(".INCLUDEDFROMFILE", VAR_GLOBAL); - return DONE; - } - - if (DEBUG(PARSE)) - fprintf(debug_file, "ParseEOF: returning to file %s, line %d\n", + curFile = CurFile(); + DEBUG2(PARSE, "ParseEOF: returning to file %s, line %d\n", curFile->fname, curFile->lineno); - /* Restore the PARSEDIR/PARSEFILE variables */ - ParseSetParseFile(curFile->fname); - return (CONTINUE); + ParseSetParseFile(curFile->fname); + return TRUE; } -#define PARSE_RAW 1 -#define PARSE_SKIP 2 +typedef enum ParseRawLineResult { + PRLR_LINE, + PRLR_EOF, + PRLR_ERROR +} ParseRawLineResult; -static char * -ParseGetLine(int flags, int *length) +/* + * Parse until the end of a line, taking into account lines that end with + * backslash-newline. + */ +static ParseRawLineResult +ParseRawLine(IFile *curFile, char **out_line, char **out_line_end, + char **out_firstBackslash, char **out_firstComment) { - IFile *cf = curFile; - char *ptr; - char ch; - char *line; - char *line_end; - char *escaped; - char *comment; - char *tp; + char *line = curFile->buf_ptr; + char *p = line; + char *line_end = line; + char *firstBackslash = NULL; + char *firstComment = NULL; + ParseRawLineResult res = PRLR_LINE; + + curFile->lineno++; - /* Loop through blank lines and comment lines */ - for (;;) { - cf->lineno++; - line = cf->P_ptr; - ptr = line; - line_end = line; - escaped = NULL; - comment = NULL; for (;;) { - if (cf->P_end != NULL && ptr == cf->P_end) { - /* end of buffer */ - ch = 0; - break; - } - ch = *ptr; - if (ch == 0 || (ch == '\\' && ptr[1] == 0)) { - if (cf->P_end == NULL) - /* End of string (aka for loop) data */ - break; - /* see if there is more we can parse */ - while (ptr++ < cf->P_end) { - if ((ch = *ptr) == '\n') { - if (ptr > line && ptr[-1] == '\\') - continue; - Parse_Error(PARSE_WARNING, - "Zero byte read from file, skipping rest of line."); + char ch; + + if (p == curFile->buf_end) { + res = PRLR_EOF; break; - } } - if (cf->nextbuf != NULL) { - /* - * End of this buffer; return EOF and outer logic - * will get the next one. (eww) - */ - break; + + ch = *p; + if (ch == '\0' || + (ch == '\\' && p + 1 < curFile->buf_end && p[1] == '\0')) { + Parse_Error(PARSE_FATAL, "Zero byte read from file"); + return PRLR_ERROR; } - Parse_Error(PARSE_FATAL, "Zero byte read from file"); - return NULL; - } - if (ch == '\\') { - /* Don't treat next character as special, remember first one */ - if (escaped == NULL) - escaped = ptr; - if (ptr[1] == '\n') - cf->lineno++; - ptr += 2; - line_end = ptr; - continue; - } - if (ch == '#' && comment == NULL) { - /* Remember first '#' for comment stripping */ - /* Unless previous char was '[', as in modifier :[#] */ - if (!(ptr > line && ptr[-1] == '[')) - comment = line_end; - } - ptr++; - if (ch == '\n') - break; - if (!isspace((unsigned char)ch)) - /* We are not interested in trailing whitespace */ - line_end = ptr; + /* Treat next character after '\' as literal. */ + if (ch == '\\') { + if (firstBackslash == NULL) + firstBackslash = p; + if (p[1] == '\n') { + curFile->lineno++; + if (p + 2 == curFile->buf_end) { + line_end = p; + *line_end = '\n'; + p += 2; + continue; + } + } + p += 2; + line_end = p; + assert(p <= curFile->buf_end); + continue; + } + + /* + * Remember the first '#' for comment stripping, unless + * the previous char was '[', as in the modifier ':[#]'. + */ + if (ch == '#' && firstComment == NULL && + !(p > line && p[-1] == '[')) + firstComment = line_end; + + p++; + if (ch == '\n') + break; + + /* We are not interested in trailing whitespace. */ + if (!ch_isspace(ch)) + line_end = p; } - /* Save next 'to be processed' location */ - cf->P_ptr = ptr; - - /* Check we have a non-comment, non-blank line */ - if (line_end == line || comment == line) { - if (ch == 0) - /* At end of file */ - return NULL; - /* Parse another line */ - continue; - } - - /* We now have a line of data */ - *line_end = 0; - - if (flags & PARSE_RAW) { - /* Leave '\' (etc) in line buffer (eg 'for' lines) */ - *length = line_end - line; - return line; - } - - if (flags & PARSE_SKIP) { - /* Completely ignore non-directives */ - if (line[0] != '.') - continue; - /* We could do more of the .else/.elif/.endif checks here */ - } - break; - } - - /* Brutally ignore anything after a non-escaped '#' in non-commands */ - if (comment != NULL && line[0] != '\t') { - line_end = comment; - *line_end = 0; - } - - /* If we didn't see a '\\' then the in-situ data is fine */ - if (escaped == NULL) { - *length = line_end - line; - return line; - } - - /* Remove escapes from '\n' and '#' */ - tp = ptr = escaped; - escaped = line; - for (; ; *tp++ = ch) { - ch = *ptr++; - if (ch != '\\') { - if (ch == 0) - break; - continue; - } - - ch = *ptr++; - if (ch == 0) { - /* Delete '\\' at end of buffer */ - tp--; - break; - } - - if (ch == '#' && line[0] != '\t') - /* Delete '\\' from before '#' on non-command lines */ - continue; - - if (ch != '\n') { - /* Leave '\\' in buffer for later */ - *tp++ = '\\'; - /* Make sure we don't delete an escaped ' ' from the line end */ - escaped = tp + 1; - continue; - } - - /* Escaped '\n' replace following whitespace with a single ' ' */ - while (ptr[0] == ' ' || ptr[0] == '\t') - ptr++; - ch = ' '; - } - - /* Delete any trailing spaces - eg from empty continuations */ - while (tp > escaped && isspace((unsigned char)tp[-1])) - tp--; - - *tp = 0; - *length = tp - line; - return line; + *out_line = line; + curFile->buf_ptr = p; + *out_line_end = line_end; + *out_firstBackslash = firstBackslash; + *out_firstComment = firstComment; + return res; } -/*- - *--------------------------------------------------------------------- - * ParseReadLine -- - * Read an entire line from the input file. Called only by Parse_File. +/* + * Beginning at start, unescape '\#' to '#' and replace backslash-newline + * with a single space. + */ +static void +UnescapeBackslash(char *line, char *start) +{ + char *src = start; + char *dst = start; + char *spaceStart = line; + + for (;;) { + char ch = *src++; + if (ch != '\\') { + if (ch == '\0') + break; + *dst++ = ch; + continue; + } + + ch = *src++; + if (ch == '\0') { + /* Delete '\\' at end of buffer */ + dst--; + break; + } + + /* Delete '\\' from before '#' on non-command lines */ + if (ch == '#' && line[0] != '\t') { + *dst++ = ch; + continue; + } + + if (ch != '\n') { + /* Leave '\\' in buffer for later */ + *dst++ = '\\'; + /* + * Make sure we don't delete an escaped ' ' from the + * line end. + */ + spaceStart = dst + 1; + *dst++ = ch; + continue; + } + + /* + * Escaped '\n' -- replace following whitespace with a single + * ' '. + */ + pp_skip_hspace(&src); + *dst++ = ' '; + } + + /* Delete any trailing spaces - eg from empty continuations */ + while (dst > spaceStart && ch_isspace(dst[-1])) + dst--; + *dst = '\0'; +} + +typedef enum GetLineMode { + /* + * Return the next line that is neither empty nor a comment. + * Backslash line continuations are folded into a single space. + * A trailing comment, if any, is discarded. + */ + GLM_NONEMPTY, + + /* + * Return the next line, even if it is empty or a comment. + * Preserve backslash-newline to keep the line numbers correct. + * + * Used in .for loops to collect the body of the loop while waiting + * for the corresponding .endfor. + */ + GLM_FOR_BODY, + + /* + * Return the next line that starts with a dot. + * Backslash line continuations are folded into a single space. + * A trailing comment, if any, is discarded. + * + * Used in .if directives to skip over irrelevant branches while + * waiting for the corresponding .endif. + */ + GLM_DOT +} GetLineMode; + +/* Return the next "interesting" logical line from the current file. */ +static char * +ParseGetLine(GetLineMode mode) +{ + IFile *curFile = CurFile(); + char *line; + char *line_end; + char *firstBackslash; + char *firstComment; + + for (;;) { + ParseRawLineResult res = ParseRawLine(curFile, + &line, &line_end, &firstBackslash, &firstComment); + if (res == PRLR_ERROR) + return NULL; + + if (line_end == line || firstComment == line) { + if (res == PRLR_EOF) + return NULL; + if (mode != GLM_FOR_BODY) + continue; + } + + /* We now have a line of data */ + assert(ch_isspace(*line_end)); + *line_end = '\0'; + + if (mode == GLM_FOR_BODY) + return line; /* Don't join the physical lines. */ + + if (mode == GLM_DOT && line[0] != '.') + continue; + break; + } + + /* Brutally ignore anything after a non-escaped '#' in non-commands. */ + if (firstComment != NULL && line[0] != '\t') + *firstComment = '\0'; + + /* If we didn't see a '\\' then the in-situ data is fine. */ + if (firstBackslash == NULL) + return line; + + /* Remove escapes from '\n' and '#' */ + UnescapeBackslash(line, firstBackslash); + + return line; +} + +static Boolean +ParseSkippedBranches(void) +{ + char *line; + + while ((line = ParseGetLine(GLM_DOT)) != NULL) { + if (Cond_EvalLine(line) == COND_PARSE) + break; + /* + * TODO: Check for typos in .elif directives + * such as .elsif or .elseif. + * + * This check will probably duplicate some of + * the code in ParseLine. Most of the code + * there cannot apply, only ParseVarassign and + * ParseDependency can, and to prevent code + * duplication, these would need to be called + * with a flag called onlyCheckSyntax. + * + * See directive-elif.mk for details. + */ + } + + return line != NULL; +} + +static Boolean +ParseForLoop(const char *line) +{ + int rval; + int firstLineno; + + rval = For_Eval(line); + if (rval == 0) + return FALSE; /* Not a .for line */ + if (rval < 0) + return TRUE; /* Syntax error - error printed, ignore line */ + + firstLineno = CurFile()->lineno; + + /* Accumulate loop lines until matching .endfor */ + do { + line = ParseGetLine(GLM_FOR_BODY); + if (line == NULL) { + Parse_Error(PARSE_FATAL, + "Unexpected end of file in for loop."); + break; + } + } while (For_Accum(line)); + + For_Run(firstLineno); /* Stash each iteration as a new 'input file' */ + + return TRUE; /* Read next line from for-loop buffer */ +} + +/* + * Read an entire line from the input file. + * + * Empty lines, .if and .for are completely handled by this function, + * leaving only variable assignments, other directives, dependency lines + * and shell commands to the caller. * * Results: - * A line w/o its newline - * - * Side Effects: - * Only those associated with reading a character - *--------------------------------------------------------------------- + * A line without its newline and without any trailing whitespace, + * or NULL. */ static char * ParseReadLine(void) { - char *line; /* Result */ - int lineLength; /* Length of result */ - int lineno; /* Saved line # */ - int rval; + char *line; - for (;;) { - line = ParseGetLine(0, &lineLength); - if (line == NULL) - return NULL; + for (;;) { + line = ParseGetLine(GLM_NONEMPTY); + if (line == NULL) + return NULL; - if (line[0] != '.') - return line; + if (line[0] != '.') + return line; - /* - * The line might be a conditional. Ask the conditional module - * about it and act accordingly - */ - switch (Cond_Eval(line)) { - case COND_SKIP: - /* Skip to next conditional that evaluates to COND_PARSE. */ - do { - line = ParseGetLine(PARSE_SKIP, &lineLength); - } while (line && Cond_Eval(line) != COND_PARSE); - if (line == NULL) - break; - continue; - case COND_PARSE: - continue; - case COND_INVALID: /* Not a conditional line */ - /* Check for .for loops */ - rval = For_Eval(line); - if (rval == 0) - /* Not a .for line */ - break; - if (rval < 0) - /* Syntax error - error printed, ignore line */ - continue; - /* Start of a .for loop */ - lineno = curFile->lineno; - /* Accumulate loop lines until matching .endfor */ - do { - line = ParseGetLine(PARSE_RAW, &lineLength); - if (line == NULL) { - Parse_Error(PARSE_FATAL, - "Unexpected end of file in for loop."); - break; + /* + * The line might be a conditional. Ask the conditional module + * about it and act accordingly + */ + switch (Cond_EvalLine(line)) { + case COND_SKIP: + if (!ParseSkippedBranches()) + return NULL; + continue; + case COND_PARSE: + continue; + case COND_INVALID: /* Not a conditional line */ + if (ParseForLoop(line)) + continue; + break; } - } while (For_Accum(line)); - /* Stash each iteration as a new 'input file' */ - For_Run(lineno); - /* Read next line from for-loop buffer */ - continue; + return line; } - return (line); - } } -/*- - *----------------------------------------------------------------------- - * ParseFinishLine -- - * Handle the end of a dependency group. - * - * Results: - * Nothing. - * - * Side Effects: - * inLine set FALSE. 'targets' list destroyed. - * - *----------------------------------------------------------------------- +static void +FinishDependencyGroup(void) +{ + GNodeListNode *ln; + + if (targets == NULL) + return; + + for (ln = targets->first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + + Suff_EndTransform(gn); + + /* + * Mark the target as already having commands if it does, to + * keep from having shell commands on multiple dependency + * lines. + */ + if (!Lst_IsEmpty(&gn->commands)) + gn->type |= OP_HAS_COMMANDS; + } + + Lst_Free(targets); + targets = NULL; +} + +/* Add the command to each target from the current dependency spec. */ +static void +ParseLine_ShellCommand(const char *p) +{ + cpp_skip_whitespace(&p); + if (*p == '\0') + return; /* skip empty commands */ + + if (targets == NULL) { + Parse_Error(PARSE_FATAL, + "Unassociated shell command \"%s\"", p); + return; + } + + { + char *cmd = bmake_strdup(p); + GNodeListNode *ln; + + for (ln = targets->first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + ParseAddCmd(gn, cmd); + } +#ifdef CLEANUP + Lst_Append(&targCmds, cmd); +#endif + } +} + +MAKE_INLINE Boolean +IsDirective(const char *dir, size_t dirlen, const char *name) +{ + return dirlen == strlen(name) && memcmp(dir, name, dirlen) == 0; +} + +/* + * See if the line starts with one of the known directives, and if so, handle + * the directive. + */ +static Boolean +ParseDirective(char *line) +{ + char *cp = line + 1; + const char *dir, *arg; + size_t dirlen; + + pp_skip_whitespace(&cp); + if (IsInclude(cp, FALSE)) { + ParseDoInclude(cp); + return TRUE; + } + + dir = cp; + while (ch_isalpha(*cp) || *cp == '-') + cp++; + dirlen = (size_t)(cp - dir); + + if (*cp != '\0' && !ch_isspace(*cp)) + return FALSE; + + pp_skip_whitespace(&cp); + arg = cp; + + if (IsDirective(dir, dirlen, "undef")) { + Var_Undef(cp); + return TRUE; + } else if (IsDirective(dir, dirlen, "export")) { + Var_Export(VEM_PLAIN, arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "export-env")) { + Var_Export(VEM_ENV, arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "export-literal")) { + Var_Export(VEM_LITERAL, arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "unexport")) { + Var_UnExport(FALSE, arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "unexport-env")) { + Var_UnExport(TRUE, arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "info")) { + ParseMessage(PARSE_INFO, "info", arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "warning")) { + ParseMessage(PARSE_WARNING, "warning", arg); + return TRUE; + } else if (IsDirective(dir, dirlen, "error")) { + ParseMessage(PARSE_FATAL, "error", arg); + return TRUE; + } + return FALSE; +} + +static Boolean +ParseVarassign(const char *line) +{ + VarAssign var; + + if (!Parse_IsVar(line, &var)) + return FALSE; + + FinishDependencyGroup(); + Parse_DoVar(&var, SCOPE_GLOBAL); + return TRUE; +} + +static char * +FindSemicolon(char *p) +{ + int level = 0; + + for (; *p != '\0'; p++) { + if (*p == '\\' && p[1] != '\0') { + p++; + continue; + } + + if (*p == '$' && (p[1] == '(' || p[1] == '{')) + level++; + else if (level > 0 && (*p == ')' || *p == '}')) + level--; + else if (level == 0 && *p == ';') + break; + } + return p; +} + +/* + * dependency -> target... op [source...] + * op -> ':' | '::' | '!' */ static void -ParseFinishLine(void) +ParseDependency(char *line) { - if (inLine) { - Lst_ForEach(targets, Suff_EndTransform, NULL); - Lst_Destroy(targets, ParseHasCommands); - targets = NULL; - inLine = FALSE; - } + VarEvalFlags eflags; + char *expanded_line; + const char *shellcmd = NULL; + + /* + * For some reason - probably to make the parser impossible - + * a ';' can be used to separate commands from dependencies. + * Attempt to avoid ';' inside substitution patterns. + */ + { + char *semicolon = FindSemicolon(line); + if (*semicolon != '\0') { + /* Terminate the dependency list at the ';' */ + *semicolon = '\0'; + shellcmd = semicolon + 1; + } + } + + /* + * We now know it's a dependency line so it needs to have all + * variables expanded before being parsed. + * + * XXX: Ideally the dependency line would first be split into + * its left-hand side, dependency operator and right-hand side, + * and then each side would be expanded on its own. This would + * allow for the left-hand side to allow only defined variables + * and to allow variables on the right-hand side to be undefined + * as well. + * + * Parsing the line first would also prevent that targets + * generated from variable expressions are interpreted as the + * dependency operator, such as in "target${:U\:} middle: source", + * in which the middle is interpreted as a source, not a target. + */ + + /* In lint mode, allow undefined variables to appear in + * dependency lines. + * + * Ideally, only the right-hand side would allow undefined + * variables since it is common to have optional dependencies. + * Having undefined variables on the left-hand side is more + * unusual though. Since both sides are expanded in a single + * pass, there is not much choice what to do here. + * + * In normal mode, it does not matter whether undefined + * variables are allowed or not since as of 2020-09-14, + * Var_Parse does not print any parse errors in such a case. + * It simply returns the special empty string var_Error, + * which cannot be detected in the result of Var_Subst. */ + eflags = opts.strict ? VARE_WANTRES : VARE_UNDEFERR; + (void)Var_Subst(line, SCOPE_CMDLINE, eflags, &expanded_line); + /* TODO: handle errors */ + + /* Need a fresh list for the target nodes */ + if (targets != NULL) + Lst_Free(targets); + targets = Lst_New(); + + ParseDoDependency(expanded_line); + free(expanded_line); + + if (shellcmd != NULL) + ParseLine_ShellCommand(shellcmd); } - -/*- - *--------------------------------------------------------------------- - * Parse_File -- - * Parse a file into its component parts, incorporating it into the - * current dependency graph. This is the main function and controls - * almost every other function in this module - * - * Input: - * name the name of the file being read - * fd Open file to makefile to parse - * - * Results: - * None - * - * Side Effects: - * closes fd. - * Loads. Nodes are added to the list of all targets, nodes and links - * are added to the dependency graph. etc. etc. etc. - *--------------------------------------------------------------------- - */ -void -Parse_File(const char *name, int fd) +static void +ParseLine(char *line) { - char *cp; /* pointer into the line */ - char *line; /* the line we're working on */ - struct loadedfile *lf; + /* + * Lines that begin with '.' can be pretty much anything: + * - directives like '.include' or '.if', + * - suffix rules like '.c.o:', + * - dependencies for filenames that start with '.', + * - variable assignments like '.tmp=value'. + */ + if (line[0] == '.' && ParseDirective(line)) + return; - lf = loadfile(name, fd); - - inLine = FALSE; - fatals = 0; - - if (name == NULL) { - name = "(stdin)"; - } - - Parse_SetInput(name, 0, -1, loadedfile_nextbuf, lf); - curFile->lf = lf; - - do { - for (; (line = ParseReadLine()) != NULL; ) { - if (DEBUG(PARSE)) - fprintf(debug_file, "ParseReadLine (%d): '%s'\n", - curFile->lineno, line); - if (*line == '.') { - /* - * Lines that begin with the special character may be - * include or undef directives. - * On the other hand they can be suffix rules (.c.o: ...) - * or just dependencies for filenames that start '.'. - */ - for (cp = line + 1; isspace((unsigned char)*cp); cp++) { - continue; - } - if (strncmp(cp, "include", 7) == 0 || - ((cp[0] == 's' || cp[0] == '-') && - strncmp(&cp[1], "include", 7) == 0)) { - ParseDoInclude(cp); - continue; - } - if (strncmp(cp, "undef", 5) == 0) { - char *cp2; - for (cp += 5; isspace((unsigned char) *cp); cp++) - continue; - for (cp2 = cp; !isspace((unsigned char) *cp2) && - (*cp2 != '\0'); cp2++) - continue; - *cp2 = '\0'; - Var_Delete(cp, VAR_GLOBAL); - continue; - } else if (strncmp(cp, "export", 6) == 0) { - for (cp += 6; isspace((unsigned char) *cp); cp++) - continue; - Var_Export(cp, 1); - continue; - } else if (strncmp(cp, "unexport", 8) == 0) { - Var_UnExport(cp); - continue; - } else if (strncmp(cp, "info", 4) == 0 || - strncmp(cp, "error", 5) == 0 || - strncmp(cp, "warning", 7) == 0) { - if (ParseMessage(cp)) - continue; - } - } - - if (*line == '\t') { - /* - * If a line starts with a tab, it can only hope to be - * a creation command. - */ - cp = line + 1; - shellCommand: - for (; isspace ((unsigned char)*cp); cp++) { - continue; - } - if (*cp) { - if (!inLine) - Parse_Error(PARSE_FATAL, - "Unassociated shell command \"%s\"", - cp); - /* - * So long as it's not a blank line and we're actually - * in a dependency spec, add the command to the list of - * commands of all targets in the dependency spec - */ - if (targets) { - cp = bmake_strdup(cp); - Lst_ForEach(targets, ParseAddCmd, cp); -#ifdef CLEANUP - Lst_AtEnd(targCmds, cp); -#endif - } - } - continue; - } + if (line[0] == '\t') { + ParseLine_ShellCommand(line + 1); + return; + } #ifdef SYSVINCLUDE - if (((strncmp(line, "include", 7) == 0 && - isspace((unsigned char) line[7])) || - ((line[0] == 's' || line[0] == '-') && - strncmp(&line[1], "include", 7) == 0 && - isspace((unsigned char) line[8]))) && - strchr(line, ':') == NULL) { + if (IsSysVInclude(line)) { /* * It's an S3/S5-style "include". */ ParseTraditionalInclude(line); - continue; - } + return; + } #endif + #ifdef GMAKEEXPORT - if (strncmp(line, "export", 6) == 0 && - isspace((unsigned char) line[6]) && - strchr(line, ':') == NULL) { + if (strncmp(line, "export", 6) == 0 && ch_isspace(line[6]) && + strchr(line, ':') == NULL) { /* * It's a Gmake "export". */ ParseGmakeExport(line); - continue; - } -#endif - if (Parse_IsVar(line)) { - ParseFinishLine(); - Parse_DoVar(line, VAR_GLOBAL); - continue; - } - -#ifndef POSIX - /* - * To make life easier on novices, if the line is indented we - * first make sure the line has a dependency operator in it. - * If it doesn't have an operator and we're in a dependency - * line's script, we assume it's actually a shell command - * and add it to the current list of targets. - */ - cp = line; - if (isspace((unsigned char) line[0])) { - while ((*cp != '\0') && isspace((unsigned char) *cp)) - cp++; - while (*cp && (ParseIsEscaped(line, cp) || - (*cp != ':') && (*cp != '!'))) { - cp++; - } - if (*cp == '\0') { - if (inLine) { - Parse_Error(PARSE_WARNING, - "Shell command needs a leading tab"); - goto shellCommand; - } - } - } -#endif - ParseFinishLine(); - - /* - * For some reason - probably to make the parser impossible - - * a ';' can be used to separate commands from dependencies. - * Attempt to avoid ';' inside substitution patterns. - */ - { - int level = 0; - - for (cp = line; *cp != 0; cp++) { - if (*cp == '\\' && cp[1] != 0) { - cp++; - continue; - } - if (*cp == '$' && - (cp[1] == '(' || cp[1] == '{')) { - level++; - continue; - } - if (level > 0) { - if (*cp == ')' || *cp == '}') { - level--; - continue; - } - } else if (*cp == ';') { - break; - } - } - } - if (*cp != 0) - /* Terminate the dependency list at the ';' */ - *cp++ = 0; - else - cp = NULL; - - /* - * We now know it's a dependency line so it needs to have all - * variables expanded before being parsed. Tell the variable - * module to complain if some variable is undefined... - */ - line = Var_Subst(NULL, line, VAR_CMD, TRUE); - - /* - * Need a non-circular list for the target nodes - */ - if (targets) - Lst_Destroy(targets, NULL); - - targets = Lst_Init(FALSE); - inLine = TRUE; - - ParseDoDependency(line); - free(line); - - /* If there were commands after a ';', add them now */ - if (cp != NULL) { - goto shellCommand; - } + return; } - /* - * Reached EOF, but it may be just EOF of an include file... - */ - } while (ParseEOF() == CONTINUE); +#endif - if (fatals) { - (void)fflush(stdout); - (void)fprintf(stderr, - "%s: Fatal errors encountered -- cannot continue", - progname); - PrintOnError(NULL, NULL); - exit(1); - } + if (ParseVarassign(line)) + return; + + FinishDependencyGroup(); + + ParseDependency(line); } -/*- - *--------------------------------------------------------------------- - * Parse_Init -- - * initialize the parsing module +/* + * Parse a top-level makefile, incorporating its content into the global + * dependency graph. * - * Results: - * none - * - * Side Effects: - * the parseIncPath list is initialized... - *--------------------------------------------------------------------- + * Input: + * name The name of the file being read + * fd The open file to parse; will be closed at the end */ void +Parse_File(const char *name, int fd) +{ + char *line; /* the line we're working on */ + struct loadedfile *lf; + + lf = loadfile(name, fd); + + assert(targets == NULL); + + if (name == NULL) + name = "(stdin)"; + + Parse_SetInput(name, 0, -1, loadedfile_readMore, lf); + CurFile()->lf = lf; + + do { + while ((line = ParseReadLine()) != NULL) { + DEBUG2(PARSE, "ParseReadLine (%d): '%s'\n", + CurFile()->lineno, line); + ParseLine(line); + } + /* Reached EOF, but it may be just EOF of an include file. */ + } while (ParseEOF()); + + FinishDependencyGroup(); + + if (fatals != 0) { + (void)fflush(stdout); + (void)fprintf(stderr, + "%s: Fatal errors encountered -- cannot continue", + progname); + PrintOnError(NULL, NULL); + exit(1); + } +} + +/* Initialize the parsing module. */ +void Parse_Init(void) { - mainNode = NULL; - parseIncPath = Lst_Init(FALSE); - sysIncPath = Lst_Init(FALSE); - defIncPath = Lst_Init(FALSE); - includes = Lst_Init(FALSE); -#ifdef CLEANUP - targCmds = Lst_Init(FALSE); -#endif + mainNode = NULL; + parseIncPath = SearchPath_New(); + sysIncPath = SearchPath_New(); + defSysIncPath = SearchPath_New(); + Vector_Init(&includes, sizeof(IFile)); } +/* Clean up the parsing module. */ void Parse_End(void) { #ifdef CLEANUP - Lst_Destroy(targCmds, (FreeProc *)free); - if (targets) - Lst_Destroy(targets, NULL); - Lst_Destroy(defIncPath, Dir_Destroy); - Lst_Destroy(sysIncPath, Dir_Destroy); - Lst_Destroy(parseIncPath, Dir_Destroy); - Lst_Destroy(includes, NULL); /* Should be empty now */ + Lst_DoneCall(&targCmds, free); + assert(targets == NULL); + SearchPath_Free(defSysIncPath); + SearchPath_Free(sysIncPath); + SearchPath_Free(parseIncPath); + assert(includes.len == 0); + Vector_Done(&includes); #endif } -/*- - *----------------------------------------------------------------------- - * Parse_MainName -- - * Return a Lst of the main target to create for main()'s sake. If - * no such target exists, we Punt with an obnoxious error message. - * - * Results: - * A Lst of the single node to create. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- +/* + * Return a list containing the single main target to create. + * If no such target exists, we Punt with an obnoxious error message. */ -Lst -Parse_MainName(void) +void +Parse_MainName(GNodeList *mainList) { - Lst mainList; /* result list */ + if (mainNode == NULL) + Punt("no target to make."); - mainList = Lst_Init(FALSE); + Lst_Append(mainList, mainNode); + if (mainNode->type & OP_DOUBLEDEP) + Lst_AppendAll(mainList, &mainNode->cohorts); - if (mainNode == NULL) { - Punt("no target to make."); - /*NOTREACHED*/ - } else if (mainNode->type & OP_DOUBLEDEP) { - (void)Lst_AtEnd(mainList, mainNode); - Lst_Concat(mainList, mainNode->cohorts, LST_CONCNEW); - } - else - (void)Lst_AtEnd(mainList, mainNode); - Var_Append(".TARGETS", mainNode->name, VAR_GLOBAL); - return (mainList); + Global_Append(".TARGETS", mainNode->name); } -/*- - *----------------------------------------------------------------------- - * ParseMark -- - * Add the filename and lineno to the GNode so that we remember - * where it was first defined. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -static void -ParseMark(GNode *gn) +int +Parse_GetFatals(void) { - gn->fname = curFile->fname; - gn->lineno = curFile->lineno; + return fatals; } diff --git a/usr.bin/make/pathnames.h b/usr.bin/make/pathnames.h index 12c4f3d7b..3c7000ca1 100644 --- a/usr.bin/make/pathnames.h +++ b/usr.bin/make/pathnames.h @@ -1,4 +1,4 @@ -/* $NetBSD: pathnames.h,v 1.17 2009/04/11 09:41:18 apb Exp $ */ +/* $NetBSD: pathnames.h,v 1.18 2020/11/29 09:27:40 rillig Exp $ */ /* * Copyright (c) 1990, 1993 @@ -39,15 +39,15 @@ #include #endif -#define _PATH_OBJDIR "obj" -#define _PATH_OBJDIRPREFIX "/usr/obj" +#define _PATH_OBJDIR "obj" +#define _PATH_OBJDIRPREFIX "/usr/obj" #ifndef _PATH_DEFSHELLDIR -#define _PATH_DEFSHELLDIR "/bin" +#define _PATH_DEFSHELLDIR "/bin" #endif -#define _PATH_DEFSYSMK "sys.mk" +#define _PATH_DEFSYSMK "sys.mk" #ifndef _PATH_DEFSYSPATH -#define _PATH_DEFSYSPATH "/usr/share/mk" +#define _PATH_DEFSYSPATH "/usr/share/mk" #endif #ifndef _PATH_TMP -#define _PATH_TMP "/tmp/" /* with trailing slash */ +#define _PATH_TMP "/tmp/" /* with trailing slash */ #endif diff --git a/usr.bin/make/sprite.h b/usr.bin/make/sprite.h deleted file mode 100644 index 6ec4fe2e4..000000000 --- a/usr.bin/make/sprite.h +++ /dev/null @@ -1,116 +0,0 @@ -/* $NetBSD: sprite.h,v 1.11 2009/01/23 21:26:30 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 - */ - -/* - * Copyright (c) 1989 by Berkeley Softworks - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 - */ - -/* - * sprite.h -- - * - * Common constants and type declarations for Sprite. - */ - -#ifndef _SPRITE -#define _SPRITE - - -/* - * A boolean type is defined as an integer, not an enum. This allows a - * boolean argument to be an expression that isn't strictly 0 or 1 valued. - */ - -typedef int Boolean; -#ifndef TRUE -#define TRUE 1 -#endif /* TRUE */ -#ifndef FALSE -#define FALSE 0 -#endif /* FALSE */ - -/* - * Functions that must return a status can return a ReturnStatus to - * indicate success or type of failure. - */ - -typedef int ReturnStatus; - -/* - * The following statuses overlap with the first 2 generic statuses - * defined in status.h: - * - * SUCCESS There was no error. - * FAILURE There was a general error. - */ - -#define SUCCESS 0x00000000 -#define FAILURE 0x00000001 - -#endif /* _SPRITE */ diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 0260447f8..c486df6d3 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -1,6 +1,6 @@ -/* $NetBSD: str.c,v 1.35 2014/02/12 01:35:56 sjg Exp $ */ +/* $NetBSD: str.c,v 1.81 2021/02/01 22:36:28 rillig Exp $ */ -/*- +/* * Copyright (c) 1988, 1989, 1990, 1993 * The Regents of the University of California. All rights reserved. * @@ -32,7 +32,7 @@ * SUCH DAMAGE. */ -/*- +/* * Copyright (c) 1989 by Berkeley Softworks * All rights reserved. * @@ -68,186 +68,176 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: str.c,v 1.35 2014/02/12 01:35:56 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90"; -#else -__RCSID("$NetBSD: str.c,v 1.35 2014/02/12 01:35:56 sjg Exp $"); -#endif -#endif /* not lint */ -#endif - #include "make.h" -/*- - * str_concat -- - * concatenate the two strings, inserting a space or slash between them, - * freeing them if requested. - * - * returns -- - * the resulting string in allocated space. - */ +/* "@(#)str.c 5.8 (Berkeley) 6/1/90" */ +MAKE_RCSID("$NetBSD: str.c,v 1.81 2021/02/01 22:36:28 rillig Exp $"); + +/* Return the concatenation of s1 and s2, freshly allocated. */ char * -str_concat(const char *s1, const char *s2, int flags) +str_concat2(const char *s1, const char *s2) { - int len1, len2; - char *result; - - /* get the length of both strings */ - len1 = strlen(s1); - len2 = strlen(s2); - - /* allocate length plus separator plus EOS */ - result = bmake_malloc((u_int)(len1 + len2 + 2)); - - /* copy first string into place */ + size_t len1 = strlen(s1); + size_t len2 = strlen(s2); + char *result = bmake_malloc(len1 + len2 + 1); memcpy(result, s1, len1); - - /* add separator character */ - if (flags & STR_ADDSPACE) { - result[len1] = ' '; - ++len1; - } else if (flags & STR_ADDSLASH) { - result[len1] = '/'; - ++len1; - } - - /* copy second string plus EOS into place */ memcpy(result + len1, s2, len2 + 1); - - return(result); + return result; } -/*- - * brk_string -- - * Fracture a string into an array of words (as delineated by tabs or - * spaces) taking quotation marks into account. Leading tabs/spaces - * are ignored. - * - * If expand is TRUE, quotes are removed and escape sequences - * such as \r, \t, etc... are expanded. - * - * returns -- - * Pointer to the array of pointers to the words. - * Memory containing the actual words in *buffer. - * Both of these must be free'd by the caller. - * Number of words in *store_argc. - */ -char ** -brk_string(const char *str, int *store_argc, Boolean expand, char **buffer) +/* Return the concatenation of s1, s2 and s3, freshly allocated. */ +char * +str_concat3(const char *s1, const char *s2, const char *s3) { - int argc, ch; - char inquote, *start, *t; - const char *p; - int len; - int argmax = 50, curlen = 0; - char **argv; + size_t len1 = strlen(s1); + size_t len2 = strlen(s2); + size_t len3 = strlen(s3); + char *result = bmake_malloc(len1 + len2 + len3 + 1); + memcpy(result, s1, len1); + memcpy(result + len1, s2, len2); + memcpy(result + len1 + len2, s3, len3 + 1); + return result; +} - /* skip leading space chars. */ - for (; *str == ' ' || *str == '\t'; ++str) - continue; +/* Return the concatenation of s1, s2, s3 and s4, freshly allocated. */ +char * +str_concat4(const char *s1, const char *s2, const char *s3, const char *s4) +{ + size_t len1 = strlen(s1); + size_t len2 = strlen(s2); + size_t len3 = strlen(s3); + size_t len4 = strlen(s4); + char *result = bmake_malloc(len1 + len2 + len3 + len4 + 1); + memcpy(result, s1, len1); + memcpy(result + len1, s2, len2); + memcpy(result + len1 + len2, s3, len3); + memcpy(result + len1 + len2 + len3, s4, len4 + 1); + return result; +} - /* allocate room for a copy of the string */ - if ((len = strlen(str) + 1) > curlen) - *buffer = bmake_malloc(curlen = len); +/* + * Fracture a string into an array of words (as delineated by tabs or spaces) + * taking quotation marks into account. + * + * If expand is TRUE, quotes are removed and escape sequences such as \r, \t, + * etc... are expanded. In this case, return NULL on parse errors. + * + * Returns the fractured words, which must be freed later using Words_Free, + * unless the returned Words.words was NULL. + */ +Words +Str_Words(const char *str, Boolean expand) +{ + size_t str_len; + char *words_buf; + size_t words_cap; + char **words; + size_t words_len; + char inquote; + char *word_start; + char *word_end; + const char *str_p; - /* - * initial argmax based on len - */ - argmax = MAX((len / 5), 50); - argv = bmake_malloc((argmax + 1) * sizeof(char *)); + /* XXX: why only hspace, not whitespace? */ + cpp_skip_hspace(&str); /* skip leading space chars. */ + + /* words_buf holds the words, separated by '\0'. */ + str_len = strlen(str); + words_buf = bmake_malloc(str_len + 1); + + words_cap = str_len / 5 > 50 ? str_len / 5 : 50; + words = bmake_malloc((words_cap + 1) * sizeof(char *)); /* * copy the string; at the same time, parse backslashes, - * quotes and build the argument list. + * quotes and build the word list. */ - argc = 0; + words_len = 0; inquote = '\0'; - for (p = str, start = t = *buffer;; ++p) { - switch(ch = *p) { + word_start = words_buf; + word_end = words_buf; + for (str_p = str;; str_p++) { + char ch = *str_p; + switch (ch) { case '"': case '\'': - if (inquote) { + if (inquote != '\0') { if (inquote == ch) inquote = '\0'; else break; - } - else { - inquote = (char) ch; + } else { + inquote = ch; /* Don't miss "" or '' */ - if (start == NULL && p[1] == inquote) { + if (word_start == NULL && str_p[1] == inquote) { if (!expand) { - start = t; - *t++ = ch; + word_start = word_end; + *word_end++ = ch; } else - start = t + 1; - p++; + word_start = word_end + 1; + str_p++; inquote = '\0'; break; } } if (!expand) { - if (!start) - start = t; - *t++ = ch; + if (word_start == NULL) + word_start = word_end; + *word_end++ = ch; } continue; case ' ': case '\t': case '\n': - if (inquote) + if (inquote != '\0') break; - if (!start) + if (word_start == NULL) continue; /* FALLTHROUGH */ case '\0': /* - * end of a token -- make sure there's enough argv + * end of a token -- make sure there's enough words * space and save off a pointer. */ - if (!start) - goto done; + if (word_start == NULL) + goto done; - *t++ = '\0'; - if (argc == argmax) { - argmax *= 2; /* ramp up fast */ - argv = (char **)bmake_realloc(argv, - (argmax + 1) * sizeof(char *)); + *word_end++ = '\0'; + if (words_len == words_cap) { + size_t new_size; + words_cap *= 2; /* ramp up fast */ + new_size = (words_cap + 1) * sizeof(char *); + words = bmake_realloc(words, new_size); } - argv[argc++] = start; - start = NULL; + words[words_len++] = word_start; + word_start = NULL; if (ch == '\n' || ch == '\0') { - if (expand && inquote) { - free(argv); - free(*buffer); - *buffer = NULL; - return NULL; + if (expand && inquote != '\0') { + free(words); + free(words_buf); + return (Words){ NULL, 0, NULL }; } goto done; } continue; case '\\': if (!expand) { - if (!start) - start = t; - *t++ = '\\'; - if (*(p+1) == '\0') /* catch '\' at end of line */ + if (word_start == NULL) + word_start = word_end; + *word_end++ = '\\'; + /* catch '\' at end of line */ + if (str_p[1] == '\0') continue; - ch = *++p; + ch = *++str_p; break; } - switch (ch = *++p) { + switch (ch = *++str_p) { case '\0': case '\n': /* hmmm; fix it up as best we can */ ch = '\\'; - --p; + str_p--; break; case 'b': ch = '\b'; @@ -267,248 +257,119 @@ brk_string(const char *str, int *store_argc, Boolean expand, char **buffer) } break; } - if (!start) - start = t; - *t++ = (char) ch; + if (word_start == NULL) + word_start = word_end; + *word_end++ = ch; } -done: argv[argc] = NULL; - *store_argc = argc; - return(argv); +done: + words[words_len] = NULL; /* useful for argv */ + return (Words){ words, words_len, words_buf }; } /* - * Str_FindSubstring -- See if a string contains a particular substring. + * Str_Match -- Test if a string matches a pattern like "*.[ch]". + * The following special characters are known *?\[] (as in fnmatch(3)). * - * Input: - * string String to search. - * substring Substring to find in string. - * - * Results: If string contains substring, the return value is the location of - * the first matching instance of substring in string. If string doesn't - * contain substring, the return value is NULL. Matching is done on an exact - * character-for-character basis with no wildcards or special characters. - * - * Side effects: None. + * XXX: this function does not detect or report malformed patterns. */ -char * -Str_FindSubstring(const char *string, const char *substring) +Boolean +Str_Match(const char *str, const char *pat) { - const char *a, *b; - - /* - * First scan quickly through the two strings looking for a single- - * character match. When it's found, then compare the rest of the - * substring. - */ - - for (b = substring; *string != 0; string += 1) { - if (*string != *b) - continue; - a = string; - for (;;) { - if (*b == 0) - return UNCONST(string); - if (*a++ != *b++) - break; - } - b = substring; - } - return NULL; -} - -/* - * Str_Match -- - * - * See if a particular string matches a particular pattern. - * - * Results: Non-zero is returned if string matches pattern, 0 otherwise. The - * matching operation permits the following special characters in the - * pattern: *?\[] (see the man page for details on what these mean). - * - * XXX this function does not detect or report malformed patterns. - * - * Side effects: None. - */ -int -Str_Match(const char *string, const char *pattern) -{ - char c2; - for (;;) { /* * See if we're at the end of both the pattern and the - * string. If, we succeeded. If we're at the end of the + * string. If so, we succeeded. If we're at the end of the * pattern but not at the end of the string, we failed. */ - if (*pattern == 0) - return(!*string); - if (*string == 0 && *pattern != '*') - return(0); + if (*pat == '\0') + return *str == '\0'; + if (*str == '\0' && *pat != '*') + return FALSE; + /* - * Check for a "*" as the next pattern character. It matches - * any substring. We handle this by calling ourselves - * recursively for each postfix of string, until either we - * match or we reach the end of the string. + * A '*' in the pattern matches any substring. We handle this + * by calling ourselves for each suffix of the string. */ - if (*pattern == '*') { - pattern += 1; - if (*pattern == 0) - return(1); - while (*string != 0) { - if (Str_Match(string, pattern)) - return(1); - ++string; + if (*pat == '*') { + pat++; + while (*pat == '*') + pat++; + if (*pat == '\0') + return TRUE; + while (*str != '\0') { + if (Str_Match(str, pat)) + return TRUE; + str++; } - return(0); + return FALSE; } - /* - * Check for a "?" as the next pattern character. It matches - * any single character. - */ - if (*pattern == '?') + + /* A '?' in the pattern matches any single character. */ + if (*pat == '?') goto thisCharOK; + /* - * Check for a "[" as the next pattern character. It is - * followed by a list of characters that are acceptable, or - * by a range (two characters separated by "-"). + * A '[' in the pattern matches a character from a list. + * The '[' is followed by the list of acceptable characters, + * or by ranges (two characters separated by '-'). In these + * character lists, the backslash is an ordinary character. */ - if (*pattern == '[') { - ++pattern; + if (*pat == '[') { + Boolean neg = pat[1] == '^'; + pat += neg ? 2 : 1; + for (;;) { - if ((*pattern == ']') || (*pattern == 0)) - return(0); - if (*pattern == *string) - break; - if (pattern[1] == '-') { - c2 = pattern[2]; - if (c2 == 0) - return(0); - if ((*pattern <= *string) && - (c2 >= *string)) + if (*pat == ']' || *pat == '\0') { + if (neg) break; - if ((*pattern >= *string) && - (c2 <= *string)) - break; - pattern += 2; + return FALSE; } - ++pattern; + /* + * XXX: This naive comparison makes the + * control flow of the pattern parser + * dependent on the actual value of the + * string. This is unpredictable. It may be + * though that the code only looks wrong but + * actually all code paths result in the same + * behavior. This needs further tests. + */ + if (*pat == *str) + break; + if (pat[1] == '-') { + if (pat[2] == '\0') + return neg; + if (*pat <= *str && pat[2] >= *str) + break; + if (*pat >= *str && pat[2] <= *str) + break; + pat += 2; + } + pat++; } - while ((*pattern != ']') && (*pattern != 0)) - ++pattern; + if (neg && *pat != ']' && *pat != '\0') + return FALSE; + while (*pat != ']' && *pat != '\0') + pat++; + if (*pat == '\0') + pat--; goto thisCharOK; } + /* - * If the next pattern character is '/', just strip off the - * '/' so we do exact matching on the character that follows. + * A backslash in the pattern matches the character following + * it exactly. */ - if (*pattern == '\\') { - ++pattern; - if (*pattern == 0) - return(0); + if (*pat == '\\') { + pat++; + if (*pat == '\0') + return FALSE; } - /* - * There's no special character. Just make sure that the - * next characters of each string match. - */ - if (*pattern != *string) - return(0); -thisCharOK: ++pattern; - ++string; + + if (*pat != *str) + return FALSE; + + thisCharOK: + pat++; + str++; } } - - -/*- - *----------------------------------------------------------------------- - * Str_SYSVMatch -- - * Check word against pattern for a match (% is wild), - * - * Input: - * word Word to examine - * pattern Pattern to examine against - * len Number of characters to substitute - * - * Results: - * Returns the beginning position of a match or null. The number - * of characters matched is returned in len. - * - * Side Effects: - * None - * - *----------------------------------------------------------------------- - */ -char * -Str_SYSVMatch(const char *word, const char *pattern, int *len) -{ - const char *p = pattern; - const char *w = word; - const char *m; - - if (*p == '\0') { - /* Null pattern is the whole string */ - *len = strlen(w); - return UNCONST(w); - } - - if ((m = strchr(p, '%')) != NULL) { - /* check that the prefix matches */ - for (; p != m && *w && *w == *p; w++, p++) - continue; - - if (p != m) - return NULL; /* No match */ - - if (*++p == '\0') { - /* No more pattern, return the rest of the string */ - *len = strlen(w); - return UNCONST(w); - } - } - - m = w; - - /* Find a matching tail */ - do - if (strcmp(p, w) == 0) { - *len = w - m; - return UNCONST(m); - } - while (*w++ != '\0'); - - return NULL; -} - - -/*- - *----------------------------------------------------------------------- - * Str_SYSVSubst -- - * Substitute '%' on the pattern with len characters from src. - * If the pattern does not contain a '%' prepend len characters - * from src. - * - * Results: - * None - * - * Side Effects: - * Places result on buf - * - *----------------------------------------------------------------------- - */ -void -Str_SYSVSubst(Buffer *buf, char *pat, char *src, int len) -{ - char *m; - - if ((m = strchr(pat, '%')) != NULL) { - /* Copy the prefix */ - Buf_AddBytes(buf, m - pat, pat); - /* skip the % */ - pat = m + 1; - } - - /* Copy the pattern */ - Buf_AddBytes(buf, len, src); - - /* append the rest */ - Buf_AddBytes(buf, strlen(pat), pat); -} diff --git a/usr.bin/make/strlist.c b/usr.bin/make/strlist.c deleted file mode 100644 index 3fb2f7dbb..000000000 --- a/usr.bin/make/strlist.c +++ /dev/null @@ -1,93 +0,0 @@ -/* $NetBSD: strlist.c,v 1.4 2009/01/24 11:59:39 dsl Exp $ */ - -/*- - * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by David Laight. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: strlist.c,v 1.4 2009/01/24 11:59:39 dsl Exp $"; -#else -#include -#ifndef lint -__RCSID("$NetBSD: strlist.c,v 1.4 2009/01/24 11:59:39 dsl Exp $"); -#endif /* not lint */ -#endif - -#include -#include -#include "strlist.h" -#include "make_malloc.h" - -void -strlist_init(strlist_t *sl) -{ - sl->sl_num = 0; - sl->sl_max = 0; - sl->sl_items = NULL; -} - -void -strlist_clean(strlist_t *sl) -{ - char *str; - int i; - - STRLIST_FOREACH(str, sl, i) - free(str); - free(sl->sl_items); - - sl->sl_num = 0; - sl->sl_max = 0; - sl->sl_items = NULL; -} - -void -strlist_add_str(strlist_t *sl, char *str, unsigned int info) -{ - unsigned int n; - strlist_item_t *items; - - if (str == NULL) - return; - - n = sl->sl_num + 1; - sl->sl_num = n; - items = sl->sl_items; - if (n >= sl->sl_max) { - items = bmake_realloc(items, (n + 7) * sizeof *sl->sl_items); - sl->sl_items = items; - sl->sl_max = n + 6; - } - items += n - 1; - items->si_str = str; - items->si_info = info; - items[1].si_str = NULL; /* STRLIST_FOREACH() terminator */ -} diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c index d9ba25e91..0b27d33e5 100644 --- a/usr.bin/make/suff.c +++ b/usr.bin/make/suff.c @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.73 2014/09/07 20:55:34 joerg Exp $ */ +/* $NetBSD: suff.c,v 1.348 2021/03/15 12:15:03 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,2593 +68,2111 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.73 2014/09/07 20:55:34 joerg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; -#else -__RCSID("$NetBSD: suff.c,v 1.73 2014/09/07 20:55:34 joerg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * suff.c -- - * Functions to maintain suffix lists and find implicit dependents - * using suffix transformation rules +/* + * Maintain suffix lists and find implicit dependents using suffix + * transformation rules such as ".c.o". * * Interface: - * Suff_Init Initialize all things to do with suffixes. + * Suff_Init Initialize the module. * - * Suff_End Cleanup the module + * Suff_End Clean up the module. * - * Suff_DoPaths This function is used to make life easier - * when searching for a file according to its - * suffix. It takes the global search path, - * as defined using the .PATH: target, and appends - * its directories to the path of each of the - * defined suffixes, as specified using - * .PATH: targets. In addition, all - * directories given for suffixes labeled as - * include files or libraries, using the .INCLUDES - * or .LIBS targets, are played with using - * Dir_MakeFlags to create the .INCLUDES and - * .LIBS global variables. + * Suff_DoPaths Extend the search path of each suffix to include the + * default search path. * - * Suff_ClearSuffixes Clear out all the suffixes and defined - * transformations. + * Suff_ClearSuffixes + * Clear out all the suffixes and transformations. * - * Suff_IsTransform Return TRUE if the passed string is the lhs - * of a transformation rule. + * Suff_IsTransform + * See if the passed string is a transformation rule. * - * Suff_AddSuffix Add the passed string as another known suffix. + * Suff_AddSuffix Add the passed string as another known suffix. * - * Suff_GetPath Return the search path for the given suffix. + * Suff_GetPath Return the search path for the given suffix. * - * Suff_AddInclude Mark the given suffix as denoting an include - * file. + * Suff_AddInclude + * Mark the given suffix as denoting an include file. * - * Suff_AddLib Mark the given suffix as denoting a library. + * Suff_AddLib Mark the given suffix as denoting a library. * - * Suff_AddTransform Add another transformation to the suffix - * graph. Returns GNode suitable for framing, I - * mean, tacking commands, attributes, etc. on. + * Suff_AddTransform + * Add another transformation to the suffix graph. * - * Suff_SetNull Define the suffix to consider the suffix of - * any file that doesn't have a known one. + * Suff_SetNull Define the suffix to consider the suffix of + * any file that doesn't have a known one. * - * Suff_FindDeps Find implicit sources for and the location of - * a target based on its suffix. Returns the - * bottom-most node added to the graph or NULL - * if the target had no implicit sources. + * Suff_FindDeps Find implicit sources for and the location of + * a target based on its suffix. Returns the + * bottom-most node added to the graph or NULL + * if the target had no implicit sources. * - * Suff_FindPath Return the appropriate path to search in - * order to find the node. + * Suff_FindPath Return the appropriate path to search in order to + * find the node. */ -#include -#include "make.h" -#include "hash.h" -#include "dir.h" +#include "make.h" +#include "dir.h" -static Lst sufflist; /* Lst of suffixes */ +/* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */ +MAKE_RCSID("$NetBSD: suff.c,v 1.348 2021/03/15 12:15:03 rillig Exp $"); + +typedef List SuffixList; +typedef ListNode SuffixListNode; + +typedef List CandidateList; +typedef ListNode CandidateListNode; + +/* The defined suffixes, such as '.c', '.o', '.l'. */ +static SuffixList sufflist = LST_INIT; #ifdef CLEANUP -static Lst suffClean; /* Lst of suffixes to be cleaned */ +/* The suffixes to be cleaned up at the end. */ +static SuffixList suffClean = LST_INIT; #endif -static Lst srclist; /* Lst of sources */ -static Lst transforms; /* Lst of transformation rules */ - -static int sNum = 0; /* Counter for assigning suffix numbers */ /* - * Structure describing an individual suffix. + * The transformation rules, such as '.c.o' to transform '.c' into '.o', + * or simply '.c' to transform 'file.c' into 'file'. */ -typedef struct _Suff { - char *name; /* The suffix itself */ - int nameLen; /* Length of the suffix */ - short flags; /* Type of suffix */ -#define SUFF_INCLUDE 0x01 /* One which is #include'd */ -#define SUFF_LIBRARY 0x02 /* One which contains a library */ -#define SUFF_NULL 0x04 /* The empty suffix */ - Lst searchPath; /* The path along which files of this suffix - * may be found */ - int sNum; /* The suffix number */ - int refCount; /* Reference count of list membership */ - Lst parents; /* Suffixes we have a transformation to */ - Lst children; /* Suffixes we have a transformation from */ - Lst ref; /* List of lists this suffix is referenced */ -} Suff; +static GNodeList transforms = LST_INIT; /* - * for SuffSuffIsSuffix + * Counter for assigning suffix numbers. + * TODO: What are these suffix numbers used for? */ -typedef struct { - char *ename; /* The end of the name */ - int len; /* Length of the name */ -} SuffixCmpData; +static int sNum = 0; + +typedef enum SuffixFlags { + SUFF_NONE = 0, + + /* + * This suffix marks include files. Their search path ends up in the + * undocumented special variable '.INCLUDES'. + */ + SUFF_INCLUDE = 1 << 0, + + /* + * This suffix marks library files. Their search path ends up in the + * undocumented special variable '.LIBS'. + */ + SUFF_LIBRARY = 1 << 1, + + /* + * The empty suffix. + * + * XXX: What is the difference between the empty suffix and the null + * suffix? + * + * XXX: Why is SUFF_NULL needed at all? Wouldn't nameLen == 0 mean + * the same? + */ + SUFF_NULL = 1 << 2 + +} SuffixFlags; + +ENUM_FLAGS_RTTI_3(SuffixFlags, + SUFF_INCLUDE, SUFF_LIBRARY, SUFF_NULL); + +typedef List SuffixListList; /* - * Structure used in the search for implied sources. + * A suffix such as ".c" or ".o" that is used in suffix transformation rules + * such as ".c.o:". */ -typedef struct _Src { - char *file; /* The file to look for */ - char *pref; /* Prefix from which file was formed */ - Suff *suff; /* The suffix on the file */ - struct _Src *parent; /* The Src for which this is a source */ - GNode *node; /* The node describing the file */ - int children; /* Count of existing children (so we don't free - * this thing too early or never nuke it) */ +typedef struct Suffix { + /* The suffix itself, such as ".c" */ + char *name; + /* Length of the name, to avoid strlen calls */ + size_t nameLen; + /* Type of suffix */ + SuffixFlags flags; + /* The path along which files of this suffix may be found */ + SearchPath *searchPath; + /* The suffix number; TODO: document the purpose of this number */ + int sNum; + /* Reference count of list membership and several other places */ + int refCount; + /* Suffixes we have a transformation to */ + SuffixList parents; + /* Suffixes we have a transformation from */ + SuffixList children; + + /* Lists in which this suffix is referenced. + * + * XXX: These lists are used nowhere, they are just appended to, for + * no apparent reason. They do have the side effect of increasing + * refCount though. */ + SuffixListList ref; +} Suffix; + +/* + * A candidate when searching for implied sources. + * + * For example, when "src.o" is to be made, a typical candidate is "src.c" + * via the transformation rule ".c.o". If that doesn't exist, maybe there is + * another transformation rule ".pas.c" that would make "src.pas" an indirect + * candidate as well. The first such chain that leads to an existing file or + * node is finally chosen to be made. + */ +typedef struct Candidate { + /* The file or node to look for. */ + char *file; + /* The prefix from which file was formed. + * Its memory is shared among all candidates. */ + char *prefix; + /* The suffix on the file. */ + Suffix *suff; + + /* The candidate that can be made from this, + * or NULL for the top-level candidate. */ + struct Candidate *parent; + /* The node describing the file. */ + GNode *node; + + /* Count of existing children, only used for memory management, so we + * don't free this candidate too early or too late. */ + int numChildren; #ifdef DEBUG_SRC - Lst cp; /* Debug; children list */ + CandidateList childrenList; #endif -} Src; +} Candidate; + +typedef struct CandidateSearcher { + + CandidateList list; + + /* + * TODO: Add HashSet for seen entries, to avoid endless loops such as + * in suff-transform-endless.mk. + */ + +} CandidateSearcher; + + +/* TODO: Document the difference between nullSuff and emptySuff. */ +/* The NULL suffix for this run */ +static Suffix *nullSuff; +/* The empty suffix required for POSIX single-suffix transformation rules */ +static Suffix *emptySuff; + + +static Suffix * +Suffix_Ref(Suffix *suff) +{ + suff->refCount++; + return suff; +} + +/* Change the value of a Suffix variable, adjusting the reference counts. */ +static void +Suffix_Reassign(Suffix **var, Suffix *suff) +{ + if (*var != NULL) + (*var)->refCount--; + *var = suff; + suff->refCount++; +} + +/* Set a Suffix variable to NULL, adjusting the reference count. */ +static void +Suffix_Unassign(Suffix **var) +{ + if (*var != NULL) + (*var)->refCount--; + *var = NULL; +} /* - * A structure for passing more than one argument to the Lst-library-invoked - * function... - */ -typedef struct { - Lst l; - Src *s; -} LstSrc; - -typedef struct { - GNode **gn; - Suff *s; - Boolean r; -} GNodeSuff; - -static Suff *suffNull; /* The NULL suffix for this run */ -static Suff *emptySuff; /* The empty suffix required for POSIX - * single-suffix transformation rules */ - - -static const char *SuffStrIsPrefix(const char *, const char *); -static char *SuffSuffIsSuffix(const Suff *, const SuffixCmpData *); -static int SuffSuffIsSuffixP(const void *, const void *); -static int SuffSuffHasNameP(const void *, const void *); -static int SuffSuffIsPrefix(const void *, const void *); -static int SuffGNHasNameP(const void *, const void *); -static void SuffUnRef(void *, void *); -static void SuffFree(void *); -static void SuffInsert(Lst, Suff *); -static void SuffRemove(Lst, Suff *); -static Boolean SuffParseTransform(char *, Suff **, Suff **); -static int SuffRebuildGraph(void *, void *); -static int SuffScanTargets(void *, void *); -static int SuffAddSrc(void *, void *); -static int SuffRemoveSrc(Lst); -static void SuffAddLevel(Lst, Src *); -static Src *SuffFindThem(Lst, Lst); -static Src *SuffFindCmds(Src *, Lst); -static void SuffExpandChildren(LstNode, GNode *); -static void SuffExpandWildcards(LstNode, GNode *); -static Boolean SuffApplyTransform(GNode *, GNode *, Suff *, Suff *); -static void SuffFindDeps(GNode *, Lst); -static void SuffFindArchiveDeps(GNode *, Lst); -static void SuffFindNormalDeps(GNode *, Lst); -static int SuffPrintName(void *, void *); -static int SuffPrintSuff(void *, void *); -static int SuffPrintTrans(void *, void *); - - /*************** Lst Predicates ****************/ -/*- - *----------------------------------------------------------------------- - * SuffStrIsPrefix -- - * See if pref is a prefix of str. - * - * Input: - * pref possible prefix - * str string to check - * - * Results: - * NULL if it ain't, pointer to character in str after prefix if so - * - * Side Effects: - * None - *----------------------------------------------------------------------- + * See if pref is a prefix of str. + * Return NULL if it ain't, pointer to character in str after prefix if so. */ static const char * -SuffStrIsPrefix(const char *pref, const char *str) +StrTrimPrefix(const char *pref, const char *str) { - while (*str && *pref == *str) { - pref++; - str++; - } + while (*str != '\0' && *pref == *str) { + pref++; + str++; + } - return (*pref ? NULL : str); + return *pref != '\0' ? NULL : str; } -/*- - *----------------------------------------------------------------------- - * SuffSuffIsSuffix -- - * See if suff is a suffix of str. sd->ename should point to THE END - * of the string to check. (THE END == the null byte) - * - * Input: - * s possible suffix - * sd string to examine - * - * Results: - * NULL if it ain't, pointer to character in str before suffix if - * it is. - * - * Side Effects: - * None - *----------------------------------------------------------------------- +/* + * See if suff is a suffix of str, and if so, return the pointer to the suffix + * in str, which at the same time marks the end of the prefix. */ -static char * -SuffSuffIsSuffix(const Suff *s, const SuffixCmpData *sd) +static const char * +StrTrimSuffix(const char *str, size_t strLen, const char *suff, size_t suffLen) { - char *p1; /* Pointer into suffix name */ - char *p2; /* Pointer into string being examined */ + const char *suffInStr; + size_t i; - if (sd->len < s->nameLen) - return NULL; /* this string is shorter than the suffix */ + if (strLen < suffLen) + return NULL; - p1 = s->name + s->nameLen; - p2 = sd->ename; + suffInStr = str + strLen - suffLen; + for (i = 0; i < suffLen; i++) + if (suff[i] != suffInStr[i]) + return NULL; - while (p1 >= s->name && *p1 == *p2) { - p1--; - p2--; - } - - return (p1 == s->name - 1 ? p2 : NULL); + return suffInStr; } -/*- - *----------------------------------------------------------------------- - * SuffSuffIsSuffixP -- - * Predicate form of SuffSuffIsSuffix. Passed as the callback function - * to Lst_Find. - * - * Results: - * 0 if the suffix is the one desired, non-zero if not. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- +/* + * See if suff is a suffix of name, and if so, return the end of the prefix + * in name. */ -static int -SuffSuffIsSuffixP(const void *s, const void *sd) +static const char * +Suffix_TrimSuffix(const Suffix *suff, size_t nameLen, const char *nameEnd) { - return(!SuffSuffIsSuffix(s, sd)); + return StrTrimSuffix(nameEnd - nameLen, nameLen, + suff->name, suff->nameLen); } -/*- - *----------------------------------------------------------------------- - * SuffSuffHasNameP -- - * Callback procedure for finding a suffix based on its name. Used by - * Suff_GetPath. - * - * Input: - * s Suffix to check - * sd Desired name - * - * Results: - * 0 if the suffix is of the given name. non-zero otherwise. - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -static int -SuffSuffHasNameP(const void *s, const void *sname) +static Boolean +Suffix_IsSuffix(const Suffix *suff, size_t nameLen, const char *nameEnd) { - return (strcmp(sname, ((const Suff *)s)->name)); + return Suffix_TrimSuffix(suff, nameLen, nameEnd) != NULL; } -/*- - *----------------------------------------------------------------------- - * SuffSuffIsPrefix -- - * See if the suffix described by s is a prefix of the string. Care - * must be taken when using this to search for transformations and - * what-not, since there could well be two suffixes, one of which - * is a prefix of the other... - * - * Input: - * s suffix to compare - * str string to examine - * - * Results: - * 0 if s is a prefix of str. non-zero otherwise - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -static int -SuffSuffIsPrefix(const void *s, const void *str) +static Suffix * +FindSuffixByNameLen(const char *name, size_t nameLen) { - return SuffStrIsPrefix(((const Suff *)s)->name, str) == NULL; + SuffixListNode *ln; + + for (ln = sufflist.first; ln != NULL; ln = ln->next) { + Suffix *suff = ln->datum; + if (suff->nameLen == nameLen && + memcmp(suff->name, name, nameLen) == 0) + return suff; + } + return NULL; } -/*- - *----------------------------------------------------------------------- - * SuffGNHasNameP -- - * See if the graph node has the desired name - * - * Input: - * gn current node we're looking at - * name name we're looking for - * - * Results: - * 0 if it does. non-zero if it doesn't - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -static int -SuffGNHasNameP(const void *gn, const void *name) +static Suffix * +FindSuffixByName(const char *name) { - return (strcmp(name, ((const GNode *)gn)->name)); + return FindSuffixByNameLen(name, strlen(name)); } - /*********** Maintenance Functions ************/ +static GNode * +FindTransformByName(const char *name) +{ + GNodeListNode *ln; + + for (ln = transforms.first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + if (strcmp(gn->name, name) == 0) + return gn; + } + return NULL; +} static void -SuffUnRef(void *lp, void *sp) +SuffixList_Unref(SuffixList *list, Suffix *suff) { - Lst l = (Lst) lp; - - LstNode ln = Lst_Member(l, sp); - if (ln != NULL) { - Lst_Remove(l, ln); - ((Suff *)sp)->refCount--; - } + SuffixListNode *ln = Lst_FindDatum(list, suff); + if (ln != NULL) { + Lst_Remove(list, ln); + suff->refCount--; + } } -/*- - *----------------------------------------------------------------------- - * SuffFree -- - * Free up all memory associated with the given suffix structure. - * - * Results: - * none - * - * Side Effects: - * the suffix entry is detroyed - *----------------------------------------------------------------------- - */ +/* Free up all memory associated with the given suffix structure. */ static void -SuffFree(void *sp) +Suffix_Free(Suffix *suff) { - Suff *s = (Suff *)sp; - if (s == suffNull) - suffNull = NULL; + if (suff == nullSuff) + nullSuff = NULL; - if (s == emptySuff) - emptySuff = NULL; + if (suff == emptySuff) + emptySuff = NULL; -#ifdef notdef - /* We don't delete suffixes in order, so we cannot use this */ - if (s->refCount) - Punt("Internal error deleting suffix `%s' with refcount = %d", s->name, - s->refCount); +#if 0 + /* We don't delete suffixes in order, so we cannot use this */ + if (suff->refCount != 0) + Punt("Internal error deleting suffix `%s' with refcount = %d", + suff->name, suff->refCount); #endif - Lst_Destroy(s->ref, NULL); - Lst_Destroy(s->children, NULL); - Lst_Destroy(s->parents, NULL); - Lst_Destroy(s->searchPath, Dir_Destroy); + Lst_Done(&suff->ref); + Lst_Done(&suff->children); + Lst_Done(&suff->parents); + SearchPath_Free(suff->searchPath); - free(s->name); - free(s); + free(suff->name); + free(suff); } -/*- - *----------------------------------------------------------------------- - * SuffRemove -- - * Remove the suffix into the list - * - * Results: - * None - * - * Side Effects: - * The reference count for the suffix is decremented and the - * suffix is possibly freed - *----------------------------------------------------------------------- +static void +SuffFree(void *p) +{ + Suffix_Free(p); +} + +/* Remove the suffix from the list, and free if it is otherwise unused. */ +static void +SuffixList_Remove(SuffixList *list, Suffix *suff) +{ + SuffixList_Unref(list, suff); + if (suff->refCount == 0) { + /* XXX: can lead to suff->refCount == -1 */ + SuffixList_Unref(&sufflist, suff); + DEBUG1(SUFF, "Removing suffix \"%s\"\n", suff->name); + SuffFree(suff); + } +} + +/* + * Insert the suffix into the list, keeping the list ordered by suffix + * number. */ static void -SuffRemove(Lst l, Suff *s) +SuffixList_Insert(SuffixList *list, Suffix *suff) { - SuffUnRef(l, s); - if (s->refCount == 0) { - SuffUnRef(sufflist, s); - SuffFree(s); - } + SuffixListNode *ln; + Suffix *listSuff = NULL; + + for (ln = list->first; ln != NULL; ln = ln->next) { + listSuff = ln->datum; + if (listSuff->sNum >= suff->sNum) + break; + } + + if (ln == NULL) { + DEBUG2(SUFF, "inserting \"%s\" (%d) at end of list\n", + suff->name, suff->sNum); + Lst_Append(list, Suffix_Ref(suff)); + Lst_Append(&suff->ref, list); + } else if (listSuff->sNum != suff->sNum) { + DEBUG4(SUFF, "inserting \"%s\" (%d) before \"%s\" (%d)\n", + suff->name, suff->sNum, listSuff->name, listSuff->sNum); + Lst_InsertBefore(list, ln, Suffix_Ref(suff)); + Lst_Append(&suff->ref, list); + } else { + DEBUG2(SUFF, "\"%s\" (%d) is already there\n", + suff->name, suff->sNum); + } } - -/*- - *----------------------------------------------------------------------- - * SuffInsert -- - * Insert the suffix into the list keeping the list ordered by suffix - * numbers. - * - * Input: - * l the list where in s should be inserted - * s the suffix to insert - * - * Results: - * None - * - * Side Effects: - * The reference count of the suffix is incremented - *----------------------------------------------------------------------- - */ + static void -SuffInsert(Lst l, Suff *s) +Relate(Suffix *srcSuff, Suffix *targSuff) { - LstNode ln; /* current element in l we're examining */ - Suff *s2 = NULL; /* the suffix descriptor in this element */ - - if (Lst_Open(l) == FAILURE) { - return; - } - while ((ln = Lst_Next(l)) != NULL) { - s2 = (Suff *)Lst_Datum(ln); - if (s2->sNum >= s->sNum) { - break; - } - } - - Lst_Close(l); - if (DEBUG(SUFF)) { - fprintf(debug_file, "inserting %s(%d)...", s->name, s->sNum); - } - if (ln == NULL) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "at end of list\n"); - } - (void)Lst_AtEnd(l, s); - s->refCount++; - (void)Lst_AtEnd(s->ref, l); - } else if (s2->sNum != s->sNum) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "before %s(%d)\n", s2->name, s2->sNum); - } - (void)Lst_InsertBefore(l, ln, s); - s->refCount++; - (void)Lst_AtEnd(s->ref, l); - } else if (DEBUG(SUFF)) { - fprintf(debug_file, "already there\n"); - } + SuffixList_Insert(&targSuff->children, srcSuff); + SuffixList_Insert(&srcSuff->parents, targSuff); } -/*- - *----------------------------------------------------------------------- - * Suff_ClearSuffixes -- - * This is gross. Nuke the list of suffixes but keep all transformation - * rules around. The transformation graph is destroyed in this process, - * but we leave the list of rules so when a new graph is formed the rules - * will remain. - * This function is called from the parse module when a - * .SUFFIXES:\n line is encountered. - * - * Results: - * none - * - * Side Effects: - * the sufflist and its graph nodes are destroyed - *----------------------------------------------------------------------- +static Suffix * +Suffix_New(const char *name) +{ + Suffix *suff = bmake_malloc(sizeof *suff); + + suff->name = bmake_strdup(name); + suff->nameLen = strlen(suff->name); + suff->searchPath = SearchPath_New(); + Lst_Init(&suff->children); + Lst_Init(&suff->parents); + Lst_Init(&suff->ref); + suff->sNum = sNum++; + suff->flags = SUFF_NONE; + suff->refCount = 1; /* XXX: why 1? It's not assigned anywhere yet. */ + + return suff; +} + +/* + * Nuke the list of suffixes but keep all transformation rules around. The + * transformation graph is destroyed in this process, but we leave the list + * of rules so when a new graph is formed, the rules will remain. This + * function is called when a line '.SUFFIXES:' with an empty suffixes list is + * encountered in a makefile. */ void Suff_ClearSuffixes(void) { #ifdef CLEANUP - Lst_Concat(suffClean, sufflist, LST_CONCLINK); + Lst_MoveAll(&suffClean, &sufflist); #endif - sufflist = Lst_Init(FALSE); - sNum = 0; - suffNull = emptySuff; + DEBUG0(SUFF, "Clearing all suffixes\n"); + Lst_Init(&sufflist); + sNum = 0; + if (nullSuff != NULL) + SuffFree(nullSuff); + emptySuff = nullSuff = Suffix_New(""); + + SearchPath_AddAll(nullSuff->searchPath, &dirSearchPath); + nullSuff->flags = SUFF_NULL; } -/*- - *----------------------------------------------------------------------- - * SuffParseTransform -- - * Parse a transformation string to find its two component suffixes. +/* + * Parse a transformation string such as ".c.o" to find its two component + * suffixes (the source ".c" and the target ".o"). If there are no such + * suffixes, try a single-suffix transformation as well. * - * Input: - * str String being parsed - * srcPtr Place to store source of trans. - * targPtr Place to store target of trans. - * - * Results: - * TRUE if the string is a valid transformation and FALSE otherwise. - * - * Side Effects: - * The passed pointers are overwritten. - * - *----------------------------------------------------------------------- + * Return TRUE if the string is a valid transformation. */ static Boolean -SuffParseTransform(char *str, Suff **srcPtr, Suff **targPtr) +ParseTransform(const char *str, Suffix **out_src, Suffix **out_targ) { - LstNode srcLn; /* element in suffix list of trans source*/ - Suff *src; /* Source of transformation */ - LstNode targLn; /* element in suffix list of trans target*/ - char *str2; /* Extra pointer (maybe target suffix) */ - LstNode singleLn; /* element in suffix list of any suffix - * that exactly matches str */ - Suff *single = NULL;/* Source of possible transformation to - * null suffix */ + SuffixListNode *ln; + Suffix *single = NULL; - srcLn = NULL; - singleLn = NULL; + /* + * Loop looking first for a suffix that matches the start of the + * string and then for one that exactly matches the rest of it. If + * we can find two that meet these criteria, we've successfully + * parsed the string. + */ + for (ln = sufflist.first; ln != NULL; ln = ln->next) { + Suffix *src = ln->datum; - /* - * Loop looking first for a suffix that matches the start of the - * string and then for one that exactly matches the rest of it. If - * we can find two that meet these criteria, we've successfully - * parsed the string. - */ - for (;;) { - if (srcLn == NULL) { - srcLn = Lst_Find(sufflist, str, SuffSuffIsPrefix); - } else { - srcLn = Lst_FindFrom(sufflist, Lst_Succ(srcLn), str, - SuffSuffIsPrefix); + if (StrTrimPrefix(src->name, str) == NULL) + continue; + + if (str[src->nameLen] == '\0') { + single = src; + } else { + Suffix *targ = FindSuffixByName(str + src->nameLen); + if (targ != NULL) { + *out_src = src; + *out_targ = targ; + return TRUE; + } + } } - if (srcLn == NULL) { - /* - * Ran out of source suffixes -- no such rule - */ - if (singleLn != NULL) { + + if (single != NULL) { /* - * Not so fast Mr. Smith! There was a suffix that encompassed - * the entire string, so we assume it was a transformation - * to the null suffix (thank you POSIX). We still prefer to - * find a double rule over a singleton, hence we leave this - * check until the end. + * There was a suffix that encompassed the entire string, so we + * assume it was a transformation to the null suffix (thank you + * POSIX; search for "single suffix" or "single-suffix"). * - * XXX: Use emptySuff over suffNull? + * We still prefer to find a double rule over a singleton, + * hence we leave this check until the end. + * + * XXX: Use emptySuff over nullSuff? */ - *srcPtr = single; - *targPtr = suffNull; - return(TRUE); - } - return (FALSE); + *out_src = single; + *out_targ = nullSuff; + return TRUE; } - src = (Suff *)Lst_Datum(srcLn); - str2 = str + src->nameLen; - if (*str2 == '\0') { - single = src; - singleLn = srcLn; - } else { - targLn = Lst_Find(sufflist, str2, SuffSuffHasNameP); - if (targLn != NULL) { - *srcPtr = src; - *targPtr = (Suff *)Lst_Datum(targLn); - return (TRUE); - } - } - } + return FALSE; } -/*- - *----------------------------------------------------------------------- - * Suff_IsTransform -- - * Return TRUE if the given string is a transformation rule - * - * - * Input: - * str string to check - * - * Results: - * TRUE if the string is a concatenation of two known suffixes. - * FALSE otherwise - * - * Side Effects: - * None - *----------------------------------------------------------------------- +/* + * Return TRUE if the given string is a transformation rule, that is, a + * concatenation of two known suffixes such as ".c.o" or a single suffix + * such as ".o". */ Boolean -Suff_IsTransform(char *str) +Suff_IsTransform(const char *str) { - Suff *src, *targ; + Suffix *src, *targ; - return (SuffParseTransform(str, &src, &targ)); + return ParseTransform(str, &src, &targ); } -/*- - *----------------------------------------------------------------------- - * Suff_AddTransform -- - * Add the transformation rule described by the line to the - * list of rules and place the transformation itself in the graph +/* + * Add the transformation rule to the list of rules and place the + * transformation itself in the graph. + * + * The transformation is linked to the two suffixes mentioned in the name. * * Input: - * line name of transformation to add + * name must have the form ".from.to" or just ".from" * * Results: - * The node created for the transformation in the transforms list - * - * Side Effects: - * The node is placed on the end of the transforms Lst and links are - * made between the two suffixes mentioned in the target name - *----------------------------------------------------------------------- + * The created or existing transformation node in the transforms list */ GNode * -Suff_AddTransform(char *line) +Suff_AddTransform(const char *name) { - GNode *gn; /* GNode of transformation rule */ - Suff *s, /* source suffix */ - *t; /* target suffix */ - LstNode ln; /* Node for existing transformation */ + Suffix *srcSuff; + Suffix *targSuff; -#if defined(__minix) - /* Prevent complains from GCC at -O3 optimisation level. */ - s = NULL; - t = NULL; -#endif /* defined(__minix) */ + GNode *gn = FindTransformByName(name); + if (gn == NULL) { + /* + * Make a new graph node for the transformation. It will be + * filled in by the Parse module. + */ + gn = GNode_New(name); + Lst_Append(&transforms, gn); + } else { + /* + * New specification for transformation rule. Just nuke the + * old list of commands so they can be filled in again. We + * don't actually free the commands themselves, because a + * given command can be attached to several different + * transformations. + */ + Lst_Done(&gn->commands); + Lst_Init(&gn->commands); + Lst_Done(&gn->children); + Lst_Init(&gn->children); + } - ln = Lst_Find(transforms, line, SuffGNHasNameP); - if (ln == NULL) { - /* - * Make a new graph node for the transformation. It will be filled in - * by the Parse module. - */ - gn = Targ_NewGN(line); - (void)Lst_AtEnd(transforms, gn); - } else { - /* - * New specification for transformation rule. Just nuke the old list - * of commands so they can be filled in again... We don't actually - * free the commands themselves, because a given command can be - * attached to several different transformations. - */ - gn = (GNode *)Lst_Datum(ln); - Lst_Destroy(gn->commands, NULL); - Lst_Destroy(gn->children, NULL); - gn->commands = Lst_Init(FALSE); - gn->children = Lst_Init(FALSE); - } + gn->type = OP_TRANSFORM; - gn->type = OP_TRANSFORM; + { + /* TODO: Avoid the redundant parsing here. */ + Boolean ok = ParseTransform(name, &srcSuff, &targSuff); + assert(ok); + (void)ok; + } - (void)SuffParseTransform(line, &s, &t); + /* Link the two together in the proper relationship and order. */ + DEBUG2(SUFF, "defining transformation from `%s' to `%s'\n", + srcSuff->name, targSuff->name); + Relate(srcSuff, targSuff); - /* - * link the two together in the proper relationship and order - */ - if (DEBUG(SUFF)) { - fprintf(debug_file, "defining transformation from `%s' to `%s'\n", - s->name, t->name); - } - SuffInsert(t->children, s); - SuffInsert(s->parents, t); - - return (gn); + return gn; } -/*- - *----------------------------------------------------------------------- - * Suff_EndTransform -- - * Handle the finish of a transformation definition, removing the - * transformation from the graph if it has neither commands nor - * sources. This is a callback procedure for the Parse module via - * Lst_ForEach +/* + * Handle the finish of a transformation definition, removing the + * transformation from the graph if it has neither commands nor sources. + * + * If the node has no commands or children, the children and parents lists + * of the affected suffixes are altered. * * Input: - * gnp Node for transformation - * dummy Node for transformation - * - * Results: - * === 0 - * - * Side Effects: - * If the node has no commands or children, the children and parents - * lists of the affected suffixes are altered. - * - *----------------------------------------------------------------------- + * gn Node for transformation */ -int -Suff_EndTransform(void *gnp, void *dummy) +void +Suff_EndTransform(GNode *gn) { - GNode *gn = (GNode *)gnp; + Suffix *srcSuff, *targSuff; + SuffixList *srcSuffParents; - if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts)) - gn = (GNode *)Lst_Datum(Lst_Last(gn->cohorts)); - if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) && - Lst_IsEmpty(gn->children)) - { - Suff *s, *t; + if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(&gn->cohorts)) + gn = gn->cohorts.last->datum; + + if (!(gn->type & OP_TRANSFORM)) + return; + + if (!Lst_IsEmpty(&gn->commands) || !Lst_IsEmpty(&gn->children)) { + DEBUG1(SUFF, "transformation %s complete\n", gn->name); + return; + } /* * SuffParseTransform() may fail for special rules which are not * actual transformation rules. (e.g. .DEFAULT) */ - if (SuffParseTransform(gn->name, &s, &t)) { - Lst p; + if (!ParseTransform(gn->name, &srcSuff, &targSuff)) + return; - if (DEBUG(SUFF)) { - fprintf(debug_file, "deleting transformation from `%s' to `%s'\n", - s->name, t->name); - } + DEBUG2(SUFF, "deleting incomplete transformation from `%s' to `%s'\n", + srcSuff->name, targSuff->name); - /* - * Store s->parents because s could be deleted in SuffRemove - */ - p = s->parents; - - /* - * Remove the source from the target's children list. We check for a - * nil return to handle a beanhead saying something like - * .c.o .c.o: - * - * We'll be called twice when the next target is seen, but .c and .o - * are only linked once... - */ - SuffRemove(t->children, s); - - /* - * Remove the target from the source's parents list - */ - SuffRemove(p, t); - } - } else if ((gn->type & OP_TRANSFORM) && DEBUG(SUFF)) { - fprintf(debug_file, "transformation %s complete\n", gn->name); - } - - return(dummy ? 0 : 0); + /* + * Remember the parents since srcSuff could be deleted in + * SuffixList_Remove. + */ + srcSuffParents = &srcSuff->parents; + SuffixList_Remove(&targSuff->children, srcSuff); + SuffixList_Remove(srcSuffParents, targSuff); } -/*- - *----------------------------------------------------------------------- - * SuffRebuildGraph -- - * Called from Suff_AddSuffix via Lst_ForEach to search through the - * list of existing transformation rules and rebuild the transformation - * graph when it has been destroyed by Suff_ClearSuffixes. If the - * given rule is a transformation involving this suffix and another, - * existing suffix, the proper relationship is established between - * the two. +/* + * Called from Suff_AddSuffix to search through the list of + * existing transformation rules and rebuild the transformation graph when + * it has been destroyed by Suff_ClearSuffixes. If the given rule is a + * transformation involving this suffix and another, existing suffix, the + * proper relationship is established between the two. + * + * The appropriate links will be made between this suffix and others if + * transformation rules exist for it. * * Input: - * transformp Transformation to test - * sp Suffix to rebuild - * - * Results: - * Always 0. - * - * Side Effects: - * The appropriate links will be made between this suffix and - * others if transformation rules exist for it. - * - *----------------------------------------------------------------------- + * transform Transformation to test + * suff Suffix to rebuild */ -static int -SuffRebuildGraph(void *transformp, void *sp) +static void +RebuildGraph(GNode *transform, Suffix *suff) { - GNode *transform = (GNode *)transformp; - Suff *s = (Suff *)sp; - char *cp; - LstNode ln; - Suff *s2; - SuffixCmpData sd; + const char *name = transform->name; + size_t nameLen = strlen(name); + const char *toName; - /* - * First see if it is a transformation from this suffix. - */ - cp = UNCONST(SuffStrIsPrefix(s->name, transform->name)); - if (cp != NULL) { - ln = Lst_Find(sufflist, cp, SuffSuffHasNameP); - if (ln != NULL) { - /* - * Found target. Link in and return, since it can't be anything - * else. - */ - s2 = (Suff *)Lst_Datum(ln); - SuffInsert(s2->children, s); - SuffInsert(s->parents, s2); - return(0); + /* See if it is a transformation from this suffix to another suffix. */ + toName = StrTrimPrefix(suff->name, name); + if (toName != NULL) { + Suffix *to = FindSuffixByName(toName); + if (to != NULL) { + Relate(suff, to); + return; + } } - } - /* - * Not from, maybe to? - */ - sd.len = strlen(transform->name); - sd.ename = transform->name + sd.len; - cp = SuffSuffIsSuffix(s, &sd); - if (cp != NULL) { - /* - * Null-terminate the source suffix in order to find it. - */ - cp[1] = '\0'; - ln = Lst_Find(sufflist, transform->name, SuffSuffHasNameP); - /* - * Replace the start of the target suffix - */ - cp[1] = s->name[0]; - if (ln != NULL) { - /* - * Found it -- establish the proper relationship - */ - s2 = (Suff *)Lst_Datum(ln); - SuffInsert(s->children, s2); - SuffInsert(s2->parents, s); + /* See if it is a transformation from another suffix to this suffix. */ + toName = Suffix_TrimSuffix(suff, nameLen, name + nameLen); + if (toName != NULL) { + Suffix *from = FindSuffixByNameLen(name, + (size_t)(toName - name)); + if (from != NULL) + Relate(from, suff); } - } - return(0); } -/*- - *----------------------------------------------------------------------- - * SuffScanTargets -- - * Called from Suff_AddSuffix via Lst_ForEach to search through the - * list of existing targets and find if any of the existing targets - * can be turned into a transformation rule. +/* + * During Suff_AddSuffix, search through the list of existing targets and find + * if any of the existing targets can be turned into a transformation rule. + * + * If such a target is found and the target is the current main target, the + * main target is set to NULL and the next target examined (if that exists) + * becomes the main target. * * Results: - * 1 if a new main target has been selected, 0 otherwise. - * - * Side Effects: - * If such a target is found and the target is the current main - * target, the main target is set to NULL and the next target - * examined (if that exists) becomes the main target. - * - *----------------------------------------------------------------------- + * TRUE iff a new main target has been selected. */ -static int -SuffScanTargets(void *targetp, void *gsp) +static Boolean +UpdateTarget(GNode *target, GNode **inout_main, Suffix *suff, + Boolean *inout_removedMain) { - GNode *target = (GNode *)targetp; - GNodeSuff *gs = (GNodeSuff *)gsp; - Suff *s, *t; - char *ptr; + Suffix *srcSuff, *targSuff; + char *ptr; - if (*gs->gn == NULL && gs->r && (target->type & OP_NOTARGET) == 0) { - *gs->gn = target; - Targ_SetMain(target); - return 1; - } - - if ((unsigned int)target->type == OP_TRANSFORM) - return 0; - - if ((ptr = strstr(target->name, gs->s->name)) == NULL || - ptr == target->name) - return 0; - - if (SuffParseTransform(target->name, &s, &t)) { - if (*gs->gn == target) { - gs->r = TRUE; - *gs->gn = NULL; - Targ_SetMain(NULL); + if (*inout_main == NULL && *inout_removedMain && + !(target->type & OP_NOTARGET)) { + DEBUG1(MAKE, "Setting main node to \"%s\"\n", target->name); + *inout_main = target; + Targ_SetMain(target); + /* + * XXX: Why could it be a good idea to return TRUE here? + * The main task of this function is to turn ordinary nodes + * into transformations, no matter whether or not a new .MAIN + * node has been found. + */ + /* + * XXX: Even when changing this to FALSE, none of the existing + * unit tests fails. + */ + return TRUE; } - Lst_Destroy(target->children, NULL); - target->children = Lst_Init(FALSE); - target->type = OP_TRANSFORM; + + if (target->type == OP_TRANSFORM) + return FALSE; + /* - * link the two together in the proper relationship and order + * XXX: What about a transformation ".cpp.c"? If ".c" is added as + * a new suffix, it seems wrong that this transformation would be + * skipped just because ".c" happens to be a prefix of ".cpp". */ - if (DEBUG(SUFF)) { - fprintf(debug_file, "defining transformation from `%s' to `%s'\n", - s->name, t->name); + ptr = strstr(target->name, suff->name); + if (ptr == NULL) + return FALSE; + + /* + * XXX: In suff-rebuild.mk, in the line '.SUFFIXES: .c .b .a', this + * condition prevents the rule '.b.c' from being added again during + * Suff_AddSuffix(".b"). + * + * XXX: Removing this paragraph makes suff-add-later.mk use massive + * amounts of memory. + */ + if (ptr == target->name) + return FALSE; + + if (ParseTransform(target->name, &srcSuff, &targSuff)) { + if (*inout_main == target) { + DEBUG1(MAKE, + "Setting main node from \"%s\" back to null\n", + target->name); + *inout_removedMain = TRUE; + *inout_main = NULL; + Targ_SetMain(NULL); + } + Lst_Done(&target->children); + Lst_Init(&target->children); + target->type = OP_TRANSFORM; + + /* + * Link the two together in the proper relationship and order. + */ + DEBUG2(SUFF, "defining transformation from `%s' to `%s'\n", + srcSuff->name, targSuff->name); + Relate(srcSuff, targSuff); } - SuffInsert(t->children, s); - SuffInsert(s->parents, t); - } - return 0; + return FALSE; } -/*- - *----------------------------------------------------------------------- - * Suff_AddSuffix -- - * Add the suffix in string to the end of the list of known suffixes. - * Should we restructure the suffix graph? Make doesn't... +/* + * Look at all existing targets to see if adding this suffix will make one + * of the current targets mutate into a suffix rule. + * + * This is ugly, but other makes treat all targets that start with a '.' as + * suffix rules. + */ +static void +UpdateTargets(GNode **inout_main, Suffix *suff) +{ + Boolean removedMain = FALSE; + GNodeListNode *ln; + + for (ln = Targ_List()->first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + if (UpdateTarget(gn, inout_main, suff, &removedMain)) + break; + } +} + +/* + * Add the suffix to the end of the list of known suffixes. + * Should we restructure the suffix graph? Make doesn't. + * + * A GNode is created for the suffix (XXX: this sounds completely wrong) and + * a Suffix structure is created and added to the suffixes list unless the + * suffix was already known. + * The mainNode passed can be modified if a target mutated into a + * transform and that target happened to be the main target. * * Input: - * str the name of the suffix to add - * - * Results: - * None - * - * Side Effects: - * A GNode is created for the suffix and a Suff structure is created and - * added to the suffixes list unless the suffix was already known. - * The mainNode passed can be modified if a target mutated into a - * transform and that target happened to be the main target. - *----------------------------------------------------------------------- + * name the name of the suffix to add */ void -Suff_AddSuffix(char *str, GNode **gn) +Suff_AddSuffix(const char *name, GNode **inout_main) { - Suff *s; /* new suffix descriptor */ - LstNode ln; - GNodeSuff gs; + GNodeListNode *ln; - ln = Lst_Find(sufflist, str, SuffSuffHasNameP); - if (ln == NULL) { - s = bmake_malloc(sizeof(Suff)); + Suffix *suff = FindSuffixByName(name); + if (suff != NULL) + return; - s->name = bmake_strdup(str); - s->nameLen = strlen(s->name); - s->searchPath = Lst_Init(FALSE); - s->children = Lst_Init(FALSE); - s->parents = Lst_Init(FALSE); - s->ref = Lst_Init(FALSE); - s->sNum = sNum++; - s->flags = 0; - s->refCount = 1; + suff = Suffix_New(name); + Lst_Append(&sufflist, suff); + DEBUG1(SUFF, "Adding suffix \"%s\"\n", suff->name); + + UpdateTargets(inout_main, suff); - (void)Lst_AtEnd(sufflist, s); - /* - * We also look at our existing targets list to see if adding - * this suffix will make one of our current targets mutate into - * a suffix rule. This is ugly, but other makes treat all targets - * that start with a . as suffix rules. - */ - gs.gn = gn; - gs.s = s; - gs.r = FALSE; - Lst_ForEach(Targ_List(), SuffScanTargets, &gs); /* * Look for any existing transformations from or to this suffix. * XXX: Only do this after a Suff_ClearSuffixes? */ - Lst_ForEach(transforms, SuffRebuildGraph, s); - } + for (ln = transforms.first; ln != NULL; ln = ln->next) + RebuildGraph(ln->datum, suff); } -/*- - *----------------------------------------------------------------------- - * Suff_GetPath -- - * Return the search path for the given suffix, if it's defined. - * - * Results: - * The searchPath for the desired suffix or NULL if the suffix isn't - * defined. - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -Lst -Suff_GetPath(char *sname) +/* Return the search path for the given suffix, or NULL. */ +SearchPath * +Suff_GetPath(const char *sname) { - LstNode ln; - Suff *s; - - ln = Lst_Find(sufflist, sname, SuffSuffHasNameP); - if (ln == NULL) { - return NULL; - } else { - s = (Suff *)Lst_Datum(ln); - return (s->searchPath); - } + Suffix *suff = FindSuffixByName(sname); + return suff != NULL ? suff->searchPath : NULL; } -/*- - *----------------------------------------------------------------------- - * Suff_DoPaths -- - * Extend the search paths for all suffixes to include the default - * search path. +/* + * Extend the search paths for all suffixes to include the default search + * path (dirSearchPath). * - * Results: - * None. + * The default search path can be defined using the special target '.PATH'. + * The search path of each suffix can be defined using the special target + * '.PATH'. * - * Side Effects: - * The searchPath field of all the suffixes is extended by the - * directories in dirSearchPath. If paths were specified for the - * ".h" suffix, the directories are stuffed into a global variable - * called ".INCLUDES" with each directory preceded by a -I. The same - * is done for the ".a" suffix, except the variable is called - * ".LIBS" and the flag is -L. - *----------------------------------------------------------------------- + * If paths were specified for the ".h" suffix, the directories are stuffed + * into a global variable called ".INCLUDES" with each directory preceded by + * '-I'. The same is done for the ".a" suffix, except the variable is called + * ".LIBS" and the flag is '-L'. */ void Suff_DoPaths(void) { - Suff *s; - LstNode ln; - char *ptr; - Lst inIncludes; /* Cumulative .INCLUDES path */ - Lst inLibs; /* Cumulative .LIBS path */ + SuffixListNode *ln; + char *flags; + SearchPath *includesPath = SearchPath_New(); + SearchPath *libsPath = SearchPath_New(); - if (Lst_Open(sufflist) == FAILURE) { - return; - } - - inIncludes = Lst_Init(FALSE); - inLibs = Lst_Init(FALSE); - - while ((ln = Lst_Next(sufflist)) != NULL) { - s = (Suff *)Lst_Datum(ln); - if (!Lst_IsEmpty (s->searchPath)) { + for (ln = sufflist.first; ln != NULL; ln = ln->next) { + Suffix *suff = ln->datum; + if (!Lst_IsEmpty(&suff->searchPath->dirs)) { #ifdef INCLUDES - if (s->flags & SUFF_INCLUDE) { - Dir_Concat(inIncludes, s->searchPath); - } -#endif /* INCLUDES */ + if (suff->flags & SUFF_INCLUDE) + SearchPath_AddAll(includesPath, + suff->searchPath); +#endif #ifdef LIBRARIES - if (s->flags & SUFF_LIBRARY) { - Dir_Concat(inLibs, s->searchPath); - } -#endif /* LIBRARIES */ - Dir_Concat(s->searchPath, dirSearchPath); - } else { - Lst_Destroy(s->searchPath, Dir_Destroy); - s->searchPath = Lst_Duplicate(dirSearchPath, Dir_CopyDir); + if (suff->flags & SUFF_LIBRARY) + SearchPath_AddAll(libsPath, suff->searchPath); +#endif + SearchPath_AddAll(suff->searchPath, &dirSearchPath); + } else { + SearchPath_Free(suff->searchPath); + suff->searchPath = Dir_CopyDirSearchPath(); + } } - } - Var_Set(".INCLUDES", ptr = Dir_MakeFlags("-I", inIncludes), VAR_GLOBAL, 0); - free(ptr); - Var_Set(".LIBS", ptr = Dir_MakeFlags("-L", inLibs), VAR_GLOBAL, 0); - free(ptr); + flags = SearchPath_ToFlags(includesPath, "-I"); + Global_Set(".INCLUDES", flags); + free(flags); - Lst_Destroy(inIncludes, Dir_Destroy); - Lst_Destroy(inLibs, Dir_Destroy); + flags = SearchPath_ToFlags(libsPath, "-L"); + Global_Set(".LIBS", flags); + free(flags); - Lst_Close(sufflist); + SearchPath_Free(includesPath); + SearchPath_Free(libsPath); } -/*- - *----------------------------------------------------------------------- - * Suff_AddInclude -- - * Add the given suffix as a type of file which gets included. - * Called from the parse module when a .INCLUDES line is parsed. - * The suffix must have already been defined. - * - * Input: - * sname Name of the suffix to mark - * - * Results: - * None. - * - * Side Effects: - * The SUFF_INCLUDE bit is set in the suffix's flags field - * - *----------------------------------------------------------------------- +/* + * Add the given suffix as a type of file which gets included. + * Called when a '.INCLUDES: .h' line is parsed. + * To have an effect, the suffix must already exist. + * This affects the magic variable '.INCLUDES'. */ void -Suff_AddInclude(char *sname) +Suff_AddInclude(const char *suffName) { - LstNode ln; - Suff *s; - - ln = Lst_Find(sufflist, sname, SuffSuffHasNameP); - if (ln != NULL) { - s = (Suff *)Lst_Datum(ln); - s->flags |= SUFF_INCLUDE; - } + Suffix *suff = FindSuffixByName(suffName); + if (suff != NULL) + suff->flags |= SUFF_INCLUDE; } -/*- - *----------------------------------------------------------------------- - * Suff_AddLib -- - * Add the given suffix as a type of file which is a library. - * Called from the parse module when parsing a .LIBS line. The - * suffix must have been defined via .SUFFIXES before this is - * called. - * - * Input: - * sname Name of the suffix to mark - * - * Results: - * None. - * - * Side Effects: - * The SUFF_LIBRARY bit is set in the suffix's flags field - * - *----------------------------------------------------------------------- +/* + * Add the given suffix as a type of file which is a library. + * Called when a '.LIBS: .a' line is parsed. + * To have an effect, the suffix must already exist. + * This affects the magic variable '.LIBS'. */ void -Suff_AddLib(char *sname) +Suff_AddLib(const char *suffName) { - LstNode ln; - Suff *s; - - ln = Lst_Find(sufflist, sname, SuffSuffHasNameP); - if (ln != NULL) { - s = (Suff *)Lst_Datum(ln); - s->flags |= SUFF_LIBRARY; - } + Suffix *suff = FindSuffixByName(suffName); + if (suff != NULL) + suff->flags |= SUFF_LIBRARY; } - /********** Implicit Source Search Functions *********/ +/********** Implicit Source Search Functions *********/ -/*- - *----------------------------------------------------------------------- - * SuffAddSrc -- - * Add a suffix as a Src structure to the given list with its parent - * being the given Src structure. If the suffix is the null suffix, - * the prefix is used unaltered as the file name in the Src structure. - * - * Input: - * sp suffix for which to create a Src structure - * lsp list and parent for the new Src - * - * Results: - * always returns 0 - * - * Side Effects: - * A Src structure is created and tacked onto the end of the list - *----------------------------------------------------------------------- - */ -static int -SuffAddSrc(void *sp, void *lsp) +static void +CandidateSearcher_Init(CandidateSearcher *cs) { - Suff *s = (Suff *)sp; - LstSrc *ls = (LstSrc *)lsp; - Src *s2; /* new Src structure */ - Src *targ; /* Target structure */ - - targ = ls->s; - - if ((s->flags & SUFF_NULL) && (*s->name != '\0')) { - /* - * If the suffix has been marked as the NULL suffix, also create a Src - * structure for a file with no suffix attached. Two birds, and all - * that... - */ - s2 = bmake_malloc(sizeof(Src)); - s2->file = bmake_strdup(targ->pref); - s2->pref = targ->pref; - s2->parent = targ; - s2->node = NULL; - s2->suff = s; - s->refCount++; - s2->children = 0; - targ->children += 1; - (void)Lst_AtEnd(ls->l, s2); -#ifdef DEBUG_SRC - s2->cp = Lst_Init(FALSE); - Lst_AtEnd(targ->cp, s2); - fprintf(debug_file, "1 add %x %x to %x:", targ, s2, ls->l); - Lst_ForEach(ls->l, PrintAddr, NULL); - fprintf(debug_file, "\n"); -#endif - } - s2 = bmake_malloc(sizeof(Src)); - s2->file = str_concat(targ->pref, s->name, 0); - s2->pref = targ->pref; - s2->parent = targ; - s2->node = NULL; - s2->suff = s; - s->refCount++; - s2->children = 0; - targ->children += 1; - (void)Lst_AtEnd(ls->l, s2); -#ifdef DEBUG_SRC - s2->cp = Lst_Init(FALSE); - Lst_AtEnd(targ->cp, s2); - fprintf(debug_file, "2 add %x %x to %x:", targ, s2, ls->l); - Lst_ForEach(ls->l, PrintAddr, NULL); - fprintf(debug_file, "\n"); -#endif - - return(0); + Lst_Init(&cs->list); } -/*- - *----------------------------------------------------------------------- - * SuffAddLevel -- - * Add all the children of targ as Src structures to the given list - * - * Input: - * l list to which to add the new level - * targ Src structure to use as the parent - * - * Results: - * None - * - * Side Effects: - * Lots of structures are created and added to the list - *----------------------------------------------------------------------- +static void +CandidateSearcher_Done(CandidateSearcher *cs) +{ + Lst_Done(&cs->list); +} + +static void +CandidateSearcher_Add(CandidateSearcher *cs, Candidate *cand) +{ + /* TODO: filter duplicates */ + Lst_Append(&cs->list, cand); +} + +static void +CandidateSearcher_AddIfNew(CandidateSearcher *cs, Candidate *cand) +{ + /* TODO: filter duplicates */ + if (Lst_FindDatum(&cs->list, cand) == NULL) + Lst_Append(&cs->list, cand); +} + +static void +CandidateSearcher_MoveAll(CandidateSearcher *cs, CandidateList *list) +{ + /* TODO: filter duplicates */ + Lst_MoveAll(&cs->list, list); +} + + +#ifdef DEBUG_SRC +static void +CandidateList_PrintAddrs(CandidateList *list) +{ + CandidateListNode *ln; + + for (ln = list->first; ln != NULL; ln = ln->next) { + Candidate *cand = ln->datum; + debug_printf(" %p:%s", cand, cand->file); + } + debug_printf("\n"); +} +#endif + +static Candidate * +Candidate_New(char *name, char *prefix, Suffix *suff, Candidate *parent, + GNode *gn) +{ + Candidate *cand = bmake_malloc(sizeof *cand); + + cand->file = name; + cand->prefix = prefix; + cand->suff = Suffix_Ref(suff); + cand->parent = parent; + cand->node = gn; + cand->numChildren = 0; +#ifdef DEBUG_SRC + Lst_Init(&cand->childrenList); +#endif + + return cand; +} + +/* Add a new candidate to the list. */ +/*ARGSUSED*/ +static void +CandidateList_Add(CandidateList *list, char *srcName, Candidate *targ, + Suffix *suff, const char *debug_tag) +{ + Candidate *cand = Candidate_New(srcName, targ->prefix, suff, targ, + NULL); + targ->numChildren++; + Lst_Append(list, cand); + +#ifdef DEBUG_SRC + Lst_Append(&targ->childrenList, cand); + debug_printf("%s add suff %p:%s candidate %p:%s to list %p:", + debug_tag, targ, targ->file, cand, cand->file, list); + CandidateList_PrintAddrs(list); +#endif +} + +/* + * Add all candidates to the list that can be formed by applying a suffix to + * the candidate. */ static void -SuffAddLevel(Lst l, Src *targ) +CandidateList_AddCandidatesFor(CandidateList *list, Candidate *cand) { - LstSrc ls; + SuffixListNode *ln; + for (ln = cand->suff->children.first; ln != NULL; ln = ln->next) { + Suffix *suff = ln->datum; - ls.s = targ; - ls.l = l; + if ((suff->flags & SUFF_NULL) && suff->name[0] != '\0') { + /* + * If the suffix has been marked as the NULL suffix, + * also create a candidate for a file with no suffix + * attached. + */ + CandidateList_Add(list, bmake_strdup(cand->prefix), + cand, suff, "1"); + } - Lst_ForEach(targ->suff->children, SuffAddSrc, &ls); + CandidateList_Add(list, str_concat2(cand->prefix, suff->name), + cand, suff, "2"); + } } -/*- - *---------------------------------------------------------------------- - * SuffRemoveSrc -- - * Free all src structures in list that don't have a reference count - * - * Results: - * Ture if an src was removed - * - * Side Effects: - * The memory is free'd. - *---------------------------------------------------------------------- +/* + * Free the first candidate in the list that is not referenced anymore. + * Return whether a candidate was removed. */ -static int -SuffRemoveSrc(Lst l) +static Boolean +RemoveCandidate(CandidateList *srcs) { - LstNode ln; - Src *s; - int t = 0; + CandidateListNode *ln; - if (Lst_Open(l) == FAILURE) { - return 0; - } #ifdef DEBUG_SRC - fprintf(debug_file, "cleaning %lx: ", (unsigned long) l); - Lst_ForEach(l, PrintAddr, NULL); - fprintf(debug_file, "\n"); + debug_printf("cleaning list %p:", srcs); + CandidateList_PrintAddrs(srcs); #endif + for (ln = srcs->first; ln != NULL; ln = ln->next) { + Candidate *src = ln->datum; - while ((ln = Lst_Next(l)) != NULL) { - s = (Src *)Lst_Datum(ln); - if (s->children == 0) { - free(s->file); - if (!s->parent) - free(s->pref); - else { + if (src->numChildren == 0) { + if (src->parent == NULL) + free(src->prefix); + else { #ifdef DEBUG_SRC - LstNode ln = Lst_Member(s->parent->cp, s); - if (ln != NULL) - Lst_Remove(s->parent->cp, ln); + /* XXX: Lst_RemoveDatum */ + CandidateListNode *ln2; + ln2 = Lst_FindDatum(&src->parent->childrenList, + src); + if (ln2 != NULL) + Lst_Remove(&src->parent->childrenList, + ln2); #endif - --s->parent->children; - } + src->parent->numChildren--; + } #ifdef DEBUG_SRC - fprintf(debug_file, "free: [l=%x] p=%x %d\n", l, s, s->children); - Lst_Destroy(s->cp, NULL); + debug_printf("free: list %p src %p:%s children %d\n", + srcs, src, src->file, src->numChildren); + Lst_Done(&src->childrenList); +#endif + Lst_Remove(srcs, ln); + free(src->file); + free(src); + return TRUE; + } +#ifdef DEBUG_SRC + else { + debug_printf("keep: list %p src %p:%s children %d:", + srcs, src, src->file, src->numChildren); + CandidateList_PrintAddrs(&src->childrenList); + } #endif - Lst_Remove(l, ln); - free(s); - t |= 1; - Lst_Close(l); - return TRUE; } -#ifdef DEBUG_SRC - else { - fprintf(debug_file, "keep: [l=%x] p=%x %d: ", l, s, s->children); - Lst_ForEach(s->cp, PrintAddr, NULL); - fprintf(debug_file, "\n"); - } -#endif - } - Lst_Close(l); - - return t; + return FALSE; } -/*- - *----------------------------------------------------------------------- - * SuffFindThem -- - * Find the first existing file/target in the list srcs - * - * Input: - * srcs list of Src structures to search through - * - * Results: - * The lowest structure in the chain of transformations - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -static Src * -SuffFindThem(Lst srcs, Lst slst) +/* Find the first existing file/target in srcs. */ +static Candidate * +FindThem(CandidateList *srcs, CandidateSearcher *cs) { - Src *s; /* current Src */ - Src *rs; /* returned Src */ - char *ptr; + HashSet seen; - rs = NULL; + HashSet_Init(&seen); - while (!Lst_IsEmpty (srcs)) { - s = (Src *)Lst_DeQueue(srcs); + while (!Lst_IsEmpty(srcs)) { + Candidate *src = Lst_Dequeue(srcs); - if (DEBUG(SUFF)) { - fprintf(debug_file, "\ttrying %s...", s->file); +#ifdef DEBUG_SRC + debug_printf("remove from list %p src %p:%s\n", + srcs, src, src->file); +#endif + DEBUG1(SUFF, "\ttrying %s...", src->file); + + /* + * A file is considered to exist if either a node exists in the + * graph for it or the file actually exists. + */ + if (Targ_FindNode(src->file) != NULL) { + found: + HashSet_Done(&seen); + DEBUG0(SUFF, "got it\n"); + return src; + } + + { + char *file = Dir_FindFile(src->file, + src->suff->searchPath); + if (file != NULL) { + free(file); + goto found; + } + } + + DEBUG0(SUFF, "not there\n"); + + if (HashSet_Add(&seen, src->file)) + CandidateList_AddCandidatesFor(srcs, src); + else { + DEBUG1(SUFF, "FindThem: skipping duplicate \"%s\"\n", + src->file); + } + + CandidateSearcher_Add(cs, src); } + HashSet_Done(&seen); + return NULL; +} + +/* + * See if any of the children of the candidate's GNode is one from which the + * target can be transformed. If there is one, a candidate is put together + * for it and returned. + */ +static Candidate * +FindCmds(Candidate *targ, CandidateSearcher *cs) +{ + GNodeListNode *gln; + GNode *tgn; /* Target GNode */ + GNode *sgn; /* Source GNode */ + size_t prefLen; /* The length of the defined prefix */ + Suffix *suff; /* Suffix of the matching candidate */ + Candidate *ret; /* Return value */ + + tgn = targ->node; + prefLen = strlen(targ->prefix); + + for (gln = tgn->children.first; gln != NULL; gln = gln->next) { + const char *base; + + sgn = gln->datum; + + if (sgn->type & OP_OPTIONAL && Lst_IsEmpty(&tgn->commands)) { + /* + * We haven't looked to see if .OPTIONAL files exist + * yet, so don't use one as the implicit source. + * This allows us to use .OPTIONAL in .depend files so + * make won't complain "don't know how to make xxx.h" + * when a dependent file has been moved/deleted. + */ + continue; + } + + base = str_basename(sgn->name); + if (strncmp(base, targ->prefix, prefLen) != 0) + continue; + /* The node matches the prefix, see if it has a known suffix. */ + suff = FindSuffixByName(base + prefLen); + if (suff == NULL) + continue; + + /* + * It even has a known suffix, see if there's a transformation + * defined between the node's suffix and the target's suffix. + * + * XXX: Handle multi-stage transformations here, too. + */ + + if (Lst_FindDatum(&suff->parents, targ->suff) != NULL) + break; + } + + if (gln == NULL) + return NULL; + + ret = Candidate_New(bmake_strdup(sgn->name), targ->prefix, suff, targ, + sgn); + targ->numChildren++; +#ifdef DEBUG_SRC + debug_printf("3 add targ %p:%s ret %p:%s\n", + targ, targ->file, ret, ret->file); + Lst_Append(&targ->childrenList, ret); +#endif + CandidateSearcher_Add(cs, ret); + DEBUG1(SUFF, "\tusing existing source %s\n", sgn->name); + return ret; +} + +static void +ExpandWildcards(GNodeListNode *cln, GNode *pgn) +{ + GNode *cgn = cln->datum; + StringList expansions; + + if (!Dir_HasWildcards(cgn->name)) + return; + /* - * A file is considered to exist if either a node exists in the - * graph for it or the file actually exists. + * Expand the word along the chosen path */ - if (Targ_FindNode(s->file, TARG_NOCREATE) != NULL) { -#ifdef DEBUG_SRC - fprintf(debug_file, "remove %x from %x\n", s, srcs); -#endif - rs = s; - break; + Lst_Init(&expansions); + SearchPath_Expand(Suff_FindPath(cgn), cgn->name, &expansions); + + while (!Lst_IsEmpty(&expansions)) { + GNode *gn; + /* + * Fetch next expansion off the list and find its GNode + */ + char *cp = Lst_Dequeue(&expansions); + + DEBUG1(SUFF, "%s...", cp); + gn = Targ_GetNode(cp); + + /* Add gn to the parents child list before the original child */ + Lst_InsertBefore(&pgn->children, cln, gn); + Lst_Append(&gn->parents, pgn); + pgn->unmade++; } - if ((ptr = Dir_FindFile(s->file, s->suff->searchPath)) != NULL) { - rs = s; -#ifdef DEBUG_SRC - fprintf(debug_file, "remove %x from %x\n", s, srcs); -#endif - free(ptr); - break; - } + Lst_Done(&expansions); - if (DEBUG(SUFF)) { - fprintf(debug_file, "not there\n"); - } + DEBUG0(SUFF, "\n"); - SuffAddLevel(srcs, s); - Lst_AtEnd(slst, s); - } - - if (DEBUG(SUFF) && rs) { - fprintf(debug_file, "got it\n"); - } - return (rs); + /* + * Now the source is expanded, remove it from the list of children to + * keep it from being processed. + */ + pgn->unmade--; + Lst_Remove(&pgn->children, cln); + Lst_Remove(&cgn->parents, Lst_FindDatum(&cgn->parents, pgn)); } -/*- - *----------------------------------------------------------------------- - * SuffFindCmds -- - * See if any of the children of the target in the Src structure is - * one from which the target can be transformed. If there is one, - * a Src structure is put together for it and returned. +/* + * Break the result into a vector of strings whose nodes we can find, then + * add those nodes to the members list. * - * Input: - * targ Src structure to play with - * - * Results: - * The Src structure of the "winning" child, or NULL if no such beast. - * - * Side Effects: - * A Src structure may be allocated. - * - *----------------------------------------------------------------------- + * Unfortunately, we can't use Str_Words because it doesn't understand about + * variable expressions with spaces in them. */ -static Src * -SuffFindCmds(Src *targ, Lst slst) +static void +ExpandChildrenRegular(char *cp, GNode *pgn, GNodeList *members) { - LstNode ln; /* General-purpose list node */ - GNode *t, /* Target GNode */ - *s; /* Source GNode */ - int prefLen;/* The length of the defined prefix */ - Suff *suff; /* Suffix on matching beastie */ - Src *ret; /* Return value */ - char *cp; + char *start; - t = targ->node; - (void)Lst_Open(t->children); - prefLen = strlen(targ->pref); + pp_skip_hspace(&cp); + start = cp; + while (*cp != '\0') { + if (*cp == ' ' || *cp == '\t') { + GNode *gn; + /* + * White-space -- terminate element, find the node, + * add it, skip any further spaces. + */ + *cp++ = '\0'; + gn = Targ_GetNode(start); + Lst_Append(members, gn); + pp_skip_hspace(&cp); + /* Continue at the next non-space. */ + start = cp; + } else if (*cp == '$') { + /* Skip over the variable expression. */ + const char *nested_p = cp; + FStr junk; - for (;;) { - ln = Lst_Next(t->children); - if (ln == NULL) { - Lst_Close(t->children); - return NULL; - } - s = (GNode *)Lst_Datum(ln); + (void)Var_Parse(&nested_p, pgn, VARE_PARSE_ONLY, &junk); + /* TODO: handle errors */ + if (junk.str == var_Error) { + Parse_Error(PARSE_FATAL, + "Malformed variable expression at \"%s\"", + cp); + cp++; + } else { + cp += nested_p - cp; + } - if (s->type & OP_OPTIONAL && Lst_IsEmpty(t->commands)) { - /* - * We haven't looked to see if .OPTIONAL files exist yet, so - * don't use one as the implicit source. - * This allows us to use .OPTIONAL in .depend files so make won't - * complain "don't know how to make xxx.h' when a dependent file - * has been moved/deleted. - */ - continue; + FStr_Done(&junk); + } else if (cp[0] == '\\' && cp[1] != '\0') { + /* Escaped something -- skip over it. */ + /* + * XXX: In other places, escaping at this syntactical + * position is done by a '$', not a '\'. The '\' is + * only used in variable modifiers. + */ + cp += 2; + } else { + cp++; + } } - cp = strrchr(s->name, '/'); - if (cp == NULL) { - cp = s->name; - } else { - cp++; + if (cp != start) { + /* + * Stuff left over -- add it to the list too + */ + GNode *gn = Targ_GetNode(start); + Lst_Append(members, gn); } - if (strncmp(cp, targ->pref, prefLen) != 0) - continue; - /* - * The node matches the prefix ok, see if it has a known - * suffix. - */ - ln = Lst_Find(sufflist, &cp[prefLen], SuffSuffHasNameP); - if (ln == NULL) - continue; - /* - * It even has a known suffix, see if there's a transformation - * defined between the node's suffix and the target's suffix. - * - * XXX: Handle multi-stage transformations here, too. - */ - suff = (Suff *)Lst_Datum(ln); - - if (Lst_Member(suff->parents, targ->suff) != NULL) - break; - } - - /* - * Hot Damn! Create a new Src structure to describe - * this transformation (making sure to duplicate the - * source node's name so Suff_FindDeps can free it - * again (ick)), and return the new structure. - */ - ret = bmake_malloc(sizeof(Src)); - ret->file = bmake_strdup(s->name); - ret->pref = targ->pref; - ret->suff = suff; - suff->refCount++; - ret->parent = targ; - ret->node = s; - ret->children = 0; - targ->children += 1; -#ifdef DEBUG_SRC - ret->cp = Lst_Init(FALSE); - fprintf(debug_file, "3 add %x %x\n", targ, ret); - Lst_AtEnd(targ->cp, ret); -#endif - Lst_AtEnd(slst, ret); - if (DEBUG(SUFF)) { - fprintf(debug_file, "\tusing existing source %s\n", s->name); - } - return (ret); } -/*- - *----------------------------------------------------------------------- - * SuffExpandChildren -- - * Expand the names of any children of a given node that contain - * variable invocations or file wildcards into actual targets. +/* + * Expand the names of any children of a given node that contain variable + * expressions or file wildcards into actual targets. + * + * The expanded node is removed from the parent's list of children, and the + * parent's unmade counter is decremented, but other nodes may be added. * * Input: * cln Child to examine * pgn Parent node being processed - * - * Results: - * === 0 (continue) - * - * Side Effects: - * The expanded node is removed from the parent's list of children, - * and the parent's unmade counter is decremented, but other nodes - * may be added. - * - *----------------------------------------------------------------------- */ static void -SuffExpandChildren(LstNode cln, GNode *pgn) +ExpandChildren(GNodeListNode *cln, GNode *pgn) { - GNode *cgn = (GNode *)Lst_Datum(cln); - GNode *gn; /* New source 8) */ - char *cp; /* Expanded value */ + GNode *cgn = cln->datum; + char *cp; /* Expanded value */ - if (!Lst_IsEmpty(cgn->order_pred) || !Lst_IsEmpty(cgn->order_succ)) - /* It is all too hard to process the result of .ORDER */ - return; + if (!Lst_IsEmpty(&cgn->order_pred) || !Lst_IsEmpty(&cgn->order_succ)) + /* It is all too hard to process the result of .ORDER */ + return; - if (cgn->type & OP_WAIT) - /* Ignore these (& OP_PHONY ?) */ - return; + if (cgn->type & OP_WAIT) + /* Ignore these (& OP_PHONY ?) */ + return; - /* - * First do variable expansion -- this takes precedence over - * wildcard expansion. If the result contains wildcards, they'll be gotten - * to later since the resulting words are tacked on to the end of - * the children list. - */ - if (strchr(cgn->name, '$') == NULL) { - SuffExpandWildcards(cln, pgn); - return; - } + /* + * First do variable expansion -- this takes precedence over wildcard + * expansion. If the result contains wildcards, they'll be gotten to + * later since the resulting words are tacked on to the end of the + * children list. + */ + if (strchr(cgn->name, '$') == NULL) { + ExpandWildcards(cln, pgn); + return; + } - if (DEBUG(SUFF)) { - fprintf(debug_file, "Expanding \"%s\"...", cgn->name); - } - cp = Var_Subst(NULL, cgn->name, pgn, TRUE); + DEBUG1(SUFF, "Expanding \"%s\"...", cgn->name); + (void)Var_Subst(cgn->name, pgn, VARE_UNDEFERR, &cp); + /* TODO: handle errors */ - if (cp != NULL) { - Lst members = Lst_Init(FALSE); + { + GNodeList members = LST_INIT; - if (cgn->type & OP_ARCHV) { - /* - * Node was an archive(member) target, so we want to call - * on the Arch module to find the nodes for us, expanding - * variables in the parent's context. - */ - char *sacrifice = cp; - - (void)Arch_ParseArchive(&sacrifice, members, pgn); - } else { - /* - * Break the result into a vector of strings whose nodes - * we can find, then add those nodes to the members list. - * Unfortunately, we can't use brk_string b/c it - * doesn't understand about variable specifications with - * spaces in them... - */ - char *start; - char *initcp = cp; /* For freeing... */ - - for (start = cp; *start == ' ' || *start == '\t'; start++) - continue; - for (cp = start; *cp != '\0'; cp++) { - if (*cp == ' ' || *cp == '\t') { - /* - * White-space -- terminate element, find the node, - * add it, skip any further spaces. - */ - *cp++ = '\0'; - gn = Targ_FindNode(start, TARG_CREATE); - (void)Lst_AtEnd(members, gn); - while (*cp == ' ' || *cp == '\t') { - cp++; - } - /* - * Adjust cp for increment at start of loop, but - * set start to first non-space. - */ - start = cp--; - } else if (*cp == '$') { - /* - * Start of a variable spec -- contact variable module - * to find the end so we can skip over it. - */ - char *junk; - int len; - void *freeIt; - - junk = Var_Parse(cp, pgn, TRUE, &len, &freeIt); - if (junk != var_Error) { - cp += len - 1; - } - - if (freeIt) - free(freeIt); - } else if (*cp == '\\' && *cp != '\0') { - /* - * Escaped something -- skip over it - */ - cp++; + if (cgn->type & OP_ARCHV) { + /* + * Node was an 'archive(member)' target, so + * call on the Arch module to find the nodes for us, + * expanding variables in the parent's scope. + */ + char *p = cp; + (void)Arch_ParseArchive(&p, &members, pgn); + } else { + ExpandChildrenRegular(cp, pgn, &members); } - } - if (cp != start) { /* - * Stuff left over -- add it to the list too + * Add all elements of the members list to the parent node. */ - gn = Targ_FindNode(start, TARG_CREATE); - (void)Lst_AtEnd(members, gn); - } - /* - * Point cp back at the beginning again so the variable value - * can be freed. - */ - cp = initcp; + while (!Lst_IsEmpty(&members)) { + GNode *gn = Lst_Dequeue(&members); + + DEBUG1(SUFF, "%s...", gn->name); + /* + * Add gn to the parents child list before the + * original child. + */ + Lst_InsertBefore(&pgn->children, cln, gn); + Lst_Append(&gn->parents, pgn); + pgn->unmade++; + /* Expand wildcards on new node */ + ExpandWildcards(cln->prev, pgn); + } + Lst_Done(&members); + + free(cp); } - /* - * Add all elements of the members list to the parent node. - */ - while(!Lst_IsEmpty(members)) { - gn = (GNode *)Lst_DeQueue(members); - - if (DEBUG(SUFF)) { - fprintf(debug_file, "%s...", gn->name); - } - /* Add gn to the parents child list before the original child */ - (void)Lst_InsertBefore(pgn->children, cln, gn); - (void)Lst_AtEnd(gn->parents, pgn); - pgn->unmade++; - /* Expand wildcards on new node */ - SuffExpandWildcards(Lst_Prev(cln), pgn); - } - Lst_Destroy(members, NULL); + DEBUG0(SUFF, "\n"); /* - * Free the result + * Now the source is expanded, remove it from the list of children to + * keep it from being processed. */ - free(cp); - } - if (DEBUG(SUFF)) { - fprintf(debug_file, "\n"); - } - - /* - * Now the source is expanded, remove it from the list of children to - * keep it from being processed. - */ - pgn->unmade--; - Lst_Remove(pgn->children, cln); - Lst_Remove(cgn->parents, Lst_Member(cgn->parents, pgn)); + pgn->unmade--; + Lst_Remove(&pgn->children, cln); + Lst_Remove(&cgn->parents, Lst_FindDatum(&cgn->parents, pgn)); } static void -SuffExpandWildcards(LstNode cln, GNode *pgn) +ExpandAllChildren(GNode *gn) { - GNode *cgn = (GNode *)Lst_Datum(cln); - GNode *gn; /* New source 8) */ - char *cp; /* Expanded value */ - Lst explist; /* List of expansions */ + GNodeListNode *ln, *nln; - if (!Dir_HasWildcards(cgn->name)) - return; - - /* - * Expand the word along the chosen path - */ - explist = Lst_Init(FALSE); - Dir_Expand(cgn->name, Suff_FindPath(cgn), explist); - - while (!Lst_IsEmpty(explist)) { - /* - * Fetch next expansion off the list and find its GNode - */ - cp = (char *)Lst_DeQueue(explist); - - if (DEBUG(SUFF)) { - fprintf(debug_file, "%s...", cp); + for (ln = gn->children.first; ln != NULL; ln = nln) { + nln = ln->next; + ExpandChildren(ln, gn); } - gn = Targ_FindNode(cp, TARG_CREATE); - - /* Add gn to the parents child list before the original child */ - (void)Lst_InsertBefore(pgn->children, cln, gn); - (void)Lst_AtEnd(gn->parents, pgn); - pgn->unmade++; - } - - /* - * Nuke what's left of the list - */ - Lst_Destroy(explist, NULL); - - if (DEBUG(SUFF)) { - fprintf(debug_file, "\n"); - } - - /* - * Now the source is expanded, remove it from the list of children to - * keep it from being processed. - */ - pgn->unmade--; - Lst_Remove(pgn->children, cln); - Lst_Remove(cgn->parents, Lst_Member(cgn->parents, pgn)); } -/*- - *----------------------------------------------------------------------- - * Suff_FindPath -- - * Find a path along which to expand the node. +/* + * Find a path along which to expand the node. * - * If the word has a known suffix, use that path. - * If it has no known suffix, use the default system search path. + * If the node has a known suffix, use that path. + * If it has no known suffix, use the default system search path. * * Input: * gn Node being examined * * Results: * The appropriate path to search for the GNode. - * - * Side Effects: - * XXX: We could set the suffix here so that we don't have to scan - * again. - * - *----------------------------------------------------------------------- */ -Lst -Suff_FindPath(GNode* gn) +SearchPath * +Suff_FindPath(GNode *gn) { - Suff *suff = gn->suffix; + Suffix *suff = gn->suffix; - if (suff == NULL) { - SuffixCmpData sd; /* Search string data */ - LstNode ln; - sd.len = strlen(gn->name); - sd.ename = gn->name + sd.len; - ln = Lst_Find(sufflist, &sd, SuffSuffIsSuffixP); + if (suff == NULL) { + char *name = gn->name; + size_t nameLen = strlen(gn->name); + SuffixListNode *ln; + for (ln = sufflist.first; ln != NULL; ln = ln->next) + if (Suffix_IsSuffix(ln->datum, nameLen, name + nameLen)) + break; - if (DEBUG(SUFF)) { - fprintf(debug_file, "Wildcard expanding \"%s\"...", gn->name); + DEBUG1(SUFF, "Wildcard expanding \"%s\"...", gn->name); + if (ln != NULL) + suff = ln->datum; + /* + * XXX: Here we can save the suffix so we don't have to do + * this again. + */ } - if (ln != NULL) - suff = (Suff *)Lst_Datum(ln); - /* XXX: Here we can save the suffix so we don't have to do this again */ - } - if (suff != NULL) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "suffix is \"%s\"...", suff->name); + if (suff != NULL) { + DEBUG1(SUFF, "suffix is \"%s\"...\n", suff->name); + return suff->searchPath; + } else { + DEBUG0(SUFF, "\n"); + return &dirSearchPath; /* Use default search path */ } - return suff->searchPath; - } else { - /* - * Use default search path - */ - return dirSearchPath; - } } -/*- - *----------------------------------------------------------------------- - * SuffApplyTransform -- - * Apply a transformation rule, given the source and target nodes - * and suffixes. +/* + * Apply a transformation rule, given the source and target nodes and + * suffixes. * - * Input: - * tGn Target node - * sGn Source node - * t Target suffix - * s Source suffix + * The source and target are linked and the commands from the transformation + * are added to the target node's commands list. The target also inherits all + * the sources for the transformation rule. * * Results: * TRUE if successful, FALSE if not. - * - * Side Effects: - * The source and target are linked and the commands from the - * transformation are added to the target node's commands list. - * All attributes but OP_DEPMASK and OP_TRANSFORM are applied - * to the target. The target also inherits all the sources for - * the transformation rule. - * - *----------------------------------------------------------------------- */ static Boolean -SuffApplyTransform(GNode *tGn, GNode *sGn, Suff *t, Suff *s) +ApplyTransform(GNode *tgn, GNode *sgn, Suffix *tsuff, Suffix *ssuff) { - LstNode ln, nln; /* General node */ - char *tname; /* Name of transformation rule */ - GNode *gn; /* Node for same */ + GNodeListNode *ln; + char *tname; /* Name of transformation rule */ + GNode *gn; /* Node for the transformation rule */ - /* - * Form the proper links between the target and source. - */ - (void)Lst_AtEnd(tGn->children, sGn); - (void)Lst_AtEnd(sGn->parents, tGn); - tGn->unmade += 1; + /* Form the proper links between the target and source. */ + Lst_Append(&tgn->children, sgn); + Lst_Append(&sgn->parents, tgn); + tgn->unmade++; - /* - * Locate the transformation rule itself - */ - tname = str_concat(s->name, t->name, 0); - ln = Lst_Find(transforms, tname, SuffGNHasNameP); - free(tname); + /* Locate the transformation rule itself. */ + tname = str_concat2(ssuff->name, tsuff->name); + gn = FindTransformByName(tname); + free(tname); + + /* This can happen when linking an OP_MEMBER and OP_ARCHV node. */ + if (gn == NULL) + return FALSE; + + DEBUG3(SUFF, "\tapplying %s -> %s to \"%s\"\n", + ssuff->name, tsuff->name, tgn->name); + + /* Record last child; Make_HandleUse may add child nodes. */ + ln = tgn->children.last; + + /* Apply the rule. */ + Make_HandleUse(gn, tgn); + + /* Deal with wildcards and variables in any acquired sources. */ + ln = ln != NULL ? ln->next : NULL; + while (ln != NULL) { + GNodeListNode *nln = ln->next; + ExpandChildren(ln, tgn); + ln = nln; + } - if (ln == NULL) { /* - * Not really such a transformation rule (can happen when we're - * called to link an OP_MEMBER and OP_ARCHV node), so return - * FALSE. + * Keep track of another parent to which this node is transformed so + * the .IMPSRC variable can be set correctly for the parent. */ - return(FALSE); - } + Lst_Append(&sgn->implicitParents, tgn); - gn = (GNode *)Lst_Datum(ln); - - if (DEBUG(SUFF)) { - fprintf(debug_file, "\tapplying %s -> %s to \"%s\"\n", s->name, t->name, tGn->name); - } - - /* - * Record last child for expansion purposes - */ - ln = Lst_Last(tGn->children); - - /* - * Pass the buck to Make_HandleUse to apply the rule - */ - (void)Make_HandleUse(gn, tGn); - - /* - * Deal with wildcards and variables in any acquired sources - */ - for (ln = Lst_Succ(ln); ln != NULL; ln = nln) { - nln = Lst_Succ(ln); - SuffExpandChildren(ln, tGn); - } - - /* - * Keep track of another parent to which this beast is transformed so - * the .IMPSRC variable can be set correctly for the parent. - */ - (void)Lst_AtEnd(sGn->iParents, tGn); - - return(TRUE); + return TRUE; } +/* + * Member has a known suffix, so look for a transformation rule from + * it to a possible suffix of the archive. + * + * Rather than searching through the entire list, we just look at + * suffixes to which the member's suffix may be transformed. + */ +static void +ExpandMember(GNode *gn, const char *eoarch, GNode *mem, Suffix *memSuff) +{ + GNodeListNode *ln; + size_t nameLen = (size_t)(eoarch - gn->name); -/*- - *----------------------------------------------------------------------- - * SuffFindArchiveDeps -- - * Locate dependencies for an OP_ARCHV node. + /* Use first matching suffix... */ + for (ln = memSuff->parents.first; ln != NULL; ln = ln->next) + if (Suffix_IsSuffix(ln->datum, nameLen, eoarch)) + break; + + if (ln != NULL) { + /* Got one -- apply it */ + Suffix *suff = ln->datum; + if (!ApplyTransform(gn, mem, suff, memSuff)) { + DEBUG2(SUFF, "\tNo transformation from %s -> %s\n", + memSuff->name, suff->name); + } + } +} + +static void FindDeps(GNode *, CandidateSearcher *); + +/* + * Locate dependencies for an OP_ARCHV node. * * Input: * gn Node for which to locate dependencies * - * Results: - * None - * * Side Effects: * Same as Suff_FindDeps - * - *----------------------------------------------------------------------- */ static void -SuffFindArchiveDeps(GNode *gn, Lst slst) +FindDepsArchive(GNode *gn, CandidateSearcher *cs) { - char *eoarch; /* End of archive portion */ - char *eoname; /* End of member portion */ - GNode *mem; /* Node for member */ - static const char *copy[] = { - /* Variables to be copied from the member node */ - TARGET, /* Must be first */ - PREFIX, /* Must be second */ - }; - int i; /* Index into copy and vals */ - Suff *ms; /* Suffix descriptor for member */ - char *name; /* Start of member's name */ + char *eoarch; /* End of archive portion */ + char *eoname; /* End of member portion */ + GNode *mem; /* Node for member */ + Suffix *memSuff; + const char *name; /* Start of member's name */ - /* - * The node is an archive(member) pair. so we must find a - * suffix for both of them. - */ - eoarch = strchr(gn->name, '('); - eoname = strchr(eoarch, ')'); - - *eoname = '\0'; /* Nuke parentheses during suffix search */ - *eoarch = '\0'; /* So a suffix can be found */ - - name = eoarch + 1; - - /* - * To simplify things, call Suff_FindDeps recursively on the member now, - * so we can simply compare the member's .PREFIX and .TARGET variables - * to locate its suffix. This allows us to figure out the suffix to - * use for the archive without having to do a quadratic search over the - * suffix list, backtracking for each one... - */ - mem = Targ_FindNode(name, TARG_CREATE); - SuffFindDeps(mem, slst); - - /* - * Create the link between the two nodes right off - */ - (void)Lst_AtEnd(gn->children, mem); - (void)Lst_AtEnd(mem->parents, gn); - gn->unmade += 1; - - /* - * Copy in the variables from the member node to this one. - */ - for (i = (sizeof(copy)/sizeof(copy[0]))-1; i >= 0; i--) { - char *p1; - Var_Set(copy[i], Var_Value(copy[i], mem, &p1), gn, 0); - if (p1) - free(p1); - - } - - ms = mem->suffix; - if (ms == NULL) { /* - * Didn't know what it was -- use .NULL suffix if not in make mode + * The node is an archive(member) pair. so we must find a + * suffix for both of them. */ - if (DEBUG(SUFF)) { - fprintf(debug_file, "using null suffix\n"); + eoarch = strchr(gn->name, '('); + eoname = strchr(eoarch, ')'); + + /* + * Caller guarantees the format `libname(member)', via + * Arch_ParseArchive. + */ + assert(eoarch != NULL); + assert(eoname != NULL); + + *eoname = '\0'; /* Nuke parentheses during suffix search */ + *eoarch = '\0'; /* So a suffix can be found */ + + name = eoarch + 1; + + /* + * To simplify things, call Suff_FindDeps recursively on the member + * now, so we can simply compare the member's .PREFIX and .TARGET + * variables to locate its suffix. This allows us to figure out the + * suffix to use for the archive without having to do a quadratic + * search over the suffix list, backtracking for each one. + */ + mem = Targ_GetNode(name); + FindDeps(mem, cs); + + /* Create the link between the two nodes right off. */ + Lst_Append(&gn->children, mem); + Lst_Append(&mem->parents, gn); + gn->unmade++; + + /* Copy in the variables from the member node to this one. */ + Var_Set(gn, PREFIX, GNode_VarPrefix(mem)); + Var_Set(gn, TARGET, GNode_VarTarget(mem)); + + memSuff = mem->suffix; + if (memSuff == NULL) { /* Didn't know what it was. */ + DEBUG0(SUFF, "using null suffix\n"); + memSuff = nullSuff; } - ms = suffNull; - } - /* - * Set the other two local variables required for this target. - */ - Var_Set(MEMBER, name, gn, 0); - Var_Set(ARCHIVE, gn->name, gn, 0); - - if (ms != NULL) { - /* - * Member has a known suffix, so look for a transformation rule from - * it to a possible suffix of the archive. Rather than searching - * through the entire list, we just look at suffixes to which the - * member's suffix may be transformed... - */ - LstNode ln; - SuffixCmpData sd; /* Search string data */ + /* Set the other two local variables required for this target. */ + Var_Set(gn, MEMBER, name); + Var_Set(gn, ARCHIVE, gn->name); + /* Set $@ for compatibility with other makes. */ + Var_Set(gn, TARGET, gn->name); /* - * Use first matching suffix... + * Now we've got the important local variables set, expand any sources + * that still contain variables or wildcards in their names. */ - sd.len = eoarch - gn->name; - sd.ename = eoarch; - ln = Lst_Find(ms->parents, &sd, SuffSuffIsSuffixP); + ExpandAllChildren(gn); - if (ln != NULL) { - /* - * Got one -- apply it - */ - if (!SuffApplyTransform(gn, mem, (Suff *)Lst_Datum(ln), ms) && - DEBUG(SUFF)) - { - fprintf(debug_file, "\tNo transformation from %s -> %s\n", - ms->name, ((Suff *)Lst_Datum(ln))->name); - } - } - } + if (memSuff != NULL) + ExpandMember(gn, eoarch, mem, memSuff); - /* - * Replace the opening and closing parens now we've no need of the separate - * pieces. - */ - *eoarch = '('; *eoname = ')'; + /* + * Replace the opening and closing parens now we've no need of the + * separate pieces. + */ + *eoarch = '('; + *eoname = ')'; - /* - * Pretend gn appeared to the left of a dependency operator so - * the user needn't provide a transformation from the member to the - * archive. - */ - if (OP_NOP(gn->type)) { - gn->type |= OP_DEPENDS; - } + /* + * Pretend gn appeared to the left of a dependency operator so the + * user needn't provide a transformation from the member to the + * archive. + */ + if (!GNode_IsTarget(gn)) + gn->type |= OP_DEPENDS; - /* - * Flag the member as such so we remember to look in the archive for - * its modification time. - */ - mem->type |= OP_MEMBER; + /* + * Flag the member as such so we remember to look in the archive for + * its modification time. The OP_JOIN | OP_MADE is needed because + * this target should never get made. + */ + mem->type |= OP_MEMBER | OP_JOIN | OP_MADE; } -/*- - *----------------------------------------------------------------------- - * SuffFindNormalDeps -- - * Locate implicit dependencies for regular targets. +/* + * If the node is a library, it is the arch module's job to find it + * and set the TARGET variable accordingly. We merely provide the + * search path, assuming all libraries end in ".a" (if the suffix + * hasn't been defined, there's nothing we can do for it, so we just + * set the TARGET variable to the node's name in order to give it a + * value). + */ +static void +FindDepsLib(GNode *gn) +{ + Suffix *suff = FindSuffixByName(LIBSUFF); + if (suff != NULL) { + Suffix_Reassign(&gn->suffix, suff); + Arch_FindLib(gn, suff->searchPath); + } else { + Suffix_Unassign(&gn->suffix); + Var_Set(gn, TARGET, gn->name); + } + + /* + * Because a library (-lfoo) target doesn't follow the standard + * filesystem conventions, we don't set the regular variables for + * the thing. .PREFIX is simply made empty. + */ + Var_Set(gn, PREFIX, ""); +} + +static void +FindDepsRegularKnown(const char *name, size_t nameLen, GNode *gn, + CandidateList *srcs, CandidateList *targs) +{ + SuffixListNode *ln; + Candidate *targ; + char *pref; + + for (ln = sufflist.first; ln != NULL; ln = ln->next) { + Suffix *suff = ln->datum; + if (!Suffix_IsSuffix(suff, nameLen, name + nameLen)) + continue; + + pref = bmake_strldup(name, (size_t)(nameLen - suff->nameLen)); + targ = Candidate_New(bmake_strdup(gn->name), pref, suff, NULL, + gn); + + CandidateList_AddCandidatesFor(srcs, targ); + + /* Record the target so we can nuke it. */ + Lst_Append(targs, targ); + } +} + +static void +FindDepsRegularUnknown(GNode *gn, const char *sopref, + CandidateList *srcs, CandidateList *targs) +{ + Candidate *targ; + + if (!Lst_IsEmpty(targs) || nullSuff == NULL) + return; + + DEBUG1(SUFF, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); + + targ = Candidate_New(bmake_strdup(gn->name), bmake_strdup(sopref), + nullSuff, NULL, gn); + + /* + * Only use the default suffix rules if we don't have commands + * defined for this gnode; traditional make programs used to not + * define suffix rules if the gnode had children but we don't do + * this anymore. + */ + if (Lst_IsEmpty(&gn->commands)) + CandidateList_AddCandidatesFor(srcs, targ); + else { + DEBUG0(SUFF, "not "); + } + + DEBUG0(SUFF, "adding suffix rules\n"); + + Lst_Append(targs, targ); +} + +/* + * Deal with finding the thing on the default search path. We always do + * that, not only if the node is only a source (not on the lhs of a + * dependency operator or [XXX] it has neither children or commands) as + * the old pmake did. + */ +static void +FindDepsRegularPath(GNode *gn, Candidate *targ) +{ + if (gn->type & (OP_PHONY | OP_NOPATH)) + return; + + free(gn->path); + gn->path = Dir_FindFile(gn->name, + (targ == NULL ? &dirSearchPath : + targ->suff->searchPath)); + if (gn->path == NULL) + return; + + Var_Set(gn, TARGET, gn->path); + + if (targ != NULL) { + /* + * Suffix known for the thing -- trim the suffix off + * the path to form the proper .PREFIX variable. + */ + size_t savep = strlen(gn->path) - targ->suff->nameLen; + char savec; + + Suffix_Reassign(&gn->suffix, targ->suff); + + savec = gn->path[savep]; + gn->path[savep] = '\0'; + + Var_Set(gn, PREFIX, str_basename(gn->path)); + + gn->path[savep] = savec; + } else { + /* + * The .PREFIX gets the full path if the target has no + * known suffix. + */ + Suffix_Unassign(&gn->suffix); + Var_Set(gn, PREFIX, str_basename(gn->path)); + } +} + +/* + * Locate implicit dependencies for regular targets. * * Input: * gn Node for which to find sources * - * Results: - * None. - * * Side Effects: - * Same as Suff_FindDeps... - * - *----------------------------------------------------------------------- + * Same as Suff_FindDeps */ static void -SuffFindNormalDeps(GNode *gn, Lst slst) +FindDepsRegular(GNode *gn, CandidateSearcher *cs) { - char *eoname; /* End of name */ - char *sopref; /* Start of prefix */ - LstNode ln, nln; /* Next suffix node to check */ - Lst srcs; /* List of sources at which to look */ - Lst targs; /* List of targets to which things can be - * transformed. They all have the same file, - * but different suff and pref fields */ - Src *bottom; /* Start of found transformation path */ - Src *src; /* General Src pointer */ - char *pref; /* Prefix to use */ - Src *targ; /* General Src target pointer */ - SuffixCmpData sd; /* Search string data */ + /* List of sources at which to look */ + CandidateList srcs = LST_INIT; + /* + * List of targets to which things can be transformed. + * They all have the same file, but different suff and prefix fields. + */ + CandidateList targs = LST_INIT; + Candidate *bottom; /* Start of found transformation path */ + Candidate *src; + Candidate *targ; + const char *name = gn->name; + size_t nameLen = strlen(name); - sd.len = strlen(gn->name); - sd.ename = eoname = gn->name + sd.len; - - sopref = gn->name; - - /* - * Begin at the beginning... - */ - ln = Lst_First(sufflist); - srcs = Lst_Init(FALSE); - targs = Lst_Init(FALSE); - - /* - * We're caught in a catch-22 here. On the one hand, we want to use any - * transformation implied by the target's sources, but we can't examine - * the sources until we've expanded any variables/wildcards they may hold, - * and we can't do that until we've set up the target's local variables - * and we can't do that until we know what the proper suffix for the - * target is (in case there are two suffixes one of which is a suffix of - * the other) and we can't know that until we've found its implied - * source, which we may not want to use if there's an existing source - * that implies a different transformation. - * - * In an attempt to get around this, which may not work all the time, - * but should work most of the time, we look for implied sources first, - * checking transformations to all possible suffixes of the target, - * use what we find to set the target's local variables, expand the - * children, then look for any overriding transformations they imply. - * Should we find one, we discard the one we found before. - */ - bottom = NULL; - targ = NULL; - - if (!(gn->type & OP_PHONY)) { - - while (ln != NULL) { - /* - * Look for next possible suffix... - */ - ln = Lst_FindFrom(sufflist, ln, &sd, SuffSuffIsSuffixP); - - if (ln != NULL) { - int prefLen; /* Length of the prefix */ - - /* - * Allocate a Src structure to which things can be transformed - */ - targ = bmake_malloc(sizeof(Src)); - targ->file = bmake_strdup(gn->name); - targ->suff = (Suff *)Lst_Datum(ln); - targ->suff->refCount++; - targ->node = gn; - targ->parent = NULL; - targ->children = 0; #ifdef DEBUG_SRC - targ->cp = Lst_Init(FALSE); + DEBUG1(SUFF, "FindDepsRegular \"%s\"\n", gn->name); #endif - /* - * Allocate room for the prefix, whose end is found by - * subtracting the length of the suffix from - * the end of the name. - */ - prefLen = (eoname - targ->suff->nameLen) - sopref; - targ->pref = bmake_malloc(prefLen + 1); - memcpy(targ->pref, sopref, prefLen); - targ->pref[prefLen] = '\0'; + /* + * We're caught in a catch-22 here. On the one hand, we want to use + * any transformation implied by the target's sources, but we can't + * examine the sources until we've expanded any variables/wildcards + * they may hold, and we can't do that until we've set up the + * target's local variables and we can't do that until we know what + * the proper suffix for the target is (in case there are two + * suffixes one of which is a suffix of the other) and we can't know + * that until we've found its implied source, which we may not want + * to use if there's an existing source that implies a different + * transformation. + * + * In an attempt to get around this, which may not work all the time, + * but should work most of the time, we look for implied sources + * first, checking transformations to all possible suffixes of the + * target, use what we find to set the target's local variables, + * expand the children, then look for any overriding transformations + * they imply. Should we find one, we discard the one we found before. + */ + bottom = NULL; + targ = NULL; + + if (!(gn->type & OP_PHONY)) { + + FindDepsRegularKnown(name, nameLen, gn, &srcs, &targs); + + /* Handle target of unknown suffix... */ + FindDepsRegularUnknown(gn, name, &srcs, &targs); /* - * Add nodes from which the target can be made + * Using the list of possible sources built up from the target + * suffix(es), try and find an existing file/target that + * matches. */ - SuffAddLevel(srcs, targ); + bottom = FindThem(&srcs, cs); - /* - * Record the target so we can nuke it - */ - (void)Lst_AtEnd(targs, targ); + if (bottom == NULL) { + /* + * No known transformations -- use the first suffix + * found for setting the local variables. + */ + if (targs.first != NULL) + targ = targs.first->datum; + else + targ = NULL; + } else { + /* + * Work up the transformation path to find the suffix + * of the target to which the transformation was made. + */ + for (targ = bottom; + targ->parent != NULL; targ = targ->parent) + continue; + } + } - /* - * Search from this suffix's successor... - */ - ln = Lst_Succ(ln); - } + Var_Set(gn, TARGET, GNode_Path(gn)); + Var_Set(gn, PREFIX, targ != NULL ? targ->prefix : gn->name); + + /* + * Now we've got the important local variables set, expand any sources + * that still contain variables or wildcards in their names. + */ + { + GNodeListNode *ln, *nln; + for (ln = gn->children.first; ln != NULL; ln = nln) { + nln = ln->next; + ExpandChildren(ln, gn); + } + } + + if (targ == NULL) { + DEBUG1(SUFF, "\tNo valid suffix on %s\n", gn->name); + + sfnd_abort: + FindDepsRegularPath(gn, targ); + goto sfnd_return; } /* - * Handle target of unknown suffix... + * If the suffix indicates that the target is a library, mark that in + * the node's type field. */ - if (Lst_IsEmpty(targs) && suffNull != NULL) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "\tNo known suffix on %s. Using .NULL suffix\n", gn->name); - } - - targ = bmake_malloc(sizeof(Src)); - targ->file = bmake_strdup(gn->name); - targ->suff = suffNull; - targ->suff->refCount++; - targ->node = gn; - targ->parent = NULL; - targ->children = 0; - targ->pref = bmake_strdup(sopref); -#ifdef DEBUG_SRC - targ->cp = Lst_Init(FALSE); -#endif - - /* - * Only use the default suffix rules if we don't have commands - * defined for this gnode; traditional make programs used to - * not define suffix rules if the gnode had children but we - * don't do this anymore. - */ - if (Lst_IsEmpty(gn->commands)) - SuffAddLevel(srcs, targ); - else { - if (DEBUG(SUFF)) - fprintf(debug_file, "not "); - } - - if (DEBUG(SUFF)) - fprintf(debug_file, "adding suffix rules\n"); - - (void)Lst_AtEnd(targs, targ); - } + if (targ->suff->flags & SUFF_LIBRARY) + gn->type |= OP_LIB; /* - * Using the list of possible sources built up from the target - * suffix(es), try and find an existing file/target that matches. + * Check for overriding transformation rule implied by sources */ - bottom = SuffFindThem(srcs, slst); + if (!Lst_IsEmpty(&gn->children)) { + src = FindCmds(targ, cs); + + if (src != NULL) { + /* + * Free up all the candidates in the transformation + * path, up to but not including the parent node. + */ + while (bottom != NULL && bottom->parent != NULL) { + CandidateSearcher_AddIfNew(cs, bottom); + bottom = bottom->parent; + } + bottom = src; + } + } if (bottom == NULL) { - /* - * No known transformations -- use the first suffix found - * for setting the local variables. - */ - if (!Lst_IsEmpty(targs)) { - targ = (Src *)Lst_Datum(Lst_First(targs)); - } else { - targ = NULL; - } - } else { - /* - * Work up the transformation path to find the suffix of the - * target to which the transformation was made. - */ - for (targ = bottom; targ->parent != NULL; targ = targ->parent) - continue; - } - } - - Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0); - - pref = (targ != NULL) ? targ->pref : gn->name; - Var_Set(PREFIX, pref, gn, 0); - - /* - * Now we've got the important local variables set, expand any sources - * that still contain variables or wildcards in their names. - */ - for (ln = Lst_First(gn->children); ln != NULL; ln = nln) { - nln = Lst_Succ(ln); - SuffExpandChildren(ln, gn); - } - - if (targ == NULL) { - if (DEBUG(SUFF)) { - fprintf(debug_file, "\tNo valid suffix on %s\n", gn->name); + /* No idea from where it can come -- return now. */ + goto sfnd_abort; } -sfnd_abort: /* - * Deal with finding the thing on the default search path. We - * always do that, not only if the node is only a source (not - * on the lhs of a dependency operator or [XXX] it has neither - * children or commands) as the old pmake did. + * We now have a list of candidates headed by 'bottom' and linked via + * their 'parent' pointers. What we do next is create links between + * source and target nodes (which may or may not have been created) + * and set the necessary local variables in each target. + * + * The commands for each target are set from the commands of the + * transformation rule used to get from the src suffix to the targ + * suffix. Note that this causes the commands list of the original + * node, gn, to be replaced with the commands of the final + * transformation rule. */ - if ((gn->type & (OP_PHONY|OP_NOPATH)) == 0) { - free(gn->path); - gn->path = Dir_FindFile(gn->name, - (targ == NULL ? dirSearchPath : - targ->suff->searchPath)); - if (gn->path != NULL) { - char *ptr; - Var_Set(TARGET, gn->path, gn, 0); + if (bottom->node == NULL) + bottom->node = Targ_GetNode(bottom->file); - if (targ != NULL) { - /* - * Suffix known for the thing -- trim the suffix off - * the path to form the proper .PREFIX variable. - */ - int savep = strlen(gn->path) - targ->suff->nameLen; - char savec; + for (src = bottom; src->parent != NULL; src = src->parent) { + targ = src->parent; - if (gn->suffix) - gn->suffix->refCount--; - gn->suffix = targ->suff; - gn->suffix->refCount++; + Suffix_Reassign(&src->node->suffix, src->suff); - savec = gn->path[savep]; - gn->path[savep] = '\0'; + if (targ->node == NULL) + targ->node = Targ_GetNode(targ->file); - if ((ptr = strrchr(gn->path, '/')) != NULL) - ptr++; - else - ptr = gn->path; + ApplyTransform(targ->node, src->node, + targ->suff, src->suff); - Var_Set(PREFIX, ptr, gn, 0); - - gn->path[savep] = savec; - } else { - /* - * The .PREFIX gets the full path if the target has - * no known suffix. - */ - if (gn->suffix) - gn->suffix->refCount--; - gn->suffix = NULL; - - if ((ptr = strrchr(gn->path, '/')) != NULL) - ptr++; - else - ptr = gn->path; - - Var_Set(PREFIX, ptr, gn, 0); + if (targ->node != gn) { + /* + * Finish off the dependency-search process for any + * nodes between bottom and gn (no point in questing + * around the filesystem for their implicit source + * when it's already known). Note that the node + * can't have any sources that need expanding, since + * SuffFindThem will stop on an existing node, so all + * we need to do is set the standard variables. + */ + targ->node->type |= OP_DEPS_FOUND; + Var_Set(targ->node, PREFIX, targ->prefix); + Var_Set(targ->node, TARGET, targ->node->name); } - } } - goto sfnd_return; - } + Suffix_Reassign(&gn->suffix, src->suff); - /* - * If the suffix indicates that the target is a library, mark that in - * the node's type field. - */ - if (targ->suff->flags & SUFF_LIBRARY) { - gn->type |= OP_LIB; - } - - /* - * Check for overriding transformation rule implied by sources - */ - if (!Lst_IsEmpty(gn->children)) { - src = SuffFindCmds(targ, slst); - - if (src != NULL) { - /* - * Free up all the Src structures in the transformation path - * up to, but not including, the parent node. - */ - while (bottom && bottom->parent != NULL) { - if (Lst_Member(slst, bottom) == NULL) { - Lst_AtEnd(slst, bottom); - } - bottom = bottom->parent; - } - bottom = src; - } - } - - if (bottom == NULL) { /* - * No idea from where it can come -- return now. + * Nuke the transformation path and the candidates left over in the + * two lists. */ - goto sfnd_abort; - } - - /* - * We now have a list of Src structures headed by 'bottom' and linked via - * their 'parent' pointers. What we do next is create links between - * source and target nodes (which may or may not have been created) - * and set the necessary local variables in each target. The - * commands for each target are set from the commands of the - * transformation rule used to get from the src suffix to the targ - * suffix. Note that this causes the commands list of the original - * node, gn, to be replaced by the commands of the final - * transformation rule. Also, the unmade field of gn is incremented. - * Etc. - */ - if (bottom->node == NULL) { - bottom->node = Targ_FindNode(bottom->file, TARG_CREATE); - } - - for (src = bottom; src->parent != NULL; src = src->parent) { - targ = src->parent; - - if (src->node->suffix) - src->node->suffix->refCount--; - src->node->suffix = src->suff; - src->node->suffix->refCount++; - - if (targ->node == NULL) { - targ->node = Targ_FindNode(targ->file, TARG_CREATE); - } - - SuffApplyTransform(targ->node, src->node, - targ->suff, src->suff); - - if (targ->node != gn) { - /* - * Finish off the dependency-search process for any nodes - * between bottom and gn (no point in questing around the - * filesystem for their implicit source when it's already - * known). Note that the node can't have any sources that - * need expanding, since SuffFindThem will stop on an existing - * node, so all we need to do is set the standard and System V - * variables. - */ - targ->node->type |= OP_DEPS_FOUND; - - Var_Set(PREFIX, targ->pref, targ->node, 0); - - Var_Set(TARGET, targ->node->name, targ->node, 0); - } - } - - if (gn->suffix) - gn->suffix->refCount--; - gn->suffix = src->suff; - gn->suffix->refCount++; - - /* - * Nuke the transformation path and the Src structures left over in the - * two lists. - */ sfnd_return: - if (bottom) - if (Lst_Member(slst, bottom) == NULL) - Lst_AtEnd(slst, bottom); + if (bottom != NULL) + CandidateSearcher_AddIfNew(cs, bottom); - while (SuffRemoveSrc(srcs) || SuffRemoveSrc(targs)) - continue; + while (RemoveCandidate(&srcs) || RemoveCandidate(&targs)) + continue; - Lst_Concat(slst, srcs, LST_CONCLINK); - Lst_Concat(slst, targs, LST_CONCLINK); + CandidateSearcher_MoveAll(cs, &srcs); + CandidateSearcher_MoveAll(cs, &targs); } - -/*- - *----------------------------------------------------------------------- - * Suff_FindDeps -- - * Find implicit sources for the target described by the graph node - * gn - * - * Results: - * Nothing. - * - * Side Effects: - * Nodes are added to the graph below the passed-in node. The nodes - * are marked to have their IMPSRC variable filled in. The - * PREFIX variable is set for the given node and all its - * implied children. - * - * Notes: - * The path found by this target is the shortest path in the - * transformation graph, which may pass through non-existent targets, - * to an existing target. The search continues on all paths from the - * root suffix until a file is found. I.e. if there's a path - * .o -> .c -> .l -> .l,v from the root and the .l,v file exists but - * the .c and .l files don't, the search will branch out in - * all directions from .o and again from all the nodes on the - * next level until the .l,v node is encountered. - * - *----------------------------------------------------------------------- - */ - -void -Suff_FindDeps(GNode *gn) +static void +CandidateSearcher_CleanUp(CandidateSearcher *cs) { - - SuffFindDeps(gn, srclist); - while (SuffRemoveSrc(srclist)) - continue; + while (RemoveCandidate(&cs->list)) + continue; + assert(Lst_IsEmpty(&cs->list)); } /* - * Input: - * gn node we're dealing with + * Find implicit sources for the target. * + * Nodes are added to the graph as children of the passed-in node. The nodes + * are marked to have their IMPSRC variable filled in. The PREFIX variable + * is set for the given node and all its implied children. + * + * The path found by this target is the shortest path in the transformation + * graph, which may pass through nonexistent targets, to an existing target. + * The search continues on all paths from the root suffix until a file is + * found. I.e. if there's a path .o -> .c -> .l -> .l,v from the root and the + * .l,v file exists but the .c and .l files don't, the search will branch out + * in all directions from .o and again from all the nodes on the next level + * until the .l,v node is encountered. */ -static void -SuffFindDeps(GNode *gn, Lst slst) +void +Suff_FindDeps(GNode *gn) { - if (gn->type & OP_DEPS_FOUND) { - /* - * If dependencies already found, no need to do it again... - */ - return; - } else { - gn->type |= OP_DEPS_FOUND; - } - /* - * Make sure we have these set, may get revised below. - */ - Var_Set(TARGET, gn->path ? gn->path : gn->name, gn, 0); - Var_Set(PREFIX, gn->name, gn, 0); + CandidateSearcher cs; - if (DEBUG(SUFF)) { - fprintf(debug_file, "SuffFindDeps (%s)\n", gn->name); - } + CandidateSearcher_Init(&cs); - if (gn->type & OP_ARCHV) { - SuffFindArchiveDeps(gn, slst); - } else if (gn->type & OP_LIB) { - /* - * If the node is a library, it is the arch module's job to find it - * and set the TARGET variable accordingly. We merely provide the - * search path, assuming all libraries end in ".a" (if the suffix - * hasn't been defined, there's nothing we can do for it, so we just - * set the TARGET variable to the node's name in order to give it a - * value). - */ - LstNode ln; - Suff *s; + FindDeps(gn, &cs); - ln = Lst_Find(sufflist, LIBSUFF, SuffSuffHasNameP); - if (gn->suffix) - gn->suffix->refCount--; - if (ln != NULL) { - gn->suffix = s = (Suff *)Lst_Datum(ln); - gn->suffix->refCount++; - Arch_FindLib(gn, s->searchPath); - } else { - gn->suffix = NULL; - Var_Set(TARGET, gn->name, gn, 0); - } - /* - * Because a library (-lfoo) target doesn't follow the standard - * filesystem conventions, we don't set the regular variables for - * the thing. .PREFIX is simply made empty... - */ - Var_Set(PREFIX, "", gn, 0); - } else { - SuffFindNormalDeps(gn, slst); - } + CandidateSearcher_CleanUp(&cs); + CandidateSearcher_Done(&cs); } -/*- - *----------------------------------------------------------------------- - * Suff_SetNull -- - * Define which suffix is the null suffix. +static void +FindDeps(GNode *gn, CandidateSearcher *cs) +{ + if (gn->type & OP_DEPS_FOUND) + return; + gn->type |= OP_DEPS_FOUND; + + /* Make sure we have these set, may get revised below. */ + Var_Set(gn, TARGET, GNode_Path(gn)); + Var_Set(gn, PREFIX, gn->name); + + DEBUG1(SUFF, "SuffFindDeps \"%s\"\n", gn->name); + + if (gn->type & OP_ARCHV) + FindDepsArchive(gn, cs); + else if (gn->type & OP_LIB) + FindDepsLib(gn); + else + FindDepsRegular(gn, cs); +} + +/* + * Define which suffix is the null suffix. + * + * Need to handle the changing of the null suffix gracefully so the old + * transformation rules don't just go away. * * Input: * name Name of null suffix - * - * Results: - * None. - * - * Side Effects: - * 'suffNull' is altered. - * - * Notes: - * Need to handle the changing of the null suffix gracefully so the - * old transformation rules don't just go away. - * - *----------------------------------------------------------------------- */ void -Suff_SetNull(char *name) +Suff_SetNull(const char *name) { - Suff *s; - LstNode ln; - - ln = Lst_Find(sufflist, name, SuffSuffHasNameP); - if (ln != NULL) { - s = (Suff *)Lst_Datum(ln); - if (suffNull != NULL) { - suffNull->flags &= ~SUFF_NULL; + Suffix *suff = FindSuffixByName(name); + if (suff == NULL) { + Parse_Error(PARSE_WARNING, + "Desired null suffix %s not defined.", + name); + return; } - s->flags |= SUFF_NULL; - /* - * XXX: Here's where the transformation mangling would take place - */ - suffNull = s; - } else { - Parse_Error(PARSE_WARNING, "Desired null suffix %s not defined.", - name); - } + + if (nullSuff != NULL) + nullSuff->flags &= ~(unsigned)SUFF_NULL; + suff->flags |= SUFF_NULL; + /* XXX: Here's where the transformation mangling would take place. */ + nullSuff = suff; } -/*- - *----------------------------------------------------------------------- - * Suff_Init -- - * Initialize suffixes module - * - * Results: - * None - * - * Side Effects: - * Many - *----------------------------------------------------------------------- - */ +/* Initialize the suffixes module. */ void Suff_Init(void) { - sufflist = Lst_Init(FALSE); -#ifdef CLEANUP - suffClean = Lst_Init(FALSE); -#endif - srclist = Lst_Init(FALSE); - transforms = Lst_Init(FALSE); - - sNum = 0; - /* - * Create null suffix for single-suffix rules (POSIX). The thing doesn't - * actually go on the suffix list or everyone will think that's its - * suffix. - */ - emptySuff = suffNull = bmake_malloc(sizeof(Suff)); - - suffNull->name = bmake_strdup(""); - suffNull->nameLen = 0; - suffNull->searchPath = Lst_Init(FALSE); - Dir_Concat(suffNull->searchPath, dirSearchPath); - suffNull->children = Lst_Init(FALSE); - suffNull->parents = Lst_Init(FALSE); - suffNull->ref = Lst_Init(FALSE); - suffNull->sNum = sNum++; - suffNull->flags = SUFF_NULL; - suffNull->refCount = 1; - + /* + * Create null suffix for single-suffix rules (POSIX). The thing + * doesn't actually go on the suffix list or everyone will think + * that's its suffix. + */ + Suff_ClearSuffixes(); } -/*- - *---------------------------------------------------------------------- - * Suff_End -- - * Cleanup the this module - * - * Results: - * None - * - * Side Effects: - * The memory is free'd. - *---------------------------------------------------------------------- - */ - +/* Clean up the suffixes module. */ void Suff_End(void) { #ifdef CLEANUP - Lst_Destroy(sufflist, SuffFree); - Lst_Destroy(suffClean, SuffFree); - if (suffNull) - SuffFree(suffNull); - Lst_Destroy(srclist, NULL); - Lst_Destroy(transforms, NULL); + Lst_DoneCall(&sufflist, SuffFree); + Lst_DoneCall(&suffClean, SuffFree); + if (nullSuff != NULL) + SuffFree(nullSuff); + Lst_Done(&transforms); #endif } -/********************* DEBUGGING FUNCTIONS **********************/ - -static int SuffPrintName(void *s, void *dummy) +static void +PrintSuffNames(const char *prefix, SuffixList *suffs) { - fprintf(debug_file, "%s ", ((Suff *)s)->name); - return (dummy ? 0 : 0); -} + SuffixListNode *ln; -static int -SuffPrintSuff(void *sp, void *dummy) -{ - Suff *s = (Suff *)sp; - int flags; - int flag; - - fprintf(debug_file, "# `%s' [%d] ", s->name, s->refCount); - - flags = s->flags; - if (flags) { - fputs(" (", debug_file); - while (flags) { - flag = 1 << (ffs(flags) - 1); - flags &= ~flag; - switch (flag) { - case SUFF_NULL: - fprintf(debug_file, "NULL"); - break; - case SUFF_INCLUDE: - fprintf(debug_file, "INCLUDE"); - break; - case SUFF_LIBRARY: - fprintf(debug_file, "LIBRARY"); - break; - } - fputc(flags ? '|' : ')', debug_file); + debug_printf("#\t%s: ", prefix); + for (ln = suffs->first; ln != NULL; ln = ln->next) { + Suffix *suff = ln->datum; + debug_printf("%s ", suff->name); } - } - fputc('\n', debug_file); - fprintf(debug_file, "#\tTo: "); - Lst_ForEach(s->parents, SuffPrintName, NULL); - fputc('\n', debug_file); - fprintf(debug_file, "#\tFrom: "); - Lst_ForEach(s->children, SuffPrintName, NULL); - fputc('\n', debug_file); - fprintf(debug_file, "#\tSearch Path: "); - Dir_PrintPath(s->searchPath); - fputc('\n', debug_file); - return (dummy ? 0 : 0); + debug_printf("\n"); } -static int -SuffPrintTrans(void *tp, void *dummy) +static void +Suffix_Print(Suffix *suff) { - GNode *t = (GNode *)tp; + debug_printf("# \"%s\" (num %d, ref %d)", + suff->name, suff->sNum, suff->refCount); + if (suff->flags != 0) { + char flags_buf[SuffixFlags_ToStringSize]; - fprintf(debug_file, "%-16s: ", t->name); - Targ_PrintType(t->type); - fputc('\n', debug_file); - Lst_ForEach(t->commands, Targ_PrintCmd, NULL); - fputc('\n', debug_file); - return(dummy ? 0 : 0); + debug_printf(" (%s)", + SuffixFlags_ToString(flags_buf, suff->flags)); + } + debug_printf("\n"); + + PrintSuffNames("To", &suff->parents); + PrintSuffNames("From", &suff->children); + + debug_printf("#\tSearch Path: "); + SearchPath_Print(suff->searchPath); + debug_printf("\n"); +} + +static void +PrintTransformation(GNode *t) +{ + debug_printf("%-16s:", t->name); + Targ_PrintType(t->type); + debug_printf("\n"); + Targ_PrintCmds(t); + debug_printf("\n"); } void Suff_PrintAll(void) { - fprintf(debug_file, "#*** Suffixes:\n"); - Lst_ForEach(sufflist, SuffPrintSuff, NULL); + debug_printf("#*** Suffixes:\n"); + { + SuffixListNode *ln; + for (ln = sufflist.first; ln != NULL; ln = ln->next) + Suffix_Print(ln->datum); + } - fprintf(debug_file, "#*** Transformations:\n"); - Lst_ForEach(transforms, SuffPrintTrans, NULL); + debug_printf("#*** Transformations:\n"); + { + GNodeListNode *ln; + for (ln = transforms.first; ln != NULL; ln = ln->next) + PrintTransformation(ln->datum); + } } diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c index 5db5477ca..30cc929b4 100644 --- a/usr.bin/make/targ.c +++ b/usr.bin/make/targ.c @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $ */ +/* $NetBSD: targ.c,v 1.166 2021/02/22 20:38:55 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -68,781 +68,550 @@ * SUCH DAMAGE. */ -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; -#else -__RCSID("$NetBSD: targ.c,v 1.60 2015/05/25 09:01:06 manu Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * targ.c -- - * Functions for maintaining the Lst allTargets. Target nodes are - * kept in two structures: a Lst, maintained by the list library, and a - * hash table, maintained by the hash library. +/* + * Maintaining the targets and sources, which are both implemented as GNode. * * Interface: - * Targ_Init Initialization procedure. + * Targ_Init Initialize the module. * - * Targ_End Cleanup the module + * Targ_End Clean up the module. * - * Targ_List Return the list of all targets so far. + * Targ_List Return the list of all targets so far. * - * Targ_NewGN Create a new GNode for the passed target - * (string). The node is *not* placed in the - * hash table, though all its fields are - * initialized. + * GNode_New Create a new GNode for the passed target + * (string). The node is *not* placed in the + * hash table, though all its fields are + * initialized. * - * Targ_FindNode Find the node for a given target, creating - * and storing it if it doesn't exist and the - * flags are right (TARG_CREATE) + * Targ_FindNode Find the node, or return NULL. * - * Targ_FindList Given a list of names, find nodes for all - * of them. If a name doesn't exist and the - * TARG_NOCREATE flag was given, an error message - * is printed. Else, if a name doesn't exist, - * its node is created. + * Targ_GetNode Find the node, or create it. * - * Targ_Ignore Return TRUE if errors should be ignored when - * creating the given target. + * Targ_NewInternalNode + * Create an internal node. * - * Targ_Silent Return TRUE if we should be silent when - * creating the given target. + * Targ_FindList Given a list of names, find nodes for all + * of them, creating them as necessary. * - * Targ_Precious Return TRUE if the target is precious and - * should not be removed if we are interrupted. + * Targ_Precious Return TRUE if the target is precious and + * should not be removed if we are interrupted. * - * Targ_Propagate Propagate information between related - * nodes. Should be called after the - * makefiles are parsed but before any - * action is taken. + * Targ_Propagate Propagate information between related nodes. + * Should be called after the makefiles are parsed + * but before any action is taken. * * Debugging: - * Targ_PrintGraph Print out the entire graphm all variables - * and statistics for the directory cache. Should - * print something for suffixes, too, but... + * Targ_PrintGraph + * Print out the entire graph, all variables and + * statistics for the directory cache. Should print + * something for suffixes, too, but... */ -#include -#include +#include -#include "make.h" -#include "hash.h" -#include "dir.h" +#include "make.h" +#include "dir.h" -static Lst allTargets; /* the list of all targets found so far */ -#ifdef CLEANUP -static Lst allGNs; /* List of all the GNodes */ -#endif -static Hash_Table targets; /* a hash table of same */ +/* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */ +MAKE_RCSID("$NetBSD: targ.c,v 1.166 2021/02/22 20:38:55 rillig Exp $"); -#define HTSIZE 191 /* initial size of hash table */ - -static int TargPrintOnlySrc(void *, void *); -static int TargPrintName(void *, void *); -#ifdef CLEANUP -static void TargFreeGN(void *); -#endif -static int TargPropagateCohort(void *, void *); -static int TargPropagateNode(void *, void *); - -/*- - *----------------------------------------------------------------------- - * Targ_Init -- - * Initialize this module - * - * Results: - * None - * - * Side Effects: - * The allTargets list and the targets hash table are initialized - *----------------------------------------------------------------------- +/* + * All target nodes that appeared on the left-hand side of one of the + * dependency operators ':', '::', '!'. */ +static GNodeList allTargets = LST_INIT; +static HashTable allTargetsByName; + +#ifdef CLEANUP +static GNodeList allNodes = LST_INIT; + +static void GNode_Free(void *); +#endif + void Targ_Init(void) { - allTargets = Lst_Init(FALSE); - Hash_InitTable(&targets, HTSIZE); + HashTable_Init(&allTargetsByName); } -/*- - *----------------------------------------------------------------------- - * Targ_End -- - * Finalize this module - * - * Results: - * None - * - * Side Effects: - * All lists and gnodes are cleared - *----------------------------------------------------------------------- - */ void Targ_End(void) { + Targ_Stats(); #ifdef CLEANUP - Lst_Destroy(allTargets, NULL); - if (allGNs) - Lst_Destroy(allGNs, TargFreeGN); - Hash_DeleteTable(&targets); + Lst_Done(&allTargets); + HashTable_Done(&allTargetsByName); + Lst_DoneCall(&allNodes, GNode_Free); #endif } -/*- - *----------------------------------------------------------------------- - * Targ_List -- - * Return the list of all targets - * - * Results: - * The list of all targets. - * - * Side Effects: - * None - *----------------------------------------------------------------------- +void +Targ_Stats(void) +{ + HashTable_DebugStats(&allTargetsByName, "targets"); +} + +/* + * Return the list of all targets, which are all nodes that appear on the + * left-hand side of a dependency declaration such as "target: source". + * The returned list does not contain pure sources. */ -Lst +GNodeList * Targ_List(void) { - return allTargets; + return &allTargets; } -/*- - *----------------------------------------------------------------------- - * Targ_NewGN -- - * Create and initialize a new graph node +/* + * Create a new graph node, but don't register it anywhere. * - * Input: - * name the name to stick in the new node + * Graph nodes that appear on the left-hand side of a dependency line such + * as "target: source" are called targets. XXX: In some cases (like the + * .ALLTARGETS variable), all nodes are called targets as well, even if they + * never appear on the left-hand side. This is a mistake. * - * Results: - * An initialized graph node with the name field filled with a copy - * of the passed name - * - * Side Effects: - * The gnode is added to the list of all gnodes. - *----------------------------------------------------------------------- + * Typical names for graph nodes are: + * "src.c" (an ordinary file) + * "clean" (a .PHONY target) + * ".END" (a special hook target) + * "-lm" (a library) + * "libc.a(isspace.o)" (an archive member) */ GNode * -Targ_NewGN(const char *name) +GNode_New(const char *name) { - GNode *gn; + GNode *gn; - gn = bmake_malloc(sizeof(GNode)); - gn->name = bmake_strdup(name); - gn->uname = NULL; - gn->path = NULL; - if (name[0] == '-' && name[1] == 'l') { - gn->type = OP_LIB; - } else { - gn->type = 0; - } - gn->unmade = 0; - gn->unmade_cohorts = 0; - gn->cohort_num[0] = 0; - gn->centurion = NULL; - gn->made = UNMADE; - gn->flags = 0; - gn->checked = 0; - gn->mtime = 0; - gn->cmgn = NULL; - gn->iParents = Lst_Init(FALSE); - gn->cohorts = Lst_Init(FALSE); - gn->parents = Lst_Init(FALSE); - gn->children = Lst_Init(FALSE); - gn->order_pred = Lst_Init(FALSE); - gn->order_succ = Lst_Init(FALSE); - Hash_InitTable(&gn->context, 0); - gn->commands = Lst_Init(FALSE); - gn->suffix = NULL; - gn->lineno = 0; - gn->fname = NULL; + gn = bmake_malloc(sizeof *gn); + gn->name = bmake_strdup(name); + gn->uname = NULL; + gn->path = NULL; + gn->type = name[0] == '-' && name[1] == 'l' ? OP_LIB : OP_NONE; + gn->flags = GNF_NONE; + gn->made = UNMADE; + gn->unmade = 0; + gn->mtime = 0; + gn->youngestChild = NULL; + Lst_Init(&gn->implicitParents); + Lst_Init(&gn->parents); + Lst_Init(&gn->children); + Lst_Init(&gn->order_pred); + Lst_Init(&gn->order_succ); + Lst_Init(&gn->cohorts); + gn->cohort_num[0] = '\0'; + gn->unmade_cohorts = 0; + gn->centurion = NULL; + gn->checked_seqno = 0; + HashTable_Init(&gn->vars); + Lst_Init(&gn->commands); + gn->suffix = NULL; + gn->fname = NULL; + gn->lineno = 0; #ifdef CLEANUP - if (allGNs == NULL) - allGNs = Lst_Init(FALSE); - Lst_AtEnd(allGNs, gn); + Lst_Append(&allNodes, gn); #endif - return (gn); + return gn; } #ifdef CLEANUP -/*- - *----------------------------------------------------------------------- - * TargFreeGN -- - * Destroy a GNode - * - * Results: - * None. - * - * Side Effects: - * None. - *----------------------------------------------------------------------- - */ static void -TargFreeGN(void *gnp) +GNode_Free(void *gnp) { - GNode *gn = (GNode *)gnp; + GNode *gn = gnp; - - free(gn->name); - if (gn->uname) + free(gn->name); free(gn->uname); - if (gn->path) free(gn->path); - /* gn->fname points to name allocated when file was opened, don't free */ - Lst_Destroy(gn->iParents, NULL); - Lst_Destroy(gn->cohorts, NULL); - Lst_Destroy(gn->parents, NULL); - Lst_Destroy(gn->children, NULL); - Lst_Destroy(gn->order_succ, NULL); - Lst_Destroy(gn->order_pred, NULL); - Hash_DeleteTable(&gn->context); - Lst_Destroy(gn->commands, NULL); - free(gn); + /* Don't free gn->youngestChild since it is not owned by this node. */ + + /* + * In the following lists, only free the list nodes, but not the + * GNodes in them since these are not owned by this node. + */ + Lst_Done(&gn->implicitParents); + Lst_Done(&gn->parents); + Lst_Done(&gn->children); + Lst_Done(&gn->order_pred); + Lst_Done(&gn->order_succ); + Lst_Done(&gn->cohorts); + + /* + * Do not free the variables themselves, even though they are owned + * by this node. + * + * XXX: For the nodes that represent targets or sources (and not + * SCOPE_GLOBAL), it should be safe to free the variables as well, + * since each node manages the memory for all its variables itself. + * + * XXX: The GNodes that are only used as variable scopes (SCOPE_CMD, + * SCOPE_GLOBAL, SCOPE_INTERNAL) are not freed at all (see Var_End, + * where they are not mentioned). These might be freed at all, if + * their variable values are indeed not used anywhere else (see + * Trace_Init for the only suspicious use). + */ + HashTable_Done(&gn->vars); + + /* + * Do not free the commands themselves, as they may be shared with + * other nodes. + */ + Lst_Done(&gn->commands); + + /* + * gn->suffix is not owned by this node. + * + * XXX: gn->suffix should be unreferenced here. This requires a + * thorough check that the reference counting is done correctly in + * all places, otherwise a suffix might be freed too early. + */ + + free(gn); } #endif +/* Get the existing global node, or return NULL. */ +GNode * +Targ_FindNode(const char *name) +{ + return HashTable_FindValue(&allTargetsByName, name); +} -/*- - *----------------------------------------------------------------------- - * Targ_FindNode -- - * Find a node in the list using the given name for matching +/* Get the existing global node, or create it. */ +GNode * +Targ_GetNode(const char *name) +{ + Boolean isNew; + HashEntry *he = HashTable_CreateEntry(&allTargetsByName, name, &isNew); + if (!isNew) + return HashEntry_Get(he); + + { + GNode *gn = Targ_NewInternalNode(name); + HashEntry_Set(he, gn); + return gn; + } +} + +/* + * Create a node, register it in .ALLTARGETS but don't store it in the + * table of global nodes. This means it cannot be found by name. * - * Input: - * name the name to find - * flags flags governing events when target not - * found - * - * Results: - * The node in the list if it was. If it wasn't, return NULL of - * flags was TARG_NOCREATE or the newly created and initialized node - * if it was TARG_CREATE - * - * Side Effects: - * Sometimes a node is created and added to the list - *----------------------------------------------------------------------- + * This is used for internal nodes, such as cohorts or .WAIT nodes. */ GNode * -Targ_FindNode(const char *name, int flags) +Targ_NewInternalNode(const char *name) { - GNode *gn; /* node in that element */ - Hash_Entry *he = NULL; /* New or used hash entry for node */ - Boolean isNew; /* Set TRUE if Hash_CreateEntry had to create */ - /* an entry for the node */ - - if (!(flags & (TARG_CREATE | TARG_NOHASH))) { - he = Hash_FindEntry(&targets, name); - if (he == NULL) - return NULL; - return (GNode *)Hash_GetValue(he); - } - - if (!(flags & TARG_NOHASH)) { - he = Hash_CreateEntry(&targets, name, &isNew); - if (!isNew) - return (GNode *)Hash_GetValue(he); - } - - gn = Targ_NewGN(name); - if (!(flags & TARG_NOHASH)) - Hash_SetValue(he, gn); - Var_Append(".ALLTARGETS", name, VAR_GLOBAL); - (void)Lst_AtEnd(allTargets, gn); - if (doing_depend) - gn->flags |= FROM_DEPEND; - return gn; + GNode *gn = GNode_New(name); + Global_Append(".ALLTARGETS", name); + Lst_Append(&allTargets, gn); + DEBUG1(TARG, "Adding \"%s\" to all targets.\n", gn->name); + if (doing_depend) + gn->flags |= FROM_DEPEND; + return gn; } -/*- - *----------------------------------------------------------------------- - * Targ_FindList -- - * Make a complete list of GNodes from the given list of names - * - * Input: - * name list of names to find - * flags flags used if no node is found for a given name - * - * Results: - * A complete list of graph nodes corresponding to all instances of all - * the names in names. - * - * Side Effects: - * If flags is TARG_CREATE, nodes will be created for all names in - * names which do not yet have graph nodes. If flags is TARG_NOCREATE, - * an error message will be printed for each name which can't be found. - * ----------------------------------------------------------------------- +/* + * Return the .END node, which contains the commands to be run when + * everything else has been made. */ -Lst -Targ_FindList(Lst names, int flags) +GNode * +Targ_GetEndNode(void) { - Lst nodes; /* result list */ - LstNode ln; /* name list element */ - GNode *gn; /* node in tLn */ - char *name; + /* + * Save the node locally to avoid having to search for it all + * the time. + */ + static GNode *endNode = NULL; - nodes = Lst_Init(FALSE); - - if (Lst_Open(names) == FAILURE) { - return (nodes); - } - while ((ln = Lst_Next(names)) != NULL) { - name = (char *)Lst_Datum(ln); - gn = Targ_FindNode(name, flags); - if (gn != NULL) { - /* - * Note: Lst_AtEnd must come before the Lst_Concat so the nodes - * are added to the list in the order in which they were - * encountered in the makefile. - */ - (void)Lst_AtEnd(nodes, gn); - } else if (flags == TARG_NOCREATE) { - Error("\"%s\" -- target unknown.", name); + if (endNode == NULL) { + endNode = Targ_GetNode(".END"); + endNode->type = OP_SPECIAL; } - } - Lst_Close(names); - return (nodes); + return endNode; } -/*- - *----------------------------------------------------------------------- - * Targ_Ignore -- - * Return true if should ignore errors when creating gn - * - * Input: - * gn node to check for - * - * Results: - * TRUE if should ignore errors - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ -Boolean -Targ_Ignore(GNode *gn) +/* Add the named nodes to the list, creating them as necessary. */ +void +Targ_FindList(GNodeList *gns, StringList *names) { - if (ignoreErrors || gn->type & OP_IGNORE) { - return (TRUE); - } else { - return (FALSE); - } + StringListNode *ln; + + for (ln = names->first; ln != NULL; ln = ln->next) { + const char *name = ln->datum; + GNode *gn = Targ_GetNode(name); + Lst_Append(gns, gn); + } } -/*- - *----------------------------------------------------------------------- - * Targ_Silent -- - * Return true if be silent when creating gn - * - * Input: - * gn node to check for - * - * Results: - * TRUE if should be silent - * - * Side Effects: - * None - *----------------------------------------------------------------------- - */ +/* See if the given target is precious. */ Boolean -Targ_Silent(GNode *gn) +Targ_Precious(const GNode *gn) { - if (beSilent || gn->type & OP_SILENT) { - return (TRUE); - } else { - return (FALSE); - } + /* XXX: Why are '::' targets precious? */ + return allPrecious || gn->type & (OP_PRECIOUS | OP_DOUBLEDEP); } -/*- - *----------------------------------------------------------------------- - * Targ_Precious -- - * See if the given target is precious - * - * Input: - * gn the node to check - * - * Results: - * TRUE if it is precious. FALSE otherwise - * - * Side Effects: - * None - *----------------------------------------------------------------------- +/* + * The main target to be made; only for debugging output. + * See mainNode in parse.c for the definitive source. */ -Boolean -Targ_Precious(GNode *gn) -{ - if (allPrecious || (gn->type & (OP_PRECIOUS|OP_DOUBLEDEP))) { - return (TRUE); - } else { - return (FALSE); - } -} +static GNode *mainTarg; -/******************* DEBUG INFO PRINTING ****************/ - -static GNode *mainTarg; /* the main target, as set by Targ_SetMain */ -/*- - *----------------------------------------------------------------------- - * Targ_SetMain -- - * Set our idea of the main target we'll be creating. Used for - * debugging output. - * - * Input: - * gn The main target we'll create - * - * Results: - * None. - * - * Side Effects: - * "mainTarg" is set to the main target's node. - *----------------------------------------------------------------------- - */ +/* Remember the main target to make; only used for debugging. */ void Targ_SetMain(GNode *gn) { - mainTarg = gn; + mainTarg = gn; } -static int -TargPrintName(void *gnp, void *pflags MAKE_ATTR_UNUSED) +static void +PrintNodeNames(GNodeList *gnodes) { - GNode *gn = (GNode *)gnp; + GNodeListNode *ln; - fprintf(debug_file, "%s%s ", gn->name, gn->cohort_num); - - return 0; + for (ln = gnodes->first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + debug_printf(" %s%s", gn->name, gn->cohort_num); + } } - -int -Targ_PrintCmd(void *cmd, void *dummy) +static void +PrintNodeNamesLine(const char *label, GNodeList *gnodes) { - fprintf(debug_file, "\t%s\n", (char *)cmd); - return (dummy ? 0 : 0); + if (Lst_IsEmpty(gnodes)) + return; + debug_printf("# %s:", label); + PrintNodeNames(gnodes); + debug_printf("\n"); } -/*- - *----------------------------------------------------------------------- - * Targ_FmtTime -- - * Format a modification time in some reasonable way and return it. - * - * Results: - * The time reformatted. - * - * Side Effects: - * The time is placed in a static area, so it is overwritten - * with each call. - * - *----------------------------------------------------------------------- +void +Targ_PrintCmds(GNode *gn) +{ + StringListNode *ln; + + for (ln = gn->commands.first; ln != NULL; ln = ln->next) { + const char *cmd = ln->datum; + debug_printf("\t%s\n", cmd); + } +} + +/* + * Format a modification time in some reasonable way and return it. + * The formatted time is placed in a static area, so it is overwritten + * with each call. */ -char * +const char * Targ_FmtTime(time_t tm) { - struct tm *parts; - static char buf[128]; + static char buf[128]; - parts = localtime(&tm); - (void)strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts); - return(buf); + struct tm *parts = localtime(&tm); + (void)strftime(buf, sizeof buf, "%k:%M:%S %b %d, %Y", parts); + return buf; } -/*- - *----------------------------------------------------------------------- - * Targ_PrintType -- - * Print out a type field giving only those attributes the user can - * set. - * - * Results: - * - * Side Effects: - * - *----------------------------------------------------------------------- - */ +/* Print out a type field giving only those attributes the user can set. */ void Targ_PrintType(int type) { - int tbit; + int tbit; -#define PRINTBIT(attr) case CONCAT(OP_,attr): fprintf(debug_file, "." #attr " "); break -#define PRINTDBIT(attr) case CONCAT(OP_,attr): if (DEBUG(TARG))fprintf(debug_file, "." #attr " "); break + type &= ~OP_OPMASK; - type &= ~OP_OPMASK; + while (type != 0) { + tbit = 1 << (ffs(type) - 1); + type &= ~tbit; - while (type) { - tbit = 1 << (ffs(type) - 1); - type &= ~tbit; - - switch(tbit) { - PRINTBIT(OPTIONAL); - PRINTBIT(USE); - PRINTBIT(EXEC); - PRINTBIT(IGNORE); - PRINTBIT(PRECIOUS); - PRINTBIT(SILENT); - PRINTBIT(MAKE); - PRINTBIT(JOIN); - PRINTBIT(INVISIBLE); - PRINTBIT(NOTMAIN); - PRINTDBIT(LIB); - /*XXX: MEMBER is defined, so CONCAT(OP_,MEMBER) gives OP_"%" */ - case OP_MEMBER: if (DEBUG(TARG))fprintf(debug_file, ".MEMBER "); break; - PRINTDBIT(ARCHV); - PRINTDBIT(MADE); - PRINTDBIT(PHONY); + switch (tbit) { +#define PRINTBIT(bit, attr) case bit: debug_printf(" " attr); break +#define PRINTDBIT(bit, attr) case bit: DEBUG0(TARG, " " attr); break + PRINTBIT(OP_OPTIONAL, ".OPTIONAL"); + PRINTBIT(OP_USE, ".USE"); + PRINTBIT(OP_EXEC, ".EXEC"); + PRINTBIT(OP_IGNORE, ".IGNORE"); + PRINTBIT(OP_PRECIOUS, ".PRECIOUS"); + PRINTBIT(OP_SILENT, ".SILENT"); + PRINTBIT(OP_MAKE, ".MAKE"); + PRINTBIT(OP_JOIN, ".JOIN"); + PRINTBIT(OP_INVISIBLE, ".INVISIBLE"); + PRINTBIT(OP_NOTMAIN, ".NOTMAIN"); + PRINTDBIT(OP_LIB, ".LIB"); + PRINTDBIT(OP_MEMBER, ".MEMBER"); + PRINTDBIT(OP_ARCHV, ".ARCHV"); + PRINTDBIT(OP_MADE, ".MADE"); + PRINTDBIT(OP_PHONY, ".PHONY"); +#undef PRINTBIT +#undef PRINTDBIT + } + } +} + +const char * +GNodeMade_Name(GNodeMade made) +{ + switch (made) { + case UNMADE: return "unmade"; + case DEFERRED: return "deferred"; + case REQUESTED: return "requested"; + case BEINGMADE: return "being made"; + case MADE: return "made"; + case UPTODATE: return "up-to-date"; + case ERROR: return "error when made"; + case ABORTED: return "aborted"; + default: return "unknown enum_made value"; } - } } static const char * -made_name(enum enum_made made) +GNode_OpName(const GNode *gn) { - switch (made) { - case UNMADE: return "unmade"; - case DEFERRED: return "deferred"; - case REQUESTED: return "requested"; - case BEINGMADE: return "being made"; - case MADE: return "made"; - case UPTODATE: return "up-to-date"; - case ERROR: return "error when made"; - case ABORTED: return "aborted"; - default: return "unknown enum_made value"; - } -} - -/*- - *----------------------------------------------------------------------- - * TargPrintNode -- - * print the contents of a node - *----------------------------------------------------------------------- - */ -int -Targ_PrintNode(void *gnp, void *passp) -{ - GNode *gn = (GNode *)gnp; - int pass = passp ? *(int *)passp : 0; - - fprintf(debug_file, "# %s%s, flags %x, type %x, made %d\n", - gn->name, gn->cohort_num, gn->flags, gn->type, gn->made); - if (gn->flags == 0) - return 0; - - if (!OP_NOP(gn->type)) { - fprintf(debug_file, "#\n"); - if (gn == mainTarg) { - fprintf(debug_file, "# *** MAIN TARGET ***\n"); - } - if (pass >= 2) { - if (gn->unmade) { - fprintf(debug_file, "# %d unmade children\n", gn->unmade); - } else { - fprintf(debug_file, "# No unmade children\n"); - } - if (! (gn->type & (OP_JOIN|OP_USE|OP_USEBEFORE|OP_EXEC))) { - if (gn->mtime != 0) { - fprintf(debug_file, "# last modified %s: %s\n", - Targ_FmtTime(gn->mtime), - made_name(gn->made)); - } else if (gn->made != UNMADE) { - fprintf(debug_file, "# non-existent (maybe): %s\n", - made_name(gn->made)); - } else { - fprintf(debug_file, "# unmade\n"); - } - } - if (!Lst_IsEmpty (gn->iParents)) { - fprintf(debug_file, "# implicit parents: "); - Lst_ForEach(gn->iParents, TargPrintName, NULL); - fprintf(debug_file, "\n"); - } - } else { - if (gn->unmade) - fprintf(debug_file, "# %d unmade children\n", gn->unmade); - } - if (!Lst_IsEmpty (gn->parents)) { - fprintf(debug_file, "# parents: "); - Lst_ForEach(gn->parents, TargPrintName, NULL); - fprintf(debug_file, "\n"); - } - if (!Lst_IsEmpty (gn->order_pred)) { - fprintf(debug_file, "# order_pred: "); - Lst_ForEach(gn->order_pred, TargPrintName, NULL); - fprintf(debug_file, "\n"); - } - if (!Lst_IsEmpty (gn->order_succ)) { - fprintf(debug_file, "# order_succ: "); - Lst_ForEach(gn->order_succ, TargPrintName, NULL); - fprintf(debug_file, "\n"); - } - - fprintf(debug_file, "%-16s", gn->name); switch (gn->type & OP_OPMASK) { - case OP_DEPENDS: - fprintf(debug_file, ": "); break; - case OP_FORCE: - fprintf(debug_file, "! "); break; - case OP_DOUBLEDEP: - fprintf(debug_file, ":: "); break; + case OP_DEPENDS: + return ":"; + case OP_FORCE: + return "!"; + case OP_DOUBLEDEP: + return "::"; } - Targ_PrintType(gn->type); - Lst_ForEach(gn->children, TargPrintName, NULL); - fprintf(debug_file, "\n"); - Lst_ForEach(gn->commands, Targ_PrintCmd, NULL); - fprintf(debug_file, "\n\n"); - if (gn->type & OP_DOUBLEDEP) { - Lst_ForEach(gn->cohorts, Targ_PrintNode, &pass); - } - } - return (0); + return ""; } -/*- - *----------------------------------------------------------------------- - * TargPrintOnlySrc -- - * Print only those targets that are just a source. - * - * Results: - * 0. - * - * Side Effects: - * The name of each file is printed preceded by #\t - * - *----------------------------------------------------------------------- - */ -static int -TargPrintOnlySrc(void *gnp, void *dummy MAKE_ATTR_UNUSED) +/* Print the contents of a node. */ +void +Targ_PrintNode(GNode *gn, int pass) { - GNode *gn = (GNode *)gnp; - if (!OP_NOP(gn->type)) - return 0; + debug_printf("# %s%s", gn->name, gn->cohort_num); + GNode_FprintDetails(opts.debug_file, ", ", gn, "\n"); + if (gn->flags == 0) + return; - fprintf(debug_file, "#\t%s [%s] ", - gn->name, gn->path ? gn->path : gn->name); - Targ_PrintType(gn->type); - fprintf(debug_file, "\n"); + if (!GNode_IsTarget(gn)) + return; - return 0; + debug_printf("#\n"); + if (gn == mainTarg) + debug_printf("# *** MAIN TARGET ***\n"); + + if (pass >= 2) { + if (gn->unmade > 0) + debug_printf("# %d unmade children\n", gn->unmade); + else + debug_printf("# No unmade children\n"); + if (!(gn->type & (OP_JOIN | OP_USE | OP_USEBEFORE | OP_EXEC))) { + if (gn->mtime != 0) { + debug_printf("# last modified %s: %s\n", + Targ_FmtTime(gn->mtime), + GNodeMade_Name(gn->made)); + } else if (gn->made != UNMADE) { + debug_printf("# nonexistent (maybe): %s\n", + GNodeMade_Name(gn->made)); + } else + debug_printf("# unmade\n"); + } + PrintNodeNamesLine("implicit parents", &gn->implicitParents); + } else { + if (gn->unmade != 0) + debug_printf("# %d unmade children\n", gn->unmade); + } + + PrintNodeNamesLine("parents", &gn->parents); + PrintNodeNamesLine("order_pred", &gn->order_pred); + PrintNodeNamesLine("order_succ", &gn->order_succ); + + debug_printf("%-16s%s", gn->name, GNode_OpName(gn)); + Targ_PrintType(gn->type); + PrintNodeNames(&gn->children); + debug_printf("\n"); + Targ_PrintCmds(gn); + debug_printf("\n\n"); + if (gn->type & OP_DOUBLEDEP) + Targ_PrintNodes(&gn->cohorts, pass); } -/*- - *----------------------------------------------------------------------- - * Targ_PrintGraph -- - * print the entire graph. heh heh - * +void +Targ_PrintNodes(GNodeList *gnodes, int pass) +{ + GNodeListNode *ln; + + for (ln = gnodes->first; ln != NULL; ln = ln->next) + Targ_PrintNode(ln->datum, pass); +} + +/* Print only those targets that are just a source. */ +static void +PrintOnlySources(void) +{ + GNodeListNode *ln; + + for (ln = allTargets.first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + if (GNode_IsTarget(gn)) + continue; + + debug_printf("#\t%s [%s]", gn->name, GNode_Path(gn)); + Targ_PrintType(gn->type); + debug_printf("\n"); + } +} + +/* * Input: - * pass Which pass this is. 1 => no processing - * 2 => processing done - * - * Results: - * none - * - * Side Effects: - * lots o' output - *----------------------------------------------------------------------- + * pass 1 => before processing + * 2 => after processing + * 3 => after processing, an error occurred */ void Targ_PrintGraph(int pass) { - fprintf(debug_file, "#*** Input graph:\n"); - Lst_ForEach(allTargets, Targ_PrintNode, &pass); - fprintf(debug_file, "\n\n"); - fprintf(debug_file, "#\n# Files that are only sources:\n"); - Lst_ForEach(allTargets, TargPrintOnlySrc, NULL); - fprintf(debug_file, "#*** Global Variables:\n"); - Var_Dump(VAR_GLOBAL); - fprintf(debug_file, "#*** Command-line Variables:\n"); - Var_Dump(VAR_CMD); - fprintf(debug_file, "\n"); - Dir_PrintDirectories(); - fprintf(debug_file, "\n"); - Suff_PrintAll(); + debug_printf("#*** Input graph:\n"); + Targ_PrintNodes(&allTargets, pass); + debug_printf("\n"); + debug_printf("\n"); + + debug_printf("#\n"); + debug_printf("# Files that are only sources:\n"); + PrintOnlySources(); + + debug_printf("#*** Global Variables:\n"); + Var_Dump(SCOPE_GLOBAL); + + debug_printf("#*** Command-line Variables:\n"); + Var_Dump(SCOPE_CMDLINE); + + debug_printf("\n"); + Dir_PrintDirectories(); + debug_printf("\n"); + + Suff_PrintAll(); } -/*- - *----------------------------------------------------------------------- - * TargPropagateNode -- - * Propagate information from a single node to related nodes if - * appropriate. +/* + * Propagate some type information to cohort nodes (those from the '::' + * dependency operator). * - * Input: - * gnp The node that we are processing. - * - * Results: - * Always returns 0, for the benefit of Lst_ForEach(). - * - * Side Effects: - * Information is propagated from this node to cohort or child - * nodes. - * - * If the node was defined with "::", then TargPropagateCohort() - * will be called for each cohort node. - * - * If the node has recursive predecessors, then - * TargPropagateRecpred() will be called for each recursive - * predecessor. - *----------------------------------------------------------------------- - */ -static int -TargPropagateNode(void *gnp, void *junk MAKE_ATTR_UNUSED) -{ - GNode *gn = (GNode *)gnp; - - if (gn->type & OP_DOUBLEDEP) - Lst_ForEach(gn->cohorts, TargPropagateCohort, gnp); - return (0); -} - -/*- - *----------------------------------------------------------------------- - * TargPropagateCohort -- - * Propagate some bits in the type mask from a node to - * a related cohort node. - * - * Input: - * cnp The node that we are processing. - * gnp Another node that has cnp as a cohort. - * - * Results: - * Always returns 0, for the benefit of Lst_ForEach(). - * - * Side Effects: - * cnp's type bitmask is modified to incorporate some of the - * bits from gnp's type bitmask. (XXX need a better explanation.) - *----------------------------------------------------------------------- - */ -static int -TargPropagateCohort(void *cgnp, void *pgnp) -{ - GNode *cgn = (GNode *)cgnp; - GNode *pgn = (GNode *)pgnp; - - cgn->type |= pgn->type & ~OP_OPMASK; - return (0); -} - -/*- - *----------------------------------------------------------------------- - * Targ_Propagate -- - * Propagate information between related nodes. Should be called - * after the makefiles are parsed but before any action is taken. - * - * Results: - * none - * - * Side Effects: - * Information is propagated between related nodes throughout the - * graph. - *----------------------------------------------------------------------- + * Should be called after the makefiles are parsed but before any action is + * taken. */ void Targ_Propagate(void) { - Lst_ForEach(allTargets, TargPropagateNode, NULL); + GNodeListNode *ln, *cln; + + for (ln = allTargets.first; ln != NULL; ln = ln->next) { + GNode *gn = ln->datum; + GNodeType type = gn->type; + + if (!(type & OP_DOUBLEDEP)) + continue; + + for (cln = gn->cohorts.first; cln != NULL; cln = cln->next) { + GNode *cohort = cln->datum; + + cohort->type |= type & ~OP_OPMASK; + } + } } diff --git a/usr.bin/make/test-variants.sh b/usr.bin/make/test-variants.sh new file mode 100644 index 000000000..01a7759b0 --- /dev/null +++ b/usr.bin/make/test-variants.sh @@ -0,0 +1,196 @@ +#! /bin/sh +# $NetBSD: test-variants.sh,v 1.9 2021/02/15 07:42:35 rillig Exp $ +# +# Build several variants of make and run the tests on them. +# +# The output of this test suite must be inspected manually to see the +# interesting details. The main purpose is to list the available build +# options. + +set -eu + +failed="no" + +fail() { + echo "failed" + failed="yes" +} + +testcase() { + echo "===> Running $*" + + env -i PATH="$PATH" USETOOLS="no" "$@" \ + sh -ce "make -s cleandir" \ + && env -i PATH="$PATH" USETOOLS="no" "$@" \ + sh -ce "make -ks all" \ + && size *.o make \ + && env -i PATH="$PATH" USETOOLS="no" MALLOC_OPTIONS="JA" \ + _MKMSG_TEST=":" "$@" \ + sh -ce "make -s test" \ + || fail +} + + +testcase # just the plain default options + +# See whether the Boolean type is only used as a single-bit type. +# By default it is aliased to int, and int is already used for any other +# purpose. +# +testcase USER_CPPFLAGS="-DUSE_DOUBLE_BOOLEAN" + +# Ensure that variables of type Boolean are not assigned integers. +# The only valid values are TRUE and FALSE. +# +testcase USER_CPPFLAGS="-DUSE_UCHAR_BOOLEAN" + +# Ensure that variables of type Boolean are not used as array index. +# +testcase USER_CPPFLAGS="-DUSE_CHAR_BOOLEAN" + +# Try a different compiler, with slightly different warnings and error +# messages. One feature that is missing from GCC is a little stricter +# checks for enums. +# +testcase HAVE_LLVM="yes" + +testcase USE_GCC8="yes" + +testcase USE_GCC9="yes" + +testcase USE_GCC10="yes" GCC10BASE="$HOME/pkg/gcc10" + +# for selecting emalloc +testcase TOOLDIR="" + +testcase USE_FILEMON="dev" + +testcase USE_FILEMON="ktrace" + +testcase USE_META="no" + +testcase USER_CPPFLAGS="-DCLEANUP" + +testcase USER_CPPFLAGS="-DDEBUG_REFCNT" + +testcase USER_CPPFLAGS="-DDEBUG_HASH_LOOKUP" + +testcase USER_CPPFLAGS="-DDEBUG_META_MODE" + +testcase USER_CPPFLAGS="-DDEBUG_REALPATH_CACHE" + +# Produces lots of debugging output. +# +#testcase USER_CPPFLAGS="-DDEBUG_SRC" + +#testcase USER_CPPFLAGS="-UGMAKEEXPORT" + +# NetBSD 8.0 x86_64 +# In file included from arch.c:135:0: +# /usr/include/sys/param.h:357:0: error: "MAXPATHLEN" redefined [-Werror] +# #define MAXPATHLEN PATH_MAX +#testcase USER_CPPFLAGS="-DMAXPATHLEN=20" + +# In this variant, the unit tests that use the :C modifier obviously fail. +# +testcase USER_CPPFLAGS="-DNO_REGEX" + +# NetBSD 8.0 x86_64 says: +# In file included from /usr/include/sys/param.h:115:0, +# from arch.c:135: +# /usr/include/sys/syslimits.h:60:0: error: "PATH_MAX" redefined [-Werror] +# #define PATH_MAX 1024 /* max bytes in pathname */ +#testcase USER_CPPFLAGS="-DPATH_MAX=20" + +# config.h:124:0: error: "POSIX" redefined [-Werror] +#testcase USER_CPPFLAGS="-DPOSIX" + +# config.h:115:0: error: "RECHECK" redefined [-Werror] +#testcase USER_CPPFLAGS="-DRECHECK" + +# This higher optimization level may trigger additional "may be used +# uninitialized" errors. Could be combined with other compilers as well. +# +testcase USER_CFLAGS="-O3" + +testcase USER_CFLAGS="-O0 -ggdb" + +# The make source code is _intended_ to be compatible with C90. +# It uses some C99 features though. +# To really port it to C90, it would have to be in a C90 environment +# in which the system headers don't aggressively depend on C99. +# +# NetBSD 8.0 x86_64: +# /usr/include/sys/cdefs.h:618:22: error: ISO C90 does not support 'long long' [-Werror=long-long] +# /usr/include/sys/endian.h:205:1: error: use of C99 long long integer constant [-Werror=long-long] +# /usr/include/pthread_types.h:128:3: error: ISO C90 doesn't support unnamed structs/unions [-Werror=pedantic] +# var.c:3027:2: error: initializer element is not computable at load time [-Werror=pedantic] +# var.c:2532:5: error: ISO C does not support '__PRETTY_FUNCTION__' predefined identifier [-Werror=pedantic] +# var.c:1574:15: error: ISO C90 does not support the 'z' gnu_printf length modifier [-Werror=format=] +# var.c:137:33: error: anonymous variadic macros were introduced in C99 [-Werror=variadic-macros] +# parse.c:2473:22: error: format '%p' expects argument of type 'void *', but argument 7 has type 'char * (*)(void *, size_t *) {aka char * (*)(void *, long unsigned int *)}' [-Werror=format=] +# +#testcase USER_CFLAGS="-std=c90 -ansi -pedantic" USER_CPPFLAGS="-Dinline=" + +# Ensure that every inline function is declared as MAKE_ATTR_UNUSED. +testcase USER_CPPFLAGS="-Dinline=" + +testcase USER_CFLAGS="-std=c90" USER_CPPFLAGS="-Dinline=" + +#testcase USER_CFLAGS="-std=c90 -pedantic" USER_CPPFLAGS="-Dinline=" + +testcase USER_CFLAGS="-ansi" USER_CPPFLAGS="-Dinline=" + +# config.h does not allow overriding these features +#testcase USER_CPPFLAGS="-UUSE_IOVEC" + +# Ensure that there are only side-effect-free conditions in the assert +# macro, or at least none that affect the outcome of the tests. +# +testcase USER_CPPFLAGS="-DNDEBUG" + +# Only in native mode, make dares to use a shortcut in Compat_RunCommand +# that circumvents the shell and instead calls execvp directly. +# Another effect is that the shell is run with -q, which prevents the +# -x and -v flags from echoing the commands from profile files. +testcase USER_CPPFLAGS="-UMAKE_NATIVE -DHAVE_STRERROR -DHAVE_SETENV -DHAVE_VSNPRINTF" + +# Running the code coverage using gcov takes a long time. Most of this +# time is spent in gcov_read_unsigned because gcov_open sets the .gcda +# file to unbuffered, which means that every single byte needs its own +# system call to be read. +# +# Combining USE_COVERAGE with USE_GCC10 or HAVE_LLVM does not work since +# these fail to link with the coverage library. +# +# Turning the optimization off is required because of: +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96622 +# +#testcase USE_COVERAGE="yes" USER_CFLAGS="-O0 -ggdb" + +testcase USE_FORT="yes" + +# Ensure that the tests can be specified either as relative filenames or +# as absolute filenames. +testcase USE_ABSOLUTE_TESTNAMES="yes" + +# This test is the result of reading through the GCC "Warning Options" +# documentation, noting down everything that sounded interesting. +# +testcase USE_GCC10=yes GCC10BASE=$HOME/pkg/gcc10 USER_CFLAGS="\ +-Wmisleading-indentation -Wmissing-attributes -Wmissing-braces \ +-Wextra -Wnonnull -Wnonnull-compare -Wnull-dereference -Wimplicit \ +-Wimplicit-fallthrough=4 -Wignored-qualifiers -Wunused \ +-Wunused-but-set-variable -Wunused-parameter -Wduplicated-branches \ +-Wduplicated-cond -Wunused-macros -Wcast-function-type -Wconversion \ +-Wenum-compare -Wmissing-field-initializers -Wredundant-decls \ +-Wno-error=conversion -Wno-error=sign-conversion -Wno-error=unused-macros \ +-Wno-error=unused-parameter -Wno-error=duplicated-branches" + +for shell in /usr/pkg/bin/bash /usr/pkg/bin/dash; do + if [ -x "$shell" ]; then + testcase USER_CPPFLAGS=-DDEFSHELL_CUSTOM="\\\"$shell\\\"" + fi +done + +test "$failed" = "no" diff --git a/usr.bin/make/trace.c b/usr.bin/make/trace.c index 267177ff5..840c7995e 100644 --- a/usr.bin/make/trace.c +++ b/usr.bin/make/trace.c @@ -1,6 +1,6 @@ -/* $NetBSD: trace.c,v 1.11 2008/12/28 18:31:51 christos Exp $ */ +/* $NetBSD: trace.c,v 1.28 2021/02/05 05:15:12 rillig Exp $ */ -/*- +/* * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * @@ -29,17 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: trace.c,v 1.11 2008/12/28 18:31:51 christos Exp $"; -#else -#include -#ifndef lint -__RCSID("$NetBSD: trace.c,v 1.11 2008/12/28 18:31:51 christos Exp $"); -#endif /* not lint */ -#endif - -/*- +/* * trace.c -- * handle logging of trace events generated by various parts of make. * @@ -54,16 +44,15 @@ __RCSID("$NetBSD: trace.c,v 1.11 2008/12/28 18:31:51 christos Exp $"); #include -#include -#include - #include "make.h" #include "job.h" #include "trace.h" +MAKE_RCSID("$NetBSD: trace.c,v 1.28 2021/02/05 05:15:12 rillig Exp $"); + static FILE *trfile; static pid_t trpid; -char *trwd; +const char *trwd; static const char *evname[] = { "BEG", @@ -77,10 +66,13 @@ static const char *evname[] = { void Trace_Init(const char *pathname) { - char *p1; if (pathname != NULL) { + FStr curDir; trpid = getpid(); - trwd = Var_Value(".CURDIR", VAR_GLOBAL, &p1); + /* XXX: This variable may get overwritten later, which + * would make trwd point to undefined behavior. */ + curDir = Var_Value(SCOPE_GLOBAL, ".CURDIR"); + trwd = curDir.str; trfile = fopen(pathname, "a"); } @@ -90,7 +82,7 @@ void Trace_Log(TrEvent event, Job *job) { struct timeval rightnow; - + if (trfile == NULL) return; @@ -101,8 +93,11 @@ Trace_Log(TrEvent event, Job *job) jobTokensRunning, evname[event], trpid, trwd); if (job != NULL) { - fprintf(trfile, " %s %d %x %x", job->node->name, - job->pid, job->flags, job->node->type); + char flags[4]; + + Job_FlagsToString(job, flags, sizeof flags); + fprintf(trfile, " %s %d %s %x", job->node->name, + job->pid, flags, job->node->type); } fputc('\n', trfile); fflush(trfile); diff --git a/usr.bin/make/trace.h b/usr.bin/make/trace.h index dc0fc6cc4..063fb26ab 100644 --- a/usr.bin/make/trace.h +++ b/usr.bin/make/trace.h @@ -1,6 +1,6 @@ -/* $NetBSD: trace.h,v 1.3 2008/04/28 20:24:14 martin Exp $ */ +/* $NetBSD: trace.h,v 1.6 2021/01/19 20:51:46 rillig Exp $ */ -/*- +/* * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * @@ -29,12 +29,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ -/*- +/* * trace.h -- * Definitions pertaining to the tracing of jobs in parallel mode. */ -typedef enum { +#ifndef MAKE_TRACE_H +#define MAKE_TRACE_H + +typedef enum TrEvent { MAKESTART, MAKEEND, MAKEERROR, @@ -47,3 +50,4 @@ void Trace_Init(const char *); void Trace_Log(TrEvent, Job *); void Trace_End(void); +#endif diff --git a/usr.bin/make/unit-tests/.cvsignore b/usr.bin/make/unit-tests/.cvsignore new file mode 100644 index 000000000..4927bd25b --- /dev/null +++ b/usr.bin/make/unit-tests/.cvsignore @@ -0,0 +1,3 @@ +*.out +*.rawout +*.status diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index 10503b93d..3d0437427 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -1,120 +1,696 @@ -# $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $ +# $NetBSD: Makefile,v 1.273 2021/03/14 11:49:37 rillig Exp $ # # Unit tests for make(1) -# The main targets are: -# -# all: run all the tests -# test: run 'all', and compare to expected results -# accept: move generated output to expected results # -# Adding a test case. +# The main targets are: +# +# all: +# run all the tests +# test: +# run 'all', and compare to expected results +# accept: +# move generated output to expected results +# +# Settable variables +# +# TEST_MAKE +# The make program to be tested. +# +# +# Adding a test case +# # Each feature should get its own set of tests in its own suitably # named makefile (*.mk), with its own set of expected results (*.exp), -# and it should be added to the TESTNAMES list. -# +# and it should be added to the TESTS list. +# +# Any added files must also be added to src/distrib/sets/lists/tests/mi. +# To do that, just run "make sync-mi" in this directory. +# +# A few *.mk files are helper files for other tests (such as include-sub.mk) +# and are thus not added to TESTS. Such files must be ignored in +# src/tests/usr.bin/make/t_make.sh. +# .MAIN: all -UNIT_TESTS:= ${.PARSEDIR} -.PATH: ${UNIT_TESTS} +# we use these below but we might be an older make +.MAKE.OS?= ${uname -s:L:sh} +.MAKE.UID?= ${id -u:L:sh} # Each test is in a sub-makefile. # Keep the list sorted. -TESTNAMES= \ - comment \ - cond1 \ - cond2 \ - error \ - export \ - export-all \ - export-env \ - doterror \ - dotwait \ - forloop \ - forsubst \ - hash \ - misc \ - moderrs \ - modmatch \ - modmisc \ - modorder \ - modts \ - modword \ - order \ - posix \ - qequals \ - sunshcmd \ - sysv \ - ternary \ - unexport \ - unexport-env \ - varcmd \ - varmisc \ - varshell +# Any test that is commented out must be ignored in +# src/tests/usr.bin/make/t_make.sh as well. +TESTS+= archive +TESTS+= archive-suffix +TESTS+= cmd-errors +TESTS+= cmd-errors-jobs +TESTS+= cmd-errors-lint +TESTS+= cmd-interrupt +TESTS+= cmdline +TESTS+= cmdline-redirect-stdin +TESTS+= cmdline-undefined +TESTS+= comment +TESTS+= compat-error +TESTS+= cond-cmp-numeric +TESTS+= cond-cmp-numeric-eq +TESTS+= cond-cmp-numeric-ge +TESTS+= cond-cmp-numeric-gt +TESTS+= cond-cmp-numeric-le +TESTS+= cond-cmp-numeric-lt +TESTS+= cond-cmp-numeric-ne +TESTS+= cond-cmp-string +TESTS+= cond-cmp-unary +TESTS+= cond-eof +TESTS+= cond-func +TESTS+= cond-func-commands +TESTS+= cond-func-defined +TESTS+= cond-func-empty +TESTS+= cond-func-exists +TESTS+= cond-func-make +TESTS+= cond-func-make-main +TESTS+= cond-func-target +TESTS+= cond-late +TESTS+= cond-op +TESTS+= cond-op-and +TESTS+= cond-op-and-lint +TESTS+= cond-op-not +TESTS+= cond-op-or +TESTS+= cond-op-or-lint +TESTS+= cond-op-parentheses +TESTS+= cond-short +TESTS+= cond-token-number +TESTS+= cond-token-plain +TESTS+= cond-token-string +TESTS+= cond-token-var +TESTS+= cond-undef-lint +TESTS+= cond1 +TESTS+= counter +TESTS+= counter-append +TESTS+= dep +TESTS+= dep-colon +TESTS+= dep-colon-bug-cross-file +TESTS+= dep-double-colon +TESTS+= dep-double-colon-indep +TESTS+= dep-exclam +TESTS+= dep-none +TESTS+= dep-percent +TESTS+= dep-var +TESTS+= dep-wildcards +TESTS+= depsrc +TESTS+= depsrc-end +TESTS+= depsrc-exec +TESTS+= depsrc-ignore +TESTS+= depsrc-made +TESTS+= depsrc-make +TESTS+= depsrc-meta +TESTS+= depsrc-nometa +TESTS+= depsrc-nometa_cmp +TESTS+= depsrc-nopath +TESTS+= depsrc-notmain +TESTS+= depsrc-optional +TESTS+= depsrc-phony +TESTS+= depsrc-precious +TESTS+= depsrc-recursive +TESTS+= depsrc-silent +TESTS+= depsrc-use +TESTS+= depsrc-usebefore +TESTS+= depsrc-usebefore-double-colon +TESTS+= depsrc-wait +TESTS+= deptgt +TESTS+= deptgt-begin +TESTS+= deptgt-begin-fail +TESTS+= deptgt-begin-fail-indirect +TESTS+= deptgt-default +TESTS+= deptgt-delete_on_error +TESTS+= deptgt-end +TESTS+= deptgt-end-fail +TESTS+= deptgt-end-fail-all +TESTS+= deptgt-end-fail-indirect +TESTS+= deptgt-end-jobs +TESTS+= deptgt-error +TESTS+= deptgt-ignore +TESTS+= deptgt-interrupt +TESTS+= deptgt-main +TESTS+= deptgt-makeflags +TESTS+= deptgt-no_parallel +TESTS+= deptgt-nopath +TESTS+= deptgt-notparallel +TESTS+= deptgt-objdir +TESTS+= deptgt-order +TESTS+= deptgt-path +TESTS+= deptgt-path-suffix +TESTS+= deptgt-phony +TESTS+= deptgt-precious +TESTS+= deptgt-shell +TESTS+= deptgt-silent +TESTS+= deptgt-stale +TESTS+= deptgt-suffixes +TESTS+= dir +TESTS+= dir-expand-path +TESTS+= directive +TESTS+= directive-dinclude +TESTS+= directive-elif +TESTS+= directive-elifdef +TESTS+= directive-elifmake +TESTS+= directive-elifndef +TESTS+= directive-elifnmake +TESTS+= directive-else +TESTS+= directive-endfor +TESTS+= directive-endif +TESTS+= directive-error +TESTS+= directive-export +TESTS+= directive-export-env +TESTS+= directive-export-impl +TESTS+= directive-export-gmake +TESTS+= directive-export-literal +TESTS+= directive-for +TESTS+= directive-for-errors +TESTS+= directive-for-escape +TESTS+= directive-for-generating-endif +TESTS+= directive-for-lines +TESTS+= directive-for-null +TESTS+= directive-hyphen-include +TESTS+= directive-if +TESTS+= directive-if-nested +TESTS+= directive-ifdef +TESTS+= directive-ifmake +TESTS+= directive-ifndef +TESTS+= directive-ifnmake +TESTS+= directive-include +TESTS+= directive-include-fatal +TESTS+= directive-info +TESTS+= directive-misspellings +TESTS+= directive-sinclude +TESTS+= directive-undef +TESTS+= directive-unexport +TESTS+= directive-unexport-env +TESTS+= directive-warning +TESTS+= dollar +TESTS+= doterror +TESTS+= dotwait +TESTS+= envfirst +TESTS+= error +TESTS+= # escape # broken by reverting POSIX changes +TESTS+= export +TESTS+= export-all +TESTS+= export-env +TESTS+= export-variants +TESTS+= forloop +TESTS+= forsubst +TESTS+= gnode-submake +TESTS+= hanoi-include +TESTS+= impsrc +TESTS+= include-main +TESTS+= job-flags +TESTS+= job-output-long-lines +TESTS+= jobs-empty-commands +TESTS+= jobs-error-indirect +TESTS+= jobs-error-nested +TESTS+= jobs-error-nested-make +TESTS+= lint +TESTS+= make-exported +TESTS+= meta-cmd-cmp +TESTS+= moderrs +TESTS+= modmatch +TESTS+= modmisc +TESTS+= modts +TESTS+= modword +.if ${.MAKE.UID} > 0 +TESTS+= objdir-writable +.endif +TESTS+= opt +TESTS+= opt-backwards +TESTS+= opt-chdir +TESTS+= opt-debug +TESTS+= opt-debug-all +TESTS+= opt-debug-archive +TESTS+= opt-debug-curdir +TESTS+= opt-debug-cond +TESTS+= opt-debug-dir +TESTS+= opt-debug-errors +TESTS+= opt-debug-file +TESTS+= opt-debug-for +TESTS+= opt-debug-graph1 +TESTS+= opt-debug-graph2 +TESTS+= opt-debug-graph3 +TESTS+= opt-debug-hash +TESTS+= opt-debug-jobs +TESTS+= opt-debug-lint +TESTS+= opt-debug-loud +TESTS+= opt-debug-meta +TESTS+= opt-debug-making +TESTS+= opt-debug-no-rm +TESTS+= opt-debug-parse +TESTS+= opt-debug-suff +TESTS+= opt-debug-targets +TESTS+= opt-debug-varraw +TESTS+= opt-debug-var +TESTS+= opt-debug-x-trace +TESTS+= opt-define +TESTS+= opt-env +TESTS+= opt-file +TESTS+= opt-ignore +TESTS+= opt-include-dir +TESTS+= opt-jobs +TESTS+= opt-jobs-internal +TESTS+= opt-jobs-no-action +TESTS+= opt-keep-going +TESTS+= opt-keep-going-multiple +TESTS+= opt-m-include-dir +TESTS+= opt-no-action +TESTS+= opt-no-action-at-all +TESTS+= opt-no-action-runflags +TESTS+= opt-no-action-touch +TESTS+= opt-query +TESTS+= opt-raw +TESTS+= opt-silent +TESTS+= opt-touch +TESTS+= opt-touch-jobs +TESTS+= opt-tracefile +TESTS+= opt-var-expanded +TESTS+= opt-var-literal +TESTS+= opt-warnings-as-errors +TESTS+= opt-where-am-i +TESTS+= opt-x-reduce-exported +TESTS+= order +TESTS+= parse-var +TESTS+= phony-end +TESTS+= posix +TESTS+= # posix1 # broken by reverting POSIX changes +TESTS+= recursive +TESTS+= sh +TESTS+= sh-dots +TESTS+= sh-errctl +TESTS+= sh-flags +TESTS+= sh-jobs +TESTS+= sh-jobs-error +TESTS+= sh-leading-at +TESTS+= sh-leading-hyphen +TESTS+= sh-leading-plus +TESTS+= sh-meta-chars +TESTS+= sh-multi-line +TESTS+= sh-single-line +TESTS+= shell-csh +TESTS+= shell-custom +TESTS+= shell-ksh +TESTS+= shell-sh +TESTS+= suff-add-later +TESTS+= suff-clear-regular +TESTS+= suff-clear-single +TESTS+= suff-incomplete +TESTS+= suff-lookup +TESTS+= suff-main +TESTS+= suff-main-several +TESTS+= suff-phony +TESTS+= suff-rebuild +TESTS+= suff-self +TESTS+= suff-transform-debug +TESTS+= suff-transform-endless +TESTS+= suff-transform-expand +TESTS+= suff-transform-select +TESTS+= sunshcmd +TESTS+= ternary +TESTS+= unexport +TESTS+= unexport-env +TESTS+= use-inference +TESTS+= var-class +TESTS+= var-class-cmdline +TESTS+= var-class-env +TESTS+= var-class-global +TESTS+= var-class-local +TESTS+= var-class-local-legacy +TESTS+= var-eval-short +TESTS+= var-op +TESTS+= var-op-append +TESTS+= var-op-assign +TESTS+= var-op-default +TESTS+= var-op-expand +TESTS+= var-op-shell +TESTS+= var-op-sunsh +TESTS+= var-recursive +TESTS+= varcmd +TESTS+= vardebug +TESTS+= varfind +TESTS+= varmisc +TESTS+= varmod +TESTS+= varmod-assign +TESTS+= varmod-defined +TESTS+= varmod-edge +TESTS+= varmod-exclam-shell +TESTS+= varmod-extension +TESTS+= varmod-gmtime +TESTS+= varmod-hash +TESTS+= varmod-head +TESTS+= varmod-ifelse +TESTS+= varmod-indirect +TESTS+= varmod-l-name-to-value +TESTS+= varmod-localtime +TESTS+= varmod-loop +TESTS+= varmod-match +TESTS+= varmod-match-escape +TESTS+= varmod-no-match +TESTS+= varmod-order +TESTS+= varmod-order-reverse +TESTS+= varmod-order-shuffle +TESTS+= varmod-path +TESTS+= varmod-quote +TESTS+= varmod-quote-dollar +TESTS+= varmod-range +TESTS+= varmod-remember +TESTS+= varmod-root +TESTS+= varmod-select-words +TESTS+= varmod-shell +TESTS+= varmod-subst +TESTS+= varmod-subst-regex +TESTS+= varmod-sun-shell +TESTS+= varmod-sysv +TESTS+= varmod-tail +TESTS+= varmod-to-abs +TESTS+= varmod-to-lower +TESTS+= varmod-to-many-words +TESTS+= varmod-to-one-word +TESTS+= varmod-to-separator +TESTS+= varmod-to-upper +TESTS+= varmod-undefined +TESTS+= varmod-unique +TESTS+= varname +TESTS+= varname-dollar +TESTS+= varname-dot-alltargets +TESTS+= varname-dot-curdir +TESTS+= varname-dot-includes +TESTS+= varname-dot-includedfromdir +TESTS+= varname-dot-includedfromfile +TESTS+= varname-dot-libs +TESTS+= varname-dot-make-dependfile +TESTS+= varname-dot-make-expand_variables +TESTS+= varname-dot-make-exported +TESTS+= varname-dot-make-jobs +TESTS+= varname-dot-make-jobs-prefix +TESTS+= varname-dot-make-level +TESTS+= varname-dot-make-makefile_preference +TESTS+= varname-dot-make-makefiles +TESTS+= varname-dot-make-meta-bailiwick +TESTS+= varname-dot-make-meta-created +TESTS+= varname-dot-make-meta-files +TESTS+= varname-dot-make-meta-ignore_filter +TESTS+= varname-dot-make-meta-ignore_paths +TESTS+= varname-dot-make-meta-ignore_patterns +TESTS+= varname-dot-make-meta-prefix +TESTS+= varname-dot-make-mode +TESTS+= varname-dot-make-path_filemon +TESTS+= varname-dot-make-pid +TESTS+= varname-dot-make-ppid +TESTS+= varname-dot-make-save_dollars +TESTS+= varname-dot-makeflags +TESTS+= varname-dot-makeoverrides +TESTS+= varname-dot-newline +TESTS+= varname-dot-objdir +TESTS+= varname-dot-parsedir +TESTS+= varname-dot-parsefile +TESTS+= varname-dot-path +TESTS+= varname-dot-shell +TESTS+= varname-dot-targets +TESTS+= varname-empty +TESTS+= varname-make +TESTS+= varname-make_print_var_on_error +TESTS+= varname-make_print_var_on_error-jobs +TESTS+= varname-makefile +TESTS+= varname-makeflags +TESTS+= varname-pwd +TESTS+= varname-vpath +TESTS+= varparse-dynamic +TESTS+= varparse-errors +TESTS+= varparse-mod +TESTS+= varparse-undef-partial +TESTS+= varquote -# these tests were broken by referting POSIX chanegs -STRICT_POSIX_TESTS = \ - escape \ - impsrc \ - phony-end \ - posix1 \ - suffixes +# Ideas for more tests: +# char-0020-space.mk +# char-005C-backslash.mk +# escape-cond-str.mk +# escape-cond-func-arg.mk +# escape-cond-func-arg.mk +# escape-varmod.mk +# escape-varmod-define.mk +# escape-varmod-match.mk +# escape-varname.mk +# escape-varassign-varname.mk +# escape-varassign-varname-cmdline.mk +# escape-varassign-value.mk +# escape-varassign-value-cmdline.mk +# escape-dependency-source.mk +# escape-dependency-target.mk +# escape-for-varname.mk +# escape-for-item.mk +# posix-*.mk (see posix.mk and posix1.mk) -# Override make flags for certain tests -flags.doterror= -flags.order=-j1 +# Additional environment variables for some of the tests. +# The base environment is -i PATH="$PATH". +ENV.depsrc-optional+= TZ=UTC +ENV.envfirst= FROM_ENV=value-from-env +ENV.varmisc= FROM_ENV=env +ENV.varmisc+= FROM_ENV_BEFORE=env +ENV.varmisc+= FROM_ENV_AFTER=env +ENV.varmod-localtime+= TZ=Europe/Berlin +ENV.varname-vpath+= VPATH=varname-vpath.dir:varname-vpath.dir2 -OUTFILES= ${TESTNAMES:S/$/.out/} +# Override make flags for some of the tests; default is -k. +# If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of +# settings FLAGS.test=-dv here, since that is closer to the test code. +FLAGS.cond-func-make= via-cmdline +FLAGS.directive-ifmake= first second +FLAGS.doterror= # none, especially not -k +FLAGS.jobs-error-indirect= # none, especially not -k +FLAGS.jobs-error-nested= # none, especially not -k +FLAGS.jobs-error-nested-make= # none, especially not -k +FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmdline-plain' + +# Some tests need extra postprocessing. +SED_CMDS.dir= ${:D remove output from -DCLEANUP mode } +SED_CMDS.dir+= -e '/^OpenDirs_Done:/d' +SED_CMDS.dir+= -e '/^CachedDir /d' +SED_CMDS.export= -e '/^[^=_A-Za-z0-9]*=/d' +SED_CMDS.export-all= ${SED_CMDS.export} +SED_CMDS.export-env= ${SED_CMDS.export} +SED_CMDS.job-output-long-lines= \ + ${:D Job separators on their own line are ok. } \ + -e '/^--- job-[ab] ---$$/d' \ + ${:D Plain output lines are ok as well. } \ + ${:D They may come in multiples of 1024 or as 10000. } \ + -e '/^aa*$$/d' \ + -e '/^bb*$$/d' \ + ${:D The following lines should rather not occur since the job } \ + ${:D marker should always be at the beginning of the line. } \ + -e '/^aa*--- job-b ---$$/d' \ + -e '/^bb*--- job-a ---$$/d' +SED_CMDS.opt-debug-graph1= ${STD_SED_CMDS.dg1} +SED_CMDS.opt-debug-graph2= ${STD_SED_CMDS.dg2} +SED_CMDS.opt-debug-graph3= ${STD_SED_CMDS.dg3} +SED_CMDS.opt-debug-jobs= -e 's,([0-9][0-9]*),(),' +SED_CMDS.opt-debug-jobs+= -e 's,pid [0-9][0-9]*,pid ,' +SED_CMDS.opt-debug-jobs+= -e 's,Process [0-9][0-9]*,Process ,' +SED_CMDS.opt-debug-jobs+= -e 's,JobFinish: [0-9][0-9]*,JobFinish: ,' +SED_CMDS.opt-debug-jobs+= -e 's,Command: ${.SHELL:T},Command: ,' +# The "-q" may be there or not, see jobs.c, variable shells. +SED_CMDS.opt-debug-jobs+= -e 's,^\(.Command: \) -q,\1,' +SED_CMDS.opt-debug-lint+= ${STD_SED_CMDS.regex} +SED_CMDS.opt-jobs-no-action= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.opt-no-action-runflags= ${STD_SED_CMDS.hide-from-output} +# For Compat_RunCommand, useShell == FALSE. +SED_CMDS.sh-dots= -e 's,^.*\.\.\.:.*,,' +# For Compat_RunCommand, useShell == TRUE. +SED_CMDS.sh-dots+= -e 's,^make: exec(\(.*\)) failed (.*)$$,,' +SED_CMDS.sh-dots+= -e 's,^\(\*\*\* Error code \)[1-9][0-9]*,\1,' +SED_CMDS.sh-errctl= ${STD_SED_CMDS.dj} +SED_CMDS.sh-flags= ${STD_SED_CMDS.hide-from-output} +SED_CMDS.suff-main+= ${STD_SED_CMDS.dg1} +SED_CMDS.suff-main-several+= ${STD_SED_CMDS.dg1} +SED_CMDS.suff-transform-debug+= ${STD_SED_CMDS.dg1} +SED_CMDS.var-op-shell+= ${STD_SED_CMDS.shell} +SED_CMDS.var-op-shell+= -e '/command/s,No such.*,not found,' +SED_CMDS.vardebug+= -e 's,${.SHELL},,' +SED_CMDS.varmod-subst-regex+= ${STD_SED_CMDS.regex} +SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: ",' +SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: "[^"]*,make: ",' +SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g' +SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g' +SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g' +SED_CMDS.varname-empty= -e 's,${.CURDIR},,g' +SED_CMDS.varname-empty+= -e '/\.PARSEDIR/d' +SED_CMDS.varname-empty+= -e '/\.SHELL/d' + +# Some tests need an additional round of postprocessing. +POSTPROC.deptgt-suffixes= awk '/^\#\*\*\* Suffixes/,/^never-stop/' +POSTPROC.gnode-submake= awk '/Input graph/, /^$$/' + +# Some tests reuse other tests, which makes them unnecessarily fragile. +export-all.rawout: export.mk +unexport.rawout: export.mk +unexport-env.rawout: export.mk + +# End of the configuration section. + +# Some standard sed commands, to be used in the SED_CMDS above. + +# Omit details such as process IDs from the output of the -dg1 option. +STD_SED_CMDS.dg1= -e 's,${.CURDIR}$$,,' +STD_SED_CMDS.dg1+= -e 's, ${DEFSYSPATH:U/usr/share/mk}$$, ,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(MACHINE[_ARCH]* *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(MAKE *=\) .*,\1
,' +STD_SED_CMDS.dg1+= -e 's,^\(\.SHELL *=\) .*,\1
,' + +STD_SED_CMDS.dg2= ${STD_SED_CMDS.dg1} +STD_SED_CMDS.dg2+= -e 's,\(last modified\) ..:..:.. ... ..\, ....,\1 ,' +STD_SED_CMDS.dg3= ${STD_SED_CMDS.dg2} + +# Omit details such as process IDs from the output of the -dj option. +STD_SED_CMDS.dj= \ + -e '/Process/d;/JobFinish:/d' \ + -e 's,^\(Job_TokenWithdraw\)([0-9]*),\1(),' \ + -e 's,^([0-9][0-9]*) \(withdrew token\),() \1,' \ + -e 's, \(pid\) [0-9][0-9]*, \1 ,' \ + -e 's,^\( Command:\) .*,\1 ,' + +# Reduce the noise for tests running with the -n option, since there is no +# other way to suppress the echoing of the commands. +STD_SED_CMDS.hide-from-output= \ + -e '/^echo hide-from-output/d' \ + -e 's,hide-from-output ,,' \ + -e 's,hide-from-output,,' + +# Normalize the output for error messages from the shell. +# +# $shell -c '...' +# NetBSD sh ...: not found +# NetBSD ksh ksh: ...: not found +# bash 5.0.18 bash: ...: command not found +# bash 5.1.0 bash: line 1: ...: command not found +# dash dash: 1: ...: not found +# +# $shell -c '< /nonexistent' +# NetBSD sh sh: cannot open /nonexistent: no such file +# NetBSD ksh ksh: cannot open /nonexistent: No such file or directory +# bash 5.0.18 bash: /nonexistent: No such file or directory +# bash 5.1.0 bash: line 1: /nonexistent: No such file or directory +# dash dash: 1: cannot open /nonexistent: No such file +# +# echo '< /nonexistent' | $shell +# NetBSD sh sh: cannot open /nonexistent: no such file +# NetBSD ksh ksh: [1]: cannot open /nonexistent: No such file or directory +# bash 5.0.18 bash: line 1: /nonexistent: No such file or directory +# bash 5.1.0 bash: line 1: /nonexistent: No such file or directory +# dash dash: 1: cannot open /nonexistent: No such file +# +STD_SED_CMDS.shell+= -e 's,^${.SHELL:T}: line [0-9][0-9]*: ,,' +STD_SED_CMDS.shell+= -e 's,^${.SHELL:T}: [0-9][0-9]*: ,,' +STD_SED_CMDS.shell+= -e 's,^${.SHELL:T}: ,,' + +# The actual error messages for a failed regcomp or regexec differ between the +# implementations. +STD_SED_CMDS.regex= \ + -e 's,\(Regex compilation error:\).*,\1 (details omitted),' + +# End of the configuration helpers section. + +UNIT_TESTS:= ${.PARSEDIR} +.PATH: ${UNIT_TESTS} + +.if ${USE_ABSOLUTE_TESTNAMES:Uno} == yes +OUTFILES= ${TESTS:@test@${.CURDIR:tA}/${test}.out@} +.else +OUTFILES= ${TESTS:=.out} +.endif all: ${OUTFILES} -CLEANFILES += *.rawout *.out *.status *.tmp *.core *.tmp -CLEANFILES += obj*.[och] lib*.a # posix1.mk -CLEANFILES += issue* .[ab]* # suffixes.mk -CLEANRECURSIVE += dir dummy # posix1.mk +CLEANFILES= *.rawout *.out *.status *.tmp *.core *.tmp +CLEANFILES+= obj*.[och] lib*.a # posix1.mk +CLEANFILES+= issue* .[ab]* # suffixes.mk +CLEANDIRS= dir dummy # posix1.mk clean: rm -f ${CLEANFILES} -.if !empty(CLEANRECURSIVE) - rm -rf ${CLEANRECURSIVE} -.endif + rm -rf ${CLEANDIRS} -TEST_MAKE?= ${.MAKE} -TOOL_SED?= sed +TEST_MAKE?= ${.MAKE} +TOOL_SED?= sed # ensure consistent results from sort(1) -LC_ALL= C -LANG= C +LC_ALL= C +LANG= C .export LANG LC_ALL -# the tests are actually done with sub-makes. + +# for many tests we need a TMPDIR that will not collide +# with other users. +.if ${.OBJDIR} != ${.CURDIR} +# easy +TMPDIR:= ${.OBJDIR}/tmp +.elif defined(TMPDIR) +TMPDIR:= ${TMPDIR}/uid${.MAKE.UID} +.else +TMPDIR:= /tmp/uid${.MAKE.UID} +.endif +# make sure it exists +.if !exist(${TMPDIR}) +x!= echo; mkdir -p ${TMPDIR} +.endif + +MAKE_TEST_ENV?= MALLOC_OPTIONS="JA" # for jemalloc +MAKE_TEST_ENV+= TMPDIR=${TMPDIR} + +.if ${.MAKE.OS} == "NetBSD" +LIMIT_RESOURCES?= ulimit -v 200000 +.endif +LIMIT_RESOURCES?= : + +# Each test is run in a sub-make, to keep the tests for interfering with +# each other, and because they use different environment variables and +# command line options. .SUFFIXES: .mk .rawout .out .mk.rawout: - @echo ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} - -@cd ${.OBJDIR} && \ - { ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} \ - 2>&1 ; echo $$? >${.TARGET:R}.status ; } > ${.TARGET}.tmp + @${_MKMSG_TEST:Uecho '# test '} ${.PREFIX} + @set -eu; \ + ${LIMIT_RESOURCES}; \ + cd ${.OBJDIR}; \ + env -i PATH="$$PATH" ${MAKE_TEST_ENV} ${ENV.${.PREFIX:T}} \ + ${TEST_MAKE} \ + -r -C ${.CURDIR} -f ${.IMPSRC} \ + ${FLAGS.${.PREFIX:T}:U-k} \ + > ${.TARGET}.tmp 2>&1 \ + && status=$$? || status=$$?; \ + echo $$status > ${.TARGET:R}.status @mv ${.TARGET}.tmp ${.TARGET} -# We always pretend .MAKE was called 'make' -# and strip ${.CURDIR}/ from the output -# and replace anything after 'stopped in' with unit-tests -# so the results can be compared. +# Postprocess the test output so that the results can be compared. +# +# always pretend .MAKE was called 'make' +_SED_CMDS+= -e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,' +_SED_CMDS+= -e 's,${TEST_MAKE:S,.,\\.,g},make,' +_SED_CMDS+= -e 's,${TEST_MAKE:T:S,.,\\.,g}[][0-9]* warning,make warning,' +_SED_CMDS+= -e 's,^usage: ${TEST_MAKE:T:S,.,\\.,g} ,usage: make ,' +# replace anything after 'stopped in' with unit-tests +_SED_CMDS+= -e '/stopped/s, /.*, unit-tests,' +_SED_CMDS+= -e 's,${TMPDIR},TMPDIR,g' +# strip ${.CURDIR}/ from the output +_SED_CMDS+= -e 's,${.CURDIR:S,.,\\.,g}/,,g' +_SED_CMDS+= -e 's,${UNIT_TESTS:S,.,\\.,g}/,,g' + .rawout.out: - @echo postprocess ${.TARGET} - @${TOOL_SED} -e 's,^${TEST_MAKE:T:C/\./\\\./g}[][0-9]*:,make:,' \ - -e 's,${TEST_MAKE:C/\./\\\./g},make,' \ - -e '/stopped/s, /.*, unit-tests,' \ - -e 's,${.CURDIR:C/\./\\\./g}/,,g' \ - -e 's,${UNIT_TESTS:C/\./\\\./g}/,,g' \ - < ${.IMPSRC} > ${.TARGET}.tmp - @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp - @mv ${.TARGET}.tmp ${.TARGET} + @${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \ + < ${.IMPSRC} > ${.TARGET}.tmp1 + @${POSTPROC.${.PREFIX:T}:Ucat} < ${.TARGET}.tmp1 > ${.TARGET}.tmp2 + @rm ${.TARGET}.tmp1 + @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp2 + @mv ${.TARGET}.tmp2 ${.TARGET} # Compare all output files test: ${OUTFILES} .PHONY @failed= ; \ - for test in ${TESTNAMES}; do \ + for test in ${TESTS}; do \ diff -u ${UNIT_TESTS}/$${test}.exp $${test}.out \ || failed="$${failed}$${failed:+ }$${test}" ; \ done ; \ @@ -125,14 +701,34 @@ test: ${OUTFILES} .PHONY fi accept: - @for test in ${TESTNAMES}; do \ + @for test in ${TESTS}; do \ cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \ || { echo "Replacing $${test}.exp" ; \ cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ done +# Note: only works for adding tests. +# To remove a test, the $$mi file must be edited manually. +sync-mi: + @set -eu; \ + cd "${MAKEFILE:tA:H}/../../.."; \ + mi="distrib/sets/lists/tests/mi"; \ + cvs update "$$mi"; \ + testsdir="usr.bin/make/unit-tests"; \ + fmt="./usr/tests/$$testsdir/%s\ttests-usr.bin-tests\tcompattestfile,atf\\n"; \ + cat "$$mi" > "$$mi.tmp"; \ + (cd "$$testsdir" && ls *.exp *.mk) | xargs printf "$$fmt" >> "$$mi.tmp"; \ + distrib/sets/fmt-list "$$mi.tmp"; \ + mv "$$mi.tmp" "$$mi"; \ + cvs diff "$$mi" || true + .if exists(${TEST_MAKE}) -${TESTNAMES:S/$/.rawout/}: ${TEST_MAKE} +${TESTS:=.rawout}: ${TEST_MAKE} +# in meta mode, we *know* if a target script is impacted +# by a makefile change. +.if ${.MAKE.MODE:Unormal:Mmeta} == "" +${TESTS:=.rawout}: ${.PARSEDIR}/Makefile +.endif .endif .-include diff --git a/usr.bin/make/unit-tests/archive-suffix.exp b/usr.bin/make/unit-tests/archive-suffix.exp new file mode 100644 index 000000000..05f2ac662 --- /dev/null +++ b/usr.bin/make/unit-tests/archive-suffix.exp @@ -0,0 +1,2 @@ +`all' is up to date. +exit status 0 diff --git a/usr.bin/make/unit-tests/archive-suffix.mk b/usr.bin/make/unit-tests/archive-suffix.mk new file mode 100644 index 000000000..a216fd2d3 --- /dev/null +++ b/usr.bin/make/unit-tests/archive-suffix.mk @@ -0,0 +1,23 @@ +# $NetBSD: archive-suffix.mk,v 1.3 2020/11/15 14:07:53 rillig Exp $ +# +# Between 2020-08-23 and 2020-08-30, the below code produced an assertion +# failure in Var_SetWithFlags, triggered by Compat_Make, when setting the +# .IMPSRC of an archive node to its .TARGET. +# +# The code assumed that the .TARGET variable of every node would be set, but +# that is not guaranteed. +# +# Between 2016-03-15 and 2016-03-16 the behavior of the below code changed. +# Until 2016-03-15, it remade the target, starting with 2016-03-16 it says +# "`all' is up to date". + +.SUFFIXES: +.SUFFIXES: .c .o + +all: lib.a(obj1.o) + +.c.o: + : making $@ + +obj1.c: + : $@ diff --git a/usr.bin/make/unit-tests/archive.exp b/usr.bin/make/unit-tests/archive.exp new file mode 100644 index 000000000..645add4f5 --- /dev/null +++ b/usr.bin/make/unit-tests/archive.exp @@ -0,0 +1,28 @@ +Making remove-archive +rm -f libprog.a + +Making libprog.a out-of-date archive.mk modmisc.mk varmisc.mk +ar cru libprog.a archive.mk modmisc.mk varmisc.mk +ranlib libprog.a + +Making create-archive out-of-date libprog.a + +Making list-archive out-of-date libprog.a +ar t libprog.a +archive.mk +modmisc.mk +varmisc.mk + +Making list-archive-wildcard out-of-date archive-suffix.mk archive.mk ternary.mk +list-archive-wildcard: archive-suffix.mk +list-archive-wildcard: archive.mk +list-archive-wildcard: ternary.mk + +Making depend-on-existing-member out-of-date archive.mk +depend-on-existing-member + +`depend-on-nonexistent-member' is up to date. +Making remove-archive +rm -f libprog.a + +exit status 0 diff --git a/usr.bin/make/unit-tests/archive.mk b/usr.bin/make/unit-tests/archive.mk new file mode 100644 index 000000000..f8815cf40 --- /dev/null +++ b/usr.bin/make/unit-tests/archive.mk @@ -0,0 +1,60 @@ +# $NetBSD: archive.mk,v 1.11 2020/11/15 14:07:53 rillig Exp $ +# +# Very basic demonstration of handling archives, based on the description +# in PSD.doc/tutorial.ms. +# +# This test aims at covering the code, not at being an introduction to +# archive handling. That's why it deviates from the tutorial style of +# several other tests. + +ARCHIVE= libprog.a +FILES= archive.mk modmisc.mk varmisc.mk + +all: +.if ${.PARSEDIR:tA} != ${.CURDIR:tA} + @cd ${MAKEFILE:H} && cp ${FILES} [at]*.mk ${.CURDIR} +.endif +# The following targets create and remove files. The filesystem cache in +# dir.c would probably not handle this correctly, therefore each of the +# targets is run in its separate sub-make. + @${MAKE} -f ${MAKEFILE} remove-archive + @${MAKE} -f ${MAKEFILE} create-archive + @${MAKE} -f ${MAKEFILE} list-archive + @${MAKE} -f ${MAKEFILE} list-archive-wildcard + @${MAKE} -f ${MAKEFILE} depend-on-existing-member + @${MAKE} -f ${MAKEFILE} depend-on-nonexistent-member + @${MAKE} -f ${MAKEFILE} remove-archive + +create-archive: ${ARCHIVE} pre post + +# The indirect references with the $$ cover the code in Arch_ParseArchive +# that calls Var_Parse. It's an esoteric scenario since at the point where +# Arch_ParseArchive is called, the dependency line is already fully expanded. +# +${ARCHIVE}: $${:Ulibprog.a}(archive.mk modmisc.mk $${:Uvarmisc.mk}) pre post + ar cru ${.TARGET} ${.OODATE:O} + ranlib ${.TARGET} + +list-archive: ${ARCHIVE} pre post + ar t ${.ALLSRC} + +# XXX: I had expected that this dependency would select all *.mk files from +# the archive. Instead, the globbing is done in the current directory. +# +# To prevent an overly long file list, the pattern is restricted to [at]*.mk. +list-archive-wildcard: ${ARCHIVE}([at]*.mk) pre post + @printf '%s\n' ${.ALLSRC:O:@member@${.TARGET:Q}': '${member:Q}@} + +depend-on-existing-member: ${ARCHIVE}(archive.mk) pre post + @echo $@ + +depend-on-nonexistent-member: ${ARCHIVE}(nonexistent.mk) pre post + @echo $@ + +remove-archive: pre post + rm -f ${ARCHIVE} + +pre: .USEBEFORE + @echo Making ${.TARGET} ${.OODATE:C,.+,out-of-date,W} ${.OODATE:O} +post: .USE + @echo diff --git a/usr.bin/make/unit-tests/cmd-errors-jobs.exp b/usr.bin/make/unit-tests/cmd-errors-jobs.exp new file mode 100644 index 000000000..9ed055797 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors-jobs.exp @@ -0,0 +1,9 @@ +: undefined eol +make: Unclosed variable "UNCLOSED" +: unclosed-variable +make: Unclosed variable expression (expecting '}') for "UNCLOSED" +: unclosed-modifier +make: Unknown modifier "Z" +: unknown-modifier eol +: end eol +exit status 0 diff --git a/usr.bin/make/unit-tests/cmd-errors-jobs.mk b/usr.bin/make/unit-tests/cmd-errors-jobs.mk new file mode 100644 index 000000000..8462a2e34 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors-jobs.mk @@ -0,0 +1,32 @@ +# $NetBSD: cmd-errors-jobs.mk,v 1.1 2020/12/27 05:11:40 rillig Exp $ +# +# Demonstrate how errors in variable expansions affect whether the commands +# are actually executed in jobs mode. + +.MAKEFLAGS: -j1 + +all: undefined unclosed-variable unclosed-modifier unknown-modifier end + +# Undefined variables are not an error. They expand to empty strings. +undefined: + : $@ ${UNDEFINED} eol + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-variable: + : $@ ${UNCLOSED + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-modifier: + : $@ ${UNCLOSED: + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unknown-modifier: + : $@ ${UNKNOWN:Z} eol + +end: + : $@ eol + +# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0. diff --git a/usr.bin/make/unit-tests/cmd-errors-lint.exp b/usr.bin/make/unit-tests/cmd-errors-lint.exp new file mode 100644 index 000000000..90b63bbcb --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors-lint.exp @@ -0,0 +1,9 @@ +: undefined +make: Unclosed variable "UNCLOSED" +: unclosed-variable +make: Unclosed variable expression (expecting '}') for "UNCLOSED" +: unclosed-modifier +make: Unknown modifier "Z" +: unknown-modifier +: end +exit status 2 diff --git a/usr.bin/make/unit-tests/cmd-errors-lint.mk b/usr.bin/make/unit-tests/cmd-errors-lint.mk new file mode 100644 index 000000000..371e12af0 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors-lint.mk @@ -0,0 +1,32 @@ +# $NetBSD: cmd-errors-lint.mk,v 1.1 2020/11/02 20:43:27 rillig Exp $ +# +# Demonstrate how errors in variable expansions affect whether the commands +# are actually executed. + +.MAKEFLAGS: -dL + +all: undefined unclosed-variable unclosed-modifier unknown-modifier end + +# Undefined variables are not an error. They expand to empty strings. +undefined: + : $@ ${UNDEFINED} + +# XXX: As of 2020-11-01, this obvious syntax error is not detected. +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-variable: + : $@ ${UNCLOSED + +# XXX: As of 2020-11-01, this obvious syntax error is not detected. +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-modifier: + : $@ ${UNCLOSED: + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unknown-modifier: + : $@ ${UNKNOWN:Z} + +end: + : $@ diff --git a/usr.bin/make/unit-tests/cmd-errors.exp b/usr.bin/make/unit-tests/cmd-errors.exp new file mode 100644 index 000000000..9ed055797 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors.exp @@ -0,0 +1,9 @@ +: undefined eol +make: Unclosed variable "UNCLOSED" +: unclosed-variable +make: Unclosed variable expression (expecting '}') for "UNCLOSED" +: unclosed-modifier +make: Unknown modifier "Z" +: unknown-modifier eol +: end eol +exit status 0 diff --git a/usr.bin/make/unit-tests/cmd-errors.mk b/usr.bin/make/unit-tests/cmd-errors.mk new file mode 100644 index 000000000..356fe1a3e --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-errors.mk @@ -0,0 +1,30 @@ +# $NetBSD: cmd-errors.mk,v 1.4 2020/12/27 05:11:40 rillig Exp $ +# +# Demonstrate how errors in variable expansions affect whether the commands +# are actually executed in compat mode. + +all: undefined unclosed-variable unclosed-modifier unknown-modifier end + +# Undefined variables are not an error. They expand to empty strings. +undefined: + : $@ ${UNDEFINED} eol + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-variable: + : $@ ${UNCLOSED + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unclosed-modifier: + : $@ ${UNCLOSED: + +# XXX: As of 2020-11-01, this command is executed even though it contains +# parse errors. +unknown-modifier: + : $@ ${UNKNOWN:Z} eol + +end: + : $@ eol + +# XXX: As of 2020-11-02, despite the parse errors, the exit status is 0. diff --git a/usr.bin/make/unit-tests/cmd-interrupt.exp b/usr.bin/make/unit-tests/cmd-interrupt.exp new file mode 100644 index 000000000..91f4439e7 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-interrupt.exp @@ -0,0 +1,9 @@ +> cmd-interrupt-ordinary +make: *** cmd-interrupt-ordinary removed +interrupt-ordinary: ok +> cmd-interrupt-phony +make: *** cmd-interrupt-phony removed +interrupt-phony: ok +> cmd-interrupt-precious +interrupt-precious: ok +exit status 0 diff --git a/usr.bin/make/unit-tests/cmd-interrupt.mk b/usr.bin/make/unit-tests/cmd-interrupt.mk new file mode 100644 index 000000000..fa0d85fc9 --- /dev/null +++ b/usr.bin/make/unit-tests/cmd-interrupt.mk @@ -0,0 +1,50 @@ +# $NetBSD: cmd-interrupt.mk,v 1.3 2020/11/15 14:07:53 rillig Exp $ +# +# Tests for interrupting a command. +# +# If a command is interrupted (usually by the user, here by itself), the +# target is removed. This is to avoid having an unfinished target that +# would be newer than all of its sources and would therefore not be +# tried again in the next run. +# +# This happens for ordinary targets as well as for .PHONY targets, even +# though the .PHONY targets usually do not correspond to a file. +# +# To protect the target from being removed, the target has to be marked with +# the special source .PRECIOUS. These targets need to ensure for themselves +# that interrupting them does not leave an inconsistent state behind. +# +# See also: +# CompatDeleteTarget + +all: clean-before interrupt-ordinary interrupt-phony interrupt-precious clean-after + +clean-before clean-after: .PHONY + @rm -f cmd-interrupt-ordinary cmd-interrupt-phony cmd-interrupt-precious + +interrupt-ordinary: + @${.MAKE} ${MAKEFLAGS} -f ${MAKEFILE} cmd-interrupt-ordinary || true + # The ././ is necessary to work around the file cache. + @echo ${.TARGET}: ${exists(././cmd-interrupt-ordinary) :? error : ok } + +interrupt-phony: .PHONY + @${.MAKE} ${MAKEFLAGS} -f ${MAKEFILE} cmd-interrupt-phony || true + # The ././ is necessary to work around the file cache. + @echo ${.TARGET}: ${exists(././cmd-interrupt-phony) :? error : ok } + +interrupt-precious: .PRECIOUS + @${.MAKE} ${MAKEFLAGS} -f ${MAKEFILE} cmd-interrupt-precious || true + # The ././ is necessary to work around the file cache. + @echo ${.TARGET}: ${exists(././cmd-interrupt-precious) :? ok : error } + +cmd-interrupt-ordinary: + > ${.TARGET} + @kill -INT ${.MAKE.PID} + +cmd-interrupt-phony: .PHONY + > ${.TARGET} + @kill -INT ${.MAKE.PID} + +cmd-interrupt-precious: .PRECIOUS + > ${.TARGET} + @kill -INT ${.MAKE.PID} diff --git a/usr.bin/make/unit-tests/misc.exp b/usr.bin/make/unit-tests/cmdline-redirect-stdin.exp similarity index 100% rename from usr.bin/make/unit-tests/misc.exp rename to usr.bin/make/unit-tests/cmdline-redirect-stdin.exp diff --git a/usr.bin/make/unit-tests/cmdline-redirect-stdin.mk b/usr.bin/make/unit-tests/cmdline-redirect-stdin.mk new file mode 100644 index 000000000..994016b5e --- /dev/null +++ b/usr.bin/make/unit-tests/cmdline-redirect-stdin.mk @@ -0,0 +1,34 @@ +# $NetBSD: cmdline-redirect-stdin.mk,v 1.1 2021/02/01 20:31:41 rillig Exp $ +# +# Demonstrate that the '!=' assignment operator can read individual lines +# from make's stdin. +# +# This edge case is an implementation detail that has no practical +# application. + +all: .PHONY + @printf '%s\n' "first line" "second line" \ + | ${MAKE} -f ${MAKEFILE} read-lines + +.if make(read-lines) +line1!= read line; echo "$$line" +line2!= read line; echo "$$line" + +.if ${line1} != "first line" +. error line1="${line1}" + +.elif ${line2} == "" +# If this branch is ever reached, the shell from the assignment to line1 +# probably buffers its input. Most shells use unbuffered stdin, and this +# is actually specified by POSIX, which says that "The read utility shall +# read a single line from standard input". This is the reason why the shell +# reads its input byte by byte, which makes it terribly slow for practical +# applications. +. error The shell's read command does not read a single line. + +.elif ${line2} != "second line" +. error line2="${line2}" +.endif + +read-lines: .PHONY +.endif diff --git a/usr.bin/make/unit-tests/cmdline-undefined.exp b/usr.bin/make/unit-tests/cmdline-undefined.exp new file mode 100644 index 000000000..977ceee6d --- /dev/null +++ b/usr.bin/make/unit-tests/cmdline-undefined.exp @@ -0,0 +1,17 @@ +The = assignment operator +make: "cmdline-undefined.mk" line 29: From the command line: Undefined is . +make: "cmdline-undefined.mk" line 30: From .MAKEFLAGS '=': Undefined is . +make: "cmdline-undefined.mk" line 31: From .MAKEFLAGS ':=': Undefined is . +make: "cmdline-undefined.mk" line 35: From the command line: Undefined is now defined. +make: "cmdline-undefined.mk" line 36: From .MAKEFLAGS '=': Undefined is now defined. +make: "cmdline-undefined.mk" line 37: From .MAKEFLAGS ':=': Undefined is now defined. + +The := assignment operator +make: "cmdline-undefined.mk" line 29: From the command line: Undefined is . +make: "cmdline-undefined.mk" line 30: From .MAKEFLAGS '=': Undefined is . +make: "cmdline-undefined.mk" line 31: From .MAKEFLAGS ':=': Undefined is . +make: "cmdline-undefined.mk" line 35: From the command line: Undefined is now defined. +make: "cmdline-undefined.mk" line 36: From .MAKEFLAGS '=': Undefined is now defined. +make: "cmdline-undefined.mk" line 37: From .MAKEFLAGS ':=': Undefined is now defined. + +exit status 0 diff --git a/usr.bin/make/unit-tests/cmdline-undefined.mk b/usr.bin/make/unit-tests/cmdline-undefined.mk new file mode 100644 index 000000000..5a3375cbb --- /dev/null +++ b/usr.bin/make/unit-tests/cmdline-undefined.mk @@ -0,0 +1,40 @@ +# $NetBSD: cmdline-undefined.mk,v 1.2 2020/11/04 04:49:33 rillig Exp $ +# +# Tests for undefined variable expressions in the command line. + +all: + # When the command line is parsed, variable assignments using the + # '=' assignment operator do get their variable name expanded + # (which probably occurs rarely in practice, if at all), but their + # variable value is not expanded, as usual. + # + @echo 'The = assignment operator' + @${.MAKE} -f ${MAKEFILE} print-undefined \ + CMDLINE='Undefined is $${UNDEFINED}.' + @echo + + # The interesting case is using the ':=' assignment operator, which + # expands its right-hand side. But only those variables that are + # defined. + @echo 'The := assignment operator' + @${.MAKE} -f ${MAKEFILE} print-undefined \ + CMDLINE:='Undefined is $${UNDEFINED}.' + @echo + +.if make(print-undefined) + +.MAKEFLAGS: MAKEFLAGS_ASSIGN='Undefined is $${UNDEFINED}.' +.MAKEFLAGS: MAKEFLAGS_SUBST:='Undefined is $${UNDEFINED}.' + +.info From the command line: ${CMDLINE} +.info From .MAKEFLAGS '=': ${MAKEFLAGS_ASSIGN} +.info From .MAKEFLAGS ':=': ${MAKEFLAGS_SUBST} + +UNDEFINED?= now defined + +.info From the command line: ${CMDLINE} +.info From .MAKEFLAGS '=': ${MAKEFLAGS_ASSIGN} +.info From .MAKEFLAGS ':=': ${MAKEFLAGS_SUBST} + +print-undefined: +.endif diff --git a/usr.bin/make/unit-tests/cmdline.exp b/usr.bin/make/unit-tests/cmdline.exp new file mode 100644 index 000000000..596281ab0 --- /dev/null +++ b/usr.bin/make/unit-tests/cmdline.exp @@ -0,0 +1,5 @@ +makeobjdir-direct: +show-objdir: TMPDIR/6a8899d2-d227-4b55-9b6b-f3c8eeb83fd5 +makeobjdir-indirect: +show-objdir: TMPDIR/a7b41170-53f8-4cc2-bc5c-e4c3dd93ec45/ +exit status 0 diff --git a/usr.bin/make/unit-tests/cmdline.mk b/usr.bin/make/unit-tests/cmdline.mk new file mode 100644 index 000000000..f82e7f967 --- /dev/null +++ b/usr.bin/make/unit-tests/cmdline.mk @@ -0,0 +1,36 @@ +# $NetBSD: cmdline.mk,v 1.3 2021/02/06 18:26:03 sjg Exp $ +# +# Tests for command line parsing and related special variables. + +TMPBASE?= ${TMPDIR:U/tmp/uid${.MAKE.UID}} +SUB1= a7b41170-53f8-4cc2-bc5c-e4c3dd93ec45 # just a random UUID +SUB2= 6a8899d2-d227-4b55-9b6b-f3c8eeb83fd5 # just a random UUID +MAKE_CMD= env TMPBASE=${TMPBASE}/${SUB1} ${.MAKE} -f ${MAKEFILE} -r +DIR2= ${TMPBASE}/${SUB2} +DIR12= ${TMPBASE}/${SUB1}/${SUB2} + +all: prepare-dirs +all: makeobjdir-direct makeobjdir-indirect + +prepare-dirs: + @rm -rf ${DIR2} ${DIR12} + @mkdir -p ${DIR2} ${DIR12} + +# The .OBJDIR can be set via the MAKEOBJDIR command line variable. +# It must be a command line variable; an environment variable would not work. +makeobjdir-direct: + @echo $@: + @${MAKE_CMD} MAKEOBJDIR=${DIR2} show-objdir + +# The .OBJDIR can be set via the MAKEOBJDIR command line variable, +# and that variable could even contain the usual modifiers. +# Since the .OBJDIR=MAKEOBJDIR assignment happens very early, +# the SUB2 variable in the modifier is not defined yet and is therefore empty. +# The SUB1 in the resulting path comes from the environment variable TMPBASE, +# see MAKE_CMD. +makeobjdir-indirect: + @echo $@: + @${MAKE_CMD} MAKEOBJDIR='$${TMPBASE}/$${SUB2}' show-objdir + +show-objdir: + @echo $@: ${.OBJDIR:Q} diff --git a/usr.bin/make/unit-tests/comment.exp b/usr.bin/make/unit-tests/comment.exp index 9a97df0b7..f4d31d01b 100644 --- a/usr.bin/make/unit-tests/comment.exp +++ b/usr.bin/make/unit-tests/comment.exp @@ -1,5 +1,6 @@ -comment testing start -this is foo -This is how a comment looks: # comment -comment testing done +echo This is a shell comment: # comment +This is a shell comment: +echo This is not a shell comment: '# comment' +This is not a shell comment: # comment +A shell comment can#not start in the middle of a word. exit status 0 diff --git a/usr.bin/make/unit-tests/comment.mk b/usr.bin/make/unit-tests/comment.mk index 7dd7dbbe2..d4fb04110 100644 --- a/usr.bin/make/unit-tests/comment.mk +++ b/usr.bin/make/unit-tests/comment.mk @@ -1,31 +1,78 @@ -# This is a comment -.if ${MACHINE_ARCH} == something -FOO=bar -.endif +# $NetBSD: comment.mk,v 1.3 2020/11/15 14:07:53 rillig Exp $ +# +# Demonstrate how comments are written in makefiles. + +# This is a comment. #\ - Multiline comment +This is a multiline comment. -BAR=# defined -FOOBAR= # defined - -# This is an escaped comment \ -that keeps going until the end of this line - -# Another escaped comment \ +# Another multiline comment \ that \ goes \ -on +on and on. -# This is NOT an escaped comment due to the double backslashes \\ -all: hi foo bar - @echo comment testing done + # Comments can be indented with spaces, but that is rather unusual. -hi: - @echo comment testing start + # Comments can be indented with a tab. + # These are not shell commands, they are just makefile comments. -foo: - @echo this is $@ +.if 1 # There can be comments after conditions. +.endif # And after the closing directive. -bar: - @echo This is how a comment looks: '# comment' +VAR= # This comment makes the variable value empty. + # ParseGetLine removes any whitespace before the + # comment. +.if ${VAR} != "" +. error +.endif + +# The comment does not need to start at the beginning of a word (as in the +# shell), it can start anywhere. +VAR=# defined but empty + +# The space before the comment is always trimmed. +VAR= value +.if ${VAR} != "value" +. error +.endif + +# This comment ends with 2 backslashes. An even number of backslashes does +# not count as a line continuation, therefore the variable assignment that +# follows is actively interpreted. \\ +VAR= not part of the comment +.if ${VAR} != "not part of the comment" +. error +.endif + +# To escape a comment sign, precede it with a backslash. +VAR= \# # Both in the assignment. +.if ${VAR} != "\#" # And in the comparison. +. error +.endif + +# Since 2012-03-24 the variable modifier :[#] does not need to be escaped. +# To keep the parsing code simple, any "[#" does not start a comment, even +# outside of a variable expression. +WORDS= ${VAR:[#]} [# +.if ${WORDS} != "1 [#" +. error +.endif + +# An odd number of backslashes makes a line continuation, \\\ +no matter if it is 3 or 5 \\\\\ +or 9 backslashes. \\\\\\\\\ +This is the last line of the comment. +VAR= no comment anymore +.if ${VAR} != "no comment anymore" +. error +.endif + +all: +# In the commands associated with a target, the '#' does not start a makefile +# comment. The '#' is just passed to the shell, like any ordinary character. + echo This is a shell comment: # comment +# If the '#' were to start a makefile comment, the following shell command +# would have unbalanced quotes. + echo This is not a shell comment: '# comment' + @echo A shell comment can#not start in the middle of a word. diff --git a/usr.bin/make/unit-tests/compat-error.exp b/usr.bin/make/unit-tests/compat-error.exp new file mode 100644 index 000000000..256cb6d43 --- /dev/null +++ b/usr.bin/make/unit-tests/compat-error.exp @@ -0,0 +1,15 @@ +: Making success1 out of nothing. +: Making fail1 out of nothing. +false 'fail1' '${.TARGET}' '$${.TARGET}' +*** Error code 1 (continuing) +: Making success2 out of nothing. +: Making fail2 out of nothing. +false 'fail2' '${.TARGET}' '$${.TARGET}' +*** Error code 1 (continuing) +: Making success3 out of nothing. + +Stop. +make: stopped in unit-tests +.ERROR target: +.ERROR command: <> +exit status 1 diff --git a/usr.bin/make/unit-tests/compat-error.mk b/usr.bin/make/unit-tests/compat-error.mk new file mode 100644 index 000000000..4cbc48d4b --- /dev/null +++ b/usr.bin/make/unit-tests/compat-error.mk @@ -0,0 +1,37 @@ +# $NetBSD: compat-error.mk,v 1.3 2020/12/13 19:33:53 rillig Exp $ +# +# Test detailed error handling in compat mode. +# +# Until 2020-12-13, .ERROR_TARGET was success3, which was wrong. +# Since compat.c 1.215 from 2020-12-13, it is 'fail1', which is the first +# failed top-level target. XXX: Even better would be if .ERROR_TARGET were +# the smallest target that caused the build to fail, even if it were a +# sub-sub-sub-dependency of a top-level target. +# +# XXX: As of 2020-12-13, .ERROR_CMD is empty, which is wrong. +# +# See also: +# Compat_Run +# +# The commit that added the NULL command to gn->commands: +# CVS: 1994.06.06.22.45.?? +# Git: 26a8972fd7f982502c5fbfdabd34578b99d77ca5 +# 1994: Lst_Replace (cmdNode, (ClientData) NULL); +# 2020: LstNode_SetNull(cmdNode); +# +# The commit that skipped NULL commands for .ERROR_CMD: +# CVS: 2016.08.11.19.53.?? +# Git: 58b23478b7353d46457089e726b07a49197388e4 + +.MAKEFLAGS: success1 fail1 success2 fail2 success3 + +success1 success2 success3: + : Making ${.TARGET} out of nothing. + +fail1 fail2: + : Making ${.TARGET} out of nothing. + false '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}' + +.ERROR: + @echo ${.TARGET} target: '<'${.ERROR_TARGET:Q}'>' + @echo ${.TARGET} command: '<'${.ERROR_CMD:Q}'>' diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp b/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp new file mode 100644 index 000000000..72d3d9357 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp @@ -0,0 +1,5 @@ +make: "cond-cmp-numeric-eq.mk" line 67: Malformed conditional (!(12345 = 12345)) +make: "cond-cmp-numeric-eq.mk" line 74: Malformed conditional (!(12345 === 12345)) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk b/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk new file mode 100644 index 000000000..c6b39876e --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk @@ -0,0 +1,81 @@ +# $NetBSD: cond-cmp-numeric-eq.mk,v 1.5 2020/11/08 21:47:59 rillig Exp $ +# +# Tests for numeric comparisons with the == operator in .if conditions. + +# This comparison yields the same result, whether numeric or character-based. +.if 1 == 1 +.else +. error +.endif + +# This comparison yields the same result, whether numeric or character-based. +.if 1 == 2 +. error +.endif + +.if 2 == 1 +. error +.endif + +# Scientific notation is supported, as per strtod. +.if 2e7 == 2000e4 +.else +. error +.endif + +.if 2000e4 == 2e7 +.else +. error +.endif + +# Trailing zeroes after the decimal point are irrelevant for the numeric +# value. +.if 3.30000 == 3.3 +.else +. error +.endif + +.if 3.3 == 3.30000 +.else +. error +.endif + +# As of 2020-08-23, numeric comparison is implemented as parsing both sides +# as double, and then performing a normal comparison. The range of double is +# typically 16 or 17 significant digits, therefore these two numbers seem to +# be equal. +.if 1.000000000000000001 == 1.000000000000000002 +.else +. error +.endif + +# Because an IEEE 754 double can only hold integers with a mantissa of 53 +# bits, these two numbers are considered the same. The 993 is rounded down +# to the 992. +.if 9007199254740993 == 9007199254740992 +.else +. error +.endif +# The 995 is rounded up, the 997 is rounded down. +.if 9007199254740995 == 9007199254740997 +.else +. error Probably a misconfiguration in the floating point environment, \ + or maybe a machine without IEEE 754 floating point support. +.endif + +# There is no = operator for numbers. +.if !(12345 = 12345) +. error +.else +. error +.endif + +# There is no === operator for numbers either. +.if !(12345 === 12345) +. error +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/qequals.exp b/usr.bin/make/unit-tests/cond-cmp-numeric-ge.exp similarity index 51% rename from usr.bin/make/unit-tests/qequals.exp rename to usr.bin/make/unit-tests/cond-cmp-numeric-ge.exp index 6b2f4dce6..39a938395 100644 --- a/usr.bin/make/unit-tests/qequals.exp +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-ge.exp @@ -1,2 +1 @@ -V.i386 ?= OK exit status 0 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-ge.mk b/usr.bin/make/unit-tests/cond-cmp-numeric-ge.mk new file mode 100644 index 000000000..e64be7f0c --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-ge.mk @@ -0,0 +1,75 @@ +# $NetBSD: cond-cmp-numeric-ge.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for numeric comparisons with the >= operator in .if conditions. + +# When both sides are equal, the >= operator always yields true. +.if 1 >= 1 +.else +. error +.endif + +# This comparison yields the same result, whether numeric or character-based. +.if 1 >= 2 +. error +.endif + +.if 2 >= 1 +.else +. error +.endif + +# If this comparison were character-based instead of numerical, the +# 5 would be >= 14 since its first digit is greater. +.if 5 >= 14 +. error +.endif + +.if 14 >= 5 +.else +. error +.endif + +# Scientific notation is supported, as per strtod. +.if 2e7 >= 1e8 +. error +.endif + +.if 1e8 >= 2e7 +.else +. error +.endif + +# Floating pointer numbers can be compared as well. +# This might be tempting to use for version numbers, but there are a few pitfalls. +.if 3.141 >= 111.222 +. error +.endif + +.if 111.222 >= 3.141 +.else +. error +.endif + +# When parsed as a version number, 3.30 is greater than 3.7. +# Since make parses numbers as plain numbers, that leads to wrong results. +# Numeric comparisons are not suited for comparing version number. +.if 3.30 >= 3.7 +. error +.endif + +.if 3.7 >= 3.30 +.else +. error +.endif + +# As of 2020-08-23, numeric comparison is implemented as parsing both sides +# as double, and then performing a normal comparison. The range of double is +# typically 16 or 17 significant digits, therefore these two numbers seem to +# be equal. +.if 1.000000000000000001 >= 1.000000000000000002 +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-gt.exp b/usr.bin/make/unit-tests/cond-cmp-numeric-gt.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-gt.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-gt.mk b/usr.bin/make/unit-tests/cond-cmp-numeric-gt.mk new file mode 100644 index 000000000..1cdcc9891 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-gt.mk @@ -0,0 +1,73 @@ +# $NetBSD: cond-cmp-numeric-gt.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for numeric comparisons with the > operator in .if conditions. + +# When both sides are equal, the > operator always yields false. +.if 1 > 1 +. error +.endif + +# This comparison yields the same result, whether numeric or character-based. +.if 1 > 2 +. error +.endif + +.if 2 > 1 +.else +. error +.endif + +# If this comparison were character-based instead of numerical, the +# 5 would be > 14 since its first digit is greater. +.if 5 > 14 +. error +.endif + +.if 14 > 5 +.else +. error +.endif + +# Scientific notation is supported, as per strtod. +.if 2e7 > 1e8 +. error +.endif + +.if 1e8 > 2e7 +.else +. error +.endif + +# Floating pointer numbers can be compared as well. +# This might be tempting to use for version numbers, but there are a few pitfalls. +.if 3.141 > 111.222 +. error +.endif + +.if 111.222 > 3.141 +.else +. error +.endif + +# When parsed as a version number, 3.30 is greater than 3.7. +# Since make parses numbers as plain numbers, that leads to wrong results. +# Numeric comparisons are not suited for comparing version number. +.if 3.30 > 3.7 +. error +.endif + +.if 3.7 > 3.30 +.else +. error +.endif + +# As of 2020-08-23, numeric comparison is implemented as parsing both sides +# as double, and then performing a normal comparison. The range of double is +# typically 16 or 17 significant digits, therefore these two numbers seem to +# be equal. +.if 1.000000000000000001 > 1.000000000000000002 +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-le.exp b/usr.bin/make/unit-tests/cond-cmp-numeric-le.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-le.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-le.mk b/usr.bin/make/unit-tests/cond-cmp-numeric-le.mk new file mode 100644 index 000000000..05f5e8dba --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-le.mk @@ -0,0 +1,75 @@ +# $NetBSD: cond-cmp-numeric-le.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for numeric comparisons with the <= operator in .if conditions. + +# When both sides are equal, the <= operator always yields true. +.if 1 <= 1 +.else +. error +.endif + +# This comparison yields the same result, whether numeric or character-based. +.if 1 <= 2 +.else +. error +.endif + +.if 2 <= 1 +. error +.endif + +# If this comparison were character-based instead of numerical, the +# 5 would be >= 14 since its first digit is greater. +.if 5 <= 14 +.else +. error +.endif + +.if 14 <= 5 +. error +.endif + +# Scientific notation is supported, as per strtod. +.if 2e7 <= 1e8 +.else +. error +.endif + +.if 1e8 <= 2e7 +. error +.endif + +# Floating pointer numbers can be compared as well. +# This might be tempting to use for version numbers, but there are a few pitfalls. +.if 3.141 <= 111.222 +.else +. error +.endif + +.if 111.222 <= 3.141 +. error +.endif + +# When parsed as a version number, 3.30 is greater than 3.7. +# Since make parses numbers as plain numbers, that leads to wrong results. +# Numeric comparisons are not suited for comparing version number. +.if 3.30 <= 3.7 +.else +. error +.endif + +.if 3.7 <= 3.30 +. error +.endif + +# As of 2020-08-23, numeric comparison is implemented as parsing both sides +# as double, and then performing a normal comparison. The range of double is +# typically 16 or 17 significant digits, therefore these two numbers seem to +# be equal. +.if 1.000000000000000001 <= 1.000000000000000002 +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-lt.exp b/usr.bin/make/unit-tests/cond-cmp-numeric-lt.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-lt.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-lt.mk b/usr.bin/make/unit-tests/cond-cmp-numeric-lt.mk new file mode 100644 index 000000000..b0dddd591 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-lt.mk @@ -0,0 +1,73 @@ +# $NetBSD: cond-cmp-numeric-lt.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for numeric comparisons with the < operator in .if conditions. + +# When both sides are equal, the < operator always yields false. +.if 1 < 1 +. error +.endif + +# This comparison yields the same result, whether numeric or character-based. +.if 1 < 2 +.else +. error +.endif + +.if 2 < 1 +. error +.endif + +# If this comparison were character-based instead of numerical, the +# 5 would be > 14 since its first digit is greater. +.if 5 < 14 +.else +. error +.endif + +.if 14 < 5 +. error +.endif + +# Scientific notation is supported, as per strtod. +.if 2e7 < 1e8 +.else +. error +.endif + +.if 1e8 < 2e7 +. error +.endif + +# Floating pointer numbers can be compared as well. +# This might be tempting to use for version numbers, but there are a few pitfalls. +.if 3.141 < 111.222 +.else +. error +.endif + +.if 111.222 < 3.141 +. error +.endif + +# When parsed as a version number, 3.30 is greater than 3.7. +# Since make parses numbers as plain numbers, that leads to wrong results. +# Numeric comparisons are not suited for comparing version number. +.if 3.30 < 3.7 +.else +. error +.endif + +.if 3.7 < 3.30 +. error +.endif + +# As of 2020-08-23, numeric comparison is implemented as parsing both sides +# as double, and then performing a normal comparison. The range of double is +# typically 16 or 17 significant digits, therefore these two numbers seem to +# be equal. +.if 1.000000000000000001 < 1.000000000000000002 +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-ne.exp b/usr.bin/make/unit-tests/cond-cmp-numeric-ne.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-ne.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric-ne.mk b/usr.bin/make/unit-tests/cond-cmp-numeric-ne.mk new file mode 100644 index 000000000..0a366a905 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric-ne.mk @@ -0,0 +1,49 @@ +# $NetBSD: cond-cmp-numeric-ne.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for numeric comparisons with the != operator in .if conditions. + +# When both sides are equal, the != operator always yields false. +.if 1 != 1 +. error +.endif + +# This comparison yields the same result, whether numeric or character-based. +.if 1 != 2 +.else +. error +.endif + +.if 2 != 1 +.else +. error +.endif + +# Scientific notation is supported, as per strtod. +.if 2e7 != 2000e4 +. error +.endif + +.if 2000e4 != 2e7 +. error +.endif + +# Trailing zeroes after the decimal point are irrelevant for the numeric +# value. +.if 3.30000 != 3.3 +. error +.endif + +.if 3.3 != 3.30000 +. error +.endif + +# As of 2020-08-23, numeric comparison is implemented as parsing both sides +# as double, and then performing a normal comparison. The range of double is +# typically 16 or 17 significant digits, therefore these two numbers seem to +# be equal. +.if 1.000000000000000001 != 1.000000000000000002 +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric.exp b/usr.bin/make/unit-tests/cond-cmp-numeric.exp new file mode 100644 index 000000000..4a97b6879 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric.exp @@ -0,0 +1,11 @@ +CondParser_Eval: !(${:UINF} > 1e100) +make: "cond-cmp-numeric.mk" line 11: String comparison operator must be either == or != +CondParser_Eval: ${:UNaN} > NaN +make: "cond-cmp-numeric.mk" line 16: String comparison operator must be either == or != +CondParser_Eval: !(${:UNaN} == NaN) +lhs = "NaN", rhs = "NaN", op = == +CondParser_Eval: 123 ! 123 +make: "cond-cmp-numeric.mk" line 34: Malformed conditional (123 ! 123) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-cmp-numeric.mk b/usr.bin/make/unit-tests/cond-cmp-numeric.mk new file mode 100644 index 000000000..b1ec3e719 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-numeric.mk @@ -0,0 +1,41 @@ +# $NetBSD: cond-cmp-numeric.mk,v 1.4 2020/11/08 22:56:16 rillig Exp $ +# +# Tests for numeric comparisons in .if conditions. + +.MAKEFLAGS: -dc + +# The ${:U...} on the left-hand side is necessary for the parser. + +# Even if strtod(3) parses "INF" as +Infinity, make does not accept this +# since it is not really a number; see TryParseNumber. +.if !(${:UINF} > 1e100) +. error +.endif + +# Neither is NaN a number; see TryParseNumber. +.if ${:UNaN} > NaN +. error +.endif + +# Since NaN is not parsed as a number, both operands are interpreted +# as strings and are therefore equal. If they were parsed as numbers, +# they would compare unequal, since NaN is unequal to any and everything, +# including itself. +.if !(${:UNaN} == NaN) +. error +.endif + +# The parsing code in CondParser_Comparison only performs a light check on +# whether the operator is valid, leaving the rest of the work to the +# evaluation functions EvalCompareNum and EvalCompareStr. Ensure that this +# parse error is properly reported. +# +# XXX: The warning message does not mention the actual operator. +.if 123 ! 123 +. error +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-cmp-string.exp b/usr.bin/make/unit-tests/cond-cmp-string.exp new file mode 100644 index 000000000..a10341ed2 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-string.exp @@ -0,0 +1,11 @@ +make: "cond-cmp-string.mk" line 18: Malformed conditional (str != str) +make: "cond-cmp-string.mk" line 42: Malformed conditional ("string" != "str""ing") +make: "cond-cmp-string.mk" line 49: Malformed conditional (!("value" = "value")) +make: "cond-cmp-string.mk" line 56: Malformed conditional (!("value" === "value")) +make: "cond-cmp-string.mk" line 113: String comparison operator must be either == or != +make: "cond-cmp-string.mk" line 120: String comparison operator must be either == or != +make: "cond-cmp-string.mk" line 127: String comparison operator must be either == or != +make: "cond-cmp-string.mk" line 134: String comparison operator must be either == or != +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-cmp-string.mk b/usr.bin/make/unit-tests/cond-cmp-string.mk new file mode 100644 index 000000000..9f3e731b2 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-string.mk @@ -0,0 +1,138 @@ +# $NetBSD: cond-cmp-string.mk,v 1.14 2021/01/19 19:54:57 rillig Exp $ +# +# Tests for string comparisons in .if conditions. + +# This is a simple comparison of string literals. +# Nothing surprising here. +.if "str" != "str" +. error +.endif + +# The right-hand side of the comparison may be written without quotes. +.if "str" != str +. error +.endif + +# The left-hand side of the comparison must be enclosed in quotes. +# This one is not enclosed in quotes and thus generates an error message. +.if str != str +. error +.endif + +# The left-hand side of the comparison requires that any variable expression +# is defined. +# +# The variable named "" is never defined, nevertheless it can be used as a +# starting point for variable expressions. Applying the :U modifier to such +# an undefined expression turns it into a defined expression. +# +# See ApplyModifier_Defined and VEF_DEF. +.if ${:Ustr} != "str" +. error +.endif + +# Any character in a string literal may be escaped using a backslash. +# This means that "\n" does not mean a newline but a simple "n". +.if "string" != "\s\t\r\i\n\g" +. error +.endif + +# It is not possible to concatenate two string literals to form a single +# string. In C, Python and the shell this is possible, but not in make. +.if "string" != "str""ing" +. error +.else +. error +.endif + +# There is no = operator for strings. +.if !("value" = "value") +. error +.else +. error +.endif + +# There is no === operator for strings either. +.if !("value" === "value") +. error +.else +. error +.endif + +# A variable expression can be enclosed in double quotes. +.if ${:Uword} != "${:Uword}" +. error +.endif + +# Between 2003-01-01 (maybe even earlier) and 2020-10-30, adding one of the +# characters " \t!=><" directly after a variable expression resulted in a +# "Malformed conditional", even though the string was well-formed. +.if ${:Uword } != "${:Uword} " +. error +.endif +# Some other characters worked though, and some didn't. +# Those that are mentioned in is_separator didn't work. +.if ${:Uword0} != "${:Uword}0" +. error +.endif +.if ${:Uword&} != "${:Uword}&" +. error +.endif +.if ${:Uword!} != "${:Uword}!" +. error +.endif +.if ${:Uword<} != "${:Uword}<" +. error +.endif + +# Adding another variable expression to the string literal works though. +.if ${:Uword} != "${:Uwo}${:Urd}" +. error +.endif + +# Adding a space at the beginning of the quoted variable expression works +# though. +.if ${:U word } != " ${:Uword} " +. error +.endif + +# If at least one side of the comparison is a string literal, the string +# comparison is performed. +.if 12345 != "12345" +. error +.endif + +# If at least one side of the comparison is a string literal, the string +# comparison is performed. The ".0" in the left-hand side makes the two +# sides of the equation unequal. +.if 12345.0 == "12345" +. error +.endif + +# Strings cannot be compared relationally, only for equality. +.if "string" < "string" +. error +.else +. error +.endif + +# Strings cannot be compared relationally, only for equality. +.if "string" <= "string" +. error +.else +. error +.endif + +# Strings cannot be compared relationally, only for equality. +.if "string" > "string" +. error +.else +. error +.endif + +# Strings cannot be compared relationally, only for equality. +.if "string" >= "string" +. error +.else +. error +.endif diff --git a/usr.bin/make/unit-tests/cond-cmp-unary.exp b/usr.bin/make/unit-tests/cond-cmp-unary.exp new file mode 100644 index 000000000..89f90dc16 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-unary.exp @@ -0,0 +1,2 @@ +make: "cond-cmp-unary.mk" line 53: This is only reached because of a bug in EvalNotEmpty. +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-cmp-unary.mk b/usr.bin/make/unit-tests/cond-cmp-unary.mk new file mode 100644 index 000000000..168de0f30 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-cmp-unary.mk @@ -0,0 +1,58 @@ +# $NetBSD: cond-cmp-unary.mk,v 1.2 2020/11/11 07:30:11 rillig Exp $ +# +# Tests for unary comparisons in .if conditions, that is, comparisons with +# a single operand. If the operand is a number, it is compared to zero, +# if it is a string, it is tested for emptiness. + +# The number 0 evaluates to false. +.if 0 +. error +.endif + +# Any other number evaluates to true. +.if !12345 +. error +.endif + +# The empty string evaluates to false. +.if "" +. error +.endif + +# Any other string evaluates to true. +.if !"0" +. error +.endif + +# The empty string may come from a variable expression. +# +# XXX: As of 2020-11-11, this empty string is interpreted "as a number" in +# EvalNotEmpty, which is plain wrong. The bug is in TryParseNumber. +.if ${:U} +. error +.endif + +# A variable expression that is not surrounded by quotes is interpreted +# as a number if possible, otherwise as a string. +.if ${:U0} +. error +.endif + +# A non-zero number from a variable expression evaluates to true. +.if !${:U12345} +. error +.endif + +# A string of whitespace should evaluate to false. +# +# XXX: As of 2020-11-11, the implementation in EvalNotEmpty does not skip +# whitespace before testing for the end. This was probably an oversight in +# a commit from 1992-04-15 saying "A variable is empty when it just contains +# spaces". +.if ${:U } +. info This is only reached because of a bug in EvalNotEmpty. +.else +. error +.endif + +all: # nothing diff --git a/usr.bin/make/unit-tests/cond-eof.exp b/usr.bin/make/unit-tests/cond-eof.exp new file mode 100644 index 000000000..3b1e6eb1f --- /dev/null +++ b/usr.bin/make/unit-tests/cond-eof.exp @@ -0,0 +1,9 @@ +side effect +make: "cond-eof.mk" line 15: Malformed conditional (0 ${SIDE_EFFECT} ${SIDE_EFFECT2}) +side effect +make: "cond-eof.mk" line 17: Malformed conditional (1 ${SIDE_EFFECT} ${SIDE_EFFECT2}) +side effect +make: "cond-eof.mk" line 19: Malformed conditional ((0) ${SIDE_EFFECT} ${SIDE_EFFECT2}) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-eof.mk b/usr.bin/make/unit-tests/cond-eof.mk new file mode 100644 index 000000000..08f432bc4 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-eof.mk @@ -0,0 +1,20 @@ +# $NetBSD: cond-eof.mk,v 1.2 2020/12/14 20:28:09 rillig Exp $ +# +# Tests for parsing conditions, especially the end of such conditions, which +# are represented as the token TOK_EOF. + +SIDE_EFFECT= ${:!echo 'side effect' 1>&2!} +SIDE_EFFECT2= ${:!echo 'side effect 2' 1>&2!} + +# In the following conditions, ${SIDE_EFFECT} is the position of the first +# parse error. It is always fully evaluated, even if it were not necessary +# to expand the variable expression. This is because these syntax errors are +# an edge case that does not occur during normal operation, therefore there +# is no need to optimize for this case, and it would slow down the common +# case as well. +.if 0 ${SIDE_EFFECT} ${SIDE_EFFECT2} +.endif +.if 1 ${SIDE_EFFECT} ${SIDE_EFFECT2} +.endif +.if (0) ${SIDE_EFFECT} ${SIDE_EFFECT2} +.endif diff --git a/usr.bin/make/unit-tests/cond-func-commands.exp b/usr.bin/make/unit-tests/cond-func-commands.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-commands.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-func-commands.mk b/usr.bin/make/unit-tests/cond-func-commands.mk new file mode 100644 index 000000000..e127a8ebd --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-commands.mk @@ -0,0 +1,37 @@ +# $NetBSD: cond-func-commands.mk,v 1.5 2020/11/15 14:07:53 rillig Exp $ +# +# Tests for the commands() function in .if conditions. + +.MAIN: all + +# At this point, the target 'target' does not exist yet, therefore it cannot +# have commands. Sounds obvious, but good to know that it is really so. +.if commands(target) +. error +.endif + +target: + +# Now the target exists, but it still has no commands. +.if commands(target) +. error +.endif + +target: + # not a command + +# Even after the comment, the target still has no commands. +.if commands(target) +. error +.endif + +target: + @:; + +# Finally the target has commands. +.if !commands(target) +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-func-defined.exp b/usr.bin/make/unit-tests/cond-func-defined.exp new file mode 100644 index 000000000..878f56de2 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-defined.exp @@ -0,0 +1,8 @@ +make: "cond-func-defined.mk" line 23: Missing closing parenthesis for defined() +make: "cond-func-defined.mk" line 33: Missing closing parenthesis for defined() +make: "cond-func-defined.mk" line 45: In .for loops, variable expressions for the loop variables are +make: "cond-func-defined.mk" line 46: substituted at evaluation time. There is no actual variable +make: "cond-func-defined.mk" line 47: involved, even if it feels like it. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-func-defined.mk b/usr.bin/make/unit-tests/cond-func-defined.mk new file mode 100644 index 000000000..2aa49ccbf --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-defined.mk @@ -0,0 +1,52 @@ +# $NetBSD: cond-func-defined.mk,v 1.7 2020/11/15 14:07:53 rillig Exp $ +# +# Tests for the defined() function in .if conditions. + +DEF= defined +${:UA B}= variable name with spaces + +.if !defined(DEF) +. error +.endif + +# Horizontal whitespace (space tab) after the opening parenthesis is ignored. +.if !defined( DEF) +. error +.endif + +# Horizontal whitespace (space tab) before the closing parenthesis is ignored. +.if !defined(DEF ) +. error +.endif + +# The argument of a function must not directly contain whitespace. +.if !defined(A B) +. error +.endif + +# If necessary, the whitespace can be generated by a variable expression. +.if !defined(${:UA B}) +. error +.endif + +# Parse error: missing closing parenthesis; see ParseFuncArg. +.if defined(DEF +. error +.else +. error +.endif + +# Variables from .for loops are not defined. +# See directive-for.mk for more details. +.for var in value +. if defined(var) +. error +. else +. info In .for loops, variable expressions for the loop variables are +. info substituted at evaluation time. There is no actual variable +. info involved, even if it feels like it. +. endif +.endfor + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-func-empty.exp b/usr.bin/make/unit-tests/cond-func-empty.exp new file mode 100644 index 000000000..77a4edd47 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-empty.exp @@ -0,0 +1,5 @@ +make: "cond-func-empty.mk" line 152: Unclosed variable "WORD" +make: "cond-func-empty.mk" line 152: Malformed conditional (empty(WORD) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-func-empty.mk b/usr.bin/make/unit-tests/cond-func-empty.mk new file mode 100644 index 000000000..53d8557ce --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-empty.mk @@ -0,0 +1,184 @@ +# $NetBSD: cond-func-empty.mk,v 1.13 2021/03/15 12:15:03 rillig Exp $ +# +# Tests for the empty() function in .if conditions, which tests a variable +# expression for emptiness. +# +# Note that the argument in the parentheses is indeed a variable name, +# optionally followed by variable modifiers. +# + +.undef UNDEF +EMPTY= # empty +SPACE= ${:U } +WORD= word + +# An undefined variable is empty. +.if !empty(UNDEF) +. error +.endif + +# An undefined variable has the empty string as the value, and the :M +# variable modifier does not change that. +# +.if !empty(UNDEF:M*) +. error +.endif + +# The :S modifier replaces the empty value with an actual word. The +# expression is now no longer empty, but it is still possible to see whether +# the expression was based on an undefined variable. The expression has the +# flag VEF_UNDEF. +# +# The expression does not have the flag VEF_DEF though, therefore it is still +# considered undefined. Yes, indeed, undefined but not empty. There are a +# few variable modifiers that turn an undefined expression into a defined +# expression, among them :U and :D, but not :S. +# +# XXX: This is hard to explain to someone who doesn't know these +# implementation details. +# +.if !empty(UNDEF:S,^$,value,W) +. error +.endif + +# The :U modifier modifies expressions based on undefined variables +# (DEF_UNDEF) by adding the DEF_DEFINED flag, which marks the expression +# as "being interesting enough to be further processed". +# +.if empty(UNDEF:S,^$,value,W:Ufallback) +. error +.endif + +# And now to the surprising part. Applying the following :S modifier to the +# undefined expression makes it non-empty, but the marker VEF_UNDEF is +# preserved nevertheless. The :U modifier that follows only looks at the +# VEF_UNDEF flag to decide whether the variable is defined or not. This kind +# of makes sense since the :U modifier tests the _variable_, not the +# _expression_. +# +# But since the variable was undefined to begin with, the fallback value from +# the :U modifier is used in this expression. +# +.if ${UNDEF:S,^$,value,W:Ufallback} != "fallback" +. error +.endif + +# The variable EMPTY is completely empty (0 characters). +.if !empty(EMPTY) +. error +.endif + +# The variable SPACE has a single space, which counts as being empty. +.if !empty(SPACE) +. error +.endif + +# The variable .newline has a single newline, which counts as being empty. +.if !empty(.newline) +. error +.endif + +# The empty variable named "" gets a fallback value of " ", which counts as +# empty. +# +# Contrary to the other functions in conditionals, the trailing space is not +# stripped off, as can be seen in the -dv debug log. If the space had been +# stripped, it wouldn't make a difference in this case. +# +.if !empty(:U ) +. error +.endif + +# Now the variable named " " gets a non-empty value, which demonstrates that +# neither leading nor trailing spaces are trimmed in the argument of the +# function. If the spaces were trimmed, the variable name would be "" and +# that variable is indeed undefined. Since ParseEmptyArg calls Var_Parse +# without VarEvalFlags.undefErr, the value of the undefined variable is +# returned as an empty string. +${:U }= space +.if empty( ) +. error +.endif + +# The value of the following expression is " word", which is not empty. +.if empty(:U word) +. error +.endif + +# The :L modifier creates a variable expression that has the same value as +# its name, which both are "VAR" in this case. The value is therefore not +# empty. +.if empty(VAR:L) +. error +.endif + +# The variable WORD has the value "word", which does not count as empty. +.if empty(WORD) +. error +.endif + +# The expression ${} for a variable with the empty name always evaluates +# to an empty string (see Var_Parse, varUndefined). +.if !empty() +. error +.endif + +# Ensure that variable expressions that appear as part of the argument are +# properly parsed. Typical use cases for this are .for loops, which are +# expanded to exactly these ${:U} expressions. +# +# If everything goes well, the argument expands to "WORD", and that variable +# is defined at the beginning of this file. The surrounding 'W' and 'D' +# ensure that the parser in ParseEmptyArg has the correct position, both +# before and after the call to Var_Parse. +.if empty(W${:UOR}D) +. error +.endif + +# There may be spaces at the outside of the parentheses. +# Spaces inside the parentheses are interpreted as part of the variable name. +.if ! empty ( WORD ) +. error +.endif + +${:U WORD }= variable name with spaces + +# Now there is a variable named " WORD ", and it is not empty. +.if empty ( WORD ) +. error +.endif + +# Parse error: missing closing parenthesis. +.if empty(WORD +. error +.else +. error +.endif + +# Between 2020-06-28 and var.c 1.226 from 2020-07-02, this paragraph generated +# a wrong error message "Variable VARNAME is recursive". +# +# The bug was that the !empty() condition was evaluated, even though this was +# not necessary since the defined() condition already evaluated to false. +# +# When evaluating the !empty condition, the variable name was parsed as +# "VARNAME${:U2}", but without expanding any nested variable expression, in +# this case the ${:U2}. Therefore, the variable name came out as simply +# "VARNAME". Since this variable name should have been discarded quickly after +# parsing it, this unrealistic variable name should have done no harm. +# +# The variable expression was expanded though, and this was wrong. The +# expansion was done without VarEvalFlags.wantRes (called VARF_WANTRES back +# then) though. This had the effect that the ${:U1} from the value of VARNAME +# expanded to an empty string. This in turn created the seemingly recursive +# definition VARNAME=${VARNAME}, and that definition was never meant to be +# expanded. +# +# This was fixed by expanding nested variable expressions in the variable name +# only if the flag VarEvalFlags.wantRes is given. +VARNAME= ${VARNAME${:U1}} +.if defined(VARNAME${:U2}) && !empty(VARNAME${:U2}) +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-func-exists.exp b/usr.bin/make/unit-tests/cond-func-exists.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-exists.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-func-exists.mk b/usr.bin/make/unit-tests/cond-func-exists.mk new file mode 100644 index 000000000..48d7e727d --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-exists.mk @@ -0,0 +1,51 @@ +# $NetBSD: cond-func-exists.mk,v 1.6 2020/11/30 20:12:29 rillig Exp $ +# +# Tests for the exists() function in .if conditions. + +.if !exists(.) +. error +.endif + +# The argument to the function must not be enclosed in quotes. +# Neither double quotes nor single quotes are allowed. +.if exists(".") +. error +.endif + +.if exists('.') +. error +.endif + +# The only way to escape characters that would otherwise influence the parser +# is to enclose them in a variable expression. For function arguments, +# neither the backslash nor the dollar sign act as escape character. +.if exists(\.) +. error +.endif + +.if !exists(${:U.}) +. error +.endif + +# The argument to the function can have several variable expressions. +# See cond-func.mk for the characters that cannot be used directly. +.if !exists(${.PARSEDIR}/${.PARSEFILE}) +. error +.endif + +# Whitespace is trimmed on both sides of the function argument. +.if !exists( . ) +. error +.endif + +# The exists function does not really look up the file in the file system, +# instead it uses a cache that is preloaded very early, before parsing the +# first makefile. At that time, the file did not exist yet. +_!= > cond-func-exists.just-created +.if exists(cond-func-exists.just-created) +. error +.endif +_!= rm cond-func-exists.just-created + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-func-make-main.exp b/usr.bin/make/unit-tests/cond-func-make-main.exp new file mode 100644 index 000000000..3266459f3 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-make-main.exp @@ -0,0 +1,3 @@ +: Making dot-main-target-1a. +: Making dot-main-target-1b. +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-func-make-main.mk b/usr.bin/make/unit-tests/cond-func-make-main.mk new file mode 100644 index 000000000..31b370afa --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-make-main.mk @@ -0,0 +1,62 @@ +# $NetBSD: cond-func-make-main.mk,v 1.1 2020/11/22 19:37:27 rillig Exp $ +# +# Test how accurately the make() function in .if conditions reflects +# what is actually made. +# +# There are several ways to specify what is being made: +# +# 1. The default main target is the first target in the given makefiles that +# is not one of the special targets. For example, .PHONY is special when +# it appears on the left-hand side of the ':'. It is not special on the +# right-hand side though. +# +# 2. Command line arguments that are neither options (-ds or -k) nor variable +# assignments (VAR=value) are interpreted as targets to be made. These +# override the default main target from above. +# +# 3. All sources of the first '.MAIN: sources' line. Any further .MAIN line +# is treated as if .MAIN were a regular name. +# +# This test only covers items 1 and 3. For item 2, see cond-func-make.mk. + +first-main-target: + : Making ${.TARGET}. + +# Even though the main-target would actually be made at this point, it is +# ignored by the make() function. +.if make(first-main-target) +. error +.endif + +# Declaring a target via the .MAIN dependency adds it to the targets to be +# created (opts.create), but only that list was empty at the beginning of +# the line. This implies that several main targets can be set at the name +# time, but they have to be in the same dependency group. +# +# See ParseDoDependencyTargetSpecial, branch SP_MAIN. +.MAIN: dot-main-target-1a dot-main-target-1b + +.if !make(dot-main-target-1a) +. error +.endif +.if !make(dot-main-target-1b) +. error +.endif + +dot-main-target-{1,2}{a,b}: + : Making ${.TARGET}. + +# At this point, the list of targets to be made (opts.create) is not empty +# anymore. ParseDoDependencyTargetSpecial therefore treats the .MAIN as if +# it were an ordinary target. Since .MAIN is not listed as a dependency +# anywhere, it is not made. +.if target(.MAIN) +. error +.endif +.MAIN: dot-main-target-2a dot-main-target-2b +.if !target(.MAIN) +. error +.endif +.if make(dot-main-target-2a) +. error +.endif diff --git a/usr.bin/make/unit-tests/cond-func-make.exp b/usr.bin/make/unit-tests/cond-func-make.exp new file mode 100644 index 000000000..922203b72 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-make.exp @@ -0,0 +1,3 @@ +: via-cmdline +: via-dot-makeflags +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-func-make.mk b/usr.bin/make/unit-tests/cond-func-make.mk new file mode 100644 index 000000000..d75b69bcf --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-make.mk @@ -0,0 +1,24 @@ +# $NetBSD: cond-func-make.mk,v 1.3 2020/09/25 20:11:06 rillig Exp $ +# +# Tests for the make() function in .if conditions, which tests whether +# the argument has been passed as a target via the command line or later +# via the .MAKEFLAGS special dependency target. + +.if !make(via-cmdline) +. error +.endif +.if make(via-dot-makeflags) +. error +.endif + +.MAKEFLAGS: via-dot-makeflags + +.if !make(via-cmdline) +. error +.endif +.if !make(via-dot-makeflags) +. error +.endif + +via-cmdline via-dot-makeflags: + : $@ diff --git a/usr.bin/make/unit-tests/cond-func-target.exp b/usr.bin/make/unit-tests/cond-func-target.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-target.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-func-target.mk b/usr.bin/make/unit-tests/cond-func-target.mk new file mode 100644 index 000000000..62266839d --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func-target.mk @@ -0,0 +1,38 @@ +# $NetBSD: cond-func-target.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for the target() function in .if conditions. + +.MAIN: all + +# The target "target" does not exist yet. +.if target(target) +. error +.endif + +target: + +# The target exists, even though it does not have any commands. +.if !target(target) +. error +.endif + +target: + # not a command + +# Adding a comment to an existing target does not change whether the target +# is defined or not. +.if !target(target) +. error +.endif + +target: + @:; + +# Adding a command to an existing target does not change whether the target +# is defined or not. +.if !target(target) +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-func.exp b/usr.bin/make/unit-tests/cond-func.exp new file mode 100644 index 000000000..855b9e521 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func.exp @@ -0,0 +1,12 @@ +make: "cond-func.mk" line 36: Missing closing parenthesis for defined() +make: "cond-func.mk" line 51: Missing closing parenthesis for defined() +make: "cond-func.mk" line 54: Missing closing parenthesis for defined() +make: "cond-func.mk" line 94: The empty variable is never defined. +make: "cond-func.mk" line 102: A plain function name is parsed as !empty(...). +make: "cond-func.mk" line 109: A plain function name is parsed as !empty(...). +make: "cond-func.mk" line 119: Symbols may start with a function name. +make: "cond-func.mk" line 124: Symbols may start with a function name. +make: "cond-func.mk" line 130: Malformed conditional (defined() +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-func.mk b/usr.bin/make/unit-tests/cond-func.mk new file mode 100644 index 000000000..4ff43b72e --- /dev/null +++ b/usr.bin/make/unit-tests/cond-func.mk @@ -0,0 +1,137 @@ +# $NetBSD: cond-func.mk,v 1.9 2020/11/15 14:07:53 rillig Exp $ +# +# Tests for those parts of the functions in .if conditions that are common +# among several functions. +# +# The below test uses the function defined(...) since it has no side-effects, +# the other functions (except empty(...)) would work equally well. The +# function empty is special because it uses a different parsing algorithm for +# its argument. + +DEF= defined +${:UA B}= variable name with spaces +${:UVAR(value)}= variable name with parentheses +${:UVAR{value}}= variable name with balanced braces + +# Really strange variable names must be given indirectly via another variable, +# so that no unbalanced braces appear in the top-level expression. +VARNAME_UNBALANCED_BRACES= VAR{{{value +${VARNAME_UNBALANCED_BRACES}= variable name with unbalanced braces + +.if !defined(DEF) +. error +.endif + +# Horizontal whitespace (space tab) after the opening parenthesis is ignored. +.if !defined( DEF) +. error +.endif + +# Horizontal whitespace (space tab) before the closing parenthesis is ignored. +.if !defined(DEF ) +. error +.endif + +# The argument of a function must not directly contain whitespace. +.if !defined(A B) +. error +.endif + +# If necessary, the whitespace can be generated by a variable expression. +.if !defined(${:UA B}) +. error +.endif + +# Characters that could be mistaken for operators must not appear directly +# in a function argument. As with whitespace, these can be generated +# indirectly. +# +# It's not entirely clear why these characters are forbidden. +# The most plausible reason seems to be typo detection. +.if !defined(A&B) +. error +.endif +.if !defined(A|B) +. error +.endif + +# Even parentheses may appear in variable names. +# They must be balanced though. +.if !defined(VAR(value)) +. error +.endif + +# Braces do not have any special meaning when parsing arguments. +.if !defined(VAR{value}) +. error +.endif + +# Braces do not have any special meaning when parsing arguments. +# They don't need to be balanced. +.if !defined(VAR{{{value) +. error +.endif + +# There may be spaces around the operators and parentheses, and even +# inside the parentheses. The spaces inside the parentheses are not +# allowed for the empty() function (see cond-func-empty.mk), therefore +# they are typically omitted for the other functions as well. +.if ! defined ( DEF ) +. error +.endif + +# The following condition is interpreted as defined(A) && defined(B). +# In lack of a function call expression, each kind of .if directive has a +# default function that is called when a bare word is parsed. For the plain +# .if directive, this function is defined(); see "struct If ifs" in cond.c. +.if A&B +. error +.endif + +.if defined() +. error +.else +. info The empty variable is never defined. +.endif + +# The plain word 'defined' is interpreted as '!empty(defined)'. +# That variable is not defined (yet). +.if defined +. error +.else +. info A plain function name is parsed as !empty(...). +.endif + +# If a variable named 'defined' is actually defined and not empty, the plain +# symbol 'defined' evaluates to true. +defined= non-empty +.if defined +. info A plain function name is parsed as !empty(...). +.else +. error +.endif + +# A plain symbol name may start with one of the function names, in this case +# 'defined'. +.if defined-var +. error +.else +. info Symbols may start with a function name. +.endif + +defined-var= non-empty +.if defined-var +. info Symbols may start with a function name. +.else +. error +.endif + +# Missing closing parenthesis when parsing the function argument. +.if defined( +. error +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-late.exp b/usr.bin/make/unit-tests/cond-late.exp new file mode 100644 index 000000000..46c4aa2f4 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-late.exp @@ -0,0 +1,4 @@ +make: Bad conditional expression ` != "no"' in != "no"?: +yes +no +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-late.mk b/usr.bin/make/unit-tests/cond-late.mk new file mode 100644 index 000000000..4df3df2cf --- /dev/null +++ b/usr.bin/make/unit-tests/cond-late.mk @@ -0,0 +1,31 @@ +# $NetBSD: cond-late.mk,v 1.3 2020/11/15 14:07:53 rillig Exp $ +# +# Using the :? modifier, variable expressions can contain conditional +# expressions that are evaluated late, at expansion time. +# +# Any variables appearing in these +# conditions are expanded before parsing the condition. This is +# different from many other places. +# +# Because of this, variables that are used in these lazy conditions +# should not contain double-quotes, or the parser will probably fail. +# +# They should also not contain operators like == or <, since these are +# actually interpreted as these operators. This is demonstrated below. +# + +all: cond-literal + +COND.true= "yes" == "yes" +COND.false= "yes" != "yes" + +# If the order of evaluation were to change to first parse the condition +# and then expand the variables, the output would change from the +# current "yes no" to "yes yes", since both variables are non-empty. +cond-literal: + @echo ${ ${COND.true} :?yes:no} + @echo ${ ${COND.false} :?yes:no} + +VAR+= ${${UNDEF} != "no":?:} +.if empty(VAR:Mpattern) +.endif diff --git a/usr.bin/make/unit-tests/cond-op-and-lint.exp b/usr.bin/make/unit-tests/cond-op-and-lint.exp new file mode 100644 index 000000000..8817fd0d6 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-and-lint.exp @@ -0,0 +1,4 @@ +make: "cond-op-and-lint.mk" line 9: Unknown operator '&' +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op-and-lint.mk b/usr.bin/make/unit-tests/cond-op-and-lint.mk new file mode 100644 index 000000000..626233901 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-and-lint.mk @@ -0,0 +1,13 @@ +# $NetBSD: cond-op-and-lint.mk,v 1.1 2020/11/08 23:54:28 rillig Exp $ +# +# Tests for the && operator in .if conditions, in lint mode. + +.MAKEFLAGS: -dL + +# The '&' operator is not allowed in lint mode. +# It is not used in practice anyway. +.if 0 & 0 +. error +.else +. error +.endif diff --git a/usr.bin/make/unit-tests/cond-op-and.exp b/usr.bin/make/unit-tests/cond-op-and.exp new file mode 100644 index 000000000..173b6861a --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-and.exp @@ -0,0 +1,4 @@ +make: "cond-op-and.mk" line 43: Malformed conditional (0 &&& 0) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op-and.mk b/usr.bin/make/unit-tests/cond-op-and.mk new file mode 100644 index 000000000..83c694f15 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-and.mk @@ -0,0 +1,48 @@ +# $NetBSD: cond-op-and.mk,v 1.5 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for the && operator in .if conditions. + +.if 0 && 0 +. error +.endif + +.if 1 && 0 +. error +.endif + +.if 0 && 1 +. error +.endif + +.if !(1 && 1) +. error +.endif + +# The right-hand side is not evaluated since the left-hand side is already +# false. +.if 0 && ${UNDEF} +.endif + +# The && operator may be abbreviated as &. This is not widely known though +# and is also not documented in the manual page. + +.if 0 & 0 +. error +.endif +.if 1 & 0 +. error +.endif +.if 0 & 1 +. error +.endif +.if !(1 & 1) +. error +.endif + +# There is no operator &&&. +.if 0 &&& 0 +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-op-not.exp b/usr.bin/make/unit-tests/cond-op-not.exp new file mode 100644 index 000000000..440670ca7 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-not.exp @@ -0,0 +1,9 @@ +make: "cond-op-not.mk" line 29: Not empty evaluates to true. +make: "cond-op-not.mk" line 37: Not space evaluates to false. +make: "cond-op-not.mk" line 41: Not 0 evaluates to true. +make: "cond-op-not.mk" line 49: Not 1 evaluates to false. +make: "cond-op-not.mk" line 55: Not word evaluates to false. +make: "cond-op-not.mk" line 59: Malformed conditional (!) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op-not.mk b/usr.bin/make/unit-tests/cond-op-not.mk new file mode 100644 index 000000000..ffd5bc89e --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-not.mk @@ -0,0 +1,66 @@ +# $NetBSD: cond-op-not.mk,v 1.7 2021/01/19 17:49:13 rillig Exp $ +# +# Tests for the ! operator in .if conditions, which negates its argument. + +# The exclamation mark negates its operand. +.if !1 +. error +.endif + +# Exclamation marks can be chained. +# This doesn't happen in practice though. +.if !!!1 +. error +.endif + +# The ! binds more tightly than the &&. +.if !!0 && 1 +. error +.endif + +# The operator '==' binds more tightly than '!'. +# This is unusual since most other programming languages define the precedence +# to be the other way round. +.if !${:Uexpression} == "expression" +. error +.endif + +.if !${:U} +. info Not empty evaluates to true. +.else +. info Not empty evaluates to false. +.endif + +.if !${:U } +. info Not space evaluates to true. +.else +. info Not space evaluates to false. +.endif + +.if !${:U0} +. info Not 0 evaluates to true. +.else +. info Not 0 evaluates to false. +.endif + +.if !${:U1} +. info Not 1 evaluates to true. +.else +. info Not 1 evaluates to false. +.endif + +.if !${:Uword} +. info Not word evaluates to true. +.else +. info Not word evaluates to false. +.endif + +# A single exclamation mark is a parse error. +.if ! +. error +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-op-or-lint.exp b/usr.bin/make/unit-tests/cond-op-or-lint.exp new file mode 100644 index 000000000..8abae99b6 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-or-lint.exp @@ -0,0 +1,4 @@ +make: "cond-op-or-lint.mk" line 9: Unknown operator '|' +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op-or-lint.mk b/usr.bin/make/unit-tests/cond-op-or-lint.mk new file mode 100644 index 000000000..aa29e9a6c --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-or-lint.mk @@ -0,0 +1,13 @@ +# $NetBSD: cond-op-or-lint.mk,v 1.1 2020/11/08 23:54:28 rillig Exp $ +# +# Tests for the || operator in .if conditions, in lint mode. + +.MAKEFLAGS: -dL + +# The '|' operator is not allowed in lint mode. +# It is not used in practice anyway. +.if 0 | 0 +. error +.else +. error +.endif diff --git a/usr.bin/make/unit-tests/cond-op-or.exp b/usr.bin/make/unit-tests/cond-op-or.exp new file mode 100644 index 000000000..7888a475e --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-or.exp @@ -0,0 +1,4 @@ +make: "cond-op-or.mk" line 43: Malformed conditional (0 ||| 0) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op-or.mk b/usr.bin/make/unit-tests/cond-op-or.mk new file mode 100644 index 000000000..c6993e7c2 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-or.mk @@ -0,0 +1,48 @@ +# $NetBSD: cond-op-or.mk,v 1.6 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for the || operator in .if conditions. + +.if 0 || 0 +. error +.endif + +.if !(1 || 0) +. error +.endif + +.if !(0 || 1) +. error +.endif + +.if !(1 || 1) +. error +.endif + +# The right-hand side is not evaluated since the left-hand side is already +# true. +.if 1 || ${UNDEF} +.endif + +# The || operator may be abbreviated as |. This is not widely known though +# and is also not documented in the manual page. + +.if 0 | 0 +. error +.endif +.if !(1 | 0) +. error +.endif +.if !(0 | 1) +. error +.endif +.if !(1 | 1) +. error +.endif + +# There is no operator |||. +.if 0 ||| 0 +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-op-parentheses.exp b/usr.bin/make/unit-tests/cond-op-parentheses.exp new file mode 100644 index 000000000..b44093304 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-parentheses.exp @@ -0,0 +1,6 @@ +make: "cond-op-parentheses.mk" line 13: Parentheses can be nested at least to depth 112. +make: "cond-op-parentheses.mk" line 19: Malformed conditional (() +make: "cond-op-parentheses.mk" line 29: Malformed conditional ()) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op-parentheses.mk b/usr.bin/make/unit-tests/cond-op-parentheses.mk new file mode 100644 index 000000000..ca288cad5 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op-parentheses.mk @@ -0,0 +1,36 @@ +# $NetBSD: cond-op-parentheses.mk,v 1.4 2021/01/19 17:49:13 rillig Exp $ +# +# Tests for parentheses in .if conditions. + +# TODO: Implementation + +# Test for deeply nested conditions. +.if (((((((((((((((((((((((((((((((((((((((((((((((((((((((( \ + (((((((((((((((((((((((((((((((((((((((((((((((((((((((( \ + 1 \ + )))))))))))))))))))))))))))))))))))))))))))))))))))))))) \ + )))))))))))))))))))))))))))))))))))))))))))))))))))))))) +. info Parentheses can be nested at least to depth 112. +.else +. error +.endif + +# An unbalanced opening parenthesis is a parse error. +.if ( +. error +.else +. error +.endif + +# An unbalanced closing parenthesis is a parse error. +# +# As of 2021-01-19, CondParser_Term returned TOK_RPAREN even though this +# function promised to only ever return TOK_TRUE, TOK_FALSE or TOK_ERROR. +.if ) +. error +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-op.exp b/usr.bin/make/unit-tests/cond-op.exp new file mode 100644 index 000000000..28e8d48e2 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op.exp @@ -0,0 +1,20 @@ +make: "cond-op.mk" line 50: Malformed conditional ("!word" == !word) +make: "cond-op.mk" line 75: Malformed conditional (0 ${ERR::=evaluated}) +make: "cond-op.mk" line 79: After detecting a parse error, the rest is evaluated. +make: "cond-op.mk" line 83: Parsing continues until here. +make: "cond-op.mk" line 86: A B C => (A || B) && C A || B && C A || (B && C) +make: "cond-op.mk" line 93: 0 0 0 => 0 0 0 +make: "cond-op.mk" line 93: 0 0 1 => 0 0 0 +make: "cond-op.mk" line 93: 0 1 0 => 0 0 0 +make: "cond-op.mk" line 93: 0 1 1 => 1 1 1 +make: "cond-op.mk" line 93: 1 0 0 => 0 1 1 +make: "cond-op.mk" line 93: 1 0 1 => 1 1 1 +make: "cond-op.mk" line 93: 1 1 0 => 0 1 1 +make: "cond-op.mk" line 93: 1 1 1 => 1 1 1 +make: "cond-op.mk" line 104: Malformed conditional (1 &&) +make: "cond-op.mk" line 112: Malformed conditional (0 &&) +make: "cond-op.mk" line 120: Malformed conditional (1 ||) +make: "cond-op.mk" line 129: Malformed conditional (0 ||) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-op.mk b/usr.bin/make/unit-tests/cond-op.mk new file mode 100644 index 000000000..2ed451c90 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-op.mk @@ -0,0 +1,136 @@ +# $NetBSD: cond-op.mk,v 1.13 2021/01/19 18:20:30 rillig Exp $ +# +# Tests for operators like &&, ||, ! in .if conditions. +# +# See also: +# cond-op-and.mk +# cond-op-not.mk +# cond-op-or.mk +# cond-op-parentheses.mk + +# In make, && binds more tightly than ||, like in C. +# If make had the same precedence for both && and ||, like in the shell, +# the result would be different. +# If || were to bind more tightly than &&, the result would be different +# as well. +.if !(1 || 1 && 0) +. error +.endif + +# If make were to interpret the && and || operators like the shell, the +# previous condition would be interpreted as: +.if (1 || 1) && 0 +. error +.endif + +# The precedence of the ! operator is different from C though. It has a +# lower precedence than the comparison operators. Negating a condition +# does not need parentheses. +# +# This kind of condition looks so unfamiliar that it doesn't occur in +# practice. +.if !"word" == "word" +. error +.endif + +# This is how the above condition is actually interpreted. +.if !("word" == "word") +. error +.endif + +# TODO: Demonstrate that the precedence of the ! and == operators actually +# makes a difference. There is a simple example for sure, I just cannot +# wrap my head around it right now. See the truth table generator below +# for an example that doesn't require much thought. + +# This condition is malformed because the '!' on the right-hand side must not +# appear unquoted. If any, it must be enclosed in quotes. +# In any case, it is not interpreted as a negation of an unquoted string. +# See CondParser_String. +.if "!word" == !word +. error +.endif + +# Surprisingly, the ampersand and pipe are allowed in bare strings. +# That's another opportunity for writing confusing code. +# See CondParser_String, which only has '!' in the list of stop characters. +.if "a&&b||c" != a&&b||c +. error +.endif + +# As soon as the parser sees the '$', it knows that the condition will +# be malformed. Therefore there is no point in evaluating it. +# +# As of 2021-01-20, that part of the condition is evaluated nevertheless, +# since CondParser_Or just requests the next token, without restricting +# the token to the expected tokens. If the parser were to restrict the +# valid follow tokens for the token "0" to those that can actually produce +# a correct condition (which in this case would be comparison operators, +# TOK_AND, TOK_OR or TOK_RPAREN), the variable expression would not have +# to be evaluated. +# +# This would add a good deal of complexity to the code though, for almost +# no benefit, especially since most expressions and conditions are side +# effect free. +.if 0 ${ERR::=evaluated} +. error +.endif +.if ${ERR:Uundefined} == evaluated +. info After detecting a parse error, the rest is evaluated. +.endif + +# Just in case that parsing should ever stop on the first error. +.info Parsing continues until here. + +# Demonstration that '&&' has higher precedence than '||'. +.info A B C => (A || B) && C A || B && C A || (B && C) +.for a in 0 1 +. for b in 0 1 +. for c in 0 1 +. for r1 in ${ ($a || $b) && $c :?1:0} +. for r2 in ${ $a || $b && $c :?1:0} +. for r3 in ${ $a || ($b && $c) :?1:0} +. info $a $b $c => ${r1} ${r2} ${r3} +. endfor +. endfor +. endfor +. endfor +. endfor +.endfor + +# This condition is obviously malformed. It is properly detected and also +# was properly detected before 2021-01-19, but only because the left hand +# side of the '&&' evaluated to true. +.if 1 && +. error +.else +. error +.endif + +# This obviously malformed condition was not detected as such before cond.c +# 1.238 from 2021-01-19. +.if 0 && +. error +.else +. error +.endif + +# This obviously malformed condition was not detected as such before cond.c +# 1.238 from 2021-01-19. +.if 1 || +. error +.else +. error +.endif + +# This condition is obviously malformed. It is properly detected and also +# was properly detected before 2021-01-19, but only because the left hand +# side of the '||' evaluated to false. +.if 0 || +. error +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-short.exp b/usr.bin/make/unit-tests/cond-short.exp new file mode 100644 index 000000000..2865dcb6e --- /dev/null +++ b/usr.bin/make/unit-tests/cond-short.exp @@ -0,0 +1,16 @@ +expected and +expected and exists +expected and empty +expected U23 condition +expected VAR23 +expected M pattern +expected or +expected or exists +expected or empty +defined(V42) && ${V42} > 0: Ok +defined(V66) && ( "${iV2}" < ${V42} ): Ok +1 || ${iV1} < ${V42}: Ok +1 || ${iV2:U2} < ${V42}: Ok +0 || ${iV1} <= ${V42}: Ok +0 || ${iV2:U2} < ${V42}: Ok +exit status 0 diff --git a/usr.bin/make/unit-tests/cond-short.mk b/usr.bin/make/unit-tests/cond-short.mk new file mode 100644 index 000000000..113c3fd08 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-short.mk @@ -0,0 +1,214 @@ +# $NetBSD: cond-short.mk,v 1.16 2021/03/14 11:49:37 rillig Exp $ +# +# Demonstrates that in conditions, the right-hand side of an && or || +# is only evaluated if it can actually influence the result. +# This is called 'short-circuit evaluation' and is the usual evaluation +# mode in most programming languages. A notable exception is Ada, which +# distinguishes between the operators 'And', 'And Then', 'Or', 'Or Else'. +# +# Before 2020-06-28, the right-hand side of an && or || operator was always +# evaluated, which was wrong. In cond.c 1.69 and var.c 1.197 on 2015-10-11, +# Var_Parse got a new parameter named 'wantit'. Since then it would have been +# possible to skip evaluation of irrelevant variable expressions and only +# parse them. They were still evaluated though, the only difference to +# relevant variable expressions was that in the irrelevant variable +# expressions, undefined variables were allowed. +# +# See also: +# var-eval-short.mk, for short-circuited variable modifiers + +# The && operator: + +.if 0 && ${echo "unexpected and" 1>&2 :L:sh} +.endif + +.if 1 && ${echo "expected and" 1>&2 :L:sh} +.endif + +.if 0 && exists(nonexistent${echo "unexpected and exists" 1>&2 :L:sh}) +.endif + +.if 1 && exists(nonexistent${echo "expected and exists" 1>&2 :L:sh}) +.endif + +.if 0 && empty(${echo "unexpected and empty" 1>&2 :L:sh}) +.endif + +.if 1 && empty(${echo "expected and empty" 1>&2 :L:sh}) +.endif + +# "VAR U11" is not evaluated; it was evaluated before 2020-07-02. +# The whole !empty condition is only parsed and then discarded. +VAR= ${VAR${:U11${echo "unexpected VAR U11" 1>&2 :L:sh}}} +VAR13= ${VAR${:U12${echo "unexpected VAR13" 1>&2 :L:sh}}} +.if 0 && !empty(VAR${:U13${echo "unexpected U13 condition" 1>&2 :L:sh}}) +.endif + +VAR= ${VAR${:U21${echo "unexpected VAR U21" 1>&2 :L:sh}}} +VAR23= ${VAR${:U22${echo "expected VAR23" 1>&2 :L:sh}}} +.if 1 && !empty(VAR${:U23${echo "expected U23 condition" 1>&2 :L:sh}}) +.endif +VAR= # empty again, for the following tests + +# The :M modifier is only parsed, not evaluated. +# Before 2020-07-02, it was wrongly evaluated. +.if 0 && !empty(VAR:M${:U${echo "unexpected M pattern" 1>&2 :L:sh}}) +.endif + +.if 1 && !empty(VAR:M${:U${echo "expected M pattern" 1>&2 :L:sh}}) +.endif + +.if 0 && !empty(VAR:S,from,${:U${echo "unexpected S modifier" 1>&2 :L:sh}},) +.endif + +.if 0 && !empty(VAR:C,from,${:U${echo "unexpected C modifier" 1>&2 :L:sh}},) +.endif + +.if 0 && !empty("" == "" :? ${:U${echo "unexpected ? modifier" 1>&2 :L:sh}} :) +.endif + +.if 0 && !empty(VAR:old=${:U${echo "unexpected = modifier" 1>&2 :L:sh}}) +.endif + +.if 0 && !empty(1 2 3:L:@var@${:U${echo "unexpected @ modifier" 1>&2 :L:sh}}@) +.endif + +.if 0 && !empty(:U${:!echo "unexpected exclam modifier" 1>&2 !}) +.endif + +# Irrelevant assignment modifiers are skipped as well. +.if 0 && ${1 2 3:L:@i@${FIRST::?=$i}@} +.endif +.if 0 && ${1 2 3:L:@i@${LAST::=$i}@} +.endif +.if 0 && ${1 2 3:L:@i@${APPENDED::+=$i}@} +.endif +.if 0 && ${echo.1 echo.2 echo.3:L:@i@${RAN::!=${i:C,.*,&; & 1>\&2,:S,., ,g}}@} +.endif +.if defined(FIRST) || defined(LAST) || defined(APPENDED) || defined(RAN) +. warning first=${FIRST} last=${LAST} appended=${APPENDED} ran=${RAN} +.endif + +# The || operator: + +.if 1 || ${echo "unexpected or" 1>&2 :L:sh} +.endif + +.if 0 || ${echo "expected or" 1>&2 :L:sh} +.endif + +.if 1 || exists(nonexistent${echo "unexpected or exists" 1>&2 :L:sh}) +.endif + +.if 0 || exists(nonexistent${echo "expected or exists" 1>&2 :L:sh}) +.endif + +.if 1 || empty(${echo "unexpected or empty" 1>&2 :L:sh}) +.endif + +.if 0 || empty(${echo "expected or empty" 1>&2 :L:sh}) +.endif + +# Unreachable nested conditions are skipped completely as well. + +.if 0 +. if ${echo "unexpected nested and" 1>&2 :L:sh} +. endif +.endif + +.if 1 +.elif ${echo "unexpected nested or" 1>&2 :L:sh} +.endif + +# make sure these do not cause complaint +#.MAKEFLAGS: -dc + +# TODO: Rewrite this whole section and check all the conditions and variables. +# Several of the assumptions are probably wrong here. +# TODO: replace 'x=' with '.info' or '.error'. +V42= 42 +iV1= ${V42} +iV2= ${V66} + +.if defined(V42) && ${V42} > 0 +x= Ok +.else +x= Fail +.endif +x!= echo 'defined(V42) && $${V42} > 0: $x' >&2; echo + +# With cond.c 1.76 from 2020-07-03, the following condition triggered a +# warning: "String comparison operator should be either == or !=". +# This was because the variable expression ${iV2} was defined, but the +# contained variable V66 was undefined. The left-hand side of the comparison +# therefore evaluated to the string "${V66}", which is obviously not a number. +# +# This was fixed in cond.c 1.79 from 2020-07-09 by not evaluating irrelevant +# comparisons. Instead, they are only parsed and then discarded. +# +# At that time, there was not enough debug logging to see the details in the +# -dA log. To actually see it, add debug logging at the beginning and end of +# Var_Parse. +.if defined(V66) && ( ${iV2} < ${V42} ) +x= Fail +.else +x= Ok +.endif +# XXX: This condition doesn't match the one above. The quotes are missing +# above. This is a crucial detail since without quotes, the variable +# expression ${iV2} evaluates to "${V66}", and with quotes, it evaluates to "" +# since undefined variables are allowed and expand to an empty string. +x!= echo 'defined(V66) && ( "$${iV2}" < $${V42} ): $x' >&2; echo + +.if 1 || ${iV1} < ${V42} +x= Ok +.else +x= Fail +.endif +x!= echo '1 || $${iV1} < $${V42}: $x' >&2; echo + +# With cond.c 1.76 from 2020-07-03, the following condition triggered a +# warning: "String comparison operator should be either == or !=". +# This was because the variable expression ${iV2} was defined, but the +# contained variable V66 was undefined. The left-hand side of the comparison +# therefore evaluated to the string "${V66}", which is obviously not a number. +# +# This was fixed in cond.c 1.79 from 2020-07-09 by not evaluating irrelevant +# comparisons. Instead, they are only parsed and then discarded. +# +# At that time, there was not enough debug logging to see the details in the +# -dA log. To actually see it, add debug logging at the beginning and end of +# Var_Parse. +.if 1 || ${iV2:U2} < ${V42} +x= Ok +.else +x= Fail +.endif +x!= echo '1 || $${iV2:U2} < $${V42}: $x' >&2; echo + +# the same expressions are fine when the lhs is expanded +# ${iV1} expands to 42 +.if 0 || ${iV1} <= ${V42} +x= Ok +.else +x= Fail +.endif +x!= echo '0 || $${iV1} <= $${V42}: $x' >&2; echo + +# ${iV2:U2} expands to 2 +.if 0 || ${iV2:U2} < ${V42} +x= Ok +.else +x= Fail +.endif +x!= echo '0 || $${iV2:U2} < $${V42}: $x' >&2; echo + +# The right-hand side of the '&&' is irrelevant since the left-hand side +# already evaluates to false. Before cond.c 1.79 from 2020-07-09, it was +# expanded nevertheless, although with a small modification: undefined +# variables may be used in these expressions without generating an error. +.if defined(UNDEF) && ${UNDEF} != "undefined" +. error +.endif + +all: diff --git a/usr.bin/make/unit-tests/cond-token-number.exp b/usr.bin/make/unit-tests/cond-token-number.exp new file mode 100644 index 000000000..b5bfaf95d --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-number.exp @@ -0,0 +1,8 @@ +make: "cond-token-number.mk" line 15: Malformed conditional (-0) +make: "cond-token-number.mk" line 25: Malformed conditional (+0) +make: "cond-token-number.mk" line 35: Malformed conditional (!-1) +make: "cond-token-number.mk" line 45: Malformed conditional (!+1) +make: "cond-token-number.mk" line 80: End of the tests. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-token-number.mk b/usr.bin/make/unit-tests/cond-token-number.mk new file mode 100644 index 000000000..93e2646a6 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-number.mk @@ -0,0 +1,82 @@ +# $NetBSD: cond-token-number.mk,v 1.5 2020/11/15 14:58:14 rillig Exp $ +# +# Tests for number tokens in .if conditions. +# +# TODO: Add introduction. + +.if 0 +. error +.endif + +# Even though -0 is a number and would be accepted by strtod, it is not +# accepted by the condition parser. +# +# See the ch_isdigit call in CondParser_String. +.if -0 +. error +.else +. error +.endif + +# Even though +0 is a number and would be accepted by strtod, it is not +# accepted by the condition parser. +# +# See the ch_isdigit call in CondParser_String. +.if +0 +. error +.else +. error +.endif + +# Even though -1 is a number and would be accepted by strtod, it is not +# accepted by the condition parser. +# +# See the ch_isdigit call in CondParser_String. +.if !-1 +. error +.else +. error +.endif + +# Even though +1 is a number and would be accepted by strtod, it is not +# accepted by the condition parser. +# +# See the ch_isdigit call in CondParser_String. +.if !+1 +. error +.else +. error +.endif + +# When the number comes from a variable expression though, it may be signed. +# XXX: This is inconsistent. +.if ${:U+0} +. error +.endif + +# When the number comes from a variable expression though, it may be signed. +# XXX: This is inconsistent. +.if !${:U+1} +. error +.endif + +# Hexadecimal numbers are accepted. +.if 0x0 +. error +.endif +.if 0x1 +.else +. error +.endif + +# This is not a hexadecimal number, even though it has an x. +# It is interpreted as a string instead, effectively meaning defined(3x4). +.if 3x4 +.else +. error +.endif + +# Ensure that parsing continues until here. +.info End of the tests. + +all: # nothing diff --git a/usr.bin/make/unit-tests/cond-token-plain.exp b/usr.bin/make/unit-tests/cond-token-plain.exp new file mode 100644 index 000000000..24cfa6bcb --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-plain.exp @@ -0,0 +1,54 @@ +CondParser_Eval: ${:Uvalue} != value +lhs = "value", rhs = "value", op = != +CondParser_Eval: ${:U} != " +lhs = "", rhs = "", op = != +CondParser_Eval: ${:U#hash} != "#hash" +lhs = "#hash", rhs = "#hash", op = != +CondParser_Eval: ${:U\\} != "\\ +lhs = "\", rhs = "\", op = != +CondParser_Eval: ${:U#hash} != #hash +lhs = "#hash", rhs = "#hash", op = != +CondParser_Eval: 0 # This is treated as a comment, but why? +CondParser_Eval: ${0 # comment :?yes:no} != no +CondParser_Eval: 0 # comment +lhs = "no", rhs = "no", op = != +CondParser_Eval: ${1 # comment :?yes:no} != yes +CondParser_Eval: 1 # comment +lhs = "yes", rhs = "yes", op = != +CondParser_Eval: ${UNDEF:Uundefined}!=undefined +lhs = "undefined", rhs = "undefined", op = != +CondParser_Eval: ${UNDEF:U12345}>12345 +lhs = 12345.000000, rhs = 12345.000000, op = > +CondParser_Eval: ${UNDEF:U12345}<12345 +lhs = 12345.000000, rhs = 12345.000000, op = < +CondParser_Eval: (${UNDEF:U0})||0 +CondParser_Eval: ${:Uvar}&&name != "var&&name" +lhs = "var&&name", rhs = "var&&name", op = != +CondParser_Eval: ${:Uvar}||name != "var||name" +lhs = "var||name", rhs = "var||name", op = != +CondParser_Eval: bare +make: "cond-token-plain.mk" line 102: A bare word is treated like defined(...), and the variable 'bare' is not defined. +CondParser_Eval: VAR +make: "cond-token-plain.mk" line 107: A bare word is treated like defined(...). +CondParser_Eval: V${:UA}R +make: "cond-token-plain.mk" line 114: ok +CondParser_Eval: V${UNDEF}AR +make: "cond-token-plain.mk" line 122: Undefined variables in bare words expand to an empty string. +CondParser_Eval: 0${:Ux00} +make: "cond-token-plain.mk" line 130: Numbers can be composed from literals and variable expressions. +CondParser_Eval: 0${:Ux01} +make: "cond-token-plain.mk" line 134: Numbers can be composed from literals and variable expressions. +CondParser_Eval: "" == +make: "cond-token-plain.mk" line 140: Missing right-hand-side of operator '==' +CondParser_Eval: == "" +make: "cond-token-plain.mk" line 148: Malformed conditional (== "") +CondParser_Eval: \\ +make: "cond-token-plain.mk" line 163: The variable '\\' is not defined. +CondParser_Eval: \\ +make: "cond-token-plain.mk" line 168: Now the variable '\\' is defined. +CondParser_Eval: "unquoted\"quoted" != unquoted"quoted +lhs = "unquoted"quoted", rhs = "unquoted"quoted", op = != +CondParser_Eval: $$$$$$$$ != "" +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-token-plain.mk b/usr.bin/make/unit-tests/cond-token-plain.mk new file mode 100644 index 000000000..89f2247e0 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-plain.mk @@ -0,0 +1,192 @@ +# $NetBSD: cond-token-plain.mk,v 1.10 2021/01/21 14:08:09 rillig Exp $ +# +# Tests for plain tokens (that is, string literals without quotes) +# in .if conditions. + +.MAKEFLAGS: -dc + +.if ${:Uvalue} != value +. error +.endif + +# Malformed condition since comment parsing is done in an early phase +# and removes the '#' and everything behind it long before the condition +# parser gets to see it. +# +# XXX: The error message is missing for this malformed condition. +# The right-hand side of the comparison is just a '"', before unescaping. +.if ${:U} != "#hash" +. error +.endif + +# To get a '#' into a condition, it has to be escaped using a backslash. +# This prevents the comment parser from removing it, and in turn, it becomes +# visible to CondParser_String. +.if ${:U\#hash} != "\#hash" +. error +.endif + +# Since 2002-12-30, and still as of 2020-09-11, CondParser_Token handles +# the '#' specially, even though at this point, there should be no need for +# comment handling anymore. The comments are supposed to be stripped off +# in a very early parsing phase. +# +# See https://gnats.netbsd.org/19596 for example makefiles demonstrating the +# original problems. This workaround is probably not needed anymore. +# +# XXX: Missing error message for the malformed condition. The right-hand +# side before unescaping is double-quotes, backslash, backslash. +.if ${:U\\} != "\\#hash" +. error +.endif + +# The right-hand side of a comparison is not parsed as a token, therefore +# the code from CondParser_Token does not apply to it. +# TODO: Explain the consequences. +# TODO: Does this mean that more syntactic variants are allowed here? +.if ${:U\#hash} != \#hash +. error +.endif + +# XXX: What is the purpose of treating an escaped '#' in the following +# condition as a comment? And why only at the beginning of a token, +# just as in the shell? +.if 0 \# This is treated as a comment, but why? +. error +.endif + +# Ah, ok, this can be used to add an end-of-condition comment. But does +# anybody really use this? This is neither documented nor obvious since +# the '#' is escaped. It's much clearer to write a comment in the line +# above the condition. +.if ${0 \# comment :?yes:no} != no +. error +.endif +.if ${1 \# comment :?yes:no} != yes +. error +.endif + +# Usually there is whitespace around the comparison operator, but this is +# not required. +.if ${UNDEF:Uundefined}!=undefined +. error +.endif +.if ${UNDEF:U12345}>12345 +. error +.endif +.if ${UNDEF:U12345}<12345 +. error +.endif +.if (${UNDEF:U0})||0 +. error +.endif + +# Only the comparison operator terminates the comparison operand, and it's +# a coincidence that the '!' is both used in the '!=' comparison operator +# as well as for negating a comparison result. +# +# The boolean operators '&' and '|' don't terminate a comparison operand. +.if ${:Uvar}&&name != "var&&name" +. error +.endif +.if ${:Uvar}||name != "var||name" +. error +.endif + +# A bare word may appear alone in a condition, without any comparison +# operator. It is implicitly converted into defined(bare). +.if bare +. error +.else +. info A bare word is treated like defined(...), and the variable $\ + 'bare' is not defined. +.endif + +VAR= defined +.if VAR +. info A bare word is treated like defined(...). +.else +. error +.endif + +# Bare words may be intermixed with variable expressions. +.if V${:UA}R +. info ok +.else +. error +.endif + +# In bare words, even undefined variables are allowed. Without the bare +# words, undefined variables are not allowed. That feels inconsistent. +.if V${UNDEF}AR +. info Undefined variables in bare words expand to an empty string. +.else +. error +.endif + +.if 0${:Ux00} +. error +.else +. info Numbers can be composed from literals and variable expressions. +.endif + +.if 0${:Ux01} +. info Numbers can be composed from literals and variable expressions. +.else +. error +.endif + +# If the right-hand side is missing, it's a parse error. +.if "" == +. error +.else +. error +.endif + +# If the left-hand side is missing, it's a parse error as well, but without +# a specific error message. +.if == "" +. error +.else +. error +.endif + +# The '\\' is not a line continuation. Neither is it an unquoted string +# literal. Instead, it is parsed as a function argument (ParseFuncArg), +# and in that context, the backslash is just an ordinary character. The +# function argument thus stays '\\' (2 backslashes). This string is passed +# to FuncDefined, and since there is no variable named '\\', the condition +# evaluates to false. +.if \\ +. error +.else +. info The variable '\\' is not defined. +.endif + +${:U\\\\}= backslash +.if \\ +. info Now the variable '\\' is defined. +.else +. error +.endif + +# Anything that doesn't start with a double quote is considered a "bare word". +# Strangely, a bare word may contain double quotes inside. Nobody should ever +# depend on this since it may well be unintended. See CondParser_String. +.if "unquoted\"quoted" != unquoted"quoted +. error +.endif + +# FIXME: In CondParser_String, Var_Parse returns var_Error without a +# corresponding error message. +.if $$$$$$$$ != "" +. error +.else +. error +.endif + +# See cond-token-string.mk for similar tests where the condition is enclosed +# in "quotes". + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-token-string.exp b/usr.bin/make/unit-tests/cond-token-string.exp new file mode 100644 index 000000000..45f999345 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-string.exp @@ -0,0 +1,18 @@ +make: "cond-token-string.mk" line 13: Unknown modifier "Z" +make: "cond-token-string.mk" line 13: Malformed conditional ("" != "${:Uvalue:Z}") +make: "cond-token-string.mk" line 22: xvalue is not defined. +make: "cond-token-string.mk" line 28: Malformed conditional (x${:Uvalue} == "") +make: "cond-token-string.mk" line 37: Expected. +CondParser_Eval: "UNDEF" +make: "cond-token-string.mk" line 46: The string literal "UNDEF" is not empty. +CondParser_Eval: " " +make: "cond-token-string.mk" line 55: The string literal " " is not empty, even though it consists of whitespace only. +CondParser_Eval: "${UNDEF}" +make: "cond-token-string.mk" line 64: An undefined variable in quotes expands to an empty string, which then evaluates to false. +CondParser_Eval: "${:Uvalue}" +make: "cond-token-string.mk" line 68: A nonempty variable expression evaluates to true. +CondParser_Eval: "${:U}" +make: "cond-token-string.mk" line 76: An empty variable evaluates to false. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-token-string.mk b/usr.bin/make/unit-tests/cond-token-string.mk new file mode 100644 index 000000000..a92d3a896 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-string.mk @@ -0,0 +1,82 @@ +# $NetBSD: cond-token-string.mk,v 1.4 2021/01/21 00:38:28 rillig Exp $ +# +# Tests for quoted string literals in .if conditions. +# +# See also: +# cond-token-plain.mk +# Covers string literals without quotes (called "bare words"). + +# TODO: Implementation + +# Cover the code in CondParser_String that frees the memory after parsing +# a variable expression based on an undefined variable. +.if "" != "${:Uvalue:Z}" +. error +.else +. error +.endif + +.if x${:Uvalue} +. error +.else +. info xvalue is not defined. +.endif + +# The 'x' produces a "Malformed conditional" since the left-hand side of a +# comparison in an .if directive must be either a variable expression, a +# quoted string literal or a number that starts with a digit. +.if x${:Uvalue} == "" +. error +.else +. error +.endif + +# In plain words, a '\' can be used to escape any character, just as in +# double-quoted string literals. See CondParser_String. +.if \x${:Uvalue} == "xvalue" +. info Expected. +.else +. error +.endif + +.MAKEFLAGS: -dc + +# A string in quotes is checked whether it is not empty. +.if "UNDEF" +. info The string literal "UNDEF" is not empty. +.else +. error +.endif + +# A space is not empty as well. +# This differs from many other places where whitespace is trimmed. +.if " " +. info The string literal " " is not empty, even though it consists of $\ + whitespace only. +.else +. error +.endif + +.if "${UNDEF}" +. error +.else +. info An undefined variable in quotes expands to an empty string, which $\ + then evaluates to false. +.endif + +.if "${:Uvalue}" +. info A nonempty variable expression evaluates to true. +.else +. error +.endif + +.if "${:U}" +. error +.else +. info An empty variable evaluates to false. +.endif + +.MAKEFLAGS: -d0 + +all: + @:; diff --git a/usr.bin/make/unit-tests/cond-token-var.exp b/usr.bin/make/unit-tests/cond-token-var.exp new file mode 100644 index 000000000..fcd92d12a --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-var.exp @@ -0,0 +1,7 @@ +make: "cond-token-var.mk" line 20: ok +make: "cond-token-var.mk" line 27: Malformed conditional (${UNDEF} == ${DEF}) +make: "cond-token-var.mk" line 33: Malformed conditional (${DEF} == ${UNDEF}) +make: "cond-token-var.mk" line 42: Malformed conditional (${UNDEF}) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-token-var.mk b/usr.bin/make/unit-tests/cond-token-var.mk new file mode 100644 index 000000000..30eba87ad --- /dev/null +++ b/usr.bin/make/unit-tests/cond-token-var.mk @@ -0,0 +1,48 @@ +# $NetBSD: cond-token-var.mk,v 1.5 2020/11/15 14:58:14 rillig Exp $ +# +# Tests for variable expressions in .if conditions. +# +# Note the fine distinction between a variable and a variable expression. +# A variable has a name and a value. To access the value, one writes a +# variable expression of the form ${VAR}. This is a simple variable +# expression. Variable expressions can get more complicated by adding +# variable modifiers such as in ${VAR:Mpattern}. +# +# XXX: Strictly speaking, variable modifiers should be called expression +# modifiers instead since they only modify the expression, not the variable. +# Well, except for the assignment modifiers, these do indeed change the value +# of the variable. + +DEF= defined + +# A defined variable may appear on either side of the comparison. +.if ${DEF} == ${DEF} +. info ok +.else +. error +.endif + +# A variable that appears on the left-hand side must be defined. +# The following line thus generates a parse error. +.if ${UNDEF} == ${DEF} +. error +.endif + +# A variable that appears on the right-hand side must be defined. +# The following line thus generates a parse error. +.if ${DEF} == ${UNDEF} +. error +.endif + +# A defined variable may appear as an expression of its own. +.if ${DEF} +.endif + +# An undefined variable on its own generates a parse error. +.if ${UNDEF} +.endif + +# The :U modifier turns an undefined expression into a defined expression. +# Since the expression is defined now, it doesn't generate any parse error. +.if ${UNDEF:U} +.endif diff --git a/usr.bin/make/unit-tests/cond-undef-lint.exp b/usr.bin/make/unit-tests/cond-undef-lint.exp new file mode 100644 index 000000000..2c4feb037 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-undef-lint.exp @@ -0,0 +1,7 @@ +make: "cond-undef-lint.mk" line 23: Variable "UNDEF" is undefined +make: "cond-undef-lint.mk" line 38: Variable "UNDEF" is undefined +make: "cond-undef-lint.mk" line 38: Variable "VAR." is undefined +make: "cond-undef-lint.mk" line 49: Variable "VAR.defined" is undefined +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/cond-undef-lint.mk b/usr.bin/make/unit-tests/cond-undef-lint.mk new file mode 100644 index 000000000..9dfd1bd53 --- /dev/null +++ b/usr.bin/make/unit-tests/cond-undef-lint.mk @@ -0,0 +1,73 @@ +# $NetBSD: cond-undef-lint.mk,v 1.3 2020/11/15 14:58:14 rillig Exp $ +# +# Tests for defined and undefined variables in .if conditions, in lint mode. +# +# As of 2020-09-14, lint mode contains experimental code for printing +# accurate error messages in case of undefined variables, instead of the +# wrong "Malformed condition". +# +# See also: +# opt-debug-lint.mk + +.MAKEFLAGS: -dL + +# DEF is defined, UNDEF is not. +DEF= defined + +# An expression based on a defined variable is fine. +.if !${DEF} +. error +.endif + +# Since the condition fails to evaluate, neither of the branches is taken. +.if ${UNDEF} +. error +.else +. error +.endif + +# The variable name depends on the undefined variable, which is probably a +# mistake. The variable UNDEF, as used here, can be easily turned into +# an expression that is always defined, using the :U modifier. +# +# The outer expression does not generate an error message since there was +# already an error evaluating this variable's name. +# +# TODO: Suppress the error message "Variable VAR. is undefined". That part +# of the expression must not be evaluated at all. +.if ${VAR.${UNDEF}} +. error +.else +. error +.endif + +# The variable VAR.defined is not defined and thus generates an error message. +# +# TODO: This pattern looks a lot like CFLAGS.${OPSYS}, which is at least +# debatable. Or would any practical use of CFLAGS.${OPSYS} be via an indirect +# expression, as in the next example? +.if ${VAR.${DEF}} +. error +.else +. error +.endif + + +# Variables that are referenced indirectly may be undefined in a condition. +# +# A practical example for this is CFLAGS, which consists of CWARNS, COPTS +# and a few others. Just because these nested variables are not defined, +# this does not make the condition invalid. +# +# The crucial point is that at the point where the variable appears in the +# condition, there is no way to influence the definedness of the nested +# variables. In particular, there is no modifier that would turn undefined +# nested variables into empty strings, as an equivalent to the :U modifier. +INDIRECT= ${NESTED_UNDEF} ${NESTED_DEF} +NESTED_DEF= nested-defined + +# Since NESTED_UNDEF is not controllable at this point, it must not generate +# an error message, and it doesn't do so, since 2020-09-14. +.if !${INDIRECT} +. error +.endif diff --git a/usr.bin/make/unit-tests/cond1.exp b/usr.bin/make/unit-tests/cond1.exp index 701d504fc..0acd93578 100644 --- a/usr.bin/make/unit-tests/cond1.exp +++ b/usr.bin/make/unit-tests/cond1.exp @@ -1,5 +1,5 @@ -make: "cond1.mk" line 75: warning: extra else -make: "cond1.mk" line 85: warning: extra else +make: "cond1.mk" line 80: warning: extra else +make: "cond1.mk" line 90: warning: extra else 2 is prime A='other' B='unknown' C='clever' o='no,no' Passed: @@ -16,7 +16,7 @@ Passed: 4 is not prime 5 is prime -make: warning: String comparison operator should be either == or != +make: String comparison operator must be either == or != make: Bad conditional expression `"0" > 0' in "0" > 0?OK:No OK diff --git a/usr.bin/make/unit-tests/cond1.mk b/usr.bin/make/unit-tests/cond1.mk index e3618327e..53908c2da 100644 --- a/usr.bin/make/unit-tests/cond1.mk +++ b/usr.bin/make/unit-tests/cond1.mk @@ -1,4 +1,9 @@ -# $Id: cond1.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: cond1.mk,v 1.3 2020/11/15 14:58:14 rillig Exp $ + +# TODO: Convert these tests into tutorial form. +# TODO: Split these tests by topic. +# TODO: Use better variable names and expression values that actually express +# the intended behavior. uname(1) has nothing to do with conditions. # hard code these! TEST_UNAME_S= NetBSD diff --git a/usr.bin/make/unit-tests/cond2.exp b/usr.bin/make/unit-tests/cond2.exp deleted file mode 100644 index 22e76a5b2..000000000 --- a/usr.bin/make/unit-tests/cond2.exp +++ /dev/null @@ -1,7 +0,0 @@ -make: Bad conditional expression ` == "empty"' in == "empty"?oops:ok -make: "cond2.mk" line 13: Malformed conditional ({TEST_TYPO} == "Ok") -TEST_NOT_SET is empty or not defined -make: "cond2.mk" line 20: Malformed conditional (${TEST_NOT_SET} == "empty") -make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests -exit status 1 diff --git a/usr.bin/make/unit-tests/cond2.mk b/usr.bin/make/unit-tests/cond2.mk deleted file mode 100644 index cccc9d6f8..000000000 --- a/usr.bin/make/unit-tests/cond2.mk +++ /dev/null @@ -1,25 +0,0 @@ -# $Id: cond2.mk,v 1.1 2015/05/05 21:51:09 sjg Exp $ - -TEST_UNAME_S= NetBSD - -# this should be ok -X:= ${${TEST_UNAME_S} == "NetBSD":?Ok:fail} -.if $X == "Ok" -Y= good -.endif -# expect: Bad conditional expression ` == "empty"' in == "empty"?oops:ok -X:= ${${TEST_NOT_SET} == "empty":?oops:ok} -# expect: Malformed conditional ({TEST_TYPO} == "Ok") -.if {TEST_TYPO} == "Ok" -Y= oops -.endif -.if empty(TEST_NOT_SET) -Y!= echo TEST_NOT_SET is empty or not defined >&2; echo -.endif -# expect: Malformed conditional (${TEST_NOT_SET} == "empty") -.if ${TEST_NOT_SET} == "empty" -Y= oops -.endif - -all: - @echo $@ diff --git a/usr.bin/make/unit-tests/counter-append.exp b/usr.bin/make/unit-tests/counter-append.exp new file mode 100644 index 000000000..e2439fe08 --- /dev/null +++ b/usr.bin/make/unit-tests/counter-append.exp @@ -0,0 +1,2 @@ +A=1 B=2 C=3 COUNTER=3 +exit status 0 diff --git a/usr.bin/make/unit-tests/counter-append.mk b/usr.bin/make/unit-tests/counter-append.mk new file mode 100644 index 000000000..1c4e00d61 --- /dev/null +++ b/usr.bin/make/unit-tests/counter-append.mk @@ -0,0 +1,28 @@ +# $NetBSD: counter-append.mk,v 1.4 2020/10/17 16:57:17 rillig Exp $ +# +# Demonstrates how to let make count the number of times a variable +# is actually accessed, using the ::+= variable modifier. +# +# This works since 2020-09-23. Before that, the counter ended up at having +# 6 words, even though the NEXT variable was only accessed 3 times. +# The cause for this surprising behavior was that the ::= variable modifiers +# returned an error marker instead of a simple empty string. + +RELEVANT= yes (load-time part) # just to filter the output + +COUNTER= # zero + +NEXT= ${COUNTER::+=a}${COUNTER:[#]} + +# This variable is first set to empty and then expanded. +# See parse.c, function Parse_DoVar, keyword "!Var_Exists". +A:= ${NEXT} +B:= ${NEXT} +C:= ${NEXT} + +RELEVANT= no + +all: + @: ${RELEVANT::=yes (run-time part)} + @echo A=${A:Q} B=${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} + @: ${RELEVANT::=no} diff --git a/usr.bin/make/unit-tests/counter.exp b/usr.bin/make/unit-tests/counter.exp new file mode 100644 index 000000000..e2439fe08 --- /dev/null +++ b/usr.bin/make/unit-tests/counter.exp @@ -0,0 +1,2 @@ +A=1 B=2 C=3 COUNTER=3 +exit status 0 diff --git a/usr.bin/make/unit-tests/counter.mk b/usr.bin/make/unit-tests/counter.mk new file mode 100644 index 000000000..3c75d7a50 --- /dev/null +++ b/usr.bin/make/unit-tests/counter.mk @@ -0,0 +1,28 @@ +# $NetBSD: counter.mk,v 1.5 2020/10/17 16:57:17 rillig Exp $ +# +# Demonstrates how to let make count the number of times a variable +# is actually accessed, using the ::= variable modifier. +# +# This works since 2020-09-23. Before that, the counter ended up at having +# 4 words, even though the NEXT variable was only accessed 3 times. +# The cause for this surprising behavior was that the ::= variable modifiers +# returned an error marker instead of a simple empty string. + +RELEVANT= yes (load-time part) # just to filter the output + +COUNTER= # zero + +NEXT= ${COUNTER::=${COUNTER} a}${COUNTER:[#]} + +# This variable is first set to empty and then expanded. +# See parse.c, function Parse_DoVar, keyword "!Var_Exists". +A:= ${NEXT} +B:= ${NEXT} +C:= ${NEXT} + +RELEVANT= no + +all: + @: ${RELEVANT::=yes (run-time part)} + @echo A=${A:Q} B=${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} + @: ${RELEVANT::=no} diff --git a/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp b/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp new file mode 100644 index 000000000..855b575c4 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp @@ -0,0 +1,4 @@ +make: "dep-colon-bug-cross-file.mk" line 31: warning: duplicate script for target "all" ignored +make: "dep-colon-bug-cross-file.mk" line 40: warning: using previous script for "all" defined here +: pass 1 +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk b/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk new file mode 100644 index 000000000..57fbf4781 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk @@ -0,0 +1,41 @@ +# $NetBSD: dep-colon-bug-cross-file.mk,v 1.4 2020/09/27 09:53:41 rillig Exp $ +# +# Until 2020-09-25, the very last dependency group of a top-level makefile +# was not finished properly. This made it possible to add further commands +# to that target. +# +# In pass 1, there is a dependency group at the bottom of the file. +# This dependency group is not finished properly. Finishing the dependency +# group would add the OP_HAS_COMMANDS flag to the "all" target, thereby +# preventing any commands from being added later. +# +# After the file has been parsed completely, it is parsed again in pass 2. +# In this pass, another command is added to the "current dependency group", +# which was still the one from pass 1, which means it was possible to later +# add commands to an existing target, even across file boundaries. +# +# Oops, even worse. Running this test in a make from 2020-09-25 or earlier +# on NetBSD 8.0 x86_64 with MALLOC_OPTIONS=JA produces this or a similar +# output: +# +# make: cannot open ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ. +# +# The 'Z' means access to already freed memory; see jemalloc(3). The cause +# for this is that in MainParseArgs, the command line arguments were not +# properly copied before storing them in global variables. + +PASS?= 1 + +.if ${PASS} == 2 +all: + : pass 2 +.endif + +.if ${PASS} == 1 + +PASS= 2 +.MAKEFLAGS: -f ${.PARSEDIR:q}/${.PARSEFILE:q} + +all: + : pass 1 +.endif diff --git a/usr.bin/make/unit-tests/dep-colon.exp b/usr.bin/make/unit-tests/dep-colon.exp new file mode 100644 index 000000000..55330d95a --- /dev/null +++ b/usr.bin/make/unit-tests/dep-colon.exp @@ -0,0 +1,3 @@ +making target1 from source1 +making target2 from source2 +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-colon.mk b/usr.bin/make/unit-tests/dep-colon.mk new file mode 100644 index 000000000..e9931c9b2 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-colon.mk @@ -0,0 +1,20 @@ +# $NetBSD: dep-colon.mk,v 1.3 2020/10/17 20:10:04 rillig Exp $ +# +# Tests for the : operator in dependency declarations. + +# TODO: Implementation + +# In a dependency declaration line, there may be a shell command after the +# sources. It is separated by a semicolon. This "feature" is required by +# POSIX. It is seldom used, if at all. +all: target1 +target1: source1; @echo making ${.TARGET} from ${.ALLSRC} +source1: .PHONY + +# The semicolon for separating the sources from the creation commands must +# appear at the top-level. The semicolons inside the :S;1;2; modifier are +# skipped when looking for the semicolon that separates the sources from +# the commands. +all: target2 +target2: source${:U1:S;1;2;}; @echo making ${.TARGET} from ${.ALLSRC} +source2: .PHONY diff --git a/usr.bin/make/unit-tests/dep-double-colon-indep.exp b/usr.bin/make/unit-tests/dep-double-colon-indep.exp new file mode 100644 index 000000000..b42514475 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-double-colon-indep.exp @@ -0,0 +1,3 @@ +: 'Making 1400 dep-double-colon-1300 from dep-double-colon-1400 oodate dep-double-colon-1400' +: 'Making 1500 dep-double-colon-1300 from dep-double-colon-1500 oodate dep-double-colon-1500' +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-double-colon-indep.mk b/usr.bin/make/unit-tests/dep-double-colon-indep.mk new file mode 100644 index 000000000..9f004cf88 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-double-colon-indep.mk @@ -0,0 +1,32 @@ +# $NetBSD: dep-double-colon-indep.mk,v 1.1 2020/10/23 19:11:30 rillig Exp $ +# +# Tests for the :: operator in dependency declarations, which allows multiple +# dependency groups with the same target. Each group is evaluated on its own, +# independent of the other groups. +# +# This is useful for targets that are updatable, such as a database or a log +# file. Be careful with parallel mode though, to avoid lost updates and +# other inconsistencies. +# +# The target 1300 depends on 1200, 1400 and 1500. The target 1200 is older +# than 1300, therefore nothing is done for it. The other targets are newer +# than 1300, therefore each of them is made, independently from the other. + +.END: + @rm -f dep-double-colon-1??? + +_!= touch -t 202001011200 dep-double-colon-1200 +_!= touch -t 202001011300 dep-double-colon-1300 +_!= touch -t 202001011400 dep-double-colon-1400 +_!= touch -t 202001011500 dep-double-colon-1500 + +all: dep-double-colon-1300 + +dep-double-colon-1300:: dep-double-colon-1200 + : 'Making 1200 ${.TARGET} from ${.ALLSRC} oodate ${.OODATE}' + +dep-double-colon-1300:: dep-double-colon-1400 + : 'Making 1400 ${.TARGET} from ${.ALLSRC} oodate ${.OODATE}' + +dep-double-colon-1300:: dep-double-colon-1500 + : 'Making 1500 ${.TARGET} from ${.ALLSRC} oodate ${.OODATE}' diff --git a/usr.bin/make/unit-tests/dep-double-colon.exp b/usr.bin/make/unit-tests/dep-double-colon.exp new file mode 100644 index 000000000..5528abbab --- /dev/null +++ b/usr.bin/make/unit-tests/dep-double-colon.exp @@ -0,0 +1,5 @@ +command 1a +command 1b +command 2a +command 2b +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-double-colon.mk b/usr.bin/make/unit-tests/dep-double-colon.mk new file mode 100644 index 000000000..70fddbcf2 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-double-colon.mk @@ -0,0 +1,23 @@ +# $NetBSD: dep-double-colon.mk,v 1.5 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the '::' operator in dependency declarations, which allows +# several dependency groups for a single node, each having its own attributes +# and dependencies. In the code, the additional dependency groups are called +# cohorts. + +all:: + @echo 'command 1a' + @echo 'command 1b' + +all:: + @echo 'command 2a' + @echo 'command 2b' + +# When there are multiple command groups for a '::' target, each of these +# groups is added separately to the .ALLTARGETS variable. +# +# XXX: What is this good for? +# XXX: Where does the leading space come from? +.if ${.ALLTARGETS} != " all all" +. error +.endif diff --git a/usr.bin/make/unit-tests/dep-exclam.exp b/usr.bin/make/unit-tests/dep-exclam.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-exclam.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-exclam.mk b/usr.bin/make/unit-tests/dep-exclam.mk new file mode 100644 index 000000000..5f6b72da3 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-exclam.mk @@ -0,0 +1,13 @@ +# $NetBSD: dep-exclam.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the ! operator in dependency declarations, which always re-creates +# the target, whether or not it is out of date. +# +# TODO: Is this related to OP_PHONY? +# TODO: Is this related to OP_EXEC? +# TODO: Is this related to OP_MAKE? + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/dep-none.exp b/usr.bin/make/unit-tests/dep-none.exp new file mode 100644 index 000000000..0d299fcca --- /dev/null +++ b/usr.bin/make/unit-tests/dep-none.exp @@ -0,0 +1,4 @@ +make: no target to make. + +make: stopped in unit-tests +exit status 2 diff --git a/usr.bin/make/unit-tests/dep-none.mk b/usr.bin/make/unit-tests/dep-none.mk new file mode 100644 index 000000000..74b50aa29 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-none.mk @@ -0,0 +1,3 @@ +# $NetBSD: dep-none.mk,v 1.1 2020/08/22 12:51:11 rillig Exp $ +# +# Test for a Makefile that declares no target at all. diff --git a/usr.bin/make/unit-tests/dep-percent.exp b/usr.bin/make/unit-tests/dep-percent.exp new file mode 100644 index 000000000..1e6c04d2e --- /dev/null +++ b/usr.bin/make/unit-tests/dep-percent.exp @@ -0,0 +1,6 @@ +make: don't know how to make dep-percent.o (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/dep-percent.mk b/usr.bin/make/unit-tests/dep-percent.mk new file mode 100644 index 000000000..3d6dbeebb --- /dev/null +++ b/usr.bin/make/unit-tests/dep-percent.mk @@ -0,0 +1,14 @@ +# $NetBSD: dep-percent.mk,v 1.1 2020/10/23 19:54:35 rillig Exp $ +# +# Test for transformation rules of the form '%.o: %.c', which are supported +# by GNU make but not this make. + +.SUFFIXES: .c .o + +all: dep-percent.o + +%.o: %.c + : 'Making ${.TARGET} from ${.IMPSRC} or ${.ALLSRC}.' + +dep-percent.c: + : 'Making ${.TARGET} out of nothing.' diff --git a/usr.bin/make/unit-tests/dep-var.exp b/usr.bin/make/unit-tests/dep-var.exp new file mode 100644 index 000000000..d32aca455 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-var.exp @@ -0,0 +1,6 @@ +make: Malformed variable expression at "$)" +def2 +a-def2-b +1-2-NDIRECT_2-2-1 +) +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-var.mk b/usr.bin/make/unit-tests/dep-var.mk new file mode 100644 index 000000000..438a8a84a --- /dev/null +++ b/usr.bin/make/unit-tests/dep-var.mk @@ -0,0 +1,88 @@ +# $NetBSD: dep-var.mk,v 1.5 2020/09/13 20:04:26 rillig Exp $ +# +# Tests for variable references in dependency declarations. +# +# Uh oh, this feels so strange that probably nobody uses it. But it seems to +# be the only way to reach the lower half of SuffExpandChildren. + +# XXX: The -dv log says: +# Var_Parse: ${UNDEF1} with VARE_UNDEFERR|VARE_WANTRES +# but no error message is generated for this line. +# The variable expression ${UNDEF1} simply expands to an empty string. +all: ${UNDEF1} + +# Using a double dollar in order to circumvent immediate variable expansion +# feels like unintended behavior. At least the manual page says nothing at +# all about defined or undefined variables in dependency lines. +# +# At the point where the expression ${DEF2} is expanded, the variable DEF2 +# is defined, so everything's fine. +all: $${DEF2} a-$${DEF2}-b + +# This variable is not defined at all. +# XXX: The -dv log says: +# Var_Parse: ${UNDEF3} with VARE_UNDEFERR|VARE_WANTRES +# but no error message is generated for this line, just like for UNDEF1. +# The variable expression ${UNDEF3} simply expands to an empty string. +all: $${UNDEF3} + +# Try out how many levels of indirection are really expanded in dependency +# lines. +# +# The first level of indirection is the $$ in the dependency line. +# When the dependency line is parsed, it is resolved to the string +# "${INDIRECT_1}". At this point, the dollar is just an ordinary character, +# waiting to be expanded at some later point. +# +# Later, in SuffExpandChildren, that expression is expanded again by calling +# Var_Parse, and this time, the result is the string "1-2-${INDIRECT_2}-2-1". +# +# This string is not expanded anymore by Var_Parse. But there is another +# effect. Now DirExpandCurly comes into play and expands the curly braces +# in this filename pattern, resulting in the string "1-2-$INDIRECT_2-2-1". +# As of 2020-09-03, the test dir.mk contains further details on this topic. +# +# Finally, this string is assigned to the local ${.TARGET} variable. This +# variable is expanded when the shell command is generated. At that point, +# the $I is expanded. Since the variable I is not defined, it expands to +# the empty string. This way, the final output is the string +# "1-2-NDIRECT_2-2-1", which differs from the actual name of the target. +# For exactly this reason, it is not recommended to use dollar signs in +# target names. +# +# The number of actual expansions is way more than one might expect, +# therefore this feature is probably not widely used. +# +all: 1-$${INDIRECT_1}-1 +INDIRECT_1= 2-$${INDIRECT_2}-2 +INDIRECT_2= 3-$${INDIRECT_3}-3 +INDIRECT_3= indirect + +UNDEF1= undef1 +DEF2= def2 + +# Cover the code in SuffExpandChildren that deals with malformed variable +# expressions. +# +# This seems to be an edge case that never happens in practice, and it would +# probably be appropriate to just error out in such a case. +# +# To trigger this piece of code, the variable name must contain "$)" or "$:" +# or "$)" or "$$". Using "$:" does not work since the dependency line is +# fully expanded before parsing, therefore any ':' in a target or source name +# would be interpreted as a dependency operator instead. +all: $$$$) + +# The $$INDIRECT in the following line is treated like the dependency of the +# "all" target, that is, the "$$I" is first expanded to "$I", and in a second +# round of expansion, the "$I" expands to nothing since the variable "I" is +# undefined. +# +# Since 2020-09-13, this generates a parse error in lint mode (-dL), but not +# in normal mode since ParseDoDependency does not handle any errors after +# calling Var_Parse. +undef1 def2 a-def2-b 1-2-$$INDIRECT_2-2-1 ${:U\$)}: + @echo ${.TARGET:Q} + +# XXX: Why is the exit status still 0, even though Parse_Error is called +# with PARSE_FATAL in SuffExpandChildren? diff --git a/usr.bin/make/unit-tests/dep-wildcards.exp b/usr.bin/make/unit-tests/dep-wildcards.exp new file mode 100644 index 000000000..fb8a44e2c --- /dev/null +++ b/usr.bin/make/unit-tests/dep-wildcards.exp @@ -0,0 +1,10 @@ +dep-colon-bug-cross-file.mk +dep-colon.mk +dep-double-colon-indep.mk +dep-double-colon.mk +dep-exclam.mk +dep-none.mk +dep-percent.mk +dep-var.mk +dep-wildcards.mk +exit status 0 diff --git a/usr.bin/make/unit-tests/dep-wildcards.mk b/usr.bin/make/unit-tests/dep-wildcards.mk new file mode 100644 index 000000000..781b149f5 --- /dev/null +++ b/usr.bin/make/unit-tests/dep-wildcards.mk @@ -0,0 +1,9 @@ +# $NetBSD: dep-wildcards.mk,v 1.3 2020/09/08 05:33:05 rillig Exp $ +# +# Tests for wildcards such as *.c in dependency declarations. + +all: ${.PARSEDIR}/dep-*.mk + # The :T is necessary to run this test from another directory. + # The :O is necessary since the result of the dependency resolution + # does not order the directory entries itself. + @printf '%s\n' ${.ALLSRC:T:O} diff --git a/usr.bin/make/unit-tests/dep.exp b/usr.bin/make/unit-tests/dep.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/dep.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/dep.mk b/usr.bin/make/unit-tests/dep.mk new file mode 100644 index 000000000..b2463dfc6 --- /dev/null +++ b/usr.bin/make/unit-tests/dep.mk @@ -0,0 +1,8 @@ +# $NetBSD: dep.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for dependency declarations, such as "target: sources". + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/depsrc-end.exp b/usr.bin/make/unit-tests/depsrc-end.exp new file mode 100644 index 000000000..de0815f2b --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-end.exp @@ -0,0 +1,4 @@ +: 'Making .END.' +: 'Making .BEGIN.' +: 'Making all.' +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-end.mk b/usr.bin/make/unit-tests/depsrc-end.mk new file mode 100644 index 000000000..eb7543d5d --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-end.mk @@ -0,0 +1,14 @@ +# $NetBSD: depsrc-end.mk,v 1.1 2020/10/23 19:23:01 rillig Exp $ +# +# Demonstrate the edge case that .BEGIN depends on .END, which sounds a bit +# paradox but works since these special nodes are not in the dependency +# hierarchy where the cycles are detected. + +.BEGIN: + : 'Making ${.TARGET}.' +.END: + : 'Making ${.TARGET}.' +all: + : 'Making ${.TARGET}.' + +.BEGIN: .END diff --git a/usr.bin/make/unit-tests/depsrc-exec.exp b/usr.bin/make/unit-tests/depsrc-exec.exp new file mode 100644 index 000000000..5106d5c2a --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-exec.exp @@ -0,0 +1,2 @@ +: depsrc-exec.mk: This is always executed. +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-exec.mk b/usr.bin/make/unit-tests/depsrc-exec.mk new file mode 100644 index 000000000..e2c2b98aa --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-exec.mk @@ -0,0 +1,16 @@ +# $NetBSD: depsrc-exec.mk,v 1.3 2020/09/05 15:57:12 rillig Exp $ +# +# Tests for the special source .EXEC in dependency declarations, +# which always executes the commands, even if the target is up to date. +# The target itself is considered up to date. +# +# TODO: Describe possible use cases for .EXEC. + +all: ${MAKEFILE} ${MAKEFILE:H}/depsrc.mk + +${MAKEFILE}: .EXEC + : ${.TARGET:T}: This is always executed. + +${MAKEFILE:H}/depsrc.mk: + : This is not executed. + +: ${.TARGET:T}: This is not executed as well. diff --git a/usr.bin/make/unit-tests/depsrc-ignore.exp b/usr.bin/make/unit-tests/depsrc-ignore.exp new file mode 100644 index 000000000..162f10ddc --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-ignore.exp @@ -0,0 +1,11 @@ +ignore-errors begin +false ignore-errors +ignore-errors end +all begin +*** Error code 1 (ignored) +false all +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/depsrc-ignore.mk b/usr.bin/make/unit-tests/depsrc-ignore.mk new file mode 100644 index 000000000..aea7d2494 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-ignore.mk @@ -0,0 +1,66 @@ +# $NetBSD: depsrc-ignore.mk,v 1.5 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special source .IGNORE in dependency declarations, +# which ignores any command failures for that target. +# +# Even though 'ignore-errors' fails, 'all' is still made. Since 'all' is +# not marked with .IGNORE, it stops at the first failing command. +# +# XXX: The ordering of the messages in the output is confusing. +# The "ignored" comes much too late to be related to the "false +# ignore-errors". This is due to stdout being buffered. +# +# The "continuing" message comes from the -k option. If there had been +# other targets independent of "all", these would be built as well. +# +# Enabling the debugging option -de changes the order in which the messages +# appear. Now the "ignored" message is issued in the correct position. +# The explanation for the output reordering is that the output is buffered. +# As the manual page says, in debugging mode stdout is line buffered. +# In these tests the output is redirected to a file, therefore stdout is +# fully buffered. +# +# This is what actually happens, as of 2020-08-29. To verify it, set the +# following breakpoints in CompatRunCommand: +# +# * the "!silent" line, to see all commands +# * the "fflush" line, to see stdout being flushed +# * the "status = WEXITSTATUS" line +# * the "(continuing)" line +# * the "(ignored)" line +# +# The breakpoints are visited in the following order: +# +# "ignore-errors begin" +# Goes directly to STDOUT_FILENO since it is run in a child process. +# "false ignore-errors" +# Goes to the stdout buffer (CompatRunCommand, keyword "!silent") and +# the immediate call to fflush(stdout) copies it to STDOUT_FILENO. +# "*** Error code 1 (ignored)" +# Goes to the stdout buffer but is not flushed (CompatRunCommand, near +# the end). +# "ignore-errors end" +# Goes directly to STDOUT_FILENO. +# "all begin" +# Goes directly to STDOUT_FILENO. +# "false all" +# Goes to the stdout buffer, where the "*** Error code 1 (ignored)" is +# still waiting to be flushed. These two lines are flushed now. +# "*** Error code 1 (continuing)" +# Goes to the stdout buffer. +# "Stop." +# Goes to the stdout buffer. +# exit(1) +# Flushes the stdout buffer to STDOUT_FILENO. + +all: ignore-errors + +ignore-errors: .IGNORE + @echo $@ begin + false $@ + @echo $@ end + +all: + @echo $@ begin + false $@ + @echo $@ end diff --git a/usr.bin/make/unit-tests/depsrc-made.exp b/usr.bin/make/unit-tests/depsrc-made.exp new file mode 100644 index 000000000..9d20ddec7 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-made.exp @@ -0,0 +1,3 @@ +: Making chapter21 +: Making chapter22 +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-made.mk b/usr.bin/make/unit-tests/depsrc-made.mk new file mode 100644 index 000000000..851593e38 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-made.mk @@ -0,0 +1,15 @@ +# $NetBSD: depsrc-made.mk,v 1.3 2020/09/05 15:57:12 rillig Exp $ +# +# Tests for the special source .MADE in dependency declarations, +# which marks all its dependencies as already made, so their commands +# don't need to be executed. +# +# TODO: Describe a possible use case for .MADE. + +all: part1 part2 + +part1: chapter11 chapter12 .MADE +part2: chapter21 chapter22 + +chapter11 chapter12 chapter21 chapter22: + : Making ${.TARGET} diff --git a/usr.bin/make/unit-tests/depsrc-make.exp b/usr.bin/make/unit-tests/depsrc-make.exp new file mode 100644 index 000000000..85c936ea4 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-make.exp @@ -0,0 +1,3 @@ +this-is-made is made. +echo this-is-not-made is just echoed. +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-make.mk b/usr.bin/make/unit-tests/depsrc-make.mk new file mode 100644 index 000000000..8069007e6 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-make.mk @@ -0,0 +1,18 @@ +# $NetBSD: depsrc-make.mk,v 1.4 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special source .MAKE in dependency declarations, which +# executes the commands of the target even if the -n or -t command line +# options are given. + +# TODO: Add a test for the -t command line option. + +.MAKEFLAGS: -n + +all: this-is-made +all: this-is-not-made + +this-is-made: .MAKE + @echo ${.TARGET} is made. + +this-is-not-made: + @echo ${.TARGET} is just echoed. diff --git a/usr.bin/make/unit-tests/depsrc-meta.exp b/usr.bin/make/unit-tests/depsrc-meta.exp new file mode 100644 index 000000000..77e27582f --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-meta.exp @@ -0,0 +1,5 @@ +Skipping meta for actual-test: no commands +Skipping meta for .END: .SPECIAL +Targets from meta mode: +| TARGET depsrc-meta-target +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-meta.mk b/usr.bin/make/unit-tests/depsrc-meta.mk new file mode 100644 index 000000000..d41aad9a9 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-meta.mk @@ -0,0 +1,31 @@ +# $NetBSD: depsrc-meta.mk,v 1.4 2020/11/27 08:39:07 rillig Exp $ +# +# Tests for the special source .META in dependency declarations. + +# TODO: Implementation +# TODO: Explanation + +.if make(actual-test) + +.MAKEFLAGS: -dM +.MAKE.MODE= meta curDirOk=true + +actual-test: depsrc-meta-target +depsrc-meta-target: .META + @> ${.TARGET}-file + @rm -f ${.TARGET}-file + +.elif make(check-results) + +check-results: + @echo 'Targets from meta mode:' + @awk '/^TARGET/ { print "| " $$0 }' depsrc-meta-target.meta + @rm depsrc-meta-target.meta + +.else + +all: + @${MAKE} -f ${MAKEFILE} actual-test + @${MAKE} -f ${MAKEFILE} check-results + +.endif diff --git a/usr.bin/make/unit-tests/depsrc-nometa.exp b/usr.bin/make/unit-tests/depsrc-nometa.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-nometa.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-nometa.mk b/usr.bin/make/unit-tests/depsrc-nometa.mk new file mode 100644 index 000000000..194238385 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-nometa.mk @@ -0,0 +1,8 @@ +# $NetBSD: depsrc-nometa.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special source .NOMETA in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/depsrc-nometa_cmp.exp b/usr.bin/make/unit-tests/depsrc-nometa_cmp.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-nometa_cmp.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-nometa_cmp.mk b/usr.bin/make/unit-tests/depsrc-nometa_cmp.mk new file mode 100644 index 000000000..a0032d2c8 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-nometa_cmp.mk @@ -0,0 +1,8 @@ +# $NetBSD: depsrc-nometa_cmp.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special source .NOMETA_CMP in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/depsrc-nopath.exp b/usr.bin/make/unit-tests/depsrc-nopath.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-nopath.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-nopath.mk b/usr.bin/make/unit-tests/depsrc-nopath.mk new file mode 100644 index 000000000..052c6f10d --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-nopath.mk @@ -0,0 +1,8 @@ +# $NetBSD: depsrc-nopath.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special source .NOPATH in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/depsrc-notmain.exp b/usr.bin/make/unit-tests/depsrc-notmain.exp new file mode 100644 index 000000000..931cfc06f --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-notmain.exp @@ -0,0 +1,2 @@ +: all +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-notmain.mk b/usr.bin/make/unit-tests/depsrc-notmain.mk new file mode 100644 index 000000000..7ba572be7 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-notmain.mk @@ -0,0 +1,11 @@ +# $NetBSD: depsrc-notmain.mk,v 1.3 2020/09/05 15:57:12 rillig Exp $ +# +# Tests for the special source .NOTMAIN in dependency declarations, +# which prevents the associated target from becoming the default target +# to be made. + +ignored: .NOTMAIN + : ${.TARGET} + +all: + : ${.TARGET} diff --git a/usr.bin/make/unit-tests/depsrc-optional.exp b/usr.bin/make/unit-tests/depsrc-optional.exp new file mode 100644 index 000000000..8ecd28266 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-optional.exp @@ -0,0 +1,20 @@ +Make_ExpandUse: examine all +ExamineLater: need to examine "important" +Make_ExpandUse: examine important +ExamineLater: need to examine "optional" +ExamineLater: need to examine "optional-cohort" +Make_ExpandUse: examine optional +Make_ExpandUse: examine optional-cohort +Examining optional...nonexistent...up-to-date. +Examining optional-cohort...nonexistent...:: operator and no sources...out-of-date. +: A leaf node using '::' is considered out-of-date. + recheck(optional-cohort): update time from nonexistent to now +Examining important...nonexistent...modified before source "optional-cohort"...out-of-date. +: important is made. + recheck(important): update time from nonexistent to now +Examining all...nonexistent...modified before source "important"...out-of-date. +: all is made. + recheck(all): update time from nonexistent to now +Examining .END...nonexistent...nonexistent and no sources...out-of-date. + recheck(.END): update time from nonexistent to now +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-optional.mk b/usr.bin/make/unit-tests/depsrc-optional.mk new file mode 100644 index 000000000..f12eeca2b --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-optional.mk @@ -0,0 +1,21 @@ +# $NetBSD: depsrc-optional.mk,v 1.5 2020/11/08 10:33:47 rillig Exp $ +# +# Tests for the special source .OPTIONAL in dependency declarations, +# which ignores the target if make cannot find out how to create it. +# +# TODO: Describe practical use cases for this feature. + +all: important + : ${.TARGET} is made. + +important: optional optional-cohort + : ${.TARGET} is made. + +optional: .OPTIONAL + : An optional leaf node is not executed. + +# See IsOODateRegular. +optional-cohort:: .OPTIONAL + : A leaf node using '::' is considered out-of-date. + +.MAKEFLAGS: -dm diff --git a/usr.bin/make/unit-tests/depsrc-phony.exp b/usr.bin/make/unit-tests/depsrc-phony.exp new file mode 100644 index 000000000..fa062132b --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-phony.exp @@ -0,0 +1,2 @@ +: depsrc-phony.mk is made. +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-phony.mk b/usr.bin/make/unit-tests/depsrc-phony.mk new file mode 100644 index 000000000..c41efac36 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-phony.mk @@ -0,0 +1,9 @@ +# $NetBSD: depsrc-phony.mk,v 1.3 2020/09/05 15:57:12 rillig Exp $ +# +# Tests for the special source .PHONY in dependency declarations, +# which executes the commands for the target even if a file of the same +# name exists and would be considered up to date. + +# Without the .PHONY, this target would be "up to date". +${MAKEFILE}: .PHONY + : ${.TARGET:T} is made. diff --git a/usr.bin/make/unit-tests/depsrc-precious.exp b/usr.bin/make/unit-tests/depsrc-precious.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-precious.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-precious.mk b/usr.bin/make/unit-tests/depsrc-precious.mk new file mode 100644 index 000000000..e8522a300 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-precious.mk @@ -0,0 +1,16 @@ +# $NetBSD: depsrc-precious.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special source .PRECIOUS in dependency declarations, which +# is only relevant if the commands for the target fail or are interrupted. +# In such a case, the target file is usually removed, to avoid having +# half-finished files with a timestamp suggesting the file were up-to-date. +# +# For targets marked with .PRECIOUS, the target file is not removed. +# The author of the makefile is then responsible for avoiding the above +# situation, in which the target would be wrongly considered up-to-date, +# just because its timestamp says so. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/depsrc-recursive.exp b/usr.bin/make/unit-tests/depsrc-recursive.exp new file mode 100644 index 000000000..85c936ea4 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-recursive.exp @@ -0,0 +1,3 @@ +this-is-made is made. +echo this-is-not-made is just echoed. +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-recursive.mk b/usr.bin/make/unit-tests/depsrc-recursive.mk new file mode 100644 index 000000000..c1f153787 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-recursive.mk @@ -0,0 +1,16 @@ +# $NetBSD: depsrc-recursive.mk,v 1.3 2020/09/05 15:57:12 rillig Exp $ +# +# Tests for the special source .RECURSIVE in dependency declarations, +# which executes the commands of the target even if the -n or -t command +# line options are given. + +.MAKEFLAGS: -n + +all: this-is-made +all: this-is-not-made + +this-is-made: .RECURSIVE + @echo ${.TARGET} is made. + +this-is-not-made: + @echo ${.TARGET} is just echoed. diff --git a/usr.bin/make/unit-tests/depsrc-silent.exp b/usr.bin/make/unit-tests/depsrc-silent.exp new file mode 100644 index 000000000..1ea493702 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-silent.exp @@ -0,0 +1,4 @@ +one +two +three +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-silent.mk b/usr.bin/make/unit-tests/depsrc-silent.mk new file mode 100644 index 000000000..98da7b387 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-silent.mk @@ -0,0 +1,12 @@ +# $NetBSD: depsrc-silent.mk,v 1.3 2020/08/29 17:34:21 rillig Exp $ +# +# Tests for the special source .SILENT in dependency declarations, +# which hides the commands, no matter whether they are prefixed with +# '@' or not. + +# Without the .SILENT, the commands 'echo one' and 'echo two' would be +# written to stdout. +all: .SILENT + echo one + echo two + @echo three diff --git a/usr.bin/make/unit-tests/depsrc-use.exp b/usr.bin/make/unit-tests/depsrc-use.exp new file mode 100644 index 000000000..c9810bda4 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-use.exp @@ -0,0 +1,6 @@ +first 1 +first 2 +second 1 +second 2 +directly +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-use.mk b/usr.bin/make/unit-tests/depsrc-use.mk new file mode 100644 index 000000000..17836cd39 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-use.mk @@ -0,0 +1,24 @@ +# $NetBSD: depsrc-use.mk,v 1.4 2020/08/22 12:30:57 rillig Exp $ +# +# Tests for the special source .USE in dependency declarations, +# which allows to append common commands to other targets. + +all: action directly + +first: .USE + @echo first 1 # Using ${.TARGET} here would expand to "action" + @echo first 2 + +second: .USE + @echo second 1 + @echo second 2 + +# It's possible but uncommon to have a .USE target with no commands. +# This may happen as the result of expanding a .for loop. +empty: .USE + +# It's possible but uncommon to directly make a .USEBEFORE target. +directly: .USE + @echo directly + +action: first second empty diff --git a/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp b/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp new file mode 100644 index 000000000..8bbdef5ad --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp @@ -0,0 +1,2 @@ +double-colon early 1 +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk b/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk new file mode 100644 index 000000000..448214112 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk @@ -0,0 +1,30 @@ +# $NetBSD: depsrc-usebefore-double-colon.mk,v 1.1 2020/08/22 08:29:13 rillig Exp $ +# +# Tests for the special source .USEBEFORE in dependency declarations, +# combined with the double-colon dependency operator. + +all: action + +# The dependency operator :: allows commands to be added later to the same +# target. +double-colon:: .USEBEFORE + @echo double-colon early 1 + +# This command is ignored, which kind of makes sense since this dependency +# declaration has no .USEBEFORE source. +double-colon:: + @echo double-colon early 2 + +# XXX: This command is ignored even though it has a .USEBEFORE source. +# This is unexpected. +double-colon:: .USEBEFORE + @echo double-colon early 3 + +# At this point, the commands from the .USEBEFORE targets are copied to +# the "action" target. +action: double-colon + +# This command is not added to the "action" target since it comes too late. +# The commands had been copied in the previous line already. +double-colon:: + @echo double-colon late diff --git a/usr.bin/make/unit-tests/depsrc-usebefore.exp b/usr.bin/make/unit-tests/depsrc-usebefore.exp new file mode 100644 index 000000000..c9810bda4 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-usebefore.exp @@ -0,0 +1,6 @@ +first 1 +first 2 +second 1 +second 2 +directly +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-usebefore.mk b/usr.bin/make/unit-tests/depsrc-usebefore.mk new file mode 100644 index 000000000..001cfb0d7 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-usebefore.mk @@ -0,0 +1,28 @@ +# $NetBSD: depsrc-usebefore.mk,v 1.6 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special source .USEBEFORE in dependency declarations, +# which allows to prepend common commands to other targets. +# +# See also: +# .USE +# depsrc-use.mk + +all: action directly + +first: .USEBEFORE + @echo first 1 # Using ${.TARGET} here would expand to "action" + @echo first 2 # Using ${.TARGET} here would expand to "action" + +second: .USEBEFORE + @echo second 1 + @echo second 2 + +# It is possible but uncommon to have a .USEBEFORE target with no commands. +# This may happen as the result of expanding a .for loop. +empty: .USEBEFORE + +# It is possible but uncommon to directly make a .USEBEFORE target. +directly: .USEBEFORE + @echo directly + +action: second first empty diff --git a/usr.bin/make/unit-tests/depsrc-wait.exp b/usr.bin/make/unit-tests/depsrc-wait.exp new file mode 100644 index 000000000..d1a60fbaa --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-wait.exp @@ -0,0 +1,13 @@ +--- a --- +echo a +a +--- b1 --- +echo b1 +b1 +--- b --- +echo b +b +--- x --- +echo x +x +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc-wait.mk b/usr.bin/make/unit-tests/depsrc-wait.mk new file mode 100644 index 000000000..95b0ea96e --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc-wait.mk @@ -0,0 +1,21 @@ +# $NetBSD: depsrc-wait.mk,v 1.3 2020/09/07 18:40:32 rillig Exp $ +# +# Tests for the special source .WAIT in dependency declarations, +# which adds a sequence point between the nodes to its left and the nodes +# to its right. + +# Even though the build could run massively parallel, the .WAIT imposes a +# strict ordering in this example, which forces the targets to be made in +# exactly this order. +.MAKEFLAGS: -j8 + +# This is the example from the manual page. +.PHONY: x a b b1 +x: a .WAIT b + echo x +a: + echo a +b: b1 + echo b +b1: + echo b1 diff --git a/usr.bin/make/unit-tests/depsrc.exp b/usr.bin/make/unit-tests/depsrc.exp new file mode 100644 index 000000000..06165e6f9 --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc.exp @@ -0,0 +1,4 @@ +: 'Undefined variables are expanded directly in the dependency' +: 'declaration. They are not preserved and maybe expanded later.' +: 'This is in contrast to local variables such as ${.TARGET}.' +exit status 0 diff --git a/usr.bin/make/unit-tests/depsrc.mk b/usr.bin/make/unit-tests/depsrc.mk new file mode 100644 index 000000000..ab9d04c1d --- /dev/null +++ b/usr.bin/make/unit-tests/depsrc.mk @@ -0,0 +1,26 @@ +# $NetBSD: depsrc.mk,v 1.4 2020/12/22 19:38:44 rillig Exp $ +# +# Tests for special sources (those starting with a dot, followed by +# uppercase letters) in dependency declarations, such as .PHONY. + +# TODO: Implementation + +# TODO: Test 'target: ${:U.SILENT}' + +# Demonstrate when exactly undefined variables are expanded in a dependency +# declaration. +target: .PHONY source-${DEFINED_LATER} +# +DEFINED_LATER= later +# +source-: .PHONY + : 'Undefined variables are expanded directly in the dependency' + : 'declaration. They are not preserved and maybe expanded later.' + : 'This is in contrast to local variables such as $${.TARGET}.' +source-later: .PHONY + : 'Undefined variables are tried to be expanded in a dependency' + : 'declaration. If that fails because the variable is undefined,' + : 'the expression is preserved and tried to be expanded later.' + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp b/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp new file mode 100644 index 000000000..59575e839 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp @@ -0,0 +1,6 @@ +false +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk b/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk new file mode 100644 index 000000000..e50b6207b --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk @@ -0,0 +1,16 @@ +# $NetBSD: deptgt-begin-fail-indirect.mk,v 1.1 2020/11/24 19:02:59 rillig Exp $ +# +# Test for a .BEGIN target whose dependency results in an error. +# This stops make immediately and does not build the main targets. +# +# Between 2005-05-08 and 2020-11-24, a failing dependency of the .BEGIN node +# would not stop make from running the main targets. In the end, the exit +# status was even 0. + +.BEGIN: failing + +failing: .PHONY .NOTMAIN + false + +all: + : This is not made. diff --git a/usr.bin/make/unit-tests/deptgt-begin-fail.exp b/usr.bin/make/unit-tests/deptgt-begin-fail.exp new file mode 100644 index 000000000..59575e839 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-begin-fail.exp @@ -0,0 +1,6 @@ +false +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/deptgt-begin-fail.mk b/usr.bin/make/unit-tests/deptgt-begin-fail.mk new file mode 100644 index 000000000..80cea2566 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-begin-fail.mk @@ -0,0 +1,10 @@ +# $NetBSD: deptgt-begin-fail.mk,v 1.1 2020/11/24 19:02:59 rillig Exp $ +# +# Test for a .BEGIN target whose command results in an error. +# This stops make immediately and does not build the main targets. + +.BEGIN: + false + +all: + : This is not made. diff --git a/usr.bin/make/unit-tests/deptgt-begin.exp b/usr.bin/make/unit-tests/deptgt-begin.exp new file mode 100644 index 000000000..abc80afe9 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-begin.exp @@ -0,0 +1,7 @@ +make: "deptgt-begin.mk" line 17: warning: duplicate script for target ".BEGIN" ignored +make: "deptgt-begin.mk" line 8: warning: using previous script for ".BEGIN" defined here +: parse time +: Making before-begin before .BEGIN. +: .BEGIN +: all +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-begin.mk b/usr.bin/make/unit-tests/deptgt-begin.mk new file mode 100644 index 000000000..b71d78f37 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-begin.mk @@ -0,0 +1,47 @@ +# $NetBSD: deptgt-begin.mk,v 1.5 2020/11/15 22:28:08 rillig Exp $ +# +# Tests for the special target .BEGIN in dependency declarations, +# which is a container for commands that are run before any other +# commands from the shell lines. + +.BEGIN: + : $@ + +# To register a custom action to be run at the beginning, the simplest way is +# to directly place some commands on the '.BEGIN' target. This doesn't scale +# though, since the ':' dependency operator prevents that any other place may +# add its commands after this. +# +# There are several ways to resolve this situation, which are detailed below. +.BEGIN: + : Making another $@. + +# One way to run commands at the beginning is to define a custom target and +# make the .BEGIN depend on that target. This way, the commands from the +# custom target are run even before the .BEGIN target. +.BEGIN: before-begin +before-begin: .PHONY .NOTMAIN + : Making $@ before .BEGIN. + +# Another way is to define a custom target and make that a .USE dependency. +# For the .BEGIN target, .USE dependencies do not work though, since in +# Compat_Run, the .USE and .USEBEFORE nodes are expanded right after the +# .BEGIN target has been run, which is too late. +.BEGIN: use +use: .USE .NOTMAIN + : Making $@ from a .USE dependency. + +# Same as with .USE, but run the commands before the main commands from the +# .BEGIN target. +# +# For the .BEGIN target, .USEBEFORE dependencies do not work though, since in +# Compat_Run, the .USE and .USEBEFORE nodes are expanded right after the +# .BEGIN target has been run, which is too late. +.BEGIN: use-before +use-before: .USEBEFORE .NOTMAIN + : Making $@ from a .USEBEFORE dependency. + +all: + : $@ + +_!= echo : parse time 1>&2 diff --git a/usr.bin/make/unit-tests/deptgt-default.exp b/usr.bin/make/unit-tests/deptgt-default.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-default.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-default.mk b/usr.bin/make/unit-tests/deptgt-default.mk new file mode 100644 index 000000000..814eaf72a --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-default.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-default.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .DEFAULT in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-delete_on_error.exp b/usr.bin/make/unit-tests/deptgt-delete_on_error.exp new file mode 100644 index 000000000..9d9f1dc3e --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-delete_on_error.exp @@ -0,0 +1,51 @@ +Compatibility mode +> deptgt-delete_on_error-regular; false +*** Error code 1 (continuing) +make: *** deptgt-delete_on_error-regular removed +> deptgt-delete_on_error-regular-delete; false +*** Error code 1 (continuing) +make: *** deptgt-delete_on_error-regular-delete removed +> deptgt-delete_on_error-phony; false +*** Error code 1 (continuing) +make: *** deptgt-delete_on_error-phony removed +> deptgt-delete_on_error-phony-delete; false +*** Error code 1 (continuing) +make: *** deptgt-delete_on_error-phony-delete removed +> deptgt-delete_on_error-precious; false +*** Error code 1 (continuing) +> deptgt-delete_on_error-precious-delete; false +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests + +Parallel mode +> deptgt-delete_on_error-regular; false +*** [deptgt-delete_on_error-regular] Error code 1 +make: *** deptgt-delete_on_error-regular removed + +make: stopped in unit-tests +> deptgt-delete_on_error-regular-delete; false +*** [deptgt-delete_on_error-regular-delete] Error code 1 +make: *** deptgt-delete_on_error-regular-delete removed + +make: stopped in unit-tests +> deptgt-delete_on_error-phony; false +*** [deptgt-delete_on_error-phony] Error code 1 + +make: stopped in unit-tests +> deptgt-delete_on_error-phony-delete; false +*** [deptgt-delete_on_error-phony-delete] Error code 1 + +make: stopped in unit-tests +> deptgt-delete_on_error-precious; false +*** [deptgt-delete_on_error-precious] Error code 1 + +make: stopped in unit-tests +> deptgt-delete_on_error-precious-delete; false +*** [deptgt-delete_on_error-precious-delete] Error code 1 + +make: stopped in unit-tests +*** Error code 1 (ignored) +*** Error code 1 (ignored) +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-delete_on_error.mk b/usr.bin/make/unit-tests/deptgt-delete_on_error.mk new file mode 100644 index 000000000..e6d0610f4 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-delete_on_error.mk @@ -0,0 +1,45 @@ + # $NetBSD: deptgt-delete_on_error.mk,v 1.3 2020/10/25 21:31:00 rillig Exp $ +# +# Tests for the special target .DELETE_ON_ERROR in dependency declarations, +# which controls whether the target is deleted if a shell command fails or +# is interrupted. +# +# In compatibility mode, regular and phony targets are deleted, but precious +# targets are preserved. +# +# In parallel mode, regular targets are deleted, while phony and precious +# targets are preserved. +# +# See also: +# CompatDeleteTarget +# JobDeleteTarget + +THIS= deptgt-delete_on_error +TARGETS= ${THIS}-regular ${THIS}-regular-delete +TARGETS+= ${THIS}-phony ${THIS}-phony-delete +TARGETS+= ${THIS}-precious ${THIS}-precious-delete + +all: + @rm -f ${TARGETS} + @echo 'Compatibility mode' + @-${.MAKE} -f ${MAKEFILE} -k ${TARGETS} + @rm -f ${TARGETS} + @echo + @echo 'Parallel mode' + @-${.MAKE} -f ${MAKEFILE} -k -j1 ${TARGETS} + @rm -f ${TARGETS} + +${THIS}-regular{,-delete}: + > ${.TARGET}; false + +${THIS}-phony{,-delete}: .PHONY + > ${.TARGET}; false + +${THIS}-precious{,-delete}: .PRECIOUS + > ${.TARGET}; false + +# The special target .DELETE_ON_ERROR is a global setting. +# It does not apply to single targets. +# The following line is therefore misleading but does not generate any +# warning or even an error message. +.DELETE_ON_ERROR: ${TARGETS:M*-delete} diff --git a/usr.bin/make/unit-tests/deptgt-end-fail-all.exp b/usr.bin/make/unit-tests/deptgt-end-fail-all.exp new file mode 100644 index 000000000..2e2ee11f4 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-fail-all.exp @@ -0,0 +1,7 @@ +: Making all out of nothing. +false +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/deptgt-end-fail-all.mk b/usr.bin/make/unit-tests/deptgt-end-fail-all.mk new file mode 100644 index 000000000..4bf160d48 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-fail-all.mk @@ -0,0 +1,19 @@ +# $NetBSD: deptgt-end-fail-all.mk,v 1.2 2020/12/07 01:04:07 rillig Exp $ +# +# Test whether the commands from the .END target are run even if there is +# an error before. The manual page says "after everything else is done", +# which leaves room for interpretation. +# +# Until 2020-12-07, the .END node was made even if the main nodes had failed. +# This was not intended since the .END node had already been skipped if a +# dependency of the main nodes had failed, just not if one of the main nodes +# themselves had failed. This inconsistency was not worth keeping. To run +# some commands on error, use the .ERROR target instead, see deptgt-error.mk. + +all: .PHONY + : Making ${.TARGET} out of nothing. + false + +.END: + : Making ${.TARGET} out of nothing. + false diff --git a/usr.bin/make/unit-tests/deptgt-end-fail-indirect.exp b/usr.bin/make/unit-tests/deptgt-end-fail-indirect.exp new file mode 100644 index 000000000..17e509600 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-fail-indirect.exp @@ -0,0 +1,7 @@ +: all +false +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk b/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk new file mode 100644 index 000000000..29346b832 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk @@ -0,0 +1,16 @@ +# $NetBSD: deptgt-end-fail-indirect.mk,v 1.2 2020/12/06 21:22:04 rillig Exp $ +# +# Tests for an error in a dependency of the .END node. +# +# Before 2020-11-25, an error in the .END target did not print the "Stop." +# and exited with status 0. The cause for this was a missing condition in +# Compat_Run in the handling of the .END node. + +all: + : $@ + +.END: failing + : Making ${.TARGET} from ${.ALLSRC}. + +failing: .PHONY + false diff --git a/usr.bin/make/unit-tests/deptgt-end-fail.exp b/usr.bin/make/unit-tests/deptgt-end-fail.exp new file mode 100644 index 000000000..9db907c20 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-fail.exp @@ -0,0 +1,163 @@ +Test case all=ok all-dep=ok end=ok end-dep=ok. +: Making all-dep out of nothing. +: Making all from all-dep. +: Making end-dep out of nothing. +: Making .END from end-dep. +exit status 0 + + +Test case all=ok all-dep=ok end=ok end-dep=ERR. +: Making all-dep out of nothing. +: Making all from all-dep. +: Making end-dep out of nothing. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ok all-dep=ok end=ERR end-dep=ok. +: Making all-dep out of nothing. +: Making all from all-dep. +: Making end-dep out of nothing. +: Making .END from end-dep. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ok all-dep=ok end=ERR end-dep=ERR. +: Making all-dep out of nothing. +: Making all from all-dep. +: Making end-dep out of nothing. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ok all-dep=ERR end=ok end-dep=ok. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ok all-dep=ERR end=ok end-dep=ERR. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ok all-dep=ERR end=ERR end-dep=ok. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ok all-dep=ERR end=ERR end-dep=ERR. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ok end=ok end-dep=ok. +: Making all-dep out of nothing. +: Making all from all-dep. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ok end=ok end-dep=ERR. +: Making all-dep out of nothing. +: Making all from all-dep. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ok end=ERR end-dep=ok. +: Making all-dep out of nothing. +: Making all from all-dep. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ok end=ERR end-dep=ERR. +: Making all-dep out of nothing. +: Making all from all-dep. +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ERR end=ok end-dep=ok. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ERR end=ok end-dep=ERR. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ERR end=ERR end-dep=ok. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +Test case all=ERR all-dep=ERR end=ERR end-dep=ERR. +: Making all-dep out of nothing. +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 + + +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-end-fail.mk b/usr.bin/make/unit-tests/deptgt-end-fail.mk new file mode 100644 index 000000000..57cdc7da8 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-fail.mk @@ -0,0 +1,69 @@ +# $NetBSD: deptgt-end-fail.mk,v 1.6 2020/12/07 01:04:07 rillig Exp $ +# +# Tests for an errors in the main target, its dependencies, +# the .END node and its dependencies. +# +# Before 2020-11-25, an error in the .END target did not print the "Stop.", +# even though this was intended. The cause for this was a missing condition +# in Compat_Run, in the code handling the .END node. + +test: .PHONY + +# The default stop-on-error mode is not as interesting to test since it +# stops right after the first error. +.MAKEFLAGS: -k + +.for all in ok ERR +. for all-dep in ok ERR +. for end in ok ERR +. for end-dep in ok ERR +. for target in ${all}-${all-dep}-${end}-${end-dep} +test: ${target} +${target}: .PHONY .SILENT + echo Test case all=${all} all-dep=${all-dep} end=${end} end-dep=${end-dep}. + ${MAKE} -r -f ${MAKEFILE} \ + all=${all} all-dep=${all-dep} \ + end=${end} end-dep=${end-dep} \ + all; \ + echo "exit status $$?" + echo + echo +. endfor +. endfor +. endfor +. endfor +.endfor + +.if make(all) + +all all-dep end-dep: .PHONY + +CMD.ok= true +CMD.ERR= false + +all: all-dep + : Making ${.TARGET} from ${.ALLSRC}. + @${CMD.${all}} + +all-dep: + : Making ${.TARGET} out of nothing. + @${CMD.${all-dep}} + +.END: end-dep + : Making ${.TARGET} from ${.ALLSRC}. + @${CMD.${end}} + +end-dep: + : Making ${.TARGET} out of nothing. + @${CMD.${end-dep}} + +.endif + +# Until 2020-12-07, several of the test cases printed "`all' not remade +# because of errors.", followed by "exit status 0", which contradicted +# each other. + +# Until 2020-12-07, '.END' was even made if 'all' failed, but if a dependency +# of 'all' failed, it was skipped. This inconsistency was not needed for +# anything and thus has been dropped. To run some commands on error, use the +# .ERROR target instead, see deptgt-error.mk. diff --git a/usr.bin/make/unit-tests/deptgt-end-jobs.exp b/usr.bin/make/unit-tests/deptgt-end-jobs.exp new file mode 100644 index 000000000..8dd934b14 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-jobs.exp @@ -0,0 +1,8 @@ +: .BEGIN '${VAR}' +--- all --- +: all '${VAR}' +: .END '${VAR}' +: .END '${VAR}' deferred +: .BEGIN 'Should not be expanded.' deferred +: all 'Should not be expanded.' deferred +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-end-jobs.mk b/usr.bin/make/unit-tests/deptgt-end-jobs.mk new file mode 100644 index 000000000..1a5d5c33a --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end-jobs.mk @@ -0,0 +1,46 @@ +# $NetBSD: deptgt-end-jobs.mk,v 1.1 2020/09/23 03:06:38 rillig Exp $ +# +# Tests for the special target .END in dependency declarations, +# which is run after making the desired targets. +# +# This test is very similar to deptgt-end.mk, except for the -j option. +# This option enables parallel mode, in which the code from job.c partially +# replaces the code from compat.c. +# +# Before 2020-08-22, this test crashed with a null pointer dereference. +# Before 2020-09-23, this test crashed with an assertion failure. +.MAKEFLAGS: -j 8 + +VAR= Should not be expanded. + +.BEGIN: + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred +# Oops: The deferred command must not be expanded twice. +# The Var_Subst in Compat_RunCommand looks suspicious. +# The Var_Subst in JobSaveCommand looks suspicious. + +.END: + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred + +all: + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred +# Oops: The deferred command must not be expanded twice. +# The Var_Subst in Compat_RunCommand looks suspicious. +# The Var_Subst in JobSaveCommand looks suspicious. + +# The deferred commands are run in the order '.END .BEGIN all'. +# This may be unexpected at first since the natural order would be +# '.BEGIN all .END', but it is implemented correctly. +# +# At the point where the commands of a node with deferred commands are run, +# the deferred commands are appended to the commands of the .END node. +# This happens in Compat_RunCommand, and to prevent an endless loop, the +# deferred commands of the .END node itself are not appended to itself. +# Instead, the deferred commands of the .END node are run as if they were +# immediate commands. diff --git a/usr.bin/make/unit-tests/deptgt-end.exp b/usr.bin/make/unit-tests/deptgt-end.exp new file mode 100644 index 000000000..144ee0071 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end.exp @@ -0,0 +1,9 @@ +: .BEGIN '${VAR}' +: all '${VAR}' +: end-action '${VAR}' +: .END '${VAR}' +: .END '${VAR}' deferred +: .BEGIN 'Should not be expanded.' deferred +: all 'Should not be expanded.' deferred +: end-action 'Should not be expanded.' deferred +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-end.mk b/usr.bin/make/unit-tests/deptgt-end.mk new file mode 100644 index 000000000..1240d6714 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-end.mk @@ -0,0 +1,45 @@ +# $NetBSD: deptgt-end.mk,v 1.6 2020/10/23 19:28:17 rillig Exp $ +# +# Tests for the special target .END in dependency declarations, +# which is run after making the desired targets. + +VAR= Should not be expanded. + +.BEGIN: + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred +# Oops: The deferred command must not be expanded twice. +# The Var_Subst in Compat_RunCommand looks suspicious. +# The Var_Subst in JobSaveCommand looks suspicious. + +.END: + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred + +# The .END node can define dependencies, just like a regular target. +.END: end-action +end-action: .NOTMAIN + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred + +all: + : $@ '$${VAR}' + ... + : $@ '$${VAR}' deferred +# Oops: The deferred command must not be expanded twice. +# The Var_Subst in Compat_RunCommand looks suspicious. +# The Var_Subst in JobSaveCommand looks suspicious. + +# The deferred commands are run in the order '.END .BEGIN all'. +# This may be unexpected at first since the natural order would be +# '.BEGIN all .END', but it is implemented correctly. +# +# At the point where the commands of a node with deferred commands are run, +# the deferred commands are appended to the commands of the .END node. +# This happens in Compat_RunCommand, and to prevent an endless loop, the +# deferred commands of the .END node itself are not appended to itself. +# Instead, the deferred commands of the .END node are run as if they were +# immediate commands. diff --git a/usr.bin/make/unit-tests/deptgt-error.exp b/usr.bin/make/unit-tests/deptgt-error.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-error.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-error.mk b/usr.bin/make/unit-tests/deptgt-error.mk new file mode 100644 index 000000000..5d515b95a --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-error.mk @@ -0,0 +1,9 @@ +# $NetBSD: deptgt-error.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special target .ERROR in dependency declarations, which +# collects commands that are run when another target fails. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-ignore.exp b/usr.bin/make/unit-tests/deptgt-ignore.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-ignore.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-ignore.mk b/usr.bin/make/unit-tests/deptgt-ignore.mk new file mode 100644 index 000000000..49c14d2cf --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-ignore.mk @@ -0,0 +1,9 @@ +# $NetBSD: deptgt-ignore.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special target .IGNORE in dependency declarations, which +# does not stop if a command from this target exits with a non-zero status. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-interrupt.exp b/usr.bin/make/unit-tests/deptgt-interrupt.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-interrupt.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-interrupt.mk b/usr.bin/make/unit-tests/deptgt-interrupt.mk new file mode 100644 index 000000000..d94009a52 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-interrupt.mk @@ -0,0 +1,10 @@ +# $NetBSD: deptgt-interrupt.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special target .INTERRUPT in dependency declarations, which +# collects commands to be run when make is interrupted while building another +# target. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-main.exp b/usr.bin/make/unit-tests/deptgt-main.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-main.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-main.mk b/usr.bin/make/unit-tests/deptgt-main.mk new file mode 100644 index 000000000..84d05dc25 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-main.mk @@ -0,0 +1,10 @@ +# $NetBSD: deptgt-main.mk,v 1.3 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special target .MAIN in dependency declarations, which defines +# the main target. This main target is built if no target has been specified +# on the command line or via MAKEFLAGS. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-makeflags.exp b/usr.bin/make/unit-tests/deptgt-makeflags.exp new file mode 100644 index 000000000..f6f6f44e0 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-makeflags.exp @@ -0,0 +1,10 @@ +Global:delete DOLLAR (not found) +Command:DOLLAR = $$$$ +Global:.MAKEOVERRIDES = VAR DOLLAR +CondParser_Eval: ${DOLLAR} != "\$\$" +Var_Parse: ${DOLLAR} != "\$\$" (eval-defined) +lhs = "$$", rhs = "$$", op = != +Global:.MAKEFLAGS = -r -k -D VAR -D VAR -d cv -d +Global:.MAKEFLAGS = -r -k -D VAR -D VAR -d cv -d 0 +make: Unterminated quoted string [make VAR=initial UNBALANCED='] +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-makeflags.mk b/usr.bin/make/unit-tests/deptgt-makeflags.mk new file mode 100644 index 000000000..0a0f410e1 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-makeflags.mk @@ -0,0 +1,93 @@ +# $NetBSD: deptgt-makeflags.mk,v 1.6 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the special target .MAKEFLAGS in dependency declarations, +# which adds command line options later, at parse time. +# +# In these unit tests, it is often used to temporarily toggle the debug log +# during parsing. + +# The -D option sets a variable in the "Global" scope and thus can be +# undefined later. +.MAKEFLAGS: -D VAR +.if ${VAR} != 1 +. error +.endif + +# Variables that are set via the -D command line option are normal global +# variables and can thus be undefined later. +.undef VAR +.if defined(VAR) +. error +.endif + +# The -D command line option can define a variable again, after it has been +# undefined. +.MAKEFLAGS: -D VAR +.if ${VAR} != 1 +. error +.endif + +# The "dependency" for .MAKEFLAGS is split into words, interpreting the usual +# quotes and escape sequences from the backslash. +.MAKEFLAGS: VAR="value"' with'\ spaces +.if ${VAR} != "value with spaces" +. error +.endif + +# Variables set on the command line as VAR=value are placed in the +# "Command" scope and thus cannot be undefined. +.undef VAR +.if ${VAR} != "value with spaces" +. error +.endif + +# When parsing this line, each '$$' becomes '$', resulting in '$$$$'. +# This is assigned to the variable DOLLAR. +# In the condition, that variable is expanded, and at that point, each '$$' +# becomes '$' again, the final expression is thus '$$'. +.MAKEFLAGS: -dcv +.MAKEFLAGS: DOLLAR=$$$$$$$$ +.if ${DOLLAR} != "\$\$" +.endif +.MAKEFLAGS: -d0 + +# An empty command line is skipped. +.MAKEFLAGS: # none + +# Escape sequences like \n are interpreted. +# The following line looks as if it assigned a newline to nl, but it doesn't. +# Instead, the \n ends up as a line that is then interpreted as a variable +# assignment. At that point, the line is simply "nl=\n", and the \n is +# skipped since it is whitespace (see Parse_IsVar). +.MAKEFLAGS: nl="\n" +.if ${nl} != "" +. error +.endif + +# Next try at defining another newline variable. Since whitespace around the +# variable value is trimmed, two empty variable expressions surround the +# literal newline now. This prevents the newline from being skipped during +# parsing. The ':=' assignment operator expands the empty variable +# expressions, leaving only the newline as the variable value. +# +# This is one of the very few ways (maybe even the only one) to inject literal +# newlines into a line that is being parsed. This may confuse the parser. +# For example, in cond.c the parser only expects horizontal whitespace (' ' +# and '\t'), but no newlines. +#.MAKEFLAGS: -dcpv +.MAKEFLAGS: nl:="$${:U}\n$${:U}" +.if ${nl} != ${.newline} +. error +.endif +#.MAKEFLAGS: -d0 + +# Unbalanced quotes produce an error message. If they occur anywhere in the +# command line, the whole command line is skipped. +.MAKEFLAGS: VAR=previous +.MAKEFLAGS: VAR=initial UNBALANCED=' +.if ${VAR} != "previous" +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-no_parallel.exp b/usr.bin/make/unit-tests/deptgt-no_parallel.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-no_parallel.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-no_parallel.mk b/usr.bin/make/unit-tests/deptgt-no_parallel.mk new file mode 100644 index 000000000..247f6a9ac --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-no_parallel.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-no_parallel.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .NO_PARALLEL in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-nopath.exp b/usr.bin/make/unit-tests/deptgt-nopath.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-nopath.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-nopath.mk b/usr.bin/make/unit-tests/deptgt-nopath.mk new file mode 100644 index 000000000..a8cde2657 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-nopath.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-nopath.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .NOPATH in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-notparallel.exp b/usr.bin/make/unit-tests/deptgt-notparallel.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-notparallel.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-notparallel.mk b/usr.bin/make/unit-tests/deptgt-notparallel.mk new file mode 100644 index 000000000..db08aa9d3 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-notparallel.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-notparallel.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .NOTPARALLEL in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-objdir.exp b/usr.bin/make/unit-tests/deptgt-objdir.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-objdir.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-objdir.mk b/usr.bin/make/unit-tests/deptgt-objdir.mk new file mode 100644 index 000000000..f5e9a15d8 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-objdir.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-objdir.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .OBJDIR in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-order.exp b/usr.bin/make/unit-tests/deptgt-order.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-order.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-order.mk b/usr.bin/make/unit-tests/deptgt-order.mk new file mode 100644 index 000000000..003552f57 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-order.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-order.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .ORDER in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-path-suffix.exp b/usr.bin/make/unit-tests/deptgt-path-suffix.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-path-suffix.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-path-suffix.mk b/usr.bin/make/unit-tests/deptgt-path-suffix.mk new file mode 100644 index 000000000..3a7e697bc --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-path-suffix.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-path-suffix.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .PATH.suffix in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-path.exp b/usr.bin/make/unit-tests/deptgt-path.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-path.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-path.mk b/usr.bin/make/unit-tests/deptgt-path.mk new file mode 100644 index 000000000..f74d1a46d --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-path.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-path.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .PATH in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-phony.exp b/usr.bin/make/unit-tests/deptgt-phony.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-phony.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-phony.mk b/usr.bin/make/unit-tests/deptgt-phony.mk new file mode 100644 index 000000000..7f9909fa8 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-phony.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-phony.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .PHONY in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-precious.exp b/usr.bin/make/unit-tests/deptgt-precious.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-precious.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-precious.mk b/usr.bin/make/unit-tests/deptgt-precious.mk new file mode 100644 index 000000000..07b2bf719 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-precious.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-precious.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .PRECIOUS in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-shell.exp b/usr.bin/make/unit-tests/deptgt-shell.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-shell.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-shell.mk b/usr.bin/make/unit-tests/deptgt-shell.mk new file mode 100644 index 000000000..71b535d89 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-shell.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-shell.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .SHELL in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-silent.exp b/usr.bin/make/unit-tests/deptgt-silent.exp new file mode 100644 index 000000000..c9b89da0a --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-silent.exp @@ -0,0 +1,5 @@ +echo 'This is a loud command.' +This is a loud command. +This is not echoed because of the @. +This is not echoed because of the .SILENT. +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-silent.mk b/usr.bin/make/unit-tests/deptgt-silent.mk new file mode 100644 index 000000000..335a1e897 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-silent.mk @@ -0,0 +1,15 @@ +# $NetBSD: deptgt-silent.mk,v 1.4 2020/11/15 20:49:20 rillig Exp $ +# +# Tests for the special target .SILENT in dependency declarations. + +.SILENT: all + +all: loud + @echo 'This is not echoed because of the @.' + # Without the .SILENT, the following command would be echoed. + echo 'This is not echoed because of the .SILENT.' + +# Demonstrate that the .SILENT only applies to the particular target. +# This is unlike .DELETE_ON_ERROR, which is a global setting. +loud: .PHONY + echo 'This is a loud command.' diff --git a/usr.bin/make/unit-tests/deptgt-stale.exp b/usr.bin/make/unit-tests/deptgt-stale.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-stale.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-stale.mk b/usr.bin/make/unit-tests/deptgt-stale.mk new file mode 100644 index 000000000..cfde5a2bf --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-stale.mk @@ -0,0 +1,8 @@ +# $NetBSD: deptgt-stale.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the special target .STALE in dependency declarations. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/deptgt-suffixes.exp b/usr.bin/make/unit-tests/deptgt-suffixes.exp new file mode 100644 index 000000000..512e6d44a --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-suffixes.exp @@ -0,0 +1,33 @@ +#*** Suffixes: +# ".custom-null" (num 1, ref 1) (SUFF_NULL) +# To: +# From: +# Search Path: . .. +# ".src-left" (num 2, ref 2) +# To: .tgt-right +# From: +# Search Path: +# ".tgt-right" (num 3, ref 2) +# To: +# From: .src-left +# Search Path: +# ".tgt-left" (num 4, ref 2) +# To: +# From: .src-right +# Search Path: +# ".src-right" (num 5, ref 2) +# To: .tgt-left +# From: +# Search Path: +#*** Transformations: +.src-left.tgt-right: + : Making ${.TARGET} from ${.IMPSRC}. + +.src-right.tgt-left: + : Making ${.TARGET} from ${.IMPSRC}. + +: Making deptgt-suffixes.src-left out of nothing. +: Making deptgt-suffixes.tgt-right from deptgt-suffixes.src-left. +: Making deptgt-suffixes.src-right out of nothing. +: Making deptgt-suffixes.tgt-left from deptgt-suffixes.src-right. +exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-suffixes.mk b/usr.bin/make/unit-tests/deptgt-suffixes.mk new file mode 100644 index 000000000..15b4dc081 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt-suffixes.mk @@ -0,0 +1,35 @@ +# $NetBSD: deptgt-suffixes.mk,v 1.4 2020/11/21 21:54:42 rillig Exp $ +# +# Tests for the special target .SUFFIXES in dependency declarations. +# +# See also: +# varname-dot-includes.mk +# varname-dot-libs.mk + +.MAKEFLAGS: -dg1 + +.MAIN: all + +.SUFFIXES: .custom-null + +# TODO: What is the effect of this? How is it useful? +.NULL: .custom-null +.PATH.custom-null: . .. + +# The order in which the suffixes are listed doesn't matter. +# Here, they are listed from source to target, just like in the transformation +# rule below it. +.SUFFIXES: .src-left .tgt-right +deptgt-suffixes.src-left: + : Making ${.TARGET} out of nothing. +.src-left.tgt-right: + : Making ${.TARGET} from ${.IMPSRC}. +all: deptgt-suffixes.tgt-right + +# Here, the target is listed earlier than the source. +.SUFFIXES: .tgt-left .src-right +deptgt-suffixes.src-right: + : Making ${.TARGET} out of nothing. +.src-right.tgt-left: + : Making ${.TARGET} from ${.IMPSRC}. +all: deptgt-suffixes.tgt-left diff --git a/usr.bin/make/unit-tests/deptgt.exp b/usr.bin/make/unit-tests/deptgt.exp new file mode 100644 index 000000000..d3f0095d9 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt.exp @@ -0,0 +1,14 @@ +make: "deptgt.mk" line 10: warning: Extra target ignored +make: "deptgt.mk" line 28: Unassociated shell command ": command3 # parse error, since targets == NULL" +ParseReadLine (34): '${:U}: empty-source' +ParseDoDependency(: empty-source) +ParseReadLine (35): ' : command for empty targets list' +ParseReadLine (36): ': empty-source' +ParseDoDependency(: empty-source) +ParseReadLine (37): ' : command for empty targets list' +ParseReadLine (38): '.MAKEFLAGS: -d0' +ParseDoDependency(.MAKEFLAGS: -d0) +make: "deptgt.mk" line 46: Unknown modifier "Z" +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/deptgt.mk b/usr.bin/make/unit-tests/deptgt.mk new file mode 100644 index 000000000..09f381715 --- /dev/null +++ b/usr.bin/make/unit-tests/deptgt.mk @@ -0,0 +1,49 @@ +# $NetBSD: deptgt.mk,v 1.10 2020/12/27 18:20:26 rillig Exp $ +# +# Tests for special targets like .BEGIN or .SUFFIXES in dependency +# declarations. + +# TODO: Implementation + +# Just in case anyone tries to compile several special targets in a single +# dependency line: That doesn't work, and make immediately rejects it. +.SUFFIXES .PHONY: .c.o + +# The following lines demonstrate how 'targets' is set and reset during +# parsing of dependencies. To see it in action, set breakpoints in: +# +# ParseDoDependency at the beginning +# FinishDependencyGroup at "targets = NULL" +# Parse_File at "Lst_Free(targets)" +# Parse_File at "targets = Lst_New()" +# ParseLine_ShellCommand at "targets == NULL" +# +# Keywords: +# parse.c:targets + +target1 target2: sources # targets := [target1, target2] + : command1 # targets == [target1, target2] + : command2 # targets == [target1, target2] +VAR=value # targets := NULL + : command3 # parse error, since targets == NULL + +# In a dependency declaration, the list of targets can be empty. +# It doesn't matter whether the empty string is generated by a variable +# expression or whether it is just omitted. +.MAKEFLAGS: -dp +${:U}: empty-source + : command for empty targets list +: empty-source + : command for empty targets list +.MAKEFLAGS: -d0 + +# Just to show that a malformed expression is only expanded once in +# ParseDependencyTargetWord. The only way to produce an expression that +# is well-formed on the first expansion and ill-formed on the second +# expansion would be to use the variable modifier '::=' to modify the +# targets. This in turn would be such an extreme and unreliable edge case +# that nobody uses it. +$$$$$$$${:U:Z}: + +all: + @:; diff --git a/usr.bin/make/unit-tests/dir-expand-path.exp b/usr.bin/make/unit-tests/dir-expand-path.exp new file mode 100644 index 000000000..74de25529 --- /dev/null +++ b/usr.bin/make/unit-tests/dir-expand-path.exp @@ -0,0 +1,4 @@ +dir-expand-path.dir.1/file1.src +dir-expand-path.dir.1/file2.src +dir-expand-path.dir.2/file3.src +exit status 0 diff --git a/usr.bin/make/unit-tests/dir-expand-path.mk b/usr.bin/make/unit-tests/dir-expand-path.mk new file mode 100644 index 000000000..1ce349cce --- /dev/null +++ b/usr.bin/make/unit-tests/dir-expand-path.mk @@ -0,0 +1,19 @@ +# $NetBSD: dir-expand-path.mk,v 1.1 2020/08/22 21:55:54 rillig Exp $ +# +# Tests for filename expansion in the search path. + +_!= rm -rf dir-expand-path.dir.* +_!= mkdir dir-expand-path.dir.1 +_!= mkdir dir-expand-path.dir.2 +_!= touch dir-expand-path.dir.1/file1.src +_!= touch dir-expand-path.dir.1/file2.src +_!= touch dir-expand-path.dir.2/file3.src + +.PATH: dir-expand-path.dir.1 +.PATH: dir-expand-path.dir.2 + +all: *.src + @printf '%s\n' ${.ALLSRC:O} + +.END: + @rm -rf dir-expand-path.dir.* diff --git a/usr.bin/make/unit-tests/dir.exp b/usr.bin/make/unit-tests/dir.exp new file mode 100644 index 000000000..1adb42e6c --- /dev/null +++ b/usr.bin/make/unit-tests/dir.exp @@ -0,0 +1,50 @@ +Searching for .depend ... + failed. +Searching for .depend ... + / ... + failed. +Expanding "{one,two,three}"... one two three +Expanding "f{our,ive}"... four five +Expanding "{{thi,fou}r,fif}teen"... Expanding "{thi,fou}rteen"... thirteen fourteen +thirteen fourteen fifteen +Expanding "{pre-,}{patch,configure}"... Expanding "pre-{patch,configure}"... pre-patch pre-configure +Expanding "{patch,configure}"... pre-patch pre-configure patch configure +pre-patch pre-configure patch configure +Expanding "{fetch,extract}{,-post}"... Expanding "fetch{,-post}"... fetch fetch-post +Expanding "extract{,-post}"... fetch fetch-post extract extract-post +fetch fetch-post extract extract-post +Expanding "dup-{1,1,1,1,1,1,1}"... dup-1 dup-1 dup-1 dup-1 dup-1 dup-1 dup-1 +Expanding "{{{{{{{{{{single-word}}}}}}}}}}"... Expanding "{{{{{{{{{single-word}}}}}}}}}"... Expanding "{{{{{{{{single-word}}}}}}}}"... Expanding "{{{{{{{single-word}}}}}}}"... Expanding "{{{{{{single-word}}}}}}"... Expanding "{{{{{single-word}}}}}"... Expanding "{{{{single-word}}}}"... Expanding "{{{single-word}}}"... Expanding "{{single-word}}"... Expanding "{single-word}"... single-word +single-word +single-word +single-word +single-word +single-word +single-word +single-word +single-word +single-word +: 1 +: 2 +: 3 +: 4 +: 5 +: 13 +: 14 +: 15 +: pre-patch +: pre-configure +: patch +: configure +: fetch +: fetch-post +: extract +: extract-post +: dup-1 +: single-word +Searching for .END ... + failed. +Searching for .END ... + failed. +Found '.END' as '(not found)' +exit status 0 diff --git a/usr.bin/make/unit-tests/dir.mk b/usr.bin/make/unit-tests/dir.mk new file mode 100644 index 000000000..36fe2baf9 --- /dev/null +++ b/usr.bin/make/unit-tests/dir.mk @@ -0,0 +1,94 @@ +# $NetBSD: dir.mk,v 1.9 2021/01/23 10:48:49 rillig Exp $ +# +# Tests for dir.c. + +.MAKEFLAGS: -m / # hide /usr/share/mk from the debug log + +# Dependency lines may use braces for expansion. +# See DirExpandCurly for the implementation. +all: {one,two,three} + +# XXX: The above dependency line is parsed as a single node named +# "{one,two,three}". There are no individual targets "one", "two", "three" +# yet. The node exists but is not a target since it never appeared +# on the left-hand side of a dependency operator. However, it is listed +# in .ALLTARGETS (which lists all nodes, not only targets). +.if target(one) +. error +.endif +.if target({one,two,three}) +. error +.endif +.if ${.ALLTARGETS:M{one,two,three}} != "{one,two,three}" +. error +.endif + +one: + : 1 +two: + : 2 +three: + : 3 + +# The braces may start in the middle of a word. +all: f{our,ive} + +four: + : 4 +five: + : 5 +six: + : 6 + +# Nested braces work as expected since 2020-07-31 19:06 UTC. +# They had been broken at least since 2003-01-01, probably even longer. +all: {{thi,fou}r,fif}teen + +thirteen: + : 13 +fourteen: + : 14 +fifteen: + : 15 + +# There may be multiple brace groups side by side. +all: {pre-,}{patch,configure} + +pre-patch patch pre-configure configure: + : $@ + +# Empty pieces are allowed in the braces. +all: {fetch,extract}{,-post} + +fetch fetch-post extract extract-post: + : $@ + +# The expansions may have duplicates. +# When the source of the dependency line is expanded later, each of the +# expanded words will be the same. +all: dup-{1,1,1,1,1,1,1} + +dup-1: + : $@ + +# Other than in Bash, the braces are also expanded if there is no comma. +all: {{{{{{{{{{single-word}}}}}}}}}} + +single-word: + : $@ + +# Demonstrate debug logging for filename expansion, especially curly braces. +.MAKEFLAGS: -dd +# The below line does not call SearchPath_Expand yet. +# It is expanded only when necessary, that is, when the 'debug' target is +# indeed made. +debug: {{thi,fou}r,fif}twen +# Therefore, keep the debug logging active. + +.PHONY: one two three four five six +.PHONY: thirteen fourteen fifteen +.PHONY: single-word +.PHONY: pre-patch patch pre-configure configure +.PHONY: fetch fetch-post extract extract-post +.PHONY: dup-1 single-word +.PHONY: all diff --git a/usr.bin/make/unit-tests/directive-dinclude.exp b/usr.bin/make/unit-tests/directive-dinclude.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-dinclude.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-dinclude.mk b/usr.bin/make/unit-tests/directive-dinclude.mk new file mode 100644 index 000000000..94fa5fb44 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-dinclude.mk @@ -0,0 +1,9 @@ +# $NetBSD: directive-dinclude.mk,v 1.1 2020/09/13 09:20:23 rillig Exp $ +# +# Tests for the .dinclude directive, which includes another file, +# typically named .depend. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-elif.exp b/usr.bin/make/unit-tests/directive-elif.exp new file mode 100644 index 000000000..685649402 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elif.exp @@ -0,0 +1,21 @@ +make: "directive-elif.mk" line 47: Unknown directive "elsif" +make: "directive-elif.mk" line 52: This branch is taken. +make: "directive-elif.mk" line 60: Unknown directive "elsif" +make: "directive-elif.mk" line 63: This branch is taken. +make: "directive-elif.mk" line 69: This branch is taken. +make: "directive-elif.mk" line 89: Unknown directive "elsif" +make: "directive-elif.mk" line 90: This misspelling is detected. +make: "directive-elif.mk" line 91: This branch is taken because of the .else. +make: "directive-elif.mk" line 109: What happens on misspelling in a skipped branch? +make: "directive-elif.mk" line 119: else +make: "directive-elif.mk" line 122: What happens on misspelling in a taken branch? +make: "directive-elif.mk" line 124: 1-then +make: "directive-elif.mk" line 125: Unknown directive "elsif" +make: "directive-elif.mk" line 126: 1-elsif +make: "directive-elif.mk" line 127: Unknown directive "elsif" +make: "directive-elif.mk" line 128: 2-elsif +make: "directive-elif.mk" line 134: if-less elif +make: "directive-elif.mk" line 139: warning: extra elif +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-elif.mk b/usr.bin/make/unit-tests/directive-elif.mk new file mode 100644 index 000000000..e7b89beec --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elif.mk @@ -0,0 +1,142 @@ +# $NetBSD: directive-elif.mk,v 1.7 2020/12/19 19:49:01 rillig Exp $ +# +# Tests for the .elif directive. +# +# Misspellings of the .elif directive are not always detected. They are only +# detected if the conditional branch directly above it is taken. In all other +# cases, make skips over the skipped branch as fast as possible, looking only +# at the initial '.' of the line and whether the directive is one of the known +# conditional directives. All other directives are silently ignored, as they +# could be variable assignments or dependency declarations as well, and +# deciding this would cost time. + + +# TODO: Implementation + + +# Misspelling '.elsif' below an .if branch that is not taken. +.if 0 +. info This branch is not taken. +# As of 2020-12-19, the misspelling is not recognized as a conditional +# directive and is thus silently skipped. +# +# Since the .if condition evaluated to false, this whole branch is not taken. +.elsif 0 +. info XXX: This misspelling is not detected. +. info This branch is not taken. +# Even if the misspelling were detected, the branch would not be taken +# since the condition of the '.elsif' evaluates to false as well. +.endif + + +# Misspelling '.elsif' below an .if branch that is not taken. +.if 0 +. info This branch is not taken. +# As of 2020-12-19, the misspelling is not recognized as a conditional +# directive and is thus silently skipped. Since the .if condition evaluated +# to false, this whole branch is not taken. +.elsif 1 +. info XXX: This misspelling is not detected. +# If the misspelling were detected, this branch would be taken. +.endif + + +# Misspelling '.elsif' below an .if branch that is taken. +.if 1 +# This misspelling is in an active branch and is therefore detected. +.elsif 0 +# The only thing that make detects here is a misspelled directive, make +# doesn't recognize that it was meant to be a conditional directive. +# Therefore the branch continues here, even though the '.elsif' condition +# evaluates to false. +. info This branch is taken. +.endif + + +# Misspelling '.elsif' below an .if branch that is taken. +.if 1 +# As of 2020-12-19, the misspelling is in an active branch and is therefore +# detected. +.elsif 1 +# Since both conditions evaluate to true, this branch is taken no matter +# whether make detects a misspelling or not. +. info This branch is taken. +.endif + + +# Misspelling '.elsif' in a skipped branch below a branch that was taken. +.if 1 +. info This branch is taken. +.elif 0 +. info This branch is not taken. +.elsif 1 +. info XXX: This misspelling is not detected. +.endif + + +# Misspelling '.elsif' in an .else branch that is not taken. +.if 1 +.else +. info This branch is not taken. +.elsif 1 +. info XXX: This misspelling is not detected. +.endif + + +# Misspelling '.elsif' in an .else branch that is taken. +.if 0 +.else +.elsif 1 +. info This misspelling is detected. +. info This branch is taken because of the .else. +.endif + + +# Misspellings for .elif in a .elif branch that is not taken. +.if 0 +. info This branch is not taken. +.elif 0 # ok +. info This branch is not taken. +.elsif 0 +. info XXX: This misspelling is not detected. +. info This branch is not taken. +.elseif 0 +. info XXX: This misspelling is not detected. +. info This branch is not taken. +.endif + + +.info What happens on misspelling in a skipped branch? +.if 0 +. info 0-then +.elsif 1 +. info XXX: This misspelling is not detected. +. info 1-elsif +.elsif 2 +. info XXX: This misspelling is not detected. +. info 2-elsif +.else +. info else +.endif + +.info What happens on misspelling in a taken branch? +.if 1 +. info 1-then +.elsif 1 +. info 1-elsif +.elsif 2 +. info 2-elsif +.else +. info else +.endif + +# Expect: "if-less elif" +.elif 0 + +.if 1 +.else +# Expect: "warning: extra elif" +.elif +.endif + +all: diff --git a/usr.bin/make/unit-tests/directive-elifdef.exp b/usr.bin/make/unit-tests/directive-elifdef.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifdef.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-elifdef.mk b/usr.bin/make/unit-tests/directive-elifdef.mk new file mode 100644 index 000000000..f960c1513 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifdef.mk @@ -0,0 +1,8 @@ +# $NetBSD: directive-elifdef.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the .elifdef directive. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-elifmake.exp b/usr.bin/make/unit-tests/directive-elifmake.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifmake.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-elifmake.mk b/usr.bin/make/unit-tests/directive-elifmake.mk new file mode 100644 index 000000000..c78e3aa91 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifmake.mk @@ -0,0 +1,8 @@ +# $NetBSD: directive-elifmake.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the .elifmake directive. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-elifndef.exp b/usr.bin/make/unit-tests/directive-elifndef.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifndef.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-elifndef.mk b/usr.bin/make/unit-tests/directive-elifndef.mk new file mode 100644 index 000000000..19bb66c11 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifndef.mk @@ -0,0 +1,8 @@ +# $NetBSD: directive-elifndef.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the .elifndef directive. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-elifnmake.exp b/usr.bin/make/unit-tests/directive-elifnmake.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifnmake.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-elifnmake.mk b/usr.bin/make/unit-tests/directive-elifnmake.mk new file mode 100644 index 000000000..11c4b973c --- /dev/null +++ b/usr.bin/make/unit-tests/directive-elifnmake.mk @@ -0,0 +1,8 @@ +# $NetBSD: directive-elifnmake.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the .elifnmake directive. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-else.exp b/usr.bin/make/unit-tests/directive-else.exp new file mode 100644 index 000000000..138e893ff --- /dev/null +++ b/usr.bin/make/unit-tests/directive-else.exp @@ -0,0 +1,11 @@ +make: "directive-else.mk" line 14: The .else directive does not take arguments. +make: "directive-else.mk" line 15: ok +make: "directive-else.mk" line 19: ok +make: "directive-else.mk" line 21: The .else directive does not take arguments. +make: "directive-else.mk" line 26: if-less else +make: "directive-else.mk" line 32: ok +make: "directive-else.mk" line 33: warning: extra else +make: "directive-else.mk" line 45: The .else directive does not take arguments. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-else.mk b/usr.bin/make/unit-tests/directive-else.mk new file mode 100644 index 000000000..794057110 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-else.mk @@ -0,0 +1,49 @@ +# $NetBSD: directive-else.mk,v 1.7 2020/12/14 22:17:11 rillig Exp $ +# +# Tests for the .else directive. +# +# Since 2020-11-13, an '.else' followed by extraneous text generates a parse +# error in -dL (lint) mode. +# +# Since 2020-12-15, an '.else' followed by extraneous text always generates +# a parse error. + +.if 0 +. warning must not be reached +# The .else directive does not take any arguments. +.else 123 +. info ok +.endif + +.if 1 +. info ok +# The .else directive does not take any arguments. +.else 123 +. warning must not be reached +.endif + +# An .else without a corresponding .if is an error. +.else + +# Accidental extra .else directives are detected too. +.if 0 +. warning must not be reached +.else +. info ok +.else +. info After an extra .else, everything is skipped. +.endif + +# An .else may have a comment. This comment does not count as an argument, +# therefore no parse error. +.if 0 +.else # comment +.endif + +# A variable expression does count as an argument, even if it is empty. +.if 0 +.else ${:U} +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-endfor.exp b/usr.bin/make/unit-tests/directive-endfor.exp new file mode 100644 index 000000000..7e243a8f6 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-endfor.exp @@ -0,0 +1,4 @@ +make: "directive-endfor.mk" line 9: for-less endfor +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-endfor.mk b/usr.bin/make/unit-tests/directive-endfor.mk new file mode 100644 index 000000000..b0c37f388 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-endfor.mk @@ -0,0 +1,9 @@ +# $NetBSD: directive-endfor.mk,v 1.1 2020/12/30 14:50:08 rillig Exp $ +# +# Test for the directive .endfor, which ends a .for loop. +# +# See also: +# directive-for.mk + +# An .endfor without a corresponding .for is a parse error. +.endfor diff --git a/usr.bin/make/unit-tests/directive-endif.exp b/usr.bin/make/unit-tests/directive-endif.exp new file mode 100644 index 000000000..286d85244 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-endif.exp @@ -0,0 +1,8 @@ +make: "directive-endif.mk" line 18: The .endif directive does not take arguments. +make: "directive-endif.mk" line 23: The .endif directive does not take arguments. +make: "directive-endif.mk" line 33: The .endif directive does not take arguments. +make: "directive-endif.mk" line 39: The .endif directive does not take arguments. +make: "directive-endif.mk" line 45: Unknown directive "endifx" +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-endif.mk b/usr.bin/make/unit-tests/directive-endif.mk new file mode 100644 index 000000000..10dd6ce22 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-endif.mk @@ -0,0 +1,49 @@ +# $NetBSD: directive-endif.mk,v 1.5 2020/12/14 21:56:17 rillig Exp $ +# +# Tests for the .endif directive. +# +# Since 2020-12-15, the .endif directive no longer accepts arguments. +# The manual page had never allowed that, but the code didn't check it. +# +# See also: +# Cond_EvalLine + +# TODO: Implementation + +.MAKEFLAGS: -dL + +# Error: .endif does not take arguments +.if 0 +# Since 2020-12-15, complain about the extra text after the 'endif'. +.endif 0 + +# Error: .endif does not take arguments +.if 1 +# Since 2020-12-15, complain about the extra text after the 'endif'. +.endif 1 + +# Comments are allowed after an '.endif'. +.if 2 +.endif # comment + +# Only whitespace and comments are allowed after an '.endif', but nothing +# else. +.if 1 +# Since 2020-12-15, complain about the extra text after the 'endif'. +.endif0 + +# Only whitespace and comments are allowed after an '.endif', but nothing +# else. +.if 1 +# Since 2020-12-15, complain about the extra text after the 'endif'. +.endif/ + +# After an '.endif', no other letter must occur. This 'endifx' is not +# parsed as an 'endif', therefore another '.endif' must follow to balance +# the directives. +.if 1 +.endifx +.endif # to close the preceding '.if' + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-error.exp b/usr.bin/make/unit-tests/directive-error.exp new file mode 100644 index 000000000..bad12326a --- /dev/null +++ b/usr.bin/make/unit-tests/directive-error.exp @@ -0,0 +1,4 @@ +make: "directive-error.mk" line 13: message + +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-error.mk b/usr.bin/make/unit-tests/directive-error.mk new file mode 100644 index 000000000..135db2159 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-error.mk @@ -0,0 +1,13 @@ +# $NetBSD: directive-error.mk,v 1.5 2021/01/27 00:02:38 rillig Exp $ +# +# Tests for the .error directive, which prints an error message and exits +# immediately, unlike other "fatal" parse errors, which continue to parse +# until the end of the current top-level makefile. +# +# See also: +# opt-warnings-as-errors.mk + +# Before parse.c 1.532 from 2021-01-27, the ".error" issued an irrelevant +# message saying "parsing warnings being treated as errors". +.MAKEFLAGS: -W +.error message diff --git a/usr.bin/make/unit-tests/directive-export-env.exp b/usr.bin/make/unit-tests/directive-export-env.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-env.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-export-env.mk b/usr.bin/make/unit-tests/directive-export-env.mk new file mode 100644 index 000000000..2ef2ceaf7 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-env.mk @@ -0,0 +1,10 @@ +# $NetBSD: directive-export-env.mk,v 1.4 2020/12/13 01:07:54 rillig Exp $ +# +# Tests for the .export-env directive. + +# TODO: Implementation + +.export-env + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-export-gmake.exp b/usr.bin/make/unit-tests/directive-export-gmake.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-gmake.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-export-gmake.mk b/usr.bin/make/unit-tests/directive-export-gmake.mk new file mode 100644 index 000000000..d94cd9deb --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-gmake.mk @@ -0,0 +1,64 @@ +# $NetBSD: directive-export-gmake.mk,v 1.3 2020/11/17 20:16:44 rillig Exp $ +# +# Tests for the export directive (without leading dot), as in GNU make. + +# The "export" directive only affects the environment of the make process +# and its child processes. It does not affect the global variables or any +# other variables. +VAR= before +export VAR=exported +.if ${VAR} != "before" +. error +.endif + +# Ensure that the name-value pair is actually exported. +.if ${:!echo "\$VAR"!} != "exported" +. error +.endif + +# This line looks like it would export 2 variables, but it doesn't. +# It only exports VAR and appends everything else as the variable value. +export VAR=exported VAR2=exported-as-well +.if ${:!echo "\$VAR"!} != "exported VAR2=exported-as-well" +. error ${:!echo "\$VAR"!} +.endif + +# Contrary to the usual variable assignments, spaces are significant +# after the '=' sign and are prepended to the value of the environment +# variable. +export VAR= leading spaces +.if ${:!echo "\$VAR"!} != " leading spaces" +. error +.endif + +# Contrary to the usual variable assignments, spaces are significant +# before the '=' sign and are appended to the name of the environment +# variable. +# +# Depending on the shell, environment variables with such exotic names +# may be silently discarded. One such shell is dash, which is the default +# shell on Ubuntu and Debian. +export VAR =trailing space in varname +.if ${:!env | grep trailing || true!} != "VAR =trailing space in varname" +. if ${:!env | grep trailing || true!} != "" # for dash +. error +. endif +.endif + +# The right-hand side of the exported variable is expanded exactly once. +TWICE= expanded twice +ONCE= expanded once, leaving $${TWICE} as-is +export VAR=${ONCE} +.if ${:!echo "\$VAR"!} != "expanded once, leaving \${TWICE} as-is" +. error +.endif + +# Undefined variables are allowed on the right-hand side, they expand +# to an empty string, as usual. +export VAR=an ${UNDEF} variable +.if ${:!echo "\$VAR"!} != "an variable" +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-export-impl.exp b/usr.bin/make/unit-tests/directive-export-impl.exp new file mode 100644 index 000000000..5f7744d0a --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-impl.exp @@ -0,0 +1,56 @@ +ParseReadLine (21): 'UT_VAR= <${REF}>' +Global:UT_VAR = <${REF}> +ParseReadLine (28): '.export UT_VAR' +Global:.MAKE.EXPORTED = UT_VAR +ParseReadLine (32): ': ${UT_VAR:N*}' +Var_Parse: ${UT_VAR:N*} (eval-defined) +Var_Parse: ${REF}> (eval-defined) +Applying ${UT_VAR:N...} to "<>" (eval-defined, VFL_EXPORTED|VFL_REEXPORT, regular) +Pattern[UT_VAR] for [<>] is [*] +ModifyWords: split "<>" into 1 words +Result of ${UT_VAR:N*} is "" (eval-defined, VFL_EXPORTED|VFL_REEXPORT, regular) +ParseDoDependency(: ) +CondParser_Eval: ${:!echo "\$UT_VAR"!} != "<>" +Var_Parse: ${:!echo "\$UT_VAR"!} != "<>" (eval-defined) +Applying ${:!...} to "" (eval-defined, none, undefined) +Modifier part: "echo "$UT_VAR"" +Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) +Applying ${.MAKE.EXPORTED:O} to "UT_VAR" (eval, none, regular) +Result of ${.MAKE.EXPORTED:O} is "UT_VAR" (eval, none, regular) +Applying ${.MAKE.EXPORTED:u} to "UT_VAR" (eval, none, regular) +Result of ${.MAKE.EXPORTED:u} is "UT_VAR" (eval, none, regular) +Var_Parse: ${UT_VAR} (eval) +Var_Parse: ${REF}> (eval) +Result of ${:!echo "\$UT_VAR"!} is "<>" (eval-defined, none, defined) +lhs = "<>", rhs = "<>", op = != +ParseReadLine (49): ': ${UT_VAR:N*}' +Var_Parse: ${UT_VAR:N*} (eval-defined) +Var_Parse: ${REF}> (eval-defined) +Applying ${UT_VAR:N...} to "<>" (eval-defined, VFL_EXPORTED|VFL_REEXPORT, regular) +Pattern[UT_VAR] for [<>] is [*] +ModifyWords: split "<>" into 1 words +Result of ${UT_VAR:N*} is "" (eval-defined, VFL_EXPORTED|VFL_REEXPORT, regular) +ParseDoDependency(: ) +ParseReadLine (53): 'REF= defined' +Global:REF = defined +CondParser_Eval: ${:!echo "\$UT_VAR"!} != "" +Var_Parse: ${:!echo "\$UT_VAR"!} != "" (eval-defined) +Applying ${:!...} to "" (eval-defined, none, undefined) +Modifier part: "echo "$UT_VAR"" +Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) +Applying ${.MAKE.EXPORTED:O} to "UT_VAR" (eval, none, regular) +Result of ${.MAKE.EXPORTED:O} is "UT_VAR" (eval, none, regular) +Applying ${.MAKE.EXPORTED:u} to "UT_VAR" (eval, none, regular) +Result of ${.MAKE.EXPORTED:u} is "UT_VAR" (eval, none, regular) +Var_Parse: ${UT_VAR} (eval) +Var_Parse: ${REF}> (eval) +Result of ${:!echo "\$UT_VAR"!} is "" (eval-defined, none, defined) +lhs = "", rhs = "", op = != +ParseReadLine (61): 'all:' +ParseDoDependency(all:) +Global:.ALLTARGETS = all +ParseReadLine (62): '.MAKEFLAGS: -d0' +ParseDoDependency(.MAKEFLAGS: -d0) +Global:.MAKEFLAGS = -r -k -d cpv -d +Global:.MAKEFLAGS = -r -k -d cpv -d 0 +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-export-impl.mk b/usr.bin/make/unit-tests/directive-export-impl.mk new file mode 100644 index 000000000..226ad3c4d --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-impl.mk @@ -0,0 +1,62 @@ +# $NetBSD: directive-export-impl.mk,v 1.2 2021/02/16 16:28:41 rillig Exp $ +# +# Test for the implementation of exporting variables to child processes. +# This involves marking variables for export, actually exporting them, +# or marking them for being re-exported. +# +# See also: +# Var_Export +# ExportVar +# VarExportedMode (global) +# VFL_EXPORTED (per variable) +# VFL_REEXPORT (per variable) +# VarExportMode (per call of Var_Export and ExportVar) + +: ${:U:sh} # side effect: initialize .SHELL + +.MAKEFLAGS: -dcpv + +# This is a variable that references another variable. At this point, the +# other variable is still undefined. +UT_VAR= <${REF}> + +# At this point, ExportVar("UT_VAR", VEM_PLAIN) is called. Since the +# variable value refers to another variable, ExportVar does not actually +# export the variable but only marks it as VFL_EXPORTED and VFL_REEXPORT. +# After that, ExportVars registers the variable name in .MAKE.EXPORTED. +# That's all for now. +.export UT_VAR + +# Evaluating this expression shows the variable flags in the debug log, +# which are VFL_EXPORTED|VFL_REEXPORT. +: ${UT_VAR:N*} + +# At the last moment before actually forking off the child process for the +# :!...! modifier, Cmd_Exec calls Var_ReexportVars to have all relevant +# variables exported. Since this variable has both of the above-mentioned +# flags set, it is actually exported to the environment. The variable flags +# are not modified though, since the next time the :!...! modifier is +# evaluated, the referenced variables could have changed, therefore the +# variable will be exported anew for each ':sh' modifier, ':!...!' modifier, +# '!=' variable assignment. +.if ${:!echo "\$UT_VAR"!} != "<>" +. error +.endif + +# Evaluating this expression shows the variable flags in the debug log, +# which are still VFL_EXPORTED|VFL_REEXPORT, which means that the variable +# is still marked as being re-exported for each child process. +: ${UT_VAR:N*} + +# Now the referenced variable gets defined. This does not influence anything +# in the process of exporting the variable value, though. +REF= defined + +# Nothing surprising here. The variable UT_VAR gets exported, and this time, +# REF is defined and gets expanded into the exported environment variable. +.if ${:!echo "\$UT_VAR"!} != "" +. error +.endif + +all: +.MAKEFLAGS: -d0 diff --git a/usr.bin/make/unit-tests/directive-export-literal.exp b/usr.bin/make/unit-tests/directive-export-literal.exp new file mode 100644 index 000000000..c5557e363 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-literal.exp @@ -0,0 +1,2 @@ +value with ${UNEXPANDED} expression +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-export-literal.mk b/usr.bin/make/unit-tests/directive-export-literal.mk new file mode 100644 index 000000000..5fafa4a72 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export-literal.mk @@ -0,0 +1,13 @@ +# $NetBSD: directive-export-literal.mk,v 1.7 2020/12/13 01:07:54 rillig Exp $ +# +# Tests for the .export-literal directive, which exports a variable value +# without expanding it. + +UT_VAR= value with ${UNEXPANDED} expression + +.export-literal UT_VAR + +.export-literal # oops: missing argument + +all: + @echo "$$UT_VAR" diff --git a/usr.bin/make/unit-tests/directive-export.exp b/usr.bin/make/unit-tests/directive-export.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-export.mk b/usr.bin/make/unit-tests/directive-export.mk new file mode 100644 index 000000000..942d4b371 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-export.mk @@ -0,0 +1,44 @@ +# $NetBSD: directive-export.mk,v 1.8 2021/02/16 19:01:18 rillig Exp $ +# +# Tests for the .export directive. +# +# See also: +# directive-misspellings.mk + +# TODO: Implementation + +INDIRECT= indirect +VAR= value $$ ${INDIRECT} + +# Before 2020-12-13, this unusual expression invoked undefined behavior since +# it accessed out-of-bounds memory via Var_Export -> ExportVar -> MayExport. +.export ${:U } + +# A variable is exported using the .export directive. +# During that, its value is expanded, just like almost everywhere else. +.export VAR +.if ${:!env | grep '^VAR'!} != "VAR=value \$ indirect" +. error +.endif + +# Undefining a variable that has been exported implicitly removes it from +# the environment of all child processes. +.undef VAR +.if ${:!env | grep '^VAR' || true!} != "" +. error +.endif + +# No syntactical argument means to export all variables. +.export + +# An empty argument means no additional variables to export. +.export ${:U} + + +# Trigger the "This isn't going to end well" in ExportVarEnv. +EMPTY_SHELL= ${:sh} +.export EMPTY_SHELL # only marked for export at this point +_!= :;: # Force the variable to be actually exported. + + +all: diff --git a/usr.bin/make/unit-tests/directive-for-errors.exp b/usr.bin/make/unit-tests/directive-for-errors.exp new file mode 100644 index 000000000..da5eee473 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-errors.exp @@ -0,0 +1,22 @@ +make: "directive-for-errors.mk" line 7: Unknown directive "fori" +make: "directive-for-errors.mk" line 8: warning: +make: "directive-for-errors.mk" line 9: for-less endfor +make: "directive-for-errors.mk" line 19: Unknown directive "for" +make: "directive-for-errors.mk" line 20: warning: +make: "directive-for-errors.mk" line 21: for-less endfor +make: "directive-for-errors.mk" line 37: Dollar $ 1 1 and backslash 2 2 2. +make: "directive-for-errors.mk" line 37: Dollar $ 3 3 and backslash 4 4 4. +make: "directive-for-errors.mk" line 43: no iteration variables in for +make: "directive-for-errors.mk" line 47: warning: Should not be reached. +make: "directive-for-errors.mk" line 48: for-less endfor +make: "directive-for-errors.mk" line 53: Wrong number of words (5) in .for substitution list with 3 variables +make: "directive-for-errors.mk" line 64: missing `in' in for +make: "directive-for-errors.mk" line 66: warning: Should not be reached. +make: "directive-for-errors.mk" line 67: for-less endfor +make: "directive-for-errors.mk" line 73: Unknown modifier "Z" +make: "directive-for-errors.mk" line 74: warning: Should not be reached. +make: "directive-for-errors.mk" line 74: warning: Should not be reached. +make: "directive-for-errors.mk" line 74: warning: Should not be reached. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-for-errors.mk b/usr.bin/make/unit-tests/directive-for-errors.mk new file mode 100644 index 000000000..7890e2375 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-errors.mk @@ -0,0 +1,75 @@ +# $NetBSD: directive-for-errors.mk,v 1.1 2020/12/31 03:05:12 rillig Exp $ +# +# Tests for error handling in .for loops. + +# A .for directive must be followed by whitespace, everything else results +# in a parse error. +.fori in 1 2 3 +. warning ${i} +.endfor + +# A slash is not whitespace, therefore this is not parsed as a .for loop. +# +# XXX: The error message is misleading though. As of 2020-12-31, it says +# "Unknown directive "for"", but that directive is actually known. This is +# because ForEval does not detect the .for loop as such, so parsing +# continues in ParseLine > ParseDependency > ParseDoDependency > +# ParseDoDependencyTargets > ParseErrorNoDependency, and there the directive +# name is parsed a bit differently. +.for/i in 1 2 3 +. warning ${i} +.endfor + +# As of 2020-12-31, the variable name can be an arbitrary word, it just needs +# to be separated by whitespace. Even '$' and '\' are valid variable names, +# which is not useful in practice. +# +# The '$$' is not replaced with the values '1' or '3' from the .for loop, +# instead it is kept as-is, and when the .info directive expands its argument, +# each '$$' gets replaced with a single '$'. The "long variable expression" +# ${$} gets replaced though, even though this would be a parse error everywhere +# outside a .for loop. +# +# The '\' on the other hand is treated as a normal variable name. +${:U\$}= dollar # see whether the "variable" '$' is local +${:U\\}= backslash # see whether the "variable" '\' is local +.for $ \ in 1 2 3 4 +. info Dollar $$ ${$} $($) and backslash $\ ${\} $(\). +.endfor + +# If there are no variables, there is no point in expanding the .for loop +# since this would end up in an endless loop, each time consuming 0 of the +# 3 values. +.for in 1 2 3 +# XXX: This should not be reached. It should be skipped, as already done +# when the number of values is not a multiple of the number of variables, +# see below. +. warning Should not be reached. +.endfor + +# There are 3 variables and 5 values. These 5 values cannot be split evenly +# among the variables, therefore the loop is not expanded at all, it is +# rather skipped. +.for a b c in 1 2 3 4 5 +. warning Should not be reached. +.endfor + +# The list of values after the 'in' may be empty, no matter if this emptiness +# comes from an empty expansion or even from a syntactically empty line. +.for i in +. info Would be reached if there were items to loop over. +.endfor + +# A missing 'in' should parse the .for loop but skip the body. +.for i : k +# XXX: As of 2020-12-31, this line is reached once. +. warning Should not be reached. +.endfor + +# A malformed modifier should be detected and skip the body of the loop. +# +# XXX: As of 2020-12-31, Var_Subst doesn't report any errors, therefore +# the loop body is expanded as if no error had happened. +.for i in 1 2 ${:U3:Z} 4 +. warning Should not be reached. +.endfor diff --git a/usr.bin/make/unit-tests/directive-for-escape.exp b/usr.bin/make/unit-tests/directive-for-escape.exp new file mode 100644 index 000000000..59d4c2324 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-escape.exp @@ -0,0 +1,75 @@ +For: end for 1 +For: loop body: +. info ${:U!"#$%&'()*+,-./0-9\:;<=>?@A-Z[\\]_^a-z{|\}~} +make: Unclosed variable expression, expecting '}' for modifier "U!"" of variable "" with value "!"" +make: "directive-for-escape.mk" line 19: !" +For: end for 1 +For: loop body: +. info ${:U!"\\\\#$%&'()*+,-./0-9\:;<=>?@A-Z[\\]_^a-z{|\}~} +make: Unclosed variable expression, expecting '}' for modifier "U!"\\\\" of variable "" with value "!"\\" +make: "directive-for-escape.mk" line 29: !"\\ +For: end for 1 +For: loop body: +. info ${:U\$} +make: "directive-for-escape.mk" line 41: $ +For: loop body: +. info ${:U${V}} +make: "directive-for-escape.mk" line 41: value +For: loop body: +. info ${:U${V:=-with-modifier}} +make: "directive-for-escape.mk" line 41: value-with-modifier +For: loop body: +. info ${:U$(V)} +make: "directive-for-escape.mk" line 41: value +For: loop body: +. info ${:U$(V:=-with-modifier)} +make: "directive-for-escape.mk" line 41: value-with-modifier +For: end for 1 +For: loop body: +. info ${:U\${UNDEF\:U\\$\\$} +make: "directive-for-escape.mk" line 55: ${UNDEF:U\$ +For: loop body: +. info ${:U{{\}\}} +make: "directive-for-escape.mk" line 55: {{}} +For: loop body: +. info ${:Uend\}} +make: "directive-for-escape.mk" line 55: end} +For: end for 1 +For: loop body: +. info ${:Ubegin<${UNDEF:Ufallback:N{{{}}}}>end} +make: "directive-for-escape.mk" line 67: beginend +For: end for 1 +For: loop body: +. info ${:U\$} +make: "directive-for-escape.mk" line 75: $ +For: end for 1 +For: loop body: +. info ${NUMBERS} ${:Ureplaced} +make: "directive-for-escape.mk" line 83: one two three replaced +For: end for 1 +For: loop body: +. info ${:Ureplaced} +make: "directive-for-escape.mk" line 93: replaced +For: end for 1 +For: loop body: +. info . $$i: ${:Uinner} +. info . $${i}: ${:Uinner} +. info . $${i:M*}: ${:Uinner:M*} +. info . $$(i): $(:Uinner) +. info . $$(i:M*): $(:Uinner:M*) +. info . $${i$${:U}}: ${i${:U}} +. info . $${i\}}: ${:Uinner\}} # XXX: unclear why ForLoop_SubstVarLong needs this +. info . $${i2}: ${i2} +. info . $${i,}: ${i,} +. info . adjacent: ${:Uinner}${:Uinner}${:Uinner:M*}${:Uinner} +make: "directive-for-escape.mk" line 101: . $i: inner +make: "directive-for-escape.mk" line 102: . ${i}: inner +make: "directive-for-escape.mk" line 103: . ${i:M*}: inner +make: "directive-for-escape.mk" line 104: . $(i): inner +make: "directive-for-escape.mk" line 105: . $(i:M*): inner +make: "directive-for-escape.mk" line 106: . ${i${:U}}: outer +make: "directive-for-escape.mk" line 107: . ${i\}}: inner} +make: "directive-for-escape.mk" line 108: . ${i2}: two +make: "directive-for-escape.mk" line 109: . ${i,}: comma +make: "directive-for-escape.mk" line 110: . adjacent: innerinnerinnerinner +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-for-escape.mk b/usr.bin/make/unit-tests/directive-for-escape.mk new file mode 100644 index 000000000..babc4b8c6 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-escape.mk @@ -0,0 +1,113 @@ +# $NetBSD: directive-for-escape.mk,v 1.7 2021/02/15 07:58:19 rillig Exp $ +# +# Test escaping of special characters in the iteration values of a .for loop. +# These values get expanded later using the :U variable modifier, and this +# escaping and unescaping must pass all characters and strings effectively +# unmodified. + +.MAKEFLAGS: -df + +# Even though the .for loops take quotes into account when splitting the +# string into words, the quotes don't need to be balanced, as of 2020-12-31. +# This could be considered a bug. +ASCII= !"\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ + +# XXX: As of 2020-12-31, the '#' is not preserved in the expanded body of +# the loop since it would not need only the escaping for the :U variable +# modifier but also the escaping for the line-end comment. +.for chars in ${ASCII} +. info ${chars} +.endfor + +# As of 2020-12-31, using 2 backslashes before be '#' would treat the '#' +# as comment character. Using 3 backslashes doesn't help either since +# then the situation is essentially the same as with 1 backslash. +# This means that a '#' sign cannot be passed in the value of a .for loop +# at all. +ASCII.2020-12-31= !"\\\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~ +.for chars in ${ASCII.2020-12-31} +. info ${chars} +.endfor + +# Cover the code in for_var_len. +# +# XXX: It is unexpected that the variable V gets expanded in the loop body. +# The double '$$' should prevent exactly this. Probably nobody was +# adventurous enough to use literal dollar signs in the values of a .for +# loop. +V= value +VALUES= $$ $${V} $${V:=-with-modifier} $$(V) $$(V:=-with-modifier) +.for i in ${VALUES} +. info $i +.endfor + +# Try to cover the code for nested '{}' in for_var_len, without success. +# +# The value of the variable VALUES is not meant to be a variable expression. +# Instead, it is meant to represent literal text, the only escaping mechanism +# being that each '$' is written as '$$'. +# +# The .for loop splits ${VALUES} into 3 words, at the space characters, since +# these are not escaped. +VALUES= $${UNDEF:U\$$\$$ {{}} end} +# XXX: Where in the code does the '\$\$' get converted into a single '\$'? +.for i in ${VALUES} +. info $i +.endfor + +# Second try to cover the code for nested '{}' in for_var_len. +# +# XXX: It is wrong that for_var_len requires the braces to be balanced. +# Each variable modifier has its own inconsistent way of parsing nested +# variable expressions, braces and parentheses. (Compare ':M', ':S', and +# ':D' for details.) The only sensible thing to do is therefore to let +# Var_Parse do all the parsing work. +VALUES= begin<$${UNDEF:Ufallback:N{{{}}}}>end +.for i in ${VALUES} +. info $i +.endfor + +# A single trailing dollar doesn't happen in practice. +# The dollar sign is correctly passed through to the body of the .for loop. +# There, it is expanded by the .info directive, but even there a trailing +# dollar sign is kept as-is. +.for i in ${:U\$} +. info ${i} +.endfor + +# As of 2020-12-31, the name of the iteration variable can even contain +# colons, which then affects variable expressions having this exact modifier. +# This is clearly an unintended side effect of the implementation. +NUMBERS= one two three +.for NUMBERS:M*e in replaced +. info ${NUMBERS} ${NUMBERS:M*e} +.endfor + +# As of 2020-12-31, the name of the iteration variable can contain braces, +# which gets even more surprising than colons, since it allows to replace +# sequences of variable expressions. There is no practical use case for +# this, though. +BASENAME= one +EXT= .c +.for BASENAME}${EXT in replaced +. info ${BASENAME}${EXT} +.endfor + +# Demonstrate the various ways to refer to the iteration variable. +i= outer +i2= two +i,= comma +.for i in inner +. info . $$i: $i +. info . $${i}: ${i} +. info . $${i:M*}: ${i:M*} +. info . $$(i): $(i) +. info . $$(i:M*): $(i:M*) +. info . $${i$${:U}}: ${i${:U}} +. info . $${i\}}: ${i\}} # XXX: unclear why ForLoop_SubstVarLong needs this +. info . $${i2}: ${i2} +. info . $${i,}: ${i,} +. info . adjacent: $i${i}${i:M*}$i +.endfor + +all: diff --git a/usr.bin/make/unit-tests/directive-for-generating-endif.exp b/usr.bin/make/unit-tests/directive-for-generating-endif.exp new file mode 100644 index 000000000..9e1301abf --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-generating-endif.exp @@ -0,0 +1,7 @@ +make: "directive-for-generating-endif.mk" line 21: if-less endif +make: "directive-for-generating-endif.mk" line 21: if-less endif +make: "directive-for-generating-endif.mk" line 21: if-less endif +make: "directive-for-generating-endif.mk" line 0: 3 open conditionals +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-for-generating-endif.mk b/usr.bin/make/unit-tests/directive-for-generating-endif.mk new file mode 100644 index 000000000..b4d709551 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-generating-endif.mk @@ -0,0 +1,25 @@ +# $NetBSD: directive-for-generating-endif.mk,v 1.1 2020/08/29 18:50:25 rillig Exp $ +# +# Test whether a .for loop can be used to generate multiple .endif +# directives to close nested .if directives. Depending on the exact +# implementation, this might have been possible. +# +# If it were possible, the 3 .if directives would perfectly match the +# 3 .endif directives generated by the .for loop. +# +# After the "included file" from the .for loop, the 3 .if directives +# are still open. +# +# See For_Run and ParseReadLine. Each .for loop is treated like a separately +# included file, and in each included file the .if/.endif directives must be +# balanced. + +.if 1 +. if 2 +. if 3 +.for i in 3 2 1 +.endif +.endfor + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-for-lines.exp b/usr.bin/make/unit-tests/directive-for-lines.exp new file mode 100644 index 000000000..7aeaaa4a7 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-lines.exp @@ -0,0 +1,10 @@ +make: "directive-for-lines.mk" line 23: expect 23 +make: "directive-for-lines.mk" line 23: expect 23 +make: "directive-for-lines.mk" line 30: expect 30 +make: "directive-for-lines.mk" line 23: expect 23 +make: "directive-for-lines.mk" line 23: expect 23 +make: "directive-for-lines.mk" line 30: expect 30 +make: no target to make. + +make: stopped in unit-tests +exit status 2 diff --git a/usr.bin/make/unit-tests/directive-for-lines.mk b/usr.bin/make/unit-tests/directive-for-lines.mk new file mode 100644 index 000000000..96d659426 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-lines.mk @@ -0,0 +1,32 @@ +# $NetBSD: directive-for-lines.mk,v 1.3 2020/12/19 12:40:00 rillig Exp $ +# +# Tests for the line numbers that are reported in .for loops. +# +# Between 2007-01-01 (git 4d3c468f96e1080e, parse.c 1.127) and 2020-12-19 +# (parse.c 1.494), the line numbers for the .info directives and error +# messages inside .for loops had been wrong since ParseGetLine skipped empty +# lines, even when collecting the lines for the .for loop body. + +.for outer in a b + +# comment \ +# continued comment + +.for inner in 1 2 + +# comment \ +# continued comment + +VAR= \ + multi-line + +.info expect 23 + +.endfor + +# comment \ +# continued comment + +.info expect 30 + +.endfor diff --git a/usr.bin/make/unit-tests/directive-for-null.exp b/usr.bin/make/unit-tests/directive-for-null.exp new file mode 100644 index 000000000..37a7d6892 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-null.exp @@ -0,0 +1,10 @@ +make: "(stdin)" line 2: Zero byte read from file +make: "(stdin)" line 2: Unexpected end of file in for loop. +make: "(stdin)" line 3: Zero byte read from file +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +*** Error code 1 (continuing) + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-for-null.mk b/usr.bin/make/unit-tests/directive-for-null.mk new file mode 100644 index 000000000..a374f508d --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for-null.mk @@ -0,0 +1,19 @@ +# $NetBSD: directive-for-null.mk,v 1.1 2020/12/19 16:00:17 rillig Exp $ +# +# Test for parsing a .for loop that accidentally contains a null byte. +# +# As of 2020-12-19, there are 3 error messages: +# +# make: "(stdin)" line 2: Zero byte read from file +# make: "(stdin)" line 2: Unexpected end of file in for loop. +# make: "(stdin)" line 3: Zero byte read from file +# +# The one about "end of file" might be misleading but is due to the +# implementation. On both errors and EOF, ParseGetLine returns NULL. +# +# The one about the "zero byte" in line 3 is surprising since the only +# line that contains a null byte is line 2. + +all: .PHONY + @printf '%s\n' '.for i in 1 2 3' 'VAR=value' '.endfor' | tr 'l' '\0' \ + | ${MAKE} -f - diff --git a/usr.bin/make/unit-tests/directive-for.exp b/usr.bin/make/unit-tests/directive-for.exp new file mode 100644 index 000000000..4e882aad7 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for.exp @@ -0,0 +1,24 @@ +make: "directive-for.mk" line 108: outer +make: "directive-for.mk" line 133: a:\ a:\file.txt +make: "directive-for.mk" line 133: d:\\ +make: "directive-for.mk" line 133: d:\\file.txt +make: "directive-for.mk" line 140: ( ( ( +make: "directive-for.mk" line 140: [ [ [ +make: "directive-for.mk" line 140: { { { +make: "directive-for.mk" line 140: ) ) ) +make: "directive-for.mk" line 140: ] ] ] +make: "directive-for.mk" line 140: } } } +make: "directive-for.mk" line 140: (()) (()) (()) +make: "directive-for.mk" line 140: [[]] [[]] [[]] +make: "directive-for.mk" line 140: {{}} {{}} {{}} +make: "directive-for.mk" line 140: )( )( )( +make: "directive-for.mk" line 140: ][ ][ ][ +make: "directive-for.mk" line 140: }{ }{ }{ +make: "directive-for.mk" line 148: outer value value +make: "directive-for.mk" line 148: outer "quoted" \"quoted\" +make: "directive-for.mk" line 154: Unknown modifier "Z" +make: "directive-for.mk" line 155: XXX: Not reached word1 +make: "directive-for.mk" line 155: XXX: Not reached word3 +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-for.mk b/usr.bin/make/unit-tests/directive-for.mk new file mode 100644 index 000000000..153762509 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-for.mk @@ -0,0 +1,159 @@ +# $NetBSD: directive-for.mk,v 1.10 2020/12/27 09:58:35 rillig Exp $ +# +# Tests for the .for directive. +# +# TODO: Describe naming conventions for the loop variables. +# .for f in values +# .for file in values +# .for _FILE_ in values +# .for .FILE. in values +# .for _f_ in values + +# Using the .for loop, lists of values can be produced. +# In simple cases, the :@var@${var}@ variable modifier can be used to +# reach the same effects. +# +.undef NUMBERS +.for num in 1 2 3 +NUMBERS+= ${num} +.endfor +.if ${NUMBERS} != "1 2 3" +. error +.endif + +# The .for loop also works for multiple iteration variables. +# This is something that the variable modifier :@ cannot do. +.for name value in VARNAME value NAME2 value2 +${name}= ${value} +.endfor +.if ${VARNAME} != "value" || ${NAME2} != "value2" +. error +.endif + +# The .for loop splits the items at whitespace, taking quotes into account, +# just like the :M or :S variable modifiers. +# +# Until 2012-06-03, it had split the items exactly at whitespace, without +# taking the quotes into account. This had resulted in 10 words. +# +.undef WORDS +.for var in one t\ w\ o "three three" 'four four' `five six` +WORDS+= counted +.endfor +.if ${WORDS:[#]} != 6 +. error +.endif + +# In the body of the .for loop, the iteration variables can be accessed +# like normal variables, even though they are not really variables. +# +# Instead, the expression ${var} is transformed into ${:U1}, ${:U2} and so +# on, before the loop body is evaluated. +# +# A notable effect of this implementation technique is that the .for +# iteration variables and the normal global variables live in separate +# namespaces and do not influence each other. +# +var= value before +var2= value before +.for var var2 in 1 2 3 4 +.endfor +.if ${var} != "value before" +. warning After the .for loop, var must still have its original value. +.endif +.if ${var2} != "value before" +. warning After the .for loop, var2 must still have its original value. +.endif + +# Everything from the paragraph above also applies if the loop body is +# empty, even if there is no actual iteration since the loop items are +# also empty. +# +var= value before +var2= value before +.for var var2 in ${:U} +.endfor +.if ${var} != "value before" +. warning After the .for loop, var must still have its original value. +.endif +.if ${var2} != "value before" +. warning After the .for loop, var2 must still have its original value. +.endif + +# Until 2008-12-21, the values of the iteration variables were simply +# inserted as plain text and then parsed as usual, which made it possible +# to achieve all kinds of strange effects. +# +# Before that date, the .for loop expanded to: +# EXPANSION+= value +# Since that date, the .for loop expands to: +# EXPANSION${:U+}= value +# +EXPANSION= before +EXPANSION+ = before +.for plus in + +EXPANSION${plus}= value +.endfor +.if ${EXPANSION} != "before" +. error This must be a make from before 2009. +.endif +.if ${EXPANSION+} != "value" +. error This must be a make from before 2009. +.endif + +# When the outer .for loop is expanded, it sees the expression ${i} and +# expands it. The inner loop then has nothing more to expand. +.for i in outer +. for i in inner +. info ${i} +. endfor +.endfor + +# From https://gnats.netbsd.org/29985. +# +# Until 2008-12-21, the .for loop was expanded by replacing the variable +# value literally in the body. This could lead to situations where the +# characters from the variable value were interpreted as markup rather than +# plain text. +# +# Until 2012-06-03, the .for loop had split the words at whitespace, without +# taking quotes into account. This made it possible to have variable values +# like "a:\ a:\file.txt" that ended in a single backslash. Since then, the +# variable values have been replaced with expressions of the form ${:U...}, +# which are not interpreted as code anymore. +# +# As of 2020-09-22, a comment in for.c says that it may be possible to +# produce an "unwanted substitution", but there is no demonstration code yet. +# +# The above changes prevent a backslash at the end of a word from being +# interpreted as part of the code. Because of this, the trailingBackslash +# hack in Var_Subst is no longer needed and as of 2020-09-22, has been +# removed. +.for path in a:\ a:\file.txt d:\\ d:\\file.txt +. info ${path} +.endfor + +# Ensure that braces and parentheses are properly escaped by the .for loop. +# Each line must print the same word 3 times. +# See GetEscapes. +.for v in ( [ { ) ] } (()) [[]] {{}} )( ][ }{ +. info $v ${v} $(v) +.endfor + +# As of 2020-10-25, the variable names may contain arbitrary characters, +# except for whitespace. This allows for creative side effects. Hopefully +# nobody is misusing this "feature". +var= outer +.for var:Q in value "quoted" +. info ${var} ${var:Q} ${var:Q:Q} +.endfor + + +# XXX: A parse error or evaluation error in the items of the .for loop +# should skip the whole loop. As of 2020-12-27, the loop is expanded twice. +.for var in word1 ${:Uword2:Z} word3 +. info XXX: Not reached ${var} +.endfor + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-hyphen-include.exp b/usr.bin/make/unit-tests/directive-hyphen-include.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-hyphen-include.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-hyphen-include.mk b/usr.bin/make/unit-tests/directive-hyphen-include.mk new file mode 100644 index 000000000..8c851be43 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-hyphen-include.mk @@ -0,0 +1,9 @@ +# $NetBSD: directive-hyphen-include.mk,v 1.1 2020/09/13 09:20:23 rillig Exp $ +# +# Tests for the .-include directive, which includes another file, +# silently skipping it if it cannot be opened. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-if-nested.exp b/usr.bin/make/unit-tests/directive-if-nested.exp new file mode 100644 index 000000000..1a9ae02f0 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-if-nested.exp @@ -0,0 +1,2 @@ +make: "directive-if-nested.inc" line 1001: deeply nested .if directives +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-if-nested.mk b/usr.bin/make/unit-tests/directive-if-nested.mk new file mode 100644 index 000000000..19c8e9452 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-if-nested.mk @@ -0,0 +1,25 @@ +# $NetBSD: directive-if-nested.mk,v 1.1 2020/11/10 22:23:37 rillig Exp $ +# +# Tests for deeply nested .if directives. By default, memory for 128 nested +# .if directives is pre-allocated, any deeper nesting is reallocated. +# +# See also: +# Cond_EvalLine + +GEN= directive-if-nested.inc + +all: set-up test tear-down + +set-up: .PHONY + @{ printf '.if %s\n' ${:U:range=1000}; \ + printf '.info deeply nested .if directives\n'; \ + printf '.endif # %s\n' ${:U:range=1000}; \ + printf '\n'; \ + printf 'all:\n'; \ + } > ${GEN} + +test: .PHONY + @${MAKE} -f ${GEN} + +tear-down: .PHONY + @rm -f ${GEN} diff --git a/usr.bin/make/unit-tests/directive-if.exp b/usr.bin/make/unit-tests/directive-if.exp new file mode 100644 index 000000000..89a394fc0 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-if.exp @@ -0,0 +1,17 @@ +make: "directive-if.mk" line 13: 0 evaluates to false. +make: "directive-if.mk" line 17: 1 evaluates to true. +make: "directive-if.mk" line 40: Unknown directive "ifx" +make: "directive-if.mk" line 41: This is not conditional. +make: "directive-if.mk" line 42: if-less else +make: "directive-if.mk" line 43: This is not conditional. +make: "directive-if.mk" line 44: if-less endif +make: "directive-if.mk" line 47: Malformed conditional () +make: "directive-if.mk" line 57: Quotes in plain words are probably a mistake. +make: "directive-if.mk" line 66: Don't do this, always put a space after a directive. +make: "directive-if.mk" line 70: Don't do this, always put a space after a directive. +make: "directive-if.mk" line 76: Don't do this, always put a space around comparison operators. +make: "directive-if.mk" line 82: Don't do this, always put a space after a directive. +make: "directive-if.mk" line 86: Don't do this, always put a space after a directive. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-if.mk b/usr.bin/make/unit-tests/directive-if.mk new file mode 100644 index 000000000..b1ad2396b --- /dev/null +++ b/usr.bin/make/unit-tests/directive-if.mk @@ -0,0 +1,89 @@ +# $NetBSD: directive-if.mk,v 1.9 2020/12/19 22:33:11 rillig Exp $ +# +# Tests for the .if directive. +# +# See also: +# cond-*.mk + +# TODO: Implementation + +.if 0 +. error +.else +. info 0 evaluates to false. +.endif + +.if 1 +. info 1 evaluates to true. +.else +. error +.endif + +# There is no '.ifx'. +# +# The commit from 2005-05-01 intended to detect this situation, but it failed +# to do this since the call to is_token had its arguments switched. They were +# expected as (str, token, token_len) but were actually passed as (token, str, +# token_len). This made is_token return true even if the directive was +# directly followed by alphanumerical characters, which was wrong. The +# typical cases produced an error message such as "Malformed conditional +# (x 123)", while the intended error message was "Unknown directive". +# +# Back at that time, the commits only modified the main code but did not add +# the corresponding unit tests. This allowed the bug to hide for more than +# 15 years. +# +# Since 2020-11-10, the correct error message is produced. The '.ifx' is no +# longer interpreted as a variant of '.if', therefore the '.error' and '.else' +# are interpreted as ordinary directives, producing the error messages +# "if-less else" and "if-less endif". +.ifx 123 +.info This is not conditional. +.else +.info This is not conditional. +.endif + +# Missing condition. +.if +. error +.else +. error +.endif + +# A plain word must not start with a '"'. It may contain a embedded quotes +# though, which are kept. The quotes need not be balanced. The next space +# ends the word, and the remaining " || 1" is parsed as "or true". +.if ${:Uplain"""""} == plain""""" || 1 +. info Quotes in plain words are probably a mistake. +# XXX: Accepting quotes in plain words is probably a mistake as well. +.else +. error +.endif + +.if0 +. error +.else +. info Don't do this, always put a space after a directive. +.endif + +.if${:U-3} +. info Don't do this, always put a space after a directive. +.else +. error +.endif + +.if${:U-3}>-4 +. info Don't do this, always put a space around comparison operators. +.else +. error +.endif + +.if(1) +. info Don't do this, always put a space after a directive. +.endif + +.if!0 +. info Don't do this, always put a space after a directive. +.endif + +all: diff --git a/usr.bin/make/unit-tests/directive-ifdef.exp b/usr.bin/make/unit-tests/directive-ifdef.exp new file mode 100644 index 000000000..1a1358988 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifdef.exp @@ -0,0 +1,4 @@ +make: "directive-ifdef.mk" line 12: Function calls in .ifdef are possible. +make: "directive-ifdef.mk" line 23: String literals are tested for emptiness. +make: "directive-ifdef.mk" line 27: String literals are tested for emptiness. Whitespace is non-empty. +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-ifdef.mk b/usr.bin/make/unit-tests/directive-ifdef.mk new file mode 100644 index 000000000..12f3648e8 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifdef.mk @@ -0,0 +1,33 @@ +# $NetBSD: directive-ifdef.mk,v 1.4 2021/01/21 23:03:41 rillig Exp $ +# +# Tests for the .ifdef directive. + +# TODO: Implementation + +DEFINED= defined + +# It looks redundant to have a call to defined() in an .ifdef, but it's +# possible. The .ifdef only affects plain symbols, not function calls. +.ifdef defined(DEFINED) +. info Function calls in .ifdef are possible. +.else +. error +.endif + +# String literals are handled the same in all variants of the .if directive. +# They evaluate to true if they are not empty. Whitespace counts as non-empty +# as well. +.ifdef "" +. error +.else +. info String literals are tested for emptiness. +.endif + +.ifdef " " +. info String literals are tested for emptiness. Whitespace is non-empty. +.else +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-ifmake.exp b/usr.bin/make/unit-tests/directive-ifmake.exp new file mode 100644 index 000000000..fd4bcae15 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifmake.exp @@ -0,0 +1,11 @@ +make: "directive-ifmake.mk" line 13: ok: positive condition works +make: "directive-ifmake.mk" line 24: ok: negation works +make: "directive-ifmake.mk" line 33: ok: double negation works +make: "directive-ifmake.mk" line 40: ok: both mentioned +make: "directive-ifmake.mk" line 47: ok: only those mentioned +make: "directive-ifmake.mk" line 57: Targets can even be added at parse time. +make: "directive-ifmake.mk" line 75: ok +: first +: second +: late-target +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-ifmake.mk b/usr.bin/make/unit-tests/directive-ifmake.mk new file mode 100644 index 000000000..4d49add72 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifmake.mk @@ -0,0 +1,82 @@ +# $NetBSD: directive-ifmake.mk,v 1.8 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the .ifmake directive, which provides a shortcut for asking +# whether a certain target is requested to be made from the command line. +# +# TODO: Describe why the shortcut may be useful (if it's useful at all), +# instead of sticking to the simple '.if' only. + +# The targets 'first' and 'second' are passed in on the command line. + +# This is the most basic form. +.ifmake first +. info ok: positive condition works +.else +. warning positive condition fails +.endif + +# The not operator works as expected. +# An alternative interpretation were that this condition is asking whether +# the target "!first" was requested. To distinguish this, see the next test. +.ifmake !first +. warning unexpected +.else +. info ok: negation works +.endif + +# See if the exclamation mark really means "not", or if it is just part of +# the target name. Since it means 'not', the two exclamation marks are +# effectively ignored, and 'first' is indeed a requested target. If the +# exclamation mark were part of the name instead, the name would be '!!first', +# and such a target was not requested to be made. +.ifmake !!first +. info ok: double negation works +.else +. warning double negation fails +.endif + +# Multiple targets can be combined using the && and || operators. +.ifmake first && second +. info ok: both mentioned +.else +. warning && does not work as expected +.endif + +# Negation also works in complex conditions. +.ifmake first && !unmentioned +. info ok: only those mentioned +.else +. warning && with ! does not work as expected +.endif + +# Using the .MAKEFLAGS special dependency target, arbitrary command +# line options can be added at parse time. This means that it is +# possible to extend the targets to be made. +.MAKEFLAGS: late-target +.ifmake late-target +. info Targets can even be added at parse time. +.else +. info No, targets cannot be added at parse time anymore. +.endif + +# Numbers are interpreted as numbers, no matter whether the directive is +# a plain .if or an .ifmake. +.ifmake 0 +. error +.endif +.ifmake 1 +.else +. error +.endif + +# A condition that consists of a variable expression only (without any +# comparison operator) can be used with .if and the other .ifxxx directives. +.ifmake ${:Ufirst} +. info ok +.else +. error +.endif + + +first second unmentioned late-target: + : $@ diff --git a/usr.bin/make/unit-tests/directive-ifndef.exp b/usr.bin/make/unit-tests/directive-ifndef.exp new file mode 100644 index 000000000..c653f6344 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifndef.exp @@ -0,0 +1,2 @@ +make: "directive-ifndef.mk" line 10: guarded section +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-ifndef.mk b/usr.bin/make/unit-tests/directive-ifndef.mk new file mode 100644 index 000000000..bf509ef80 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifndef.mk @@ -0,0 +1,24 @@ +# $NetBSD: directive-ifndef.mk,v 1.6 2020/10/24 08:46:08 rillig Exp $ +# +# Tests for the .ifndef directive, which can be used for multiple-inclusion +# guards. In contrast to C, where #ifndef and #define nicely line up the +# macro name, there is no such syntax in make. Therefore, it is more +# common to use .if !defined(GUARD) instead. + +.ifndef GUARD +GUARD= # defined +. info guarded section +.endif + +.ifndef GUARD +GUARD= # defined +. info guarded section +.endif + +.if !defined(GUARD) +GUARD= # defined +. info guarded section +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-ifnmake.exp b/usr.bin/make/unit-tests/directive-ifnmake.exp new file mode 100644 index 000000000..31a5a8043 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifnmake.exp @@ -0,0 +1,3 @@ +Don't forget to run the tests (1) +Running the tests +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-ifnmake.mk b/usr.bin/make/unit-tests/directive-ifnmake.mk new file mode 100644 index 000000000..4bdb12a46 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-ifnmake.mk @@ -0,0 +1,22 @@ +# $NetBSD: directive-ifnmake.mk,v 1.5 2020/10/05 19:27:48 rillig Exp $ +# +# Tests for the .ifnmake directive, which evaluates to true if its argument +# is _not_ listed in the command-line targets to be created. + +all: + @:; + +.ifnmake(test) +.BEGIN: + @echo "Don't forget to run the tests (1)" +.endif + +.MAKEFLAGS: test + +.ifnmake(test) +.BEGIN: + @echo "Don't forget to run the tests (2)" +.endif + +test: + @echo "Running the tests" diff --git a/usr.bin/make/unit-tests/directive-include-fatal.exp b/usr.bin/make/unit-tests/directive-include-fatal.exp new file mode 100644 index 000000000..c8ca97a0f --- /dev/null +++ b/usr.bin/make/unit-tests/directive-include-fatal.exp @@ -0,0 +1,4 @@ +make: "directive-include-fatal.mk" line 13: Malformed conditional (${UNDEF}) +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-include-fatal.mk b/usr.bin/make/unit-tests/directive-include-fatal.mk new file mode 100644 index 000000000..6744f9e80 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-include-fatal.mk @@ -0,0 +1,27 @@ +# $NetBSD: directive-include-fatal.mk,v 1.3 2021/02/01 22:16:57 rillig Exp $ +# +# Test for the .include directive combined with fatal errors. +# +# At 2020-09-13, the code in Parse_File that sets "fatals = 0" looked +# suspicious, as if it were possible to suppress fatal errors by including +# another file. It was a false alarm though, since Parse_File only handles +# the top-level makefiles from the command line. Any included files are +# handled by IncludeFile instead, and that function does not reset +# the "fatals" counter. + +# Using an undefined variable in a condition generates a fatal error. +.if ${UNDEF} +.endif + +# Including another file does not reset the global variable "fatals". +# The exit status will be 1. +.include "/dev/null" + +# Adding another file to be included has no effect either. +# When the command line is parsed, the additional file is only enqueued +# in the global "makefiles" variable, but not immediately run through +# Parse_File. +.MAKEFLAGS: -f "/dev/null" + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-include.exp b/usr.bin/make/unit-tests/directive-include.exp new file mode 100644 index 000000000..af56eefb2 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-include.exp @@ -0,0 +1,8 @@ +CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" +lhs = "directive-include.mk null", rhs = "directive-include.mk null", op = != +CondParser_Eval: ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" +lhs = "directive-include.mk null", rhs = "directive-include.mk null", op = != +make: "directive-include.mk" line 25: Could not find nonexistent.mk +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-include.mk b/usr.bin/make/unit-tests/directive-include.mk new file mode 100644 index 000000000..d36914b25 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-include.mk @@ -0,0 +1,34 @@ +# $NetBSD: directive-include.mk,v 1.5 2020/11/21 14:59:11 rillig Exp $ +# +# Tests for the .include directive, which includes another file. + +# TODO: Implementation + +.MAKEFLAGS: -dc + +# All included files are recorded in the variable .MAKE.MAKEFILES. +# In this test, only the basenames of the files are compared since +# the directories can differ. +.include "/dev/null" +.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" +. error +.endif + +# Each file is recorded only once in the variable .MAKE.MAKEFILES. +# Between 2015-11-26 and 2020-10-31, the very last file could be repeated, +# due to an off-by-one bug in ParseTrackInput. +.include "/dev/null" +.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null" +. error +.endif + +.include "nonexistent.mk" +.include "/dev/null" # size 0 +# including a directory technically succeeds, but shouldn't. +#.include "." # directory + +# As of 2020-11-21, anything after the delimiter '"' is ignored. +.include "/dev/null" and ignore anything in the rest of the line. + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-info.exp b/usr.bin/make/unit-tests/directive-info.exp new file mode 100644 index 000000000..2652c1914 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-info.exp @@ -0,0 +1,15 @@ +make: "directive-info.mk" line 11: begin .info tests +make: "directive-info.mk" line 12: Unknown directive "inf" +make: "directive-info.mk" line 13: Missing argument for ".info" +make: "directive-info.mk" line 14: message +make: "directive-info.mk" line 15: indented message +make: "directive-info.mk" line 16: Unknown directive "information" +make: "directive-info.mk" line 17: Unknown directive "information" +make: "directive-info.mk" line 22: Missing argument for ".info" +make: "directive-info.mk" line 23: Missing argument for ".info" +make: "directive-info.mk" line 26: Unknown directive "info-message" +make: "directive-info.mk" line 27: no-target: no-source +make: "directive-info.mk" line 36: expect line 30 for multi-line message +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-info.mk b/usr.bin/make/unit-tests/directive-info.mk new file mode 100644 index 000000000..5feea0cde --- /dev/null +++ b/usr.bin/make/unit-tests/directive-info.mk @@ -0,0 +1,39 @@ +# $NetBSD: directive-info.mk,v 1.8 2020/12/19 22:33:11 rillig Exp $ +# +# Tests for the .info directive. +# +# Until parse.c 1.502 from 2020-12-19, a missing argument to the directive +# produced the wrong error message "Unknown directive". Since parse.c 1.503 +# from 2020-12-19, the correct "Missing argument" is produced. + +# TODO: Implementation + +.info begin .info tests +.inf # misspelled +.info # "Missing argument" +.info message +.info indented message +.information +.information message # Accepted before 2020-12-13 01:07:54. +.info.man: # not a message, but possibly a suffix rule + +# Even if lines would have trailing whitespace, this would be trimmed by +# ParseGetLine. +.info +.info # comment + +.info: message # This is a dependency declaration. +.info-message # This is an unknown directive. +.info no-target: no-source # This is a .info directive, not a dependency. +# See directive.mk for more tests of this kind. + +# Since at least 2002-01-01, the line number that is used in error messages +# and the .info directives is the number of completely read lines. For the +# following multi-line directive, this means that the reported line number is +# the one of the last line, not the first line. +.info expect line 30 for\ + multi$\ + -line message + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-misspellings.exp b/usr.bin/make/unit-tests/directive-misspellings.exp new file mode 100644 index 000000000..e51d8473b --- /dev/null +++ b/usr.bin/make/unit-tests/directive-misspellings.exp @@ -0,0 +1,45 @@ +make: "directive-misspellings.mk" line 12: Unknown directive "dinclud" +make: "directive-misspellings.mk" line 14: Unknown directive "dincludx" +make: "directive-misspellings.mk" line 15: .include filename must be delimited by '"' or '<' +make: "directive-misspellings.mk" line 17: Unknown directive "erro" +make: "directive-misspellings.mk" line 18: Unknown directive "errox" +make: "directive-misspellings.mk" line 22: Unknown directive "expor" +make: "directive-misspellings.mk" line 24: Unknown directive "exporx" +make: "directive-misspellings.mk" line 25: Unknown directive "exports" +make: "directive-misspellings.mk" line 27: Unknown directive "export-en" +make: "directive-misspellings.mk" line 30: Unknown directive "export-environment" +make: "directive-misspellings.mk" line 32: Unknown directive "export-litera" +make: "directive-misspellings.mk" line 34: Unknown directive "export-literax" +make: "directive-misspellings.mk" line 35: Unknown directive "export-literally" +make: "directive-misspellings.mk" line 37: Unknown directive "-includ" +make: "directive-misspellings.mk" line 39: Unknown directive "-includx" +make: "directive-misspellings.mk" line 40: .include filename must be delimited by '"' or '<' +make: "directive-misspellings.mk" line 42: Unknown directive "includ" +make: "directive-misspellings.mk" line 43: Could not find file +make: "directive-misspellings.mk" line 44: Unknown directive "includx" +make: "directive-misspellings.mk" line 45: .include filename must be delimited by '"' or '<' +make: "directive-misspellings.mk" line 47: Unknown directive "inf" +make: "directive-misspellings.mk" line 48: msg +make: "directive-misspellings.mk" line 49: Unknown directive "infx" +make: "directive-misspellings.mk" line 50: Unknown directive "infos" +make: "directive-misspellings.mk" line 52: Unknown directive "sinclud" +make: "directive-misspellings.mk" line 54: Unknown directive "sincludx" +make: "directive-misspellings.mk" line 55: .include filename must be delimited by '"' or '<' +make: "directive-misspellings.mk" line 57: Unknown directive "unde" +make: "directive-misspellings.mk" line 59: Unknown directive "undex" +make: "directive-misspellings.mk" line 60: Unknown directive "undefs" +make: "directive-misspellings.mk" line 62: Unknown directive "unexpor" +make: "directive-misspellings.mk" line 64: Unknown directive "unexporx" +make: "directive-misspellings.mk" line 65: Unknown directive "unexports" +make: "directive-misspellings.mk" line 67: Unknown directive "unexport-en" +make: "directive-misspellings.mk" line 69: The directive .unexport-env does not take arguments +make: "directive-misspellings.mk" line 70: Unknown directive "unexport-enx" +make: "directive-misspellings.mk" line 71: Unknown directive "unexport-envs" +make: "directive-misspellings.mk" line 73: Unknown directive "warn" +make: "directive-misspellings.mk" line 74: Unknown directive "warnin" +make: "directive-misspellings.mk" line 75: warning: msg +make: "directive-misspellings.mk" line 76: Unknown directive "warninx" +make: "directive-misspellings.mk" line 77: Unknown directive "warnings" +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-misspellings.mk b/usr.bin/make/unit-tests/directive-misspellings.mk new file mode 100644 index 000000000..5f479f03b --- /dev/null +++ b/usr.bin/make/unit-tests/directive-misspellings.mk @@ -0,0 +1,79 @@ +# $NetBSD: directive-misspellings.mk,v 1.3 2020/12/13 01:10:22 rillig Exp $ +# +# Tests for misspelled directives. +# +# Before 2020-12-12, make didn't catch most of these misspellings. For +# example, the directive ".exporting" was interpreted as if it were spelled +# ".export ing", which would export the variable named "ing" if that existed. +# Another misspelling, as improbable as the others, was that both ".infos" and +# ".information" were aliases to ".info" since the code for these diagnostic +# directives just skipped any letters following the "error", "warn" or "info". + +.dinclud "file" +.dinclude "file" +.dincludx "file" +.dincludes "file" # XXX: the 's' is not meant to be a filename + +.erro msg +.errox msg +# no .error since that would exit immediately +# no .errors since that would exit immediately, even with the typo + +.expor varname +.export varname +.exporx varname +.exports varname # Accepted before 2020-12-13 01:07:54. + +.export-en # Accepted before 2020-12-13 01:07:54. +.export-env +.export-env extra argument # XXX: undetected extra argument +.export-environment # Accepted before 2020-12-13 01:07:54. + +.export-litera varname # Accepted before 2020-12-13 01:07:54. +.export-literal varname +.export-literax varname # Accepted before 2020-12-13 01:07:54. +.export-literally varname # Accepted before 2020-12-13 01:07:54. + +.-includ "file" +.-include "file" +.-includx "file" +.-includes "file" # XXX: the 's' is not meant to be a filename + +.includ "file" +.include "file" +.includx "file" +.includex "file" # XXX: the 's' is not meant to be a filename + +.inf msg +.info msg +.infx msg +.infos msg # Accepted before 2020-12-13 01:07:54. + +.sinclud "file" +.sinclude "file" +.sincludx "file" +.sincludes "file" # XXX: the 's' is not meant to be a filename + +.unde varname +.undef varname +.undex varname +.undefs varname # Accepted before 2020-12-13 01:07:54. + +.unexpor varname +.unexport varname +.unexporx varname +.unexports varname # Accepted before 2020-12-12 18:00:18. + +.unexport-en # Accepted before 2020-12-12 18:11:42. +.unexport-env +.unexport-env extra argument # Accepted before 2020-12-12 18:00:18. +.unexport-enx # Accepted before 2020-12-12 18:00:18. +.unexport-envs # Accepted before 2020-12-12 18:00:18. + +.warn msg +.warnin msg +.warning msg +.warninx msg +.warnings msg # Accepted before 2020-12-13 01:07:54. + +all: diff --git a/usr.bin/make/unit-tests/directive-sinclude.exp b/usr.bin/make/unit-tests/directive-sinclude.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-sinclude.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-sinclude.mk b/usr.bin/make/unit-tests/directive-sinclude.mk new file mode 100644 index 000000000..1932e7b3b --- /dev/null +++ b/usr.bin/make/unit-tests/directive-sinclude.mk @@ -0,0 +1,13 @@ +# $NetBSD: directive-sinclude.mk,v 1.2 2020/11/15 20:20:58 rillig Exp $ +# +# Tests for the .sinclude directive, which includes another file, +# silently skipping it if it cannot be opened. +# +# The 'silently skipping' only applies to the case where the file cannot be +# opened. Parse errors and other errors are handled the same way as in the +# other .include directives. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-undef.exp b/usr.bin/make/unit-tests/directive-undef.exp new file mode 100644 index 000000000..56c871429 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-undef.exp @@ -0,0 +1,6 @@ +make: "directive-undef.mk" line 29: The .undef directive requires an argument +make: "directive-undef.mk" line 86: Unknown modifier "Z" +make: "directive-undef.mk" line 103: warning: UT_EXPORTED is still listed in .MAKE.EXPORTED even though spaceit is not exported anymore. +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-undef.mk b/usr.bin/make/unit-tests/directive-undef.mk new file mode 100644 index 000000000..41ea6b5bf --- /dev/null +++ b/usr.bin/make/unit-tests/directive-undef.mk @@ -0,0 +1,107 @@ +# $NetBSD: directive-undef.mk,v 1.10 2021/02/16 18:02:19 rillig Exp $ +# +# Tests for the .undef directive. +# +# See also: +# directive-misspellings.mk + +# Before var.c 1.737 from 2020-12-19, .undef only undefined the first +# variable, silently skipping all further variable names. +# +# Before var.c 1.761 from 2020-12-22, .undef complained about too many +# arguments. +# +# Since var.c 1.761 from 2020-12-22, .undef handles multiple variable names +# just like the .export directive. +1= 1 +2= 2 +3= 3 +.undef 1 2 3 +.if ${1:U_}${2:U_}${3:U_} != ___ +. warning $1$2$3 +.endif + + +# Without any arguments, until var.c 1.736 from 2020-12-19, .undef tried +# to delete the variable with the empty name, which never exists; see +# varname-empty.mk. Since var.c 1.737 from 2020-12-19, .undef complains +# about a missing argument. +.undef + + +# Trying to delete the variable with the empty name is ok, it just won't +# ever do anything since that variable is never defined. +.undef ${:U} + + +# The argument of .undef is first expanded exactly once and then split into +# words, just like everywhere else. This prevents variables whose names +# contain spaces or unbalanced 'single' or "double" quotes from being +# undefined, but these characters do not appear in variables names anyway. +1= 1 +2= 2 +3= 3 +${:U1 2 3}= one two three +VARNAMES= 1 2 3 +.undef ${VARNAMES} # undefines the variable "1 2 3" +.if !defined(${:U1 2 3}) +. error +.endif +.if ${1:U_}${2:U_}${3:U_} != "___" # these are still defined +. error +.endif + + +# A variable named " " cannot be undefined. There's no practical use case +# for such variables anyway. +SPACE= ${:U } +${SPACE}= space +.if !defined(${SPACE}) +. error +.endif +.undef ${SPACE} +.if !defined(${SPACE}) +. error +.endif + + +# A variable named "$" can be undefined since the argument to .undef is +# expanded exactly once, before being split into words. +DOLLAR= $$ +${DOLLAR}= dollar +.if !defined(${DOLLAR}) +. error +.endif +.undef ${DOLLAR} +.if defined(${DOLLAR}) +. error +.endif + + +# Since var.c 1.762 from 2020-12-22, parse errors in the argument should be +# properly detected and should stop the .undef directive from doing any work. +# +# As of var.c 1.762, this doesn't happen though because the error handling +# in Var_Parse and Var_Subst is not done properly. +.undef ${VARNAMES:L:Z} + + +UT_EXPORTED= exported-value +.export UT_EXPORTED +.if ${:!echo "\${UT_EXPORTED:-not-exported}"!} != "exported-value" +. error +.endif +.if !${.MAKE.EXPORTED:MUT_EXPORTED} +. error +.endif +.undef UT_EXPORTED # XXX: does not update .MAKE.EXPORTED +.if ${:!echo "\${UT_EXPORTED:-not-exported}"!} != "not-exported" +. error +.endif +.if ${.MAKE.EXPORTED:MUT_EXPORTED} +. warning UT_EXPORTED is still listed in .MAKE.EXPORTED even though $\ + it is not exported anymore. +.endif + + +all: diff --git a/usr.bin/make/unit-tests/directive-unexport-env.exp b/usr.bin/make/unit-tests/directive-unexport-env.exp new file mode 100644 index 000000000..18d6e92f0 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-unexport-env.exp @@ -0,0 +1,18 @@ +make: "directive-unexport-env.mk" line 13: Unknown directive "unexport-en" +make: "directive-unexport-env.mk" line 15: Unknown directive "unexport-environment" +Global:UT_EXPORTED = value +Global:UT_UNEXPORTED = value +Global:.MAKE.EXPORTED = UT_EXPORTED +make: "directive-unexport-env.mk" line 21: The directive .unexport-env does not take arguments +Var_Parse: ${.MAKE.EXPORTED:O:u} (eval) +Applying ${.MAKE.EXPORTED:O} to "UT_EXPORTED" (eval, none, regular) +Result of ${.MAKE.EXPORTED:O} is "UT_EXPORTED" (eval, none, regular) +Applying ${.MAKE.EXPORTED:u} to "UT_EXPORTED" (eval, none, regular) +Result of ${.MAKE.EXPORTED:u} is "UT_EXPORTED" (eval, none, regular) +Unexporting "UT_EXPORTED" +Global:delete .MAKE.EXPORTED +Global:.MAKEFLAGS = -r -k -d v -d +Global:.MAKEFLAGS = -r -k -d v -d 0 +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-unexport-env.mk b/usr.bin/make/unit-tests/directive-unexport-env.mk new file mode 100644 index 000000000..ef58ae732 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-unexport-env.mk @@ -0,0 +1,25 @@ +# $NetBSD: directive-unexport-env.mk,v 1.7 2020/12/12 18:11:42 rillig Exp $ +# +# Tests for the .unexport-env directive. +# +# Before 2020-12-13, the directive unexport-env wrongly accepted arguments +# and ignored them. +# +# Before 2020-12-13, misspelled directive names like "unexport-environment" +# were not properly detected. + +# TODO: Implementation + +.unexport-en # misspelled +.unexport-env # ok +.unexport-environment # misspelled + +.MAKEFLAGS: -dv +UT_EXPORTED= value +UT_UNEXPORTED= value +.export UT_EXPORTED +.unexport-env UT_EXPORTED UT_UNEXPORTED +.MAKEFLAGS: -d0 + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-unexport.exp b/usr.bin/make/unit-tests/directive-unexport.exp new file mode 100644 index 000000000..d59fb4713 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-unexport.exp @@ -0,0 +1,5 @@ +make: "directive-unexport.mk" line 18: UT_A=a UT_B=b UT_C=c +make: "directive-unexport.mk" line 19: UT_A UT_B UT_C +make: "directive-unexport.mk" line 27: UT_A=a UT_B=b UT_C=c +make: "directive-unexport.mk" line 28: +exit status 0 diff --git a/usr.bin/make/unit-tests/directive-unexport.mk b/usr.bin/make/unit-tests/directive-unexport.mk new file mode 100644 index 000000000..efc103efe --- /dev/null +++ b/usr.bin/make/unit-tests/directive-unexport.mk @@ -0,0 +1,33 @@ +# $NetBSD: directive-unexport.mk,v 1.7 2020/12/13 01:07:54 rillig Exp $ +# +# Tests for the .unexport directive. +# +# Before 2020-12-13, misspelled directives like ".unexporting" or +# ".unexport-en" had not been detected properly. +# +# See also: +# directive-misspellings.mk + +# First, export 3 variables. +UT_A= a +UT_B= b +UT_C= c +.export UT_A UT_B UT_C + +# Show the exported variables and their values. +.info ${:!env|sort|grep '^UT_'!} +.info ${.MAKE.EXPORTED} + +# XXX: Now try to unexport all of them. The variables are still exported +# but not mentioned in .MAKE.EXPORTED anymore. +# See the ":N" in Var_UnExport for the implementation. +*= asterisk +.unexport * + +.info ${:!env|sort|grep '^UT_'!} +.info ${.MAKE.EXPORTED} + +.unexport # oops: missing argument + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive-warning.exp b/usr.bin/make/unit-tests/directive-warning.exp new file mode 100644 index 000000000..b08b32073 --- /dev/null +++ b/usr.bin/make/unit-tests/directive-warning.exp @@ -0,0 +1,11 @@ +make: "directive-warning.mk" line 11: Unknown directive "warn" +make: "directive-warning.mk" line 12: Unknown directive "warn" +make: "directive-warning.mk" line 13: Unknown directive "warnin" +make: "directive-warning.mk" line 14: Unknown directive "warnin" +make: "directive-warning.mk" line 15: Missing argument for ".warning" +make: "directive-warning.mk" line 16: warning: message +make: "directive-warning.mk" line 17: Unknown directive "warnings" +make: "directive-warning.mk" line 18: Unknown directive "warnings" +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive-warning.mk b/usr.bin/make/unit-tests/directive-warning.mk new file mode 100644 index 000000000..d586c9fed --- /dev/null +++ b/usr.bin/make/unit-tests/directive-warning.mk @@ -0,0 +1,21 @@ +# $NetBSD: directive-warning.mk,v 1.6 2020/12/19 22:33:11 rillig Exp $ +# +# Tests for the .warning directive. +# +# Until parse.c 1.502 from 2020-12-19, a missing argument to the directive +# produced the wrong error message "Unknown directive". Since parse.c 1.503 +# from 2020-12-19, the correct "Missing argument" is produced. + +# TODO: Implementation + +.warn # misspelled +.warn message # misspelled +.warnin # misspelled +.warnin message # misspelled +.warning # "Missing argument" +.warning message # ok +.warnings # misspelled +.warnings messages # Accepted before 2020-12-13 01:07:54. + +all: + @:; diff --git a/usr.bin/make/unit-tests/directive.exp b/usr.bin/make/unit-tests/directive.exp new file mode 100644 index 000000000..b93d76816 --- /dev/null +++ b/usr.bin/make/unit-tests/directive.exp @@ -0,0 +1,12 @@ +make: "directive.mk" line 9: Unknown directive "indented" +make: "directive.mk" line 10: Unknown directive "indented" +make: "directive.mk" line 11: Unknown directive "indented" +make: "directive.mk" line 15: Unknown directive "info" +Global:.info = +Global:.info = value +make: "directive.mk" line 26: := value +Global:.MAKEFLAGS = -r -k -d v -d +Global:.MAKEFLAGS = -r -k -d v -d 0 +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/directive.mk b/usr.bin/make/unit-tests/directive.mk new file mode 100644 index 000000000..d463ce4f0 --- /dev/null +++ b/usr.bin/make/unit-tests/directive.mk @@ -0,0 +1,35 @@ +# $NetBSD: directive.mk,v 1.4 2020/11/15 11:57:00 rillig Exp $ +# +# Tests for the preprocessing directives, such as .if or .info. + +# TODO: Implementation + +# Unknown directives are correctly named in the error messages, +# even if they are indented. +.indented none +. indented 2 spaces +. indented tab + +# Directives must be written directly, not indirectly via variable +# expressions. +.${:Uinfo} directives cannot be indirect + +# There is no directive called '.target', therefore this is parsed as a +# dependency declaration with 2 targets and 1 source. +.target target: source + +# This looks ambiguous. It could be either an .info message or a variable +# assignment. It is a variable assignment. +.MAKEFLAGS: -dv +.info:= value +.info?= value # This is a variable assignment as well. +.info := value # The space after the '.info' makes this + # a directive. +.MAKEFLAGS: -d0 + +# This is a dependency since directives must be given directly. +# Not even the space after the '.info' can change anything about this. +.${:Uinfo} : source + +all: + @:; diff --git a/usr.bin/make/unit-tests/dollar.exp b/usr.bin/make/unit-tests/dollar.exp new file mode 100644 index 000000000..9b8c9d638 --- /dev/null +++ b/usr.bin/make/unit-tests/dollar.exp @@ -0,0 +1,51 @@ + +Printing dollar from literals and variables + +To survive the parser, a dollar sign must be doubled. + 1 dollar literal => + 1 dollar literal eol => <> + 2 dollar literal => <$> + 4 dollar literal => <$$> +Some hungry part of make eats all the dollars after a :U modifier. + 1 dollar default => <> + 2 dollar default => <> + 4 dollar default => <> +This works as expected. + 1 dollar variable => <> + 2 dollar variable => <$> + 4 dollar variable => <$$> +Some hungry part of make eats all the dollars after a :U modifier. + 1 dollar var-default => <> + 2 dollar var-default => <$> + 4 dollar var-default => <$$> + +Dollar in :S pattern + + S,$,word, => <$XYword> + S,$X,word, => <$XY> + S,$$X,word, => <$XY> + S,$$$X,word, => <$XY> + S,$X,replaced, => + S,$$X,replaced, => + S,$$$X,replaced, => + +Dollar in :C character class + +The A is replaced because the $$ is reduced to a single $, +which is then resolved to the variable X with the value VAR_X. +The effective character class becomes [VAR_XY]. + C,[$$XY],<&>,g => <$> + +Dollar in :C pattern + +For some reason, multiple dollars are folded into one. + C,$,dollar,g => <> + C,$$,dollar,g => <> + +Dollar in :S replacement + +For some reason, multiple dollars are folded into one. + S,word,a$Xo, => + S,word,a$$Xo, => + S,word,a$$$Xo, => +exit status 0 diff --git a/usr.bin/make/unit-tests/dollar.mk b/usr.bin/make/unit-tests/dollar.mk new file mode 100644 index 000000000..8a06c5bf7 --- /dev/null +++ b/usr.bin/make/unit-tests/dollar.mk @@ -0,0 +1,81 @@ +# $NetBSD: dollar.mk,v 1.4 2020/11/03 18:21:36 rillig Exp $ +# +# Test the various places where a dollar sign can appear and +# see what happens. There are lots of surprises here. +# + +LIST= plain 'single' "double" 'mix'"ed" back\ slashed +WORD= word + +DOLLAR1= $ +DOLLAR2= $$ +DOLLAR4= $$$$ + +X= VAR_X +DOLLAR_XY= $$XY +DOLLAR_AXY= $$AXY + +H= @header() { printf '\n%s\n\n' "$$*"; }; header +T= @testcase() { printf '%23s => <%s>\n' "$$@"; }; testcase +C= @comment() { printf '%s\n' "$$*"; }; comment + +# These variable values are not accessed. +# The trailing dollar in the '1 dollar literal eol' test case accesses +# the empty variable instead, which is always guaranteed to be empty. +${:U }= space-var-value +${:U${.newline}}= newline-var-value +# But this one is accessed. +${:U'}= single-quote-var-value' + +all: + $H 'Printing dollar from literals and variables' + + $C 'To survive the parser, a dollar sign must be doubled.' + $T '1 dollar literal' '$' + $T '1 dollar literal eol' ''$ + $T '2 dollar literal' '$$' + $T '4 dollar literal' '$$$$' + + $C 'Some hungry part of make eats all the dollars after a :U modifier.' + $T '1 dollar default' ''${:U$:Q} + $T '2 dollar default' ''${:U$$:Q} + $T '4 dollar default' ''${:U$$$$:Q} + + $C 'This works as expected.' + $T '1 dollar variable' ''${DOLLAR1:Q} + $T '2 dollar variable' ''${DOLLAR2:Q} + $T '4 dollar variable' ''${DOLLAR4:Q} + + $C 'Some hungry part of make eats all the dollars after a :U modifier.' + $T '1 dollar var-default' ''${:U${DOLLAR1}:Q} + $T '2 dollar var-default' ''${:U${DOLLAR2}:Q} + $T '4 dollar var-default' ''${:U${DOLLAR4}:Q} + + $H 'Dollar in :S pattern' + + $T 'S,$$,word,' ''${DOLLAR_XY:S,$,word,:Q} + $T 'S,$$X,word,' ''${DOLLAR_XY:S,$X,word,:Q} + $T 'S,$$$$X,word,' ''${DOLLAR_XY:S,$$X,word,:Q} + $T 'S,$$$$$$X,word,' ''${DOLLAR_XY:S,$$$X,word,:Q} + + $T 'S,$$X,replaced,' ''${X:S,$X,replaced,:Q} + $T 'S,$$$$X,replaced,' ''${X:S,$$X,replaced,:Q} + $T 'S,$$$$$$X,replaced,' ''${X:S,$$$X,replaced,:Q} + + $H 'Dollar in :C character class' + + $C 'The A is replaced because the $$$$ is reduced to a single $$,' + $C 'which is then resolved to the variable X with the value VAR_X.' + $C 'The effective character class becomes [VAR_XY].' + $T 'C,[$$$$XY],<&>,g' ''${DOLLAR_AXY:C,[$$XY],<&>,g:Q} + + $H 'Dollar in :C pattern' + $C 'For some reason, multiple dollars are folded into one.' + $T 'C,$$,dollar,g' ''${DOLLAR:C,$,dollar,g:Q} + $T 'C,$$$$,dollar,g' ''${DOLLAR:C,$$,dollar,g:Q} + + $H 'Dollar in :S replacement' + $C 'For some reason, multiple dollars are folded into one.' + $T 'S,word,a$$Xo,' ''${WORD:S,word,a$Xo,:Q} + $T 'S,word,a$$$$Xo,' ''${WORD:S,word,a$$Xo,:Q} + $T 'S,word,a$$$$$$Xo,' ''${WORD:S,word,a$$$Xo,:Q} diff --git a/usr.bin/make/unit-tests/doterror.exp b/usr.bin/make/unit-tests/doterror.exp index 0447a5193..5655644c3 100644 --- a/usr.bin/make/unit-tests/doterror.exp +++ b/usr.bin/make/unit-tests/doterror.exp @@ -1,9 +1,9 @@ At first, I am happy and now: sad -.ERROR: Looks like 'sad' is upset. *** Error code 1 Stop. make: stopped in unit-tests +.ERROR: Looks like 'sad' is upset. exit status 1 diff --git a/usr.bin/make/unit-tests/doterror.mk b/usr.bin/make/unit-tests/doterror.mk index 7f1c78ff5..d46fb3581 100644 --- a/usr.bin/make/unit-tests/doterror.mk +++ b/usr.bin/make/unit-tests/doterror.mk @@ -1,4 +1,4 @@ -# $Id: doterror.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: doterror.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ .BEGIN: diff --git a/usr.bin/make/unit-tests/dotwait.exp b/usr.bin/make/unit-tests/dotwait.exp index 6bf96e301..bdc0a0eb1 100644 --- a/usr.bin/make/unit-tests/dotwait.exp +++ b/usr.bin/make/unit-tests/dotwait.exp @@ -22,9 +22,9 @@ shared.2.1 shared.2.1 shared.2.99 shared.2.99 +cycle.1.99 +cycle.1.99 make: Graph cycles through `cycle.2.99' make: Graph cycles through `cycle.2.98' make: Graph cycles through `cycle.2.97' -cycle.1.99 -cycle.1.99 exit status 0 diff --git a/usr.bin/make/unit-tests/dotwait.mk b/usr.bin/make/unit-tests/dotwait.mk index 9bdaaba39..dbc502651 100644 --- a/usr.bin/make/unit-tests/dotwait.mk +++ b/usr.bin/make/unit-tests/dotwait.mk @@ -1,9 +1,9 @@ -# $NetBSD: dotwait.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: dotwait.mk,v 1.3 2020/10/24 08:50:17 rillig Exp $ -THISMAKEFILE:= ${.PARSEDIR}/${.PARSEFILE} +THISMAKEFILE:= ${.PARSEDIR}/${.PARSEFILE} -TESTS= simple recursive shared cycle -PAUSE= sleep 1 +TESTS= simple recursive shared cycle +PAUSE= sleep 1 # Use a .for loop rather than dependencies here, to ensure # that the tests are run one by one, with parallelism @@ -11,7 +11,7 @@ PAUSE= sleep 1 # Ignore "--- target ---" lines printed by parallel make. all: .for t in ${TESTS} - @${.MAKE} -f ${THISMAKEFILE} -j4 $t | grep -v "^--- " + @${.MAKE} -f ${THISMAKEFILE} -j4 $t 2>&1 | grep -v "^--- " .endfor # diff --git a/usr.bin/make/unit-tests/envfirst.exp b/usr.bin/make/unit-tests/envfirst.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/envfirst.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/envfirst.mk b/usr.bin/make/unit-tests/envfirst.mk new file mode 100644 index 000000000..60a331a5d --- /dev/null +++ b/usr.bin/make/unit-tests/envfirst.mk @@ -0,0 +1,44 @@ +# $NetBSD: envfirst.mk,v 1.5 2021/02/04 21:42:47 rillig Exp $ +# +# The -e option makes environment variables stronger than global variables. + +.MAKEFLAGS: -e + +.if ${FROM_ENV} != value-from-env +. error ${FROM_ENV} +.endif + +# Try to override the variable; this does not have any effect. +FROM_ENV= value-from-mk +.if ${FROM_ENV} != value-from-env +. error ${FROM_ENV} +.endif + +# Try to append to the variable; this also doesn't have any effect. +FROM_ENV+= appended +.if ${FROM_ENV} != value-from-env +. error ${FROM_ENV} +.endif + +# The default assignment also cannot change the variable. +FROM_ENV?= default +.if ${FROM_ENV} != value-from-env +. error ${FROM_ENV} +.endif + +# Neither can the assignment modifiers. +.if ${FROM_ENV::=from-condition} +.endif +.if ${FROM_ENV} != value-from-env +. error ${FROM_ENV} +.endif + +# Even .undef doesn't work since it only affects the global scope, +# which is independent from the environment variables. +.undef FROM_ENV +.if ${FROM_ENV} != value-from-env +. error ${FROM_ENV} +.endif + +all: + @: nothing diff --git a/usr.bin/make/unit-tests/error.exp b/usr.bin/make/unit-tests/error.exp index a2bf71b71..3adc099a4 100644 --- a/usr.bin/make/unit-tests/error.exp +++ b/usr.bin/make/unit-tests/error.exp @@ -1,4 +1,6 @@ -make: "error.mk" line 3: just FYI -make: "error.mk" line 4: warning: this could be serious -make: "error.mk" line 5: this is fatal +make: "error.mk" line 6: just FYI +make: "error.mk" line 7: warning: this could be serious +make: "error.mk" line 8: this is fatal + +make: stopped in unit-tests exit status 1 diff --git a/usr.bin/make/unit-tests/error.mk b/usr.bin/make/unit-tests/error.mk index 721ed5052..0029b3bc6 100644 --- a/usr.bin/make/unit-tests/error.mk +++ b/usr.bin/make/unit-tests/error.mk @@ -1,10 +1,12 @@ -# $Id: error.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: error.mk,v 1.3 2020/11/03 17:38:45 rillig Exp $ +# +# Demonstrate that the .error directive exits immediately, without +# continuing parsing until the end of the file. .info just FYI .warning this could be serious .error this is fatal +.info this is not reached because of the .error above all: - -.info.html: - @echo this should be ignored + : this is not reached because of the .error diff --git a/usr.bin/make/unit-tests/escape.mk b/usr.bin/make/unit-tests/escape.mk index 829403d7a..8bdd3ad2a 100644 --- a/usr.bin/make/unit-tests/escape.mk +++ b/usr.bin/make/unit-tests/escape.mk @@ -1,4 +1,4 @@ -# $Id: escape.mk,v 1.10 2014/09/09 10:22:27 apb Exp $ +# $NetBSD: escape.mk,v 1.14 2020/11/03 17:38:45 rillig Exp $ # # Test backslash escaping. @@ -35,8 +35,8 @@ # Also, our practice is that an even number of backslashes before a # newline in a variable assignment simply stores the backslashes as part # of the value, and treats the newline as though it was not escaped. -# Similarly, ann even number of backslashes before a newline in a -# command simply uses the backslashes as part of the command test, but +# Similarly, an even number of backslashes before a newline in a +# command simply uses the backslashes as part of the command, but # does not escape the newline. This is compatible with GNU make. all: .PHONY @@ -44,8 +44,8 @@ all: .PHONY # Some variables to be expanded in tests # -a = aaa -A = ${a} +a= aaa +A= ${a} # Backslash at end of line in a comment\ should continue the comment. \ @@ -57,13 +57,13 @@ __printvars: .USE .MADE # Embedded backslash in variable should be taken literally. # -VAR1BS = 111\111 -VAR1BSa = 111\${a} -VAR1BSA = 111\${A} -VAR1BSda = 111\$${a} -VAR1BSdA = 111\$${A} -VAR1BSc = 111\# backslash escapes comment char, so this is part of the value -VAR1BSsc = 111\ # This is a comment. Value ends with +VAR1BS= 111\111 +VAR1BSa= 111\${a} +VAR1BSA= 111\${A} +VAR1BSda= 111\$${a} +VAR1BSdA= 111\$${A} +VAR1BSc= 111\# backslash escapes comment char, so this is part of the value +VAR1BSsc= 111\ # This is a comment. Value ends with all: var-1bs var-1bs: .PHONY __printvars VAR1BS VAR1BSa VAR1BSA VAR1BSda VAR1BSdA \ @@ -71,13 +71,13 @@ var-1bs: .PHONY __printvars VAR1BS VAR1BSa VAR1BSA VAR1BSda VAR1BSdA \ # Double backslash in variable should be taken as two literal backslashes. # -VAR2BS = 222\\222 -VAR2BSa = 222\\${a} -VAR2BSA = 222\\${A} -VAR2BSda = 222\\$${a} -VAR2BSdA = 222\\$${A} -VAR2BSc = 222\\# backslash does not escape comment char, so this is a comment -VAR2BSsc = 222\\ # This is a comment. Value ends with +VAR2BS= 222\\222 +VAR2BSa= 222\\${a} +VAR2BSA= 222\\${A} +VAR2BSda= 222\\$${a} +VAR2BSdA= 222\\$${A} +VAR2BSc= 222\\# backslash does not escape comment char, so this is a comment +VAR2BSsc= 222\\ # This is a comment. Value ends with all: var-2bs var-2bs: .PHONY __printvars VAR2BS VAR2BSa VAR2BSA VAR2BSda VAR2BSdA \ @@ -85,19 +85,19 @@ var-2bs: .PHONY __printvars VAR2BS VAR2BSa VAR2BSA VAR2BSda VAR2BSdA \ # Backslash-newline in a variable setting is replaced by a single space. # -VAR1BSNL = 111\ +VAR1BSNL= 111\ 111 -VAR1BSNLa = 111\ +VAR1BSNLa= 111\ ${a} -VAR1BSNLA = 111\ +VAR1BSNLA= 111\ ${A} -VAR1BSNLda = 111\ +VAR1BSNLda= 111\ $${a} -VAR1BSNLdA = 111\ +VAR1BSNLdA= 111\ $${A} -VAR1BSNLc = 111\ +VAR1BSNLc= 111\ # this should be processed as a comment -VAR1BSNLsc = 111\ +VAR1BSNLsc= 111\ # this should be processed as a comment all: var-1bsnl @@ -113,19 +113,19 @@ var-1bsnl: .PHONY __printvars \ # generate syntax errors regardless of whether or not they are # treated as part of the value. # -VAR2BSNL = 222\\ +VAR2BSNL= 222\\ 222= -VAR2BSNLa = 222\\ +VAR2BSNLa= 222\\ ${a}= -VAR2BSNLA = 222\\ +VAR2BSNLA= 222\\ ${A}= -VAR2BSNLda = 222\\ +VAR2BSNLda= 222\\ $${a}= -VAR2BSNLdA = 222\\ +VAR2BSNLdA= 222\\ $${A}= -VAR2BSNLc = 222\\ +VAR2BSNLc= 222\\ # this should be processed as a comment -VAR2BSNLsc = 222\\ +VAR2BSNLsc= 222\\ # this should be processed as a comment all: var-2bsnl @@ -140,19 +140,19 @@ var-2bsnl: .PHONY __printvars \ # generate syntax errors regardless of whether or not they are # treated as part of the value. # -VAR3BSNL = 333\\\ +VAR3BSNL= 333\\\ 333= -VAR3BSNLa = 333\\\ +VAR3BSNLa= 333\\\ ${a}= -VAR3BSNLA = 333\\\ +VAR3BSNLA= 333\\\ ${A}= -VAR3BSNLda = 333\\\ +VAR3BSNLda= 333\\\ $${a}= -VAR3BSNLdA = 333\\\ +VAR3BSNLdA= 333\\\ $${A}= -VAR3BSNLc = 333\\\ +VAR3BSNLc= 333\\\ # this should be processed as a comment -VAR3BSNLsc = 333\\\ +VAR3BSNLsc= 333\\\ # this should be processed as a comment all: var-3bsnl @@ -163,20 +163,20 @@ var-3bsnl: .PHONY __printvars \ # Backslash-newline in a variable setting, plus any amount of white space # on the next line, is replaced by a single space. # -VAR1BSNL00= first line\ +VAR1BSNL00= first line\ # above line is entirely empty, and this is a comment -VAR1BSNL0= first line\ +VAR1BSNL0= first line\ no space on second line -VAR1BSNLs= first line\ +VAR1BSNLs= first line\ one space on second line -VAR1BSNLss= first line\ +VAR1BSNLss= first line\ two spaces on second line -VAR1BSNLt= first line\ +VAR1BSNLt= first line\ one tab on second line -VAR1BSNLtt= first line\ +VAR1BSNLtt= first line\ two tabs on second line -VAR1BSNLxx= first line\ +VAR1BSNLxx= first line\ many spaces and tabs [ ] on second line all: var-1bsnl-space @@ -187,7 +187,7 @@ var-1bsnl-space: .PHONY __printvars \ # Backslash-newline in a command is retained. # # The "#" in "# second line without space" makes it a comment instead -# of a syntax error if the preceding line is parsed incorretly. +# of a syntax error if the preceding line is parsed incorrectly. # The ":" in "third line':" makes it look like the start of a # target instead of a syntax error if the first line is parsed incorrectly. # @@ -220,7 +220,7 @@ cmd-1bsnl-eof: # XXX: This may differ from POSIX, but matches gmake. # # When make passes two backslashes to the shell, the shell will pass one -# backslash to the echo commant. +# backslash to the echo command. # all: cmd-2bsnl cmd-2bsnl: .PHONY diff --git a/usr.bin/make/unit-tests/export-all.mk b/usr.bin/make/unit-tests/export-all.mk index 576487b53..0d7410834 100644 --- a/usr.bin/make/unit-tests/export-all.mk +++ b/usr.bin/make/unit-tests/export-all.mk @@ -1,23 +1,24 @@ -# $Id: export-all.mk,v 1.2 2015/04/10 20:41:59 sjg Exp $ +# $NetBSD: export-all.mk,v 1.5 2020/10/24 08:50:17 rillig Exp $ -UT_OK=good -UT_F=fine +UT_OK= good +UT_F= fine # the old way to do :tA -M_tAbad = C,.*,cd & \&\& 'pwd',:sh +M_tAbad= C,.*,cd & \&\& 'pwd',:sh # the new -M_tA = tA +M_tA= tA here := ${.PARSEDIR} # this will cause trouble (recursing if we let it) -UT_BADDIR = ${${here}/../${here:T}:L:${M_tAbad}:T} +UT_BADDIR= ${${here}/../${here:T}:L:${M_tAbad}:T} # this will be ok -UT_OKDIR = ${${here}/../${here:T}:L:${M_tA}:T} +UT_OKDIR= ${${here}/../${here:T}:L:${M_tA}:T} .export +FILTER_CMD= grep ^UT_ .include "export.mk" -UT_TEST=export-all -UT_ALL=even this gets exported +UT_TEST= export-all +UT_ALL= even this gets exported diff --git a/usr.bin/make/unit-tests/export-env.exp b/usr.bin/make/unit-tests/export-env.exp index 6221232a2..8a779e6af 100644 --- a/usr.bin/make/unit-tests/export-env.exp +++ b/usr.bin/make/unit-tests/export-env.exp @@ -2,8 +2,10 @@ make: UT_TEST=export-env.mk UT_ENV=not-exported UT_EXP=not-exported +UT_LIT=literal export-env.mk env: UT_TEST=export-env.mk UT_ENV=exported UT_EXP=exported +UT_LIT=literal ${UT_TEST} exit status 0 diff --git a/usr.bin/make/unit-tests/export-env.mk b/usr.bin/make/unit-tests/export-env.mk index 6e9993b7b..1605b1a71 100644 --- a/usr.bin/make/unit-tests/export-env.mk +++ b/usr.bin/make/unit-tests/export-env.mk @@ -1,23 +1,26 @@ -# $Id: export-env.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: export-env.mk,v 1.4 2020/10/24 08:50:17 rillig Exp $ # our normal .export, subsequent changes affect the environment -UT_TEST=this +UT_TEST= this .export UT_TEST -UT_TEST:= ${.PARSEFILE} +UT_TEST:= ${.PARSEFILE} # not so with .export-env -UT_ENV=exported +UT_ENV= exported .export-env UT_ENV -UT_ENV=not-exported +UT_ENV= not-exported # gmake style export goes further; affects nothing but the environment UT_EXP=before-export export UT_EXP=exported UT_EXP=not-exported +UT_LIT= literal ${UT_TEST} +.export-literal UT_LIT + all: - @echo make:; ${UT_TEST UT_ENV UT_EXP:L:@v@echo $v=${$v};@} - @echo env:; ${UT_TEST UT_ENV UT_EXP:L:@v@echo $v=$${$v};@} + @echo make:; ${UT_TEST UT_ENV UT_EXP UT_LIT:L:@v@echo $v=${$v};@} + @echo env:; ${UT_TEST UT_ENV UT_EXP UT_LIT:L:@v@echo $v=$${$v};@} diff --git a/usr.bin/make/unit-tests/export-variants.exp b/usr.bin/make/unit-tests/export-variants.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/export-variants.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/export-variants.mk b/usr.bin/make/unit-tests/export-variants.mk new file mode 100644 index 000000000..fdbbccccc --- /dev/null +++ b/usr.bin/make/unit-tests/export-variants.mk @@ -0,0 +1,40 @@ +# $NetBSD: export-variants.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $ +# +# Test whether exported variables apply to each variant of running +# external commands: +# +# The != assignments. +# The :!cmd! modifier. +# The :sh modifier. + +SHVAR!= env | grep ^UT_ || true +.if ${SHVAR} != "" +. warning At this point, no variable should be exported. +.endif + +.if ${:!env | grep ^UT_ || true!} != "" +. warning At this point, no variable should be exported. +.endif + +.if ${env | grep ^UT_ || true:L:sh} != "" +. warning At this point, no variable should be exported. +.endif + +UT_VAR= value +.export UT_VAR + +SHVAR!= env | grep ^UT_ || true +.if ${SHVAR} != "UT_VAR=value" +. warning At this point, a single variable should be exported. +.endif + +.if ${:!env | grep ^UT_ || true!} != "UT_VAR=value" +. warning At this point, a single variable should be exported. +.endif + +.if ${env | grep ^UT_ || true:L:sh} != "UT_VAR=value" +. warning At this point, a single variable should be exported. +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/export.exp b/usr.bin/make/unit-tests/export.exp index 143771ce9..648d1283f 100644 --- a/usr.bin/make/unit-tests/export.exp +++ b/usr.bin/make/unit-tests/export.exp @@ -1,3 +1,5 @@ +MAKELEVEL=1 +TMPDIR=TMPDIR UT_DOLLAR=This is $UT_FU UT_FOO=foobar is fubar UT_FU=fubar diff --git a/usr.bin/make/unit-tests/export.mk b/usr.bin/make/unit-tests/export.mk index 1b4ee722c..94e3a862d 100644 --- a/usr.bin/make/unit-tests/export.mk +++ b/usr.bin/make/unit-tests/export.mk @@ -1,22 +1,46 @@ -# $Id: export.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: export.mk,v 1.10 2020/10/24 08:50:17 rillig Exp $ -UT_TEST=export -UT_FOO=foo${BAR} -UT_FU=fubar -UT_ZOO=hoopie -UT_NO=all -# belive it or not, we expect this one to come out with $UT_FU unexpanded. -UT_DOLLAR= This is $$UT_FU +UT_TEST= export +UT_FOO= foo${BAR} +UT_FU= fubar +UT_ZOO= hoopie +UT_NO= all +# believe it or not, we expect this one to come out with $UT_FU unexpanded. +UT_DOLLAR= This is $$UT_FU .export UT_FU UT_FOO .export UT_DOLLAR -# this one will be ignored + +.if !defined(.MAKE.PID) +. error .MAKE.PID must be defined +.endif +@= at +%= percent +*= asterisk +${:U!}= exclamation # A direct != would try to run "exclamation" + # as a shell command and assign its output + # to the empty variable. +&= ampersand + +# This is ignored because it is internal. .export .MAKE.PID +# These are ignored because they are local to the target. +.export @ +.export % +.export * +.export ! +# This is exported (see the .rawout file) but not displayed since the dash +# shell filters it out. To reach consistent output for each shell, the +# ampersand is filtered out already by FILTER_CMD. +.export & +# This is ignored because it is undefined. +.export UNDEFINED -BAR=bar is ${UT_FU} +BAR= bar is ${UT_FU} -.MAKE.EXPORTED+= UT_ZOO UT_TEST +.MAKE.EXPORTED+= UT_ZOO UT_TEST + +FILTER_CMD?= egrep -v '^(MAKEFLAGS|MALLOC_OPTIONS|PATH|PWD|SHLVL|_|&)=' all: - @env | grep '^UT_' | sort - + @env | ${FILTER_CMD} | sort diff --git a/usr.bin/make/unit-tests/forloop.exp b/usr.bin/make/unit-tests/forloop.exp index df14b7512..422711b41 100644 --- a/usr.bin/make/unit-tests/forloop.exp +++ b/usr.bin/make/unit-tests/forloop.exp @@ -1,18 +1,19 @@ -x=one -x="two and three" -x=four -x="five" -x=-I/this -x=-I"This or that" -x=-Ithat -x="-DTHIS=\"this and that\"" -cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\"" -a=one b="two and three" -a=four b="five" -a=ONE b="TWO AND THREE" -a=FOUR b="FIVE" +make: "forloop.mk" line 14: x=one +make: "forloop.mk" line 14: x="two and three" +make: "forloop.mk" line 14: x=four +make: "forloop.mk" line 14: x="five" +make: "forloop.mk" line 20: x=-I/this +make: "forloop.mk" line 20: x=-I"This or that" +make: "forloop.mk" line 20: x=-Ithat +make: "forloop.mk" line 20: x="-DTHIS=\"this and that\"" +make: "forloop.mk" line 27: cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\"" +make: "forloop.mk" line 41: newline-item=(a) +make: "forloop.mk" line 47: a=one b="two and three" +make: "forloop.mk" line 47: a=four b="five" +make: "forloop.mk" line 47: a=ONE b="TWO AND THREE" +make: "forloop.mk" line 47: a=FOUR b="FIVE" We expect an error next: -make: "forloop.mk" line 38: Wrong number of words (9) in .for substitution list with 2 vars +make: "forloop.mk" line 46: Wrong number of words (9) in .for substitution list with 2 variables make: Fatal errors encountered -- cannot continue make: stopped in unit-tests OK diff --git a/usr.bin/make/unit-tests/forloop.mk b/usr.bin/make/unit-tests/forloop.mk index e0399f355..cef05cbe4 100644 --- a/usr.bin/make/unit-tests/forloop.mk +++ b/usr.bin/make/unit-tests/forloop.mk @@ -1,42 +1,50 @@ -# $Id: forloop.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: forloop.mk,v 1.7 2020/11/03 17:37:57 rillig Exp $ all: for-loop -LIST = one "two and three" four "five" +LIST= one "two and three" four "five" .if make(for-fail) for-fail: -XTRA_LIST = xtra +XTRA_LIST= xtra .else -.for x in ${LIST} -X!= echo 'x=$x' >&2; echo -.endfor +. for x in ${LIST} +. info x=$x +. endfor -CFL = -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\"" +CFL= -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\"" cfl= -.for x in ${CFL} -X!= echo 'x=$x' >&2; echo -.if empty(cfl) -cfl= $x -.else -cfl+= $x -.endif -.endfor -X!= echo 'cfl=${cfl}' >&2; echo +. for x in ${CFL} +. info x=$x +. if empty(cfl) +cfl= $x +. else +cfl+= $x +. endif +. endfor +. info cfl=${cfl} -.if ${cfl} != ${CFL} -.error ${.newline}'${cfl}' != ${.newline}'${CFL}' -.endif +. if ${cfl} != ${CFL} +. error ${.newline}${cfl} != ${.newline}${CFL} +. endif -.for a b in ${EMPTY} -X!= echo 'a=$a b=$b' >&2; echo -.endfor -.endif +. for a b in ${EMPTY} +. info a=$a b=$b +. endfor + +# Since at least 1993, iteration stops at the first newline. +# Back then, the .newline variable didn't exist, therefore it was unlikely +# that a newline ever occurred. +. for var in a${.newline}b${.newline}c +. info newline-item=(${var}) +. endfor + +.endif # for-fail .for a b in ${LIST} ${LIST:tu} ${XTRA_LIST} -X!= echo 'a=$a b=$b' >&2; echo +. info a=$a b=$b .endfor for-loop: diff --git a/usr.bin/make/unit-tests/forsubst.mk b/usr.bin/make/unit-tests/forsubst.mk index 00cd9b634..9f293ab7f 100644 --- a/usr.bin/make/unit-tests/forsubst.mk +++ b/usr.bin/make/unit-tests/forsubst.mk @@ -1,4 +1,16 @@ -# $Id: forsubst.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: forsubst.mk,v 1.3 2020/11/03 17:59:27 rillig Exp $ +# +# The parser used to break dependency lines at ';' without regard for +# substitution patterns. Back then, the first ';' was interpreted as the +# separator between the dependency and its commands. This (perhaps coupled +# with the new handling of .for variables in ${:U...) caused +# interesting results for lines like: +# +# .for file in ${LIST} +# for-subst: ${file:S;^;${here}/;g} +# .endfor +# +# See the commit to unit-tests/forsubst (without the .mk) from 2009-10-07. all: for-subst diff --git a/usr.bin/make/unit-tests/gnode-submake.exp b/usr.bin/make/unit-tests/gnode-submake.exp new file mode 100644 index 000000000..ea00e8d76 --- /dev/null +++ b/usr.bin/make/unit-tests/gnode-submake.exp @@ -0,0 +1,11 @@ +#*** Input graph: +# all, unmade, type OP_DEPENDS, flags none +# makeinfo, unmade, type OP_DEPENDS|OP_HAS_COMMANDS, flags none +# make-index, unmade, type OP_DEPENDS|OP_SUBMAKE|OP_HAS_COMMANDS, flags none +# braces-dot, unmade, type OP_DEPENDS|OP_SUBMAKE|OP_HAS_COMMANDS, flags none +# braces-no-dot, unmade, type OP_DEPENDS|OP_SUBMAKE|OP_HAS_COMMANDS, flags none +# braces-no-dot-modifier, unmade, type OP_DEPENDS|OP_HAS_COMMANDS, flags none +# parentheses-dot, unmade, type OP_DEPENDS|OP_SUBMAKE|OP_HAS_COMMANDS, flags none +# parentheses-no-dot, unmade, type OP_DEPENDS|OP_SUBMAKE|OP_HAS_COMMANDS, flags none + +exit status 0 diff --git a/usr.bin/make/unit-tests/gnode-submake.mk b/usr.bin/make/unit-tests/gnode-submake.mk new file mode 100644 index 000000000..40ff20276 --- /dev/null +++ b/usr.bin/make/unit-tests/gnode-submake.mk @@ -0,0 +1,42 @@ +# $NetBSD: gnode-submake.mk,v 1.1 2020/11/07 23:25:06 rillig Exp $ +# +# Test whether OP_SUBMAKE is determined correctly. If it is, this node's +# shell commands are connected to the make process via pipes, to coordinate +# the number of running jobs. +# +# Determining whether a node is a sub-make node happens when the node is +# parsed. This information is only used in parallel mode, but the result +# from parsing is available in compat mode as well. + +.MAKEFLAGS: -n -dg1 + +all: makeinfo make-index +all: braces-dot braces-no-dot +all: braces-no-dot-modifier +all: parentheses-dot parentheses-no-dot + +makeinfo: + # The command contains the substring "make", but not as a whole word. + : makeinfo submake + +make-index: + # The command contains the word "make", therefore it is considered a + # possible sub-make. It isn't really, but that doesn't hurt. + : make-index + +braces-dot: + : ${.MAKE} + +braces-no-dot: + : ${MAKE} + +braces-no-dot-modifier: + # The command refers to MAKE, but not in its pure form. Therefore it + # is not considered a sub-make. + : ${MAKE:T} + +parentheses-dot: + : $(.MAKE) + +parentheses-no-dot: + : $(MAKE) diff --git a/usr.bin/make/unit-tests/hanoi-include.exp b/usr.bin/make/unit-tests/hanoi-include.exp new file mode 100644 index 000000000..ead78b9eb --- /dev/null +++ b/usr.bin/make/unit-tests/hanoi-include.exp @@ -0,0 +1,32 @@ +Move the upper disk from stack A to stack C. +Move the upper disk from stack A to stack B. +Move the upper disk from stack C to stack B. +Move the upper disk from stack A to stack C. +Move the upper disk from stack B to stack A. +Move the upper disk from stack B to stack C. +Move the upper disk from stack A to stack C. +Move the upper disk from stack A to stack B. +Move the upper disk from stack C to stack B. +Move the upper disk from stack C to stack A. +Move the upper disk from stack B to stack A. +Move the upper disk from stack C to stack B. +Move the upper disk from stack A to stack C. +Move the upper disk from stack A to stack B. +Move the upper disk from stack C to stack B. +Move the upper disk from stack A to stack C. +Move the upper disk from stack B to stack A. +Move the upper disk from stack B to stack C. +Move the upper disk from stack A to stack C. +Move the upper disk from stack B to stack A. +Move the upper disk from stack C to stack B. +Move the upper disk from stack C to stack A. +Move the upper disk from stack B to stack A. +Move the upper disk from stack B to stack C. +Move the upper disk from stack A to stack C. +Move the upper disk from stack A to stack B. +Move the upper disk from stack C to stack B. +Move the upper disk from stack A to stack C. +Move the upper disk from stack B to stack A. +Move the upper disk from stack B to stack C. +Move the upper disk from stack A to stack C. +exit status 0 diff --git a/usr.bin/make/unit-tests/hanoi-include.mk b/usr.bin/make/unit-tests/hanoi-include.mk new file mode 100644 index 000000000..3ad0a7518 --- /dev/null +++ b/usr.bin/make/unit-tests/hanoi-include.mk @@ -0,0 +1,41 @@ +# $NetBSD: hanoi-include.mk,v 1.1 2020/10/03 17:30:54 rillig Exp $ +# +# Implements the Towers of Hanoi puzzle, thereby demonstrating a bunch of +# useful programming techniques: +# +# * default assignment using the ?= assignment operator +# * including the same file recursively +# * extracting the current value of a variable using the .for loop +# * using shell commands for calculations since make is a text processor +# * using the :: dependency operator for adding commands to a target +# * on-the-fly variable assignment expressions using the ::= modifier +# +# usage: +# env N=3 make -f hanoi-include.mk +# endless loop: +# make -f hanoi-include.mk N=3 + +N?= 5 # Move this number of disks ... +FROM?= A # ... from this stack ... +VIA?= B # ... via this stack ... +TO?= C # ... to this stack. + +.if $N == 1 +. for from to in ${FROM} ${TO} +all:: + @echo "Move the upper disk from stack ${from} to stack ${to}." +. endfor +.else +_:= ${N::!=expr $N - 1} ${TMP::=${VIA}} ${VIA::=${TO}} ${TO::=${TMP}} +. include "${.PARSEDIR}/${.PARSEFILE}" +_:= ${N::!=expr $N + 1} ${TMP::=${VIA}} ${VIA::=${TO}} ${TO::=${TMP}} + +. for from to in ${FROM} ${TO} +all:: + @echo "Move the upper disk from stack ${from} to stack ${to}." +. endfor + +_:= ${N::!=expr $N - 1} ${TMP::=${VIA}} ${VIA::=${FROM}} ${FROM::=${TMP}} +. include "${.PARSEDIR}/${.PARSEFILE}" +_:= ${N::!=expr $N + 1} ${TMP::=${VIA}} ${VIA::=${FROM}} ${FROM::=${TMP}} +.endif diff --git a/usr.bin/make/unit-tests/hash.exp b/usr.bin/make/unit-tests/hash.exp deleted file mode 100644 index 0a2423436..000000000 --- a/usr.bin/make/unit-tests/hash.exp +++ /dev/null @@ -1,9 +0,0 @@ -b2af338b -3360ac65 -7747f046 -9ca87054 -880fe816 -208fcbd3 -d5d376eb -de41416c -exit status 0 diff --git a/usr.bin/make/unit-tests/hash.mk b/usr.bin/make/unit-tests/hash.mk deleted file mode 100644 index 1ed84e776..000000000 --- a/usr.bin/make/unit-tests/hash.mk +++ /dev/null @@ -1,18 +0,0 @@ -STR1= -STR2= a -STR3= ab -STR4= abc -STR5= abcd -STR6= abcde -STR7= abcdef -STR8= abcdefghijklmnopqrstuvwxyz - -all: - @echo ${STR1:hash} - @echo ${STR2:hash} - @echo ${STR3:hash} - @echo ${STR4:hash} - @echo ${STR5:hash} - @echo ${STR6:hash} - @echo ${STR7:hash} - @echo ${STR8:hash} diff --git a/usr.bin/make/unit-tests/impsrc.exp b/usr.bin/make/unit-tests/impsrc.exp index 23e8347d2..3eb050e08 100644 --- a/usr.bin/make/unit-tests/impsrc.exp +++ b/usr.bin/make/unit-tests/impsrc.exp @@ -1,13 +1,13 @@ -expected: source4 -actual: source4 +expected: +actual: expected: target1.x actual: target1.x expected: target1.y actual: target1.y -expected: source1 -actual: source1 -expected: source2 -actual: source2 -expected: source1 -actual: source1 +expected: +actual: +expected: +actual: +expected: +actual: exit status 0 diff --git a/usr.bin/make/unit-tests/impsrc.mk b/usr.bin/make/unit-tests/impsrc.mk index 95ae0c34f..6fb31adac 100644 --- a/usr.bin/make/unit-tests/impsrc.mk +++ b/usr.bin/make/unit-tests/impsrc.mk @@ -1,4 +1,4 @@ -# $NetBSD: impsrc.mk,v 1.2 2014/08/30 22:21:07 sjg Exp $ +# $NetBSD: impsrc.mk,v 1.3 2020/08/07 13:43:50 rillig Exp $ # Does ${.IMPSRC} work properly? # It should be set, in order of precedence, to ${.TARGET} of: @@ -6,6 +6,8 @@ # 2) the first prerequisite from the dependency line of an explicit rule, or # 3) the first prerequisite of an explicit rule. # +# Items 2 and 3 work in GNU make. +# Items 2 and 3 are not required by POSIX 2018. all: target1.z target2 target3 target4 @@ -19,25 +21,40 @@ all: target1.z target2 target3 target4 @echo 'expected: target1.y' @echo 'actual: $<' +# (3) Making target1.z out of target1.y is done because of an inference rule. +# Therefore $< is available here. + +# (2) This is an additional dependency on the inference rule .x.y. +# The dependency target1.x comes from the inference rule, +# therefore it is available as $<. target1.y: source3 +# (1) This is an explicit dependency, not an inference rule. +# Therefore POSIX does not specify that $< be available here. target1.x: source4 - @echo 'expected: source4' + @echo 'expected: ' # either 'source4' or '' @echo 'actual: $<' +# (4) This is an explicit dependency, independent of any inference rule. +# Therefore $< is not available here. target2: source1 source2 - @echo 'expected: source1' + @echo 'expected: ' @echo 'actual: $<' +# (5) These are two explicit dependency rules. +# The first doesn't have any dependencies, only the second has. +# If any, the value of $< would be 'source2'. target3: source1 target3: source2 source3 - @echo 'expected: source2' + @echo 'expected: ' @echo 'actual: $<' +# (6) The explicit rule does not have associated commands. +# The value of $< might come from that rule, +# but it's equally fine to leave $< undefined. target4: source1 target4: - @echo 'expected: source1' + @echo 'expected: ' @echo 'actual: $<' source1 source2 source3 source4: - diff --git a/usr.bin/make/unit-tests/include-main.exp b/usr.bin/make/unit-tests/include-main.exp new file mode 100644 index 000000000..61e716ad8 --- /dev/null +++ b/usr.bin/make/unit-tests/include-main.exp @@ -0,0 +1,17 @@ +make: "include-main.mk" line 14: main-before-ok +make: "include-main.mk" line 21: main-before-for-ok +make: "include-sub.mk" line 4: sub-before-ok +make: "include-sub.mk" line 14: sub-before-for-ok +ParseReadLine (5): '. info subsub-ok' +make: "include-subsub.mk" line 5: subsub-ok + in .for loop from include-sub.mk:31 + in .for loop from include-sub.mk:30 + in .for loop from include-sub.mk:29 + in .include from include-main.mk:27 +ParseReadLine (6): '.MAKEFLAGS: -d0' +ParseDoDependency(.MAKEFLAGS: -d0) +make: "include-sub.mk" line 38: sub-after-ok +make: "include-sub.mk" line 45: sub-after-for-ok +make: "include-main.mk" line 30: main-after-ok +make: "include-main.mk" line 37: main-after-for-ok +exit status 0 diff --git a/usr.bin/make/unit-tests/include-main.mk b/usr.bin/make/unit-tests/include-main.mk new file mode 100644 index 000000000..d3f122aef --- /dev/null +++ b/usr.bin/make/unit-tests/include-main.mk @@ -0,0 +1,43 @@ +# $NetBSD: include-main.mk,v 1.6 2021/01/22 00:44:55 rillig Exp $ +# +# Until 2020-09-05, the .INCLUDEDFROMFILE magic variable did not behave +# as described in the manual page. +# +# The manual page says that it is the "filename of the file this Makefile +# was included from", while before 2020-09-05 it was the "filename in which +# the latest .include happened". See parse.c, function ParseSetIncludeFile. +# +# Since 2020-09-05, the .INCLUDEDFROMDIR and .INCLUDEDFROMFILE variables +# properly handle nested includes and even .for loops. + +.if !defined(.INCLUDEDFROMFILE) +. info main-before-ok +.else +. warning main-before-fail(${.INCLUDEDFROMFILE}) +.endif + +.for i in once +. if !defined(.INCLUDEDFROMFILE) +. info main-before-for-ok +. else +. warning main-before-for-fail(${.INCLUDEDFROMFILE}) +. endif +.endfor + +.include "include-sub.mk" + +.if !defined(.INCLUDEDFROMFILE) +. info main-after-ok +.else +. warning main-after-fail(${.INCLUDEDFROMFILE}) +.endif + +.for i in once +. if !defined(.INCLUDEDFROMFILE) +. info main-after-for-ok +. else +. warning main-after-for-fail(${.INCLUDEDFROMFILE}) +. endif +.endfor + +all: # nothing diff --git a/usr.bin/make/unit-tests/include-sub.mk b/usr.bin/make/unit-tests/include-sub.mk new file mode 100644 index 000000000..0b8dc7739 --- /dev/null +++ b/usr.bin/make/unit-tests/include-sub.mk @@ -0,0 +1,49 @@ +# $NetBSD: include-sub.mk,v 1.7 2020/11/02 19:07:09 rillig Exp $ + +.if ${.INCLUDEDFROMFILE} == "include-main.mk" +. info sub-before-ok +.else +. warning sub-before-fail(${.INCLUDEDFROMFILE}) +.endif + +# As of 2020-09-05, the .for loop is implemented as "including a file" +# with a custom buffer. Therefore this loop has side effects on these +# variables. +.for i in once +. if ${.INCLUDEDFROMFILE} == "include-main.mk" +. info sub-before-for-ok +. else +. warning sub-before-for-fail(${.INCLUDEDFROMFILE}) +. endif +.endfor + +# To see the variable 'includes' in action: +# +# Breakpoints: +# Parse_File at "Vector_Push(&includes)" +# ParseMessage at entry +# Watches: +# ((const IFile *[10])(*includes.items)) +# *curFile + +.for i in deeply +. for i in nested +. for i in include +.include "include-subsub.mk" +. endfor +. endfor +.endfor + +.if ${.INCLUDEDFROMFILE} == "include-main.mk" +. info sub-after-ok +.else +. warning sub-after-fail(${.INCLUDEDFROMFILE}) +.endif + +.for i in once +. if ${.INCLUDEDFROMFILE} == "include-main.mk" +. info sub-after-for-ok +. else +. warning sub-after-for-fail(${.INCLUDEDFROMFILE}) +. endif +.endfor diff --git a/usr.bin/make/unit-tests/include-subsub.mk b/usr.bin/make/unit-tests/include-subsub.mk new file mode 100644 index 000000000..476d75f79 --- /dev/null +++ b/usr.bin/make/unit-tests/include-subsub.mk @@ -0,0 +1,9 @@ +# $NetBSD: include-subsub.mk,v 1.4 2021/01/26 23:44:56 rillig Exp $ + +.if ${.INCLUDEDFROMFILE} == "include-sub.mk" +.MAKEFLAGS: -dp +. info subsub-ok +.MAKEFLAGS: -d0 +.else +. warning subsub-fail(${.INCLUDEDFROMFILE}) +.endif diff --git a/usr.bin/make/unit-tests/job-flags.exp b/usr.bin/make/unit-tests/job-flags.exp new file mode 100644 index 000000000..b0c81d8f7 --- /dev/null +++ b/usr.bin/make/unit-tests/job-flags.exp @@ -0,0 +1,12 @@ +.BEGIN +silent +ignore +true in ignore +false in ignore +*** [ignore] Error code 1 (ignored) +false without indentation +false space +false tab +*** [ignore-cmds] Error code 1 (ignored) +.END +exit status 0 diff --git a/usr.bin/make/unit-tests/job-flags.mk b/usr.bin/make/unit-tests/job-flags.mk new file mode 100644 index 000000000..d4c3b5d43 --- /dev/null +++ b/usr.bin/make/unit-tests/job-flags.mk @@ -0,0 +1,32 @@ +# $NetBSD: job-flags.mk,v 1.2 2020/11/14 13:17:47 rillig Exp $ +# +# Tests for Job.flags, which are controlled by special source dependencies +# like .SILENT or .IGNORE, as well as the command line options -s or -i. + +.MAKEFLAGS: -j1 + +all: silent .WAIT ignore .WAIT ignore-cmds + +.BEGIN: + @echo $@ + +silent: .SILENT .PHONY + echo $@ + +ignore: .IGNORE .PHONY + @echo $@ + true in $@ + false in $@ + @echo 'Still there in $@' + +ignore-cmds: .PHONY + # This node is not marked .IGNORE; individual commands can be switched + # to ignore mode by prefixing them with a '-'. + -false without indentation + # This also works if the '-' is indented by a space or a tab. + # Leading whitespace is stripped off by ParseLine_ShellCommand. + -false space + -false tab + +.END: + @echo $@ diff --git a/usr.bin/make/unit-tests/job-output-long-lines.exp b/usr.bin/make/unit-tests/job-output-long-lines.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/job-output-long-lines.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/job-output-long-lines.mk b/usr.bin/make/unit-tests/job-output-long-lines.mk new file mode 100644 index 000000000..5a83bde0d --- /dev/null +++ b/usr.bin/make/unit-tests/job-output-long-lines.mk @@ -0,0 +1,32 @@ +# $NetBSD: job-output-long-lines.mk,v 1.4 2020/11/01 17:29:13 rillig Exp $ +# +# The jobs may produce long lines of output. A practical case are the echoed +# command lines from compiler invocations, with their many -D options. +# +# Each of these lines must be written atomically to the actual output. +# The markers for switching jobs must always be written at the beginning of +# the line, to make them clearly visible in large log files. +# +# As of 2020-09-27, the default job buffer size is 1024. When a job produces +# output lines that are longer than this buffer size, these output pieces are +# not terminated by a newline. Because of this missing newline, the job +# markers "--- job-a ---" and "--- job-b ---" are not always written at the +# beginning of a line, even though this is expected by anyone reading the log +# files. + +.MAKEFLAGS: -j2 + +100:= ${:U1:S,1,2222222222,g:S,2,3333333333,g} +5000:= ${100:S,3,4444444444,g:S,4,xxxxx,g} + +all: job-a job-b + +job-a: +.for i in ${:U:range=20} + @echo ${5000:S,x,a,g} +.endfor + +job-b: +.for i in ${:U:range=20} + @echo ${5000:S,x,b,g} +.endfor diff --git a/usr.bin/make/unit-tests/jobs-empty-commands.exp b/usr.bin/make/unit-tests/jobs-empty-commands.exp new file mode 100644 index 000000000..7fcf60109 --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-empty-commands.exp @@ -0,0 +1,2 @@ +action +exit status 0 diff --git a/usr.bin/make/unit-tests/jobs-empty-commands.mk b/usr.bin/make/unit-tests/jobs-empty-commands.mk new file mode 100644 index 000000000..ec8b2a8c8 --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-empty-commands.mk @@ -0,0 +1,18 @@ +# $NetBSD: jobs-empty-commands.mk,v 1.2 2021/01/30 12:46:38 rillig Exp $ +# +# In jobs mode, the shell commands for creating a target are written to a +# temporary file first, which is then run by the shell. In chains of +# dependencies, these files would end up empty. Since job.c 1.399 from +# 2021-01-29, these empty files are no longer created. +# +# https://mail-index.netbsd.org/current-users/2021/01/26/msg040215.html + +.MAKEFLAGS: -j1 +#.MAKEFLAGS: -dn # to see the created temporary files + +all: .PHONY step-1 +.for i i_plus_1 in ${:U:range=100:@i@$i $i@:[2..199]} +step-$i: .PHONY step-${i_plus_1} +.endfor +step-100: .PHONY + @echo 'action' diff --git a/usr.bin/make/unit-tests/jobs-error-indirect.exp b/usr.bin/make/unit-tests/jobs-error-indirect.exp new file mode 100644 index 000000000..5c5a3801f --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-error-indirect.exp @@ -0,0 +1,8 @@ +false +*** [indirect] Error code 1 + +make: stopped in unit-tests +1 error + +make: stopped in unit-tests +exit status 2 diff --git a/usr.bin/make/unit-tests/jobs-error-indirect.mk b/usr.bin/make/unit-tests/jobs-error-indirect.mk new file mode 100644 index 000000000..55e193d9b --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-error-indirect.mk @@ -0,0 +1,21 @@ +# $NetBSD: jobs-error-indirect.mk,v 1.1 2020/12/01 17:50:04 rillig Exp $ +# +# Ensure that in jobs mode, when a command fails, the current directory is +# printed, to aid in debugging. +# +# XXX: This test is run without the -k flag, which prints "stopped in" twice. +# Why? +# +# This particular case is not the cause for the PRs, but it is very close. +# +# https://gnats.netbsd.org/55578 +# https://gnats.netbsd.org/55832 +# +# + +.MAKEFLAGS: -j1 + +all: .PHONY indirect + +indirect: .PHONY + false diff --git a/usr.bin/make/unit-tests/jobs-error-nested-make.exp b/usr.bin/make/unit-tests/jobs-error-nested-make.exp new file mode 100644 index 000000000..88c32ab8d --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-error-nested-make.exp @@ -0,0 +1,11 @@ +make -f jobs-error-nested-make.mk nested +false +*** [nested] Error code 1 + +make: stopped in unit-tests +1 error + +make: stopped in unit-tests + +make: stopped in unit-tests +exit status 2 diff --git a/usr.bin/make/unit-tests/jobs-error-nested-make.mk b/usr.bin/make/unit-tests/jobs-error-nested-make.mk new file mode 100644 index 000000000..8cccf7df6 --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-error-nested-make.mk @@ -0,0 +1,20 @@ +# $NetBSD: jobs-error-nested-make.mk,v 1.2 2021/01/07 18:11:23 sjg Exp $ +# +# Ensure that in jobs mode, when a command fails, the current directory is +# printed, to aid in debugging, even if the target is marked as .MAKE. +# This marker is typically used for targets like 'all' that descend into +# subdirectories. +# +# XXX: In case of .MAKE targets, the "stopped if" output has been suppressed +# since job.c 1.198 from 2020-06-19. +# +# https://gnats.netbsd.org/55578 +# https://gnats.netbsd.org/55832 + +.MAKEFLAGS: -j1 + +all: .PHONY .MAKE + ${MAKE} -f ${MAKEFILE} nested + +nested: .PHONY + false diff --git a/usr.bin/make/unit-tests/jobs-error-nested.exp b/usr.bin/make/unit-tests/jobs-error-nested.exp new file mode 100644 index 000000000..f96b5d016 --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-error-nested.exp @@ -0,0 +1,15 @@ +make -f jobs-error-nested.mk nested +false +*** [nested] Error code 1 + +make: stopped in unit-tests +1 error + +make: stopped in unit-tests +*** [all] Error code 2 + +make: stopped in unit-tests +1 error + +make: stopped in unit-tests +exit status 2 diff --git a/usr.bin/make/unit-tests/jobs-error-nested.mk b/usr.bin/make/unit-tests/jobs-error-nested.mk new file mode 100644 index 000000000..879bfff89 --- /dev/null +++ b/usr.bin/make/unit-tests/jobs-error-nested.mk @@ -0,0 +1,20 @@ +# $NetBSD: jobs-error-nested.mk,v 1.1 2020/12/01 17:50:04 rillig Exp $ +# +# Ensure that in jobs mode, when a command fails, the current directory is +# printed, to aid in debugging. +# +# XXX: This test is run without the -k flag, which prints "stopped in" 4 +# times. Why? +# +# This particular case is not the cause for the PRs, but it is very close. +# +# https://gnats.netbsd.org/55578 +# https://gnats.netbsd.org/55832 + +.MAKEFLAGS: -j1 + +all: .PHONY + ${MAKE} -f ${MAKEFILE} nested + +nested: .PHONY + false diff --git a/usr.bin/make/unit-tests/lint.exp b/usr.bin/make/unit-tests/lint.exp new file mode 100644 index 000000000..d7068b5e0 --- /dev/null +++ b/usr.bin/make/unit-tests/lint.exp @@ -0,0 +1,4 @@ +make: In the :@ modifier of "VAR", the variable name "${:Ubar:S,b,v,}" must not contain a dollar. +y@:Q} +xvaluey +exit status 2 diff --git a/usr.bin/make/unit-tests/lint.mk b/usr.bin/make/unit-tests/lint.mk new file mode 100644 index 000000000..5db417639 --- /dev/null +++ b/usr.bin/make/unit-tests/lint.mk @@ -0,0 +1,22 @@ +# $NetBSD: lint.mk,v 1.4 2021/01/30 13:50:18 rillig Exp $ +# +# Demonstrates stricter checks that are only enabled in lint mode, using the +# option -dL. + +# Before main.c 1.421 from 2020-11-01, make exited successfully even though +# the error message had been issued as PARSE_FATAL. This was because back +# then, make checked for parse errors only after parsing each top-level +# makefile, in Parse_File. After that, when expanding variable expressions +# in shell commands, the parse errors were not checked again. + +# Ouch: as of 2020-08-03, the variable is malformed and parsing stops +# for a moment, but is continued after the wrongly-guessed end of the +# variable, which echoes "y@:Q}". + +.MAKEFLAGS: -dL + +all: mod-loop-varname + +mod-loop-varname: + @echo ${VAR:Uvalue:@${:Ubar:S,b,v,}@x${var}y@:Q} + @echo ${VAR:Uvalue:@!@x$!y@:Q} # surprisingly allowed diff --git a/usr.bin/make/unit-tests/make-exported.exp b/usr.bin/make/unit-tests/make-exported.exp new file mode 100644 index 000000000..05a916760 --- /dev/null +++ b/usr.bin/make/unit-tests/make-exported.exp @@ -0,0 +1,2 @@ +UT_VAR= +exit status 0 diff --git a/usr.bin/make/unit-tests/make-exported.mk b/usr.bin/make/unit-tests/make-exported.mk new file mode 100644 index 000000000..db7f09dc4 --- /dev/null +++ b/usr.bin/make/unit-tests/make-exported.mk @@ -0,0 +1,25 @@ +# $NetBSD: make-exported.mk,v 1.6 2020/10/05 19:27:48 rillig Exp $ +# +# As of 2020-08-09, the code in Var_Export is shared between the .export +# directive and the .MAKE.EXPORTED variable. This leads to non-obvious +# behavior for certain variable assignments. + +-env= make-exported-value-env +-literal= make-exported-value-literal +UT_VAR= ${UNEXPANDED} + +# Before 2020-10-03, the following line took the code path of .export-env, +# which was surprising behavior. Since 2020-10-03 this line tries to +# export the variable named "-env", but that is rejected because the +# variable name starts with a hyphen. +.MAKE.EXPORTED= -env + +# Before 2020-10-03, if the value of .MAKE.EXPORTED started with "-literal", +# make behaved like a mixture of .export-literal and a regular .export. +# +# Since 2020-10-03, the "variable" named "-literal" is not exported anymore, +# it is just ignored since its name starts with '-'. +.MAKE.EXPORTED= -literal UT_VAR + +all: + @env | sort | grep -E '^UT_|make-exported-value' || true diff --git a/usr.bin/make/unit-tests/meta-cmd-cmp.exp b/usr.bin/make/unit-tests/meta-cmd-cmp.exp new file mode 100644 index 000000000..bfc52123e --- /dev/null +++ b/usr.bin/make/unit-tests/meta-cmd-cmp.exp @@ -0,0 +1,37 @@ +one: +Building .meta-cmd-cmp.cmp +Building .meta-cmd-cmp.nocmp +Building .meta-cmd-cmp.cmp2 +This line not compared FLAGS= +Skipping meta for .END: .SPECIAL +two: +`.meta-cmd-cmp.cmp' is up to date. +`.meta-cmd-cmp.nocmp' is up to date. +.meta-cmd-cmp.cmp2.meta: 3: cannot compare command using .OODATE +`.meta-cmd-cmp.cmp2' is up to date. +Skipping meta for .END: .SPECIAL +change1: +.meta-cmd-cmp.cmp.meta: 2: a build command has changed +@echo FLAGS= > .meta-cmd-cmp.cmp +vs +@echo FLAGS=changed > .meta-cmd-cmp.cmp +Building .meta-cmd-cmp.cmp +`.meta-cmd-cmp.nocmp' is up to date. +.meta-cmd-cmp.cmp2.meta: 3: cannot compare command using .OODATE +`.meta-cmd-cmp.cmp2' is up to date. +Skipping meta for .END: .SPECIAL +change2: +.meta-cmd-cmp.cmp.meta: 2: a build command has changed +@echo FLAGS=changed > .meta-cmd-cmp.cmp +vs +@echo FLAGS= > .meta-cmd-cmp.cmp +Building .meta-cmd-cmp.cmp +`.meta-cmd-cmp.nocmp' is up to date. +.meta-cmd-cmp.cmp2.meta: 2: a build command has changed +@echo FLAGS2= > .meta-cmd-cmp.cmp2 +vs +@echo FLAGS2=changed > .meta-cmd-cmp.cmp2 +Building .meta-cmd-cmp.cmp2 +This line not compared FLAGS= +Skipping meta for .END: .SPECIAL +exit status 0 diff --git a/usr.bin/make/unit-tests/meta-cmd-cmp.mk b/usr.bin/make/unit-tests/meta-cmd-cmp.mk new file mode 100644 index 000000000..a1c0f7c10 --- /dev/null +++ b/usr.bin/make/unit-tests/meta-cmd-cmp.mk @@ -0,0 +1,52 @@ +# $NetBSD: meta-cmd-cmp.mk,v 1.2 2020/12/05 22:51:34 sjg Exp $ +# +# Tests META_MODE command line comparison +# + +.MAIN: all + +.MAKE.MODE= meta verbose silent=yes curdirok=yes +tf:= .${.PARSEFILE:R} + +.if ${.TARGETS:Nall} == "" +all: prep one two change1 change2 post + +CLEANFILES= ${tf}* + +prep post: .PHONY + @rm -f ${CLEANFILES} + +.endif + +FLAGS?= +FLAGS2?= + +tests= ${tf}.cmp ${tf}.nocmp ${tf}.cmp2 + +${tf}.cmp: + @echo FLAGS=${FLAGS:Uempty} > $@ + +${tf}.nocmp: .NOMETA_CMP + @echo FLAGS=${FLAGS:Uempty} > $@ + +# a line containing ${.OODATE} will not be compared +# this allows the trick below +${tf}.cmp2: + @echo FLAGS2=${FLAGS2:Uempty} > $@ + @echo This line not compared FLAGS=${FLAGS:Uempty} ${.OODATE:MNOMETA_CMP} + +# these do the same +one two: .PHONY + @echo $@: + @${.MAKE} -dM -r -C ${.CURDIR} -f ${MAKEFILE} ${tests} + +change1: .PHONY + @echo $@: + @${.MAKE} -dM -r -C ${.CURDIR} -f ${MAKEFILE} FLAGS=changed ${tests} + +change2: .PHONY + @echo $@: + @${.MAKE} -dM -r -C ${.CURDIR} -f ${MAKEFILE} FLAGS2=changed ${tests} + +# don't let gcov mess up the results +.MAKE.META.IGNORE_PATTERNS+= *.gcda diff --git a/usr.bin/make/unit-tests/misc.mk b/usr.bin/make/unit-tests/misc.mk deleted file mode 100644 index 2773e304b..000000000 --- a/usr.bin/make/unit-tests/misc.mk +++ /dev/null @@ -1,16 +0,0 @@ -# $Id: misc.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ - -.if !exists(${.CURDIR}/) -.warning ${.CURDIR}/ doesn't exist ? -.endif - -.if !exists(${.CURDIR}/.) -.warning ${.CURDIR}/. doesn't exist ? -.endif - -.if !exists(${.CURDIR}/..) -.warning ${.CURDIR}/.. doesn't exist ? -.endif - -all: - @: all is well diff --git a/usr.bin/make/unit-tests/moderrs.exp b/usr.bin/make/unit-tests/moderrs.exp index cb51aa09d..3166275a0 100644 --- a/usr.bin/make/unit-tests/moderrs.exp +++ b/usr.bin/make/unit-tests/moderrs.exp @@ -1,16 +1,146 @@ -Expect: Unknown modifier 'Z' -make: Unknown modifier 'Z' -VAR:Z= -Expect: Unknown modifier 'Z' -make: Unknown modifier 'Z' -VAR:Z= -Expect: Unclosed variable specification for VAR -make: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S +mod-unknown-direct: +want: Unknown modifier 'Z' +make: Unknown modifier "Z" +VAR:Z=before--after + +mod-unknown-indirect: +want: Unknown modifier 'Z' +make: Unknown modifier "Z" +VAR:Z=before-inner}-after + +unclosed-direct: +want: Unclosed variable expression, expecting '}' for modifier "S,V,v," of variable "VAR" with value "Thevariable" +make: Unclosed variable expression, expecting '}' for modifier "S,V,v," of variable "VAR" with value "Thevariable" VAR:S,V,v,=Thevariable -Expect: Unclosed variable specification for VAR -make: Unclosed variable specification after complex modifier (expecting '}') for VAR + +unclosed-indirect: +want: Unclosed variable expression after indirect modifier, expecting '}' for variable "VAR" +make: Unclosed variable expression after indirect modifier, expecting '}' for variable "VAR" VAR:S,V,v,=Thevariable -Expect: Unclosed substitution for VAR (, missing) -make: Unclosed substitution for VAR (, missing) + +unfinished-indirect: +want: Unfinished modifier for VAR (',' missing) +make: Unfinished modifier for "VAR" (',' missing) VAR:S,V,v= + +unfinished-loop: +want: Unfinished modifier for UNDEF ('@' missing) +make: Unfinished modifier for "UNDEF" ('@' missing) + +want: Unfinished modifier for UNDEF ('@' missing) +make: Unfinished modifier for "UNDEF" ('@' missing) + +1 2 3 + +loop-close: +make: Unclosed variable expression, expecting '}' for modifier "@var@${var}}...@" of variable "UNDEF" with value "1}... 2}... 3}..." +1}... 2}... 3}... +1}... 2}... 3}... + +words: +want: Unfinished modifier for UNDEF (']' missing) +make: Unfinished modifier for "UNDEF" (']' missing) + +want: Unfinished modifier for UNDEF (']' missing) +make: Unfinished modifier for "UNDEF" (']' missing) + +13= +make: Bad modifier ":[123451234512345123451234512345]" for variable "UNDEF" +12345=S,^ok,:S,^3ok,} + +exclam: +want: Unfinished modifier for VARNAME ('!' missing) +make: Unfinished modifier for "VARNAME" ('!' missing) + +want: Unfinished modifier for ! ('!' missing) +make: Unfinished modifier for "!" ('!' missing) + + +mod-subst-delimiter: +make: Missing delimiter for modifier ':S' +1: +make: Unfinished modifier for "VAR" (',' missing) +2: +make: Unfinished modifier for "VAR" (',' missing) +3: +make: Unfinished modifier for "VAR" (',' missing) +4: +make: Unfinished modifier for "VAR" (',' missing) +5: +make: Unclosed variable expression, expecting '}' for modifier "S,from,to," of variable "VAR" with value "TheVariable" +6: TheVariable +7: TheVariable + +mod-regex-delimiter: +make: Missing delimiter for :C modifier +1: +make: Unfinished modifier for "VAR" (',' missing) +2: +make: Unfinished modifier for "VAR" (',' missing) +3: +make: Unfinished modifier for "VAR" (',' missing) +4: +make: Unfinished modifier for "VAR" (',' missing) +5: +make: Unclosed variable expression, expecting '}' for modifier "C,from,to," of variable "VAR" with value "TheVariable" +6: TheVariable +7: TheVariable + +mod-regex-undefined-subexpression: +one one 2 3 5 8 one3 2one 34 +make: No match for subexpression \2 +make: No match for subexpression \2 +make: No match for subexpression \1 +make: No match for subexpression \2 +make: No match for subexpression \1 +()+() ()+() ()+() 3 5 8 (3)+() ()+(1) 34 + +mod-ts-parse: +112358132134 +15152535558513521534 +make: Bad modifier ":ts\65oct" for variable "FIB" +65oct} +make: Bad modifier ":ts\65oct" for variable "" +65oct} +make: Bad modifier ":tsxy" for variable "FIB" +xy} + +mod-t-parse: +make: Bad modifier ":t" for variable "FIB" + +make: Bad modifier ":txy" for variable "FIB" +y} +make: Bad modifier ":t" for variable "FIB" + +make: Bad modifier ":t" for variable "FIB" +M*} + +mod-ifelse-parse: +make: Unfinished modifier for "FIB" (':' missing) + +make: Unfinished modifier for "FIB" (':' missing) + +make: Unfinished modifier for "FIB" ('}' missing) + +make: Unfinished modifier for "FIB" ('}' missing) + +then + +mod-remember-parse: +1 1 2 3 5 8 13 21 34 +make: Unknown modifier "__" + + +mod-sysv-parse: +make: Unknown modifier "3" +make: Unclosed variable expression, expecting '}' for modifier "3" of variable "FIB" with value "" + +make: Unknown modifier "3=" +make: Unclosed variable expression, expecting '}' for modifier "3=" of variable "FIB" with value "" + +make: Unknown modifier "3=x3" +make: Unclosed variable expression, expecting '}' for modifier "3=x3" of variable "FIB" with value "" + +1 1 2 x3 5 8 1x3 21 34 + exit status 0 diff --git a/usr.bin/make/unit-tests/moderrs.mk b/usr.bin/make/unit-tests/moderrs.mk index 825e6c719..88fb063ff 100644 --- a/usr.bin/make/unit-tests/moderrs.mk +++ b/usr.bin/make/unit-tests/moderrs.mk @@ -1,31 +1,172 @@ -# $Id: moderrs.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: moderrs.mk,v 1.27 2021/02/23 16:04:16 rillig Exp $ # # various modifier error tests -VAR=TheVariable -# incase we have to change it ;-) -MOD_UNKN=Z -MOD_TERM=S,V,v -MOD_S:= ${MOD_TERM}, +'= '\'' +VAR= TheVariable +# in case we have to change it ;-) +MOD_UNKN= Z +MOD_TERM= S,V,v +MOD_S:= ${MOD_TERM}, -all: modunkn modunknV varterm vartermV modtermV +FIB= 1 1 2 3 5 8 13 21 34 -modunkn: - @echo "Expect: Unknown modifier 'Z'" - @echo "VAR:Z=${VAR:Z}" +all: mod-unknown-direct mod-unknown-indirect +all: unclosed-direct unclosed-indirect +all: unfinished-indirect unfinished-loop +all: loop-close +all: words +all: exclam +all: mod-subst-delimiter +all: mod-regex-delimiter +all: mod-regex-undefined-subexpression +all: mod-ts-parse +all: mod-t-parse +all: mod-ifelse-parse +all: mod-remember-parse +all: mod-sysv-parse -modunknV: - @echo "Expect: Unknown modifier 'Z'" - @echo "VAR:${MOD_UNKN}=${VAR:${MOD_UNKN}}" +mod-unknown-direct: print-header print-footer + @echo 'want: Unknown modifier $'Z$'' + @echo 'VAR:Z=before-${VAR:Z}-after' -varterm: - @echo "Expect: Unclosed variable specification for VAR" +mod-unknown-indirect: print-header print-footer + @echo 'want: Unknown modifier $'Z$'' + @echo 'VAR:${MOD_UNKN}=before-${VAR:${MOD_UNKN}:inner}-after' + +unclosed-direct: print-header print-footer + @echo 'want: Unclosed variable expression, expecting $'}$' for modifier "S,V,v," of variable "VAR" with value "Thevariable"' @echo VAR:S,V,v,=${VAR:S,V,v, -vartermV: - @echo "Expect: Unclosed variable specification for VAR" +unclosed-indirect: print-header print-footer + @echo 'want: Unclosed variable expression after indirect modifier, expecting $'}$' for variable "VAR"' @echo VAR:${MOD_TERM},=${VAR:${MOD_S} -modtermV: - @echo "Expect: Unclosed substitution for VAR (, missing)" +unfinished-indirect: print-header print-footer + @echo 'want: Unfinished modifier for VAR ($',$' missing)' -@echo "VAR:${MOD_TERM}=${VAR:${MOD_TERM}}" + +unfinished-loop: print-header print-footer + @echo 'want: Unfinished modifier for UNDEF ($'@$' missing)' + @echo ${UNDEF:U1 2 3:@var} + @echo 'want: Unfinished modifier for UNDEF ($'@$' missing)' + @echo ${UNDEF:U1 2 3:@var@...} + @echo ${UNDEF:U1 2 3:@var@${var}@} + +# The closing brace after the ${var} is part of the replacement string. +# In ParseModifierPart, braces and parentheses don't have to be balanced. +# This is contrary to the :M, :N modifiers, where both parentheses and +# braces must be balanced. +# This is also contrary to the SysV modifier, where only the actually +# used delimiter (either braces or parentheses) must be balanced. +loop-close: print-header print-footer + @echo ${UNDEF:U1 2 3:@var@${var}}...@ + @echo ${UNDEF:U1 2 3:@var@${var}}...@} + +words: print-header print-footer + @echo 'want: Unfinished modifier for UNDEF ($']$' missing)' + @echo ${UNDEF:U1 2 3:[} + @echo 'want: Unfinished modifier for UNDEF ($']$' missing)' + @echo ${UNDEF:U1 2 3:[#} + + # out of bounds => empty + @echo 13=${UNDEF:U1 2 3:[13]} + + # Word index out of bounds. + # + # Until 2020-11-01, the behavior in this case depended upon the size + # of unsigned long. + # + # On LP64I32, strtol returns LONG_MAX, which was then truncated to + # int (undefined behavior), typically resulting in -1. This -1 was + # interpreted as "the last word". + # + # On ILP32, strtol returns LONG_MAX, which is a large number. This + # resulted in a range from LONG_MAX - 1 to 3, which was empty. + # + # Since 2020-11-01, the numeric overflow is detected and generates an + # error. In the remainder of the text, the '$,' is no longer parsed + # as part of a variable modifier, where it would have been interpreted + # as an anchor to the :S modifier, but as a normal variable named ','. + # That variable is undefined, resulting in an empty string. + @echo 12345=${UNDEF:U1 2 3:[123451234512345123451234512345]:S,^$,ok,:S,^3$,ok,} + +exclam: print-header print-footer + @echo 'want: Unfinished modifier for VARNAME ($'!$' missing)' + @echo ${VARNAME:!echo} + # When the final exclamation mark is missing, there is no + # fallback to the SysV substitution modifier. + # If there were a fallback, the output would be "exclam", + # and the above would have produced an "Unknown modifier '!'". + @echo 'want: Unfinished modifier for ! ($'!$' missing)' + @echo ${!:L:!=exclam} + +mod-subst-delimiter: print-header print-footer + @echo 1: ${VAR:S + @echo 2: ${VAR:S, + @echo 3: ${VAR:S,from + @echo 4: ${VAR:S,from, + @echo 5: ${VAR:S,from,to + @echo 6: ${VAR:S,from,to, + @echo 7: ${VAR:S,from,to,} + +mod-regex-delimiter: print-header print-footer + @echo 1: ${VAR:C + @echo 2: ${VAR:C, + @echo 3: ${VAR:C,from + @echo 4: ${VAR:C,from, + @echo 5: ${VAR:C,from,to + @echo 6: ${VAR:C,from,to, + @echo 7: ${VAR:C,from,to,} + +# In regular expressions with alternatives, not all capturing groups are +# always set; some may be missing. Warn about these. +# +# Since there is no way to turn off this warning, the combination of +# alternative matches and capturing groups is seldom used, if at all. +# +# A newly added modifier 'U' such as in :C,(a.)|(b.),\1\2,U might be added +# for treating undefined capturing groups as empty, but that would create a +# syntactical ambiguity since the :S and :C modifiers are open-ended (see +# mod-subst-chain). Luckily the modifier :U does not make sense after :C, +# therefore this case does not happen in practice. +# The sub-modifier for the :S and :C modifiers would have to be chosen +# wisely, to not create ambiguities while parsing. +mod-regex-undefined-subexpression: print-header print-footer + @echo ${FIB:C,1(.*),one\1,} # all ok + @echo ${FIB:C,1(.*)|2(.*),(\1)+(\2),:Q} # no match for subexpression + +mod-ts-parse: print-header print-footer + @echo ${FIB:ts} + @echo ${FIB:ts\65} # octal 065 == U+0035 == '5' + @echo ${FIB:ts\65oct} # bad modifier + @echo ${:U${FIB}:ts\65oct} # bad modifier, variable name is "" + @echo ${FIB:tsxy} # modifier too long + +mod-t-parse: print-header print-footer + @echo ${FIB:t + @echo ${FIB:txy} + @echo ${FIB:t} + @echo ${FIB:t:M*} + +mod-ifelse-parse: print-header print-footer + @echo ${FIB:? + @echo ${FIB:?then + @echo ${FIB:?then: + @echo ${FIB:?then:else + @echo ${FIB:?then:else} + +mod-remember-parse: print-header print-footer + @echo ${FIB:_} # ok + @echo ${FIB:__} # modifier name too long + +mod-sysv-parse: print-header print-footer + @echo ${FIB:3 + @echo ${FIB:3= + @echo ${FIB:3=x3 + @echo ${FIB:3=x3} # ok + +print-header: .USEBEFORE + @echo $@: +print-footer: .USE + @echo diff --git a/usr.bin/make/unit-tests/modmatch.mk b/usr.bin/make/unit-tests/modmatch.mk index 48a1befb5..7dcacf09d 100644 --- a/usr.bin/make/unit-tests/modmatch.mk +++ b/usr.bin/make/unit-tests/modmatch.mk @@ -1,21 +1,26 @@ +# $NetBSD: modmatch.mk,v 1.9 2020/10/24 08:50:17 rillig Exp $ +# +# Tests for the :M and :S modifiers. -X=a b c d e +X= a b c d e .for x in $X -LIB${x:tu}=/tmp/lib$x.a +LIB${x:tu}= /tmp/lib$x.a .endfor -X_LIBS= ${LIBA} ${LIBD} ${LIBE} +X_LIBS= ${LIBA} ${LIBD} ${LIBE} -LIB?=a +LIB?= a -var = head -res = no +var= head +res= no .if !empty(var:M${:Uhead\:tail:C/:.*//}) -res = OK +res= OK .endif -all: +all: show-libs + +show-libs: @for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done @echo "Mscanner=${res}" diff --git a/usr.bin/make/unit-tests/modmisc.exp b/usr.bin/make/unit-tests/modmisc.exp index e406647bc..10475e65e 100644 --- a/usr.bin/make/unit-tests/modmisc.exp +++ b/usr.bin/make/unit-tests/modmisc.exp @@ -7,4 +7,14 @@ path_/usr/xbin=/opt/xbin/ paths=/bin /tmp / /no/such/dir /opt/xbin PATHS=/BIN /TMP / /NO/SUCH/DIR /OPT/XBIN The answer is 42 +S: +C: +@: +S:empty +C:empty +@: +mod-quote: new + +line +mod-break-many-words: 500 exit status 0 diff --git a/usr.bin/make/unit-tests/modmisc.mk b/usr.bin/make/unit-tests/modmisc.mk index a292b9665..9ace35c15 100644 --- a/usr.bin/make/unit-tests/modmisc.mk +++ b/usr.bin/make/unit-tests/modmisc.mk @@ -1,25 +1,29 @@ -# $Id: modmisc.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: modmisc.mk,v 1.52 2020/12/20 19:29:06 rillig Exp $ # # miscellaneous modifier tests # do not put any dirs in this list which exist on some # but not all target systems - an exists() check is below. -path=:/bin:/tmp::/:.:/no/such/dir:. +path= :/bin:/tmp::/:.:/no/such/dir:. # strip cwd from path. -MOD_NODOT=S/:/ /g:N.:ts: -# and decorate, note that $'s need to be doubled. Also note that +MOD_NODOT= S/:/ /g:N.:ts: +# and decorate, note that $'s need to be doubled. Also note that # the modifier_variable can be used with other modifiers. -MOD_NODOTX=S/:/ /g:N.:@d@'$$d'@ +MOD_NODOTX= S/:/ /g:N.:@d@'$$d'@ # another mod - pretend it is more interesting -MOD_HOMES=S,/home/,/homes/, -MOD_OPT=@d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@ -MOD_SEP=S,:, ,g +MOD_HOMES= S,/home/,/homes/, +MOD_OPT= @d@$${exists($$d):?$$d:$${d:S,/usr,/opt,}}@ +MOD_SEP= S,:, ,g -all: modvar modvarloop modsysv +all: modvar modvarloop modsysv emptyvar undefvar +all: mod-quote +all: mod-break-many-words +# See also sysv.mk. modsysv: @echo "The answer is ${libfoo.a:L:libfoo.a=42}" +# Demonstrates modifiers that are given indirectly from a variable. modvar: @echo "path='${path}'" @echo "path='${path:${MOD_NODOT}}'" @@ -28,11 +32,34 @@ modvar: @echo "path=${path:${MOD_HOMES}:${MOD_NODOTX}:ts:}" .for d in ${path:${MOD_SEP}:N.} /usr/xbin -path_$d?= ${d:${MOD_OPT}:${MOD_HOMES}}/ -paths+= ${d:${MOD_OPT}:${MOD_HOMES}} +path_$d?= ${d:${MOD_OPT}:${MOD_HOMES}}/ +paths+= ${d:${MOD_OPT}:${MOD_HOMES}} .endfor modvarloop: @echo "path_/usr/xbin=${path_/usr/xbin}" @echo "paths=${paths}" @echo "PATHS=${paths:tu}" + +# When a modifier is applied to the "" variable, the result is discarded. +emptyvar: + @echo S:${:S,^$,empty,} + @echo C:${:C,^$,empty,} + @echo @:${:@var@${var}@} + +# The :U modifier turns even the "" variable into something that has a value. +# The value of the resulting expression is empty, but is still considered to +# contain a single empty word. This word can be accessed by the :S and :C +# modifiers, but not by the :@ modifier since it explicitly skips empty words. +undefvar: + @echo S:${:U:S,^$,empty,} + @echo C:${:U:C,^$,empty,} + @echo @:${:U:@var@empty@} + + +mod-quote: + @echo $@: new${.newline:Q}${.newline:Q}line + +# Cover the bmake_realloc in Str_Words. +mod-break-many-words: + @echo $@: ${UNDEF:U:range=500:[#]} diff --git a/usr.bin/make/unit-tests/modorder.exp b/usr.bin/make/unit-tests/modorder.exp deleted file mode 100644 index 411742738..000000000 --- a/usr.bin/make/unit-tests/modorder.exp +++ /dev/null @@ -1,11 +0,0 @@ -LIST = one two three four five six seven eight nine ten -LIST:O = eight five four nine one seven six ten three two -LIST:Ox = Ok -LIST:O:Ox = Ok -LISTX = Ok -LISTSX = Ok -make: Bad modifier `:OX' for LIST -BADMOD 1 = } -make: Bad modifier `:OxXX' for LIST -BADMOD 2 = XX} -exit status 0 diff --git a/usr.bin/make/unit-tests/modorder.mk b/usr.bin/make/unit-tests/modorder.mk deleted file mode 100644 index bc24d339f..000000000 --- a/usr.bin/make/unit-tests/modorder.mk +++ /dev/null @@ -1,22 +0,0 @@ -# $NetBSD: modorder.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ - -LIST= one two three four five six seven eight nine ten -LISTX= ${LIST:Ox} -LISTSX:= ${LIST:Ox} -TEST_RESULT= && echo Ok || echo Failed - -# unit-tests have to produce the same results on each run -# so we cannot actually include :Ox output. -all: - @echo "LIST = ${LIST}" - @echo "LIST:O = ${LIST:O}" - # Note that 1 in every 10! trials two independently generated - # randomized orderings will be the same. The test framework doesn't - # support checking probabilistic output, so we accept that the test - # will incorrectly fail with probability 2.8E-7. - @echo "LIST:Ox = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`" - @echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`" - @echo "LISTX = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`" - @echo "LISTSX = `test '${LISTSX}' = '${LISTSX}' ${TEST_RESULT}`" - @echo "BADMOD 1 = ${LIST:OX}" - @echo "BADMOD 2 = ${LIST:OxXX}" diff --git a/usr.bin/make/unit-tests/modts.exp b/usr.bin/make/unit-tests/modts.exp index cf3c91d43..18837016a 100644 --- a/usr.bin/make/unit-tests/modts.exp +++ b/usr.bin/make/unit-tests/modts.exp @@ -1,33 +1,14 @@ -LIST="one two three four five six" -LIST:ts,="one,two,three,four,five,six" -LIST:ts/:tu="ONE/TWO/THREE/FOUR/FIVE/SIX" -LIST:ts::tu="ONE:TWO:THREE:FOUR:FIVE:SIX" -LIST:ts:tu="ONETWOTHREEFOURFIVESIX" -LIST:tu:ts/="ONE/TWO/THREE/FOUR/FIVE/SIX" -LIST:ts:="one:two:three:four:five:six" -LIST:ts="onetwothreefourfivesix" -LIST:ts:S/two/2/="one2threefourfivesix" -LIST:S/two/2/:ts="one2threefourfivesix" -LIST:ts/:S/two/2/="one/2/three/four/five/six" -Pretend the '/' in '/n' etc. below are back-slashes. -LIST:ts/n="one -two -three -four -five -six" -LIST:ts/t="one two three four five six" -LIST:ts/012:tu="ONE -TWO -THREE -FOUR -FIVE -SIX" -make: Bad modifier `:tx' for LIST +make: Bad modifier ":tx" for variable "LIST" LIST:tx="}" -make: Bad modifier `:ts\x' for LIST -LIST:ts/x:tu="\x:tu}" +make: Bad modifier ":ts\X" for variable "LIST" +LIST:ts/x:tu="\X:tu}" FU_mod-ts="a/b/cool" FU_mod-ts:ts:T="cool" == cool? B.${AAA:ts}="Baaa" == Baaa? +:ts :S => aaxBbxaaxbbxaaxbb +:ts :S space => axa a axc +:ts :S space :M => axaxaxaxc +:ts :S => axa a axc +:ts :S :@ => axa a axc +:ts :S :@ :M => axaxaxaxc exit status 0 diff --git a/usr.bin/make/unit-tests/modts.mk b/usr.bin/make/unit-tests/modts.mk index 616bd8944..e9c10f055 100644 --- a/usr.bin/make/unit-tests/modts.mk +++ b/usr.bin/make/unit-tests/modts.mk @@ -1,43 +1,47 @@ +# $NetBSD: modts.mk,v 1.8 2020/11/03 18:42:33 rillig Exp $ -LIST= one two three -LIST+= four five six +LIST= one two three four five six -FU_mod-ts = a / b / cool +FU_mod-ts= a / b / cool -AAA= a a a -B.aaa= Baaa +AAA= a a a +B.aaa= Baaa -all: mod-ts +all: mod-ts mod-ts-space # Use print or printf iff they are builtin. -# XXX note that this causes problems, when make decides +# XXX note that this causes problems, when make decides # there is no need to use a shell, so avoid where possible. .if ${type print 2> /dev/null || echo:L:sh:Mbuiltin} != "" -PRINT= print -r -- +PRINT= print -r -- .elif ${type printf 2> /dev/null || echo:L:sh:Mbuiltin} != "" -PRINT= printf '%s\n' +PRINT= printf '%s\n' .else -PRINT= echo +PRINT= echo .endif mod-ts: - @echo 'LIST="${LIST}"' - @echo 'LIST:ts,="${LIST:ts,}"' - @echo 'LIST:ts/:tu="${LIST:ts/:tu}"' - @echo 'LIST:ts::tu="${LIST:ts::tu}"' - @echo 'LIST:ts:tu="${LIST:ts:tu}"' - @echo 'LIST:tu:ts/="${LIST:tu:ts/}"' - @echo 'LIST:ts:="${LIST:ts:}"' - @echo 'LIST:ts="${LIST:ts}"' - @echo 'LIST:ts:S/two/2/="${LIST:ts:S/two/2/}"' - @echo 'LIST:S/two/2/:ts="${LIST:S/two/2/:ts}"' - @echo 'LIST:ts/:S/two/2/="${LIST:ts/:S/two/2/}"' - @echo "Pretend the '/' in '/n' etc. below are back-slashes." - @${PRINT} 'LIST:ts/n="${LIST:ts\n}"' - @${PRINT} 'LIST:ts/t="${LIST:ts\t}"' - @${PRINT} 'LIST:ts/012:tu="${LIST:ts\012:tu}"' @${PRINT} 'LIST:tx="${LIST:tx}"' - @${PRINT} 'LIST:ts/x:tu="${LIST:ts\x:tu}"' + @${PRINT} 'LIST:ts/x:tu="${LIST:ts\X:tu}"' @${PRINT} 'FU_$@="${FU_${@:ts}:ts}"' @${PRINT} 'FU_$@:ts:T="${FU_${@:ts}:ts:T}" == cool?' @${PRINT} 'B.$${AAA:ts}="${B.${AAA:ts}}" == Baaa?' + +mod-ts-space: + # After the :ts modifier, the whole string is interpreted as a single + # word since all spaces have been replaced with x. + @${PRINT} ':ts :S => '${aa bb aa bb aa bb:L:tsx:S,b,B,:Q} + + # The :ts modifier also applies to word separators that are added + # afterwards. + @${PRINT} ':ts :S space => '${a ababa c:L:tsx:S,b, ,g:Q} + @${PRINT} ':ts :S space :M => '${a ababa c:L:tsx:S,b, ,g:M*:Q} + + # Not all modifiers behave this way though. Some of them always use + # a space as word separator instead of the :ts separator. + # This seems like an oversight during implementation. + @${PRINT} ':ts :S => '${a ababa c:L:tsx:S,b, ,g:Q} + @${PRINT} ':ts :S :@ => '${a ababa c:L:tsx:S,b, ,g:@v@${v}@:Q} + + # A final :M* modifier applies the :ts separator again, though. + @${PRINT} ':ts :S :@ :M => '${a ababa c:L:tsx:S,b, ,g:@v@${v}@:M*:Q} diff --git a/usr.bin/make/unit-tests/modword.exp b/usr.bin/make/unit-tests/modword.exp index 258d7eadd..02e9974c0 100644 --- a/usr.bin/make/unit-tests/modword.exp +++ b/usr.bin/make/unit-tests/modword.exp @@ -1,4 +1,4 @@ -make: Bad modifier `:[]' for LIST +make: Bad modifier ":[]" for variable "LIST" LIST:[]="" is an error LIST:[0]="one two three four five six" LIST:[0x0]="one two three four five six" @@ -37,17 +37,17 @@ REALLYSPACE=" " REALLYSPACE:[1]="" == "" ? REALLYSPACE:[*]:[1]=" " == " " ? LIST:[1]="one" -make: Bad modifier `:[1.]' for LIST +make: Bad modifier ":[1.]" for variable "LIST" LIST:[1.]="" is an error -make: Bad modifier `:[1].' for LIST +make: Bad modifier ":[1]." for variable "LIST" LIST:[1].="}" is an error LIST:[2]="two" LIST:[6]="six" LIST:[7]="" LIST:[999]="" -make: Bad modifier `:[-]' for LIST +make: Bad modifier ":[-]" for variable "LIST" LIST:[-]="" is an error -make: Bad modifier `:[--]' for LIST +make: Bad modifier ":[--]" for variable "LIST" LIST:[--]="" is an error LIST:[-1]="six" LIST:[-2]="five" @@ -66,20 +66,23 @@ LIST:[@]:[2]="two" LIST:[*]:C/ /,/:[2]="" LIST:[*]:C/ /,/:[*]:[2]="" LIST:[*]:C/ /,/:[@]:[2]="three" -make: Bad modifier `:[1.]' for LIST +LONGLIST:[012..0x12]="10 11 12 13 14 15 16 17 18" +make: Bad modifier ":[1.]" for variable "LIST" LIST:[1.]="" is an error -make: Bad modifier `:[1..]' for LIST +make: Bad modifier ":[1..]" for variable "LIST" LIST:[1..]="" is an error +make: Bad modifier ":[1.. ]" for variable "LIST" +LIST:[1.. ]="" is an error LIST:[1..1]="one" -make: Bad modifier `:[1..1.]' for LIST +make: Bad modifier ":[1..1.]" for variable "LIST" LIST:[1..1.]="" is an error LIST:[1..2]="one two" LIST:[2..1]="two one" LIST:[3..-2]="three four five" LIST:[-4..4]="three four" -make: Bad modifier `:[0..1]' for LIST +make: Bad modifier ":[0..1]" for variable "LIST" LIST:[0..1]="" is an error -make: Bad modifier `:[-1..0]' for LIST +make: Bad modifier ":[-1..0]" for variable "LIST" LIST:[-1..0]="" is an error LIST:[-1..1]="six five four three two one" LIST:[0..0]="one two three four five six" @@ -94,11 +97,12 @@ LIST:[${ONE}]="one" LIST:[${MINUSONE}]="six" LIST:[${STAR}]="one two three four five six" LIST:[${AT}]="one two three four five six" -make: Bad modifier `:[${EMPTY' for LIST +make: Bad modifier ":[${EMPTY" for variable "LIST" LIST:[${EMPTY}]="" is an error LIST:[${LONGLIST:[21]:S/2//}]="one" LIST:[${LIST:[#]}]="six" LIST:[${LIST:[${HASH}]}]="six" +LIST:[ -1.. +3]="six five four three" LIST:S/ /,/="one two three four five six" LIST:S/ /,/W="one,two three four five six" LIST:S/ /,/gW="one,two,three,four,five,six" diff --git a/usr.bin/make/unit-tests/modword.mk b/usr.bin/make/unit-tests/modword.mk index 00a56de19..95bb1fec7 100644 --- a/usr.bin/make/unit-tests/modword.mk +++ b/usr.bin/make/unit-tests/modword.mk @@ -1,28 +1,30 @@ -# $Id: modword.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: modword.mk,v 1.6 2021/03/14 16:00:07 rillig Exp $ # # Test behaviour of new :[] modifier +# TODO: When was this modifier new? all: mod-squarebrackets mod-S-W mod-C-W mod-tW-tw -LIST= one two three -LIST+= four five six -LONGLIST= 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 +LIST= one two three +LIST+= four five six +LONGLIST= 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 -EMPTY= # the space should be ignored -ESCAPEDSPACE=\ # escaped space before the '#' -REALLYSPACE:=${EMPTY:C/^/ /W} -HASH= \# -AT= @ -STAR= * -ZERO= 0 -ONE= 1 -MINUSONE= -1 +EMPTY= # the space should be ignored +ESCAPEDSPACE= \ # escaped space before the '#' +REALLYSPACE:= ${EMPTY:C/^/ /W} +HASH= \# +AT= @ +STAR= * +ZERO= 0 +ONE= 1 +MINUSONE= -1 mod-squarebrackets: mod-squarebrackets-0-star-at \ mod-squarebrackets-hash \ mod-squarebrackets-n \ mod-squarebrackets-start-end \ - mod-squarebrackets-nested + mod-squarebrackets-nested \ + mod-squarebrackets-space mod-squarebrackets-0-star-at: @echo 'LIST:[]="${LIST:[]}" is an error' @@ -92,10 +94,12 @@ mod-squarebrackets-n: @echo 'LIST:[*]:C/ /,/:[2]="${LIST:[*]:C/ /,/:[2]}"' @echo 'LIST:[*]:C/ /,/:[*]:[2]="${LIST:[*]:C/ /,/:[*]:[2]}"' @echo 'LIST:[*]:C/ /,/:[@]:[2]="${LIST:[*]:C/ /,/:[@]:[2]}"' + @echo 'LONGLIST:[012..0x12]="${LONGLIST:[012..0x12]}"' mod-squarebrackets-start-end: @echo 'LIST:[1.]="${LIST:[1.]}" is an error' @echo 'LIST:[1..]="${LIST:[1..]}" is an error' + @echo 'LIST:[1.. ]="${LIST:[1.. ]}" is an error' @echo 'LIST:[1..1]="${LIST:[1..1]}"' @echo 'LIST:[1..1.]="${LIST:[1..1.]}" is an error' @echo 'LIST:[1..2]="${LIST:[1..2]}"' @@ -124,6 +128,12 @@ mod-squarebrackets-nested: @echo 'LIST:[$${LIST:[#]}]="${LIST:[${LIST:[#]}]}"' @echo 'LIST:[$${LIST:[$${HASH}]}]="${LIST:[${LIST:[${HASH}]}]}"' +mod-squarebrackets-space: + # As of 2020-11-01, it is possible to have spaces before the numbers + # but not after them. This is an unintended side-effect of using + # strtol for parsing the numbers. + @echo 'LIST:[ -1.. +3]="${LIST:[ -1.. +3]}"' + mod-C-W: @echo 'LIST:C/ /,/="${LIST:C/ /,/}"' @echo 'LIST:C/ /,/W="${LIST:C/ /,/W}"' diff --git a/usr.bin/make/unit-tests/objdir-writable.exp b/usr.bin/make/unit-tests/objdir-writable.exp new file mode 100644 index 000000000..9c507f647 --- /dev/null +++ b/usr.bin/make/unit-tests/objdir-writable.exp @@ -0,0 +1,5 @@ +make warning: TMPDIR/roobj: Permission denied. +/tmp +TMPDIR/roobj +TMPDIR/roobj +exit status 0 diff --git a/usr.bin/make/unit-tests/objdir-writable.mk b/usr.bin/make/unit-tests/objdir-writable.mk new file mode 100644 index 000000000..9fc1c69af --- /dev/null +++ b/usr.bin/make/unit-tests/objdir-writable.mk @@ -0,0 +1,31 @@ +# $NetBSD: objdir-writable.mk,v 1.4 2020/11/14 07:36:00 sjg Exp $ + +# test checking for writable objdir + +RO_OBJDIR?= ${TMPDIR:U/tmp}/roobj + +.if make(do-objdir) +# this should succeed +.OBJDIR: ${RO_OBJDIR} + +do-objdir: +.else +all: no-objdir ro-objdir explicit-objdir + +# make it now +x!= echo; mkdir -p ${RO_OBJDIR}; chmod 555 ${RO_OBJDIR} + +.END: rm-objdir +rm-objdir: + @rmdir ${RO_OBJDIR} + +no-objdir: + @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C /tmp -V .OBJDIR + +ro-objdir: + @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C /tmp -V .OBJDIR MAKE_OBJDIR_CHECK_WRITABLE=no + +explicit-objdir: + @MAKEOBJDIR=/tmp ${.MAKE} -r -f ${MAKEFILE:tA} -C /tmp do-objdir -V .OBJDIR +.endif + diff --git a/usr.bin/make/unit-tests/opt-backwards.exp b/usr.bin/make/unit-tests/opt-backwards.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-backwards.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-backwards.mk b/usr.bin/make/unit-tests/opt-backwards.mk new file mode 100644 index 000000000..bc0b1eff8 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-backwards.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-backwards.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -B command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-chdir.exp b/usr.bin/make/unit-tests/opt-chdir.exp new file mode 100644 index 000000000..d9759cf9e --- /dev/null +++ b/usr.bin/make/unit-tests/opt-chdir.exp @@ -0,0 +1,6 @@ +make: chdir /./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././: File name too long +*** Error code 2 (ignored) +cwd: / +make: chdir /nonexistent: No such file or directory +*** Error code 2 (ignored) +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-chdir.mk b/usr.bin/make/unit-tests/opt-chdir.mk new file mode 100644 index 000000000..20241f027 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-chdir.mk @@ -0,0 +1,27 @@ +# $NetBSD: opt-chdir.mk,v 1.5 2020/11/15 05:43:56 sjg Exp $ +# +# Tests for the -C command line option, which changes the directory at the +# beginning. +# +# This option has been available since 2009-08-27. + +.MAKEFLAGS: -d0 # switch stdout to line-buffered + +all: chdir-filename-too-long +all: chdir-root +all: chdir-nonexistent + +# Try to overflow the internal buffer for .CURDIR, which is curdir. +chdir-filename-too-long: .PHONY .IGNORE + # 5000 slashes, separated by dots: /./././.../././ + @${MAKE} -C ${:U:range=5000:@@/@:ts.} + +# Changing to another directory is possible via the command line. +# In this test, it is the root directory since almost any other directory +# is not guaranteed to exist on every platform. +chdir-root: .PHONY .IGNORE + @MAKE_OBJDIR_CHECK_WRITABLE=no ${MAKE} -C / -V 'cwd: $${.CURDIR}' + +# Trying to change to a nonexistent directory exits immediately. +chdir-nonexistent: .PHONY .IGNORE + @${MAKE} -C /nonexistent diff --git a/usr.bin/make/unit-tests/opt-debug-all.exp b/usr.bin/make/unit-tests/opt-debug-all.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-all.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-all.mk b/usr.bin/make/unit-tests/opt-debug-all.mk new file mode 100644 index 000000000..400189eb6 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-all.mk @@ -0,0 +1,10 @@ +# $NetBSD: opt-debug-all.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dA command line option, which enables all debug options +# except for -dL (lint), since that option is not related to debug logging +# but to static analysis. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-archive.exp b/usr.bin/make/unit-tests/opt-debug-archive.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-archive.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-archive.mk b/usr.bin/make/unit-tests/opt-debug-archive.mk new file mode 100644 index 000000000..d70641f97 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-archive.mk @@ -0,0 +1,9 @@ +# $NetBSD: opt-debug-archive.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -da command line option, which adds debug logging for the +# archive handling. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-cond.exp b/usr.bin/make/unit-tests/opt-debug-cond.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-cond.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-cond.mk b/usr.bin/make/unit-tests/opt-debug-cond.mk new file mode 100644 index 000000000..2b9d1029c --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-cond.mk @@ -0,0 +1,10 @@ +# $NetBSD: opt-debug-cond.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dc command line option, which adds debug logging for the +# evaluation of conditional expressions, such as in .if directives and +# ${cond:?then:else} expressions. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-curdir.exp b/usr.bin/make/unit-tests/opt-debug-curdir.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-curdir.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-curdir.mk b/usr.bin/make/unit-tests/opt-debug-curdir.mk new file mode 100644 index 000000000..3c37d2988 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-curdir.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-debug-curdir.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dC command line option, which does nothing, as of 2020-09-05. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-dir.exp b/usr.bin/make/unit-tests/opt-debug-dir.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-dir.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-dir.mk b/usr.bin/make/unit-tests/opt-debug-dir.mk new file mode 100644 index 000000000..5036a361c --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-dir.mk @@ -0,0 +1,9 @@ +# $NetBSD: opt-debug-dir.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dd command line option, which adds debug logging for +# directory searching and caching. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-errors.exp b/usr.bin/make/unit-tests/opt-debug-errors.exp new file mode 100644 index 000000000..859a431f2 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-errors.exp @@ -0,0 +1,37 @@ +echo '3 spaces'; false +3 spaces + +*** Failed target: fail-spaces +*** Failed command: echo '3 spaces'; false +*** Error code 1 (continuing) +echo \ indented; false + indented + +*** Failed target: fail-escaped-space +*** Failed command: echo \ indented; false +*** Error code 1 (continuing) +echo 'line1 +line2'; false +line1 +line2 + +*** Failed target: fail-newline +*** Failed command: echo 'line1 line2'; false +*** Error code 1 (continuing) +echo 'line1 line2'; false +line1 line2 + +*** Failed target: fail-multiline +*** Failed command: echo 'line1 line2'; false +*** Error code 1 (continuing) +echo 'word1' 'word2'; false +word1 word2 + +*** Failed target: fail-multiline-intention +*** Failed command: echo 'word1' 'word2'; false +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-debug-errors.mk b/usr.bin/make/unit-tests/opt-debug-errors.mk new file mode 100644 index 000000000..1658c6b3c --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-errors.mk @@ -0,0 +1,42 @@ +# $NetBSD: opt-debug-errors.mk,v 1.2 2020/09/06 04:35:03 rillig Exp $ +# +# Tests for the -de command line option, which adds debug logging for +# failed commands and targets. + +.MAKEFLAGS: -de + +all: fail-spaces +all: fail-escaped-space +all: fail-newline +all: fail-multiline +all: fail-multiline-intention + +# XXX: The debug output folds the spaces, showing '3 spaces' instead of +# the correct '3 spaces'. +fail-spaces: + echo '3 spaces'; false + +# XXX: The debug output folds the spaces, showing 'echo \ indented' instead +# of the correct 'echo \ indented'. +fail-escaped-space: + echo \ indented; false + +# XXX: A newline is turned into an ordinary space in the debug log. +fail-newline: + echo 'line1${.newline}line2'; false + +# The line continuations in multiline commands are turned into an ordinary +# space before the command is actually run. +fail-multiline: + echo 'line1\ + line2'; false + +# It is a common style to align the continuation backslashes at the right +# of the lines, usually at column 73. All spaces before the continuation +# backslash are preserved and are usually outside a shell word and thus +# irrelevant. Having these spaces collapsed makes sense to show the command +# in its condensed form. +# +fail-multiline-intention: + echo 'word1' \ + 'word2'; false diff --git a/usr.bin/make/unit-tests/opt-debug-file.exp b/usr.bin/make/unit-tests/opt-debug-file.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-file.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-file.mk b/usr.bin/make/unit-tests/opt-debug-file.mk new file mode 100644 index 000000000..1ed477ef3 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-file.mk @@ -0,0 +1,37 @@ +# $NetBSD: opt-debug-file.mk,v 1.4 2020/10/05 19:27:48 rillig Exp $ +# +# Tests for the -dF command line option, which redirects the debug log +# to a file instead of writing it to stderr. + +# Enable debug logging for variable assignments and evaluation (-dv) +# and redirect the debug logging to the given file. +.MAKEFLAGS: -dvFopt-debug-file.debuglog + +# This output goes to the debug log file. +VAR= value ${:Uexpanded} + +# Hide the logging output for the remaining actions. +# As of 2020-10-03, it is not possible to disable debug logging again. +.MAKEFLAGS: -dF/dev/null + +# Make sure that the debug logging file contains some logging. +DEBUG_OUTPUT:= ${:!cat opt-debug-file.debuglog!} +# Grmbl. Because of the := operator in the above line, the variable +# value contains ${:Uexpanded}. This variable expression is expanded +# upon further processing. Therefore, don't read from untrusted input. +#.MAKEFLAGS: -dc -dFstderr +.if !${DEBUG_OUTPUT:tW:M*VAR = value expanded*} +. error ${DEBUG_OUTPUT} +.endif + +# To get the unexpanded text that was actually written to the debug log +# file, the content of that log file must not be stored in a variable. +# XXX: In the :M modifier, a dollar is escaped as '$$', not '\$'. +.if !${:!cat opt-debug-file.debuglog!:tW:M*VAR = value $${:Uexpanded}*} +. error +.endif + +_!= rm opt-debug-file.debuglog + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-for.exp b/usr.bin/make/unit-tests/opt-debug-for.exp new file mode 100644 index 000000000..ea811b9bf --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-for.exp @@ -0,0 +1,22 @@ +For: new loop 2 +For: end for 2 +For: end for 1 +For: loop body: +. for inner in 1 2 +VAR.${:Ua}${inner}= value +. endfor +For: end for 1 +For: loop body: +VAR.${:Ua}${:U1}= value +For: loop body: +VAR.${:Ua}${:U2}= value +For: loop body: +. for inner in 1 2 +VAR.${:Ub}${inner}= value +. endfor +For: end for 1 +For: loop body: +VAR.${:Ub}${:U1}= value +For: loop body: +VAR.${:Ub}${:U2}= value +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-for.mk b/usr.bin/make/unit-tests/opt-debug-for.mk new file mode 100644 index 000000000..1de770de4 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-for.mk @@ -0,0 +1,26 @@ +# $NetBSD: opt-debug-for.mk,v 1.4 2020/10/05 19:27:48 rillig Exp $ +# +# Tests for the -df command line option, which adds debug logging for +# parsing and evaluating .for loops. + +.MAKEFLAGS: -df + +# XXX: In the debug log, the "new loop 2" appears out of context. +# There should be a "begin loop 1" before, and all these messages should +# contain line number information. +# +# XXX: The "loop body" should print the nesting level as well. +# +# XXX: It is hard to extract any information from the debug log since +# the "begin" and "end" events are not balanced and the nesting level +# is not printed consistently. It would also be helpful to mention the +# actual substitutions, such as "For 1: outer=b". +# +.for outer in a b +. for inner in 1 2 +VAR.${outer}${inner}= value +. endfor +.endfor + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-graph1.exp b/usr.bin/make/unit-tests/opt-debug-graph1.exp new file mode 100644 index 000000000..43be07096 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-graph1.exp @@ -0,0 +1,55 @@ +#*** Input graph: +# all, unmade, type OP_DEPENDS|OP_HAS_COMMANDS, flags none +# made-target, unmade, type OP_DEPENDS, flags none +# made-target-no-sources, unmade, type OP_DEPENDS, flags none +# made-source, unmade, type OP_DEPENDS, flags none +# unmade-target, unmade, type OP_DEPENDS, flags none +# unmade-sources, unmade, type none, flags none +# unmade-silent-source, unmade, type OP_SILENT, flags none +# unmade-target-no-sources, unmade, type OP_DEPENDS, flags none + + +# +# Files that are only sources: +# unmade-sources [unmade-sources] +# unmade-silent-source [unmade-silent-source] .SILENT +#*** Global Variables: +.ALLTARGETS = all made-target made-target-no-sources made-source unmade-target unmade-sources unmade-silent-source unmade-target-no-sources +.CURDIR = +.INCLUDES = +.LIBS = +.MAKE =
+.MAKE.DEPENDFILE =
+.MAKE.GID =
+.MAKE.LEVEL =
+.MAKE.MAKEFILES =
+.MAKE.MAKEFILE_PREFERENCE =
+.MAKE.OS =
+.MAKE.PATH_FILEMON =
+.MAKE.PID =
+.MAKE.PPID =
+.MAKE.UID =
+.MAKEFLAGS = -r -k -d g1 +.MAKEOVERRIDES = +.OBJDIR = +.PATH = . +.TARGETS = +.newline = + +MACHINE =
+MACHINE_ARCH =
+MAKE =
+MFLAGS = -r -k -d g1 +#*** Command-line Variables: +.MAKE.LEVEL.ENV = MAKELEVEL + +#*** Directory Cache: +# Stats: 0 hits 2 misses 0 near misses 0 losers (0%) +# refs hits directory +# 1 0 +# 1 0 . +# 1 0 + +#*** Suffixes: +#*** Transformations: +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-graph1.mk b/usr.bin/make/unit-tests/opt-debug-graph1.mk new file mode 100644 index 000000000..618d49102 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-graph1.mk @@ -0,0 +1,23 @@ +# $NetBSD: opt-debug-graph1.mk,v 1.3 2020/09/05 06:46:12 rillig Exp $ +# +# Tests for the -dg1 command line option, which prints the input +# graph before making anything. + +.MAKEFLAGS: -dg1 + +all: made-target made-target-no-sources + +made-target: made-source + +made-source: + +made-target-no-sources: + +unmade-target: unmade-sources unmade-silent-source + +.SILENT: unmade-silent-source + +unmade-target-no-sources: + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-graph2.exp b/usr.bin/make/unit-tests/opt-debug-graph2.exp new file mode 100644 index 000000000..208990b5a --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-graph2.exp @@ -0,0 +1,93 @@ +: 'Making made-target.' +false +*** Error code 1 (continuing) +false +*** Error code 1 (continuing) +`all' not remade because of errors. +#*** Input graph: +# made-target, made, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_ALLSRC +# +# *** MAIN TARGET *** +# No unmade children +# last modified : made +# parents: all +made-target : + (null) + + +# error-target, error when made, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_ALLSRC +# +# No unmade children +# nonexistent (maybe): error when made +# parents: all +error-target : + (null) + + +# aborted-target, aborted, type OP_DEPENDS|OP_PHONY|OP_DEPS_FOUND|OP_MARK, flags none +# aborted-target-dependency, error when made, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_ALLSRC +# +# No unmade children +# nonexistent (maybe): error when made +# parents: aborted-target +aborted-target-dependency: + (null) + + +# all, aborted, type OP_DEPENDS|OP_DEPS_FOUND, flags CHILDMADE|FORCE +# +# 3 unmade children +# nonexistent (maybe): aborted +all : made-target error-target aborted-target + + +# .END, unmade, type OP_SPECIAL, flags none + + +# +# Files that are only sources: +# .END [.END] +#*** Global Variables: +.ALLTARGETS = made-target error-target aborted-target aborted-target-dependency all .END +.CURDIR = +.INCLUDES = +.LIBS = +.MAKE =
+.MAKE.DEPENDFILE =
+.MAKE.GID =
+.MAKE.LEVEL =
+.MAKE.MAKEFILES =
+.MAKE.MAKEFILE_PREFERENCE =
+.MAKE.OS =
+.MAKE.PATH_FILEMON =
+.MAKE.PID =
+.MAKE.PPID =
+.MAKE.UID =
+.MAKEFLAGS = -r -k -d g2 +.MAKEOVERRIDES = +.OBJDIR = +.PATH = . +.TARGETS = all +.newline = + +MACHINE =
+MACHINE_ARCH =
+MAKE =
+MFLAGS = -r -k -d g2 +#*** Command-line Variables: +.MAKE.LEVEL.ENV = MAKELEVEL +.SHELL =
+ +#*** Directory Cache: +# Stats: 0 hits 4 misses 0 near misses 0 losers (0%) +# refs hits directory +# 1 0 +# 1 0 . +# 1 0 + +#*** Suffixes: +#*** Transformations: + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-debug-graph2.mk b/usr.bin/make/unit-tests/opt-debug-graph2.mk new file mode 100644 index 000000000..49e27569a --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-graph2.mk @@ -0,0 +1,23 @@ +# $NetBSD: opt-debug-graph2.mk,v 1.3 2021/02/02 17:47:56 rillig Exp $ +# +# Tests for the -dg2 command line option, which prints the input +# graph after making everything, or before exiting on error. +# +# Before compat.c 1.222 from 2021-02-02, there was no debug output despite +# the error. + +.MAKEFLAGS: -dg2 + +.MAIN: all + +made-target: .PHONY + : 'Making $@.' + +error-target: .PHONY + false + +aborted-target: .PHONY aborted-target-dependency +aborted-target-dependency: .PHONY + false + +all: made-target error-target aborted-target diff --git a/usr.bin/make/unit-tests/opt-debug-graph3.exp b/usr.bin/make/unit-tests/opt-debug-graph3.exp new file mode 100644 index 000000000..a6b329f6b --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-graph3.exp @@ -0,0 +1,93 @@ +: 'Making made-target.' +false +*** Error code 1 (continuing) +false +*** Error code 1 (continuing) +`all' not remade because of errors. +#*** Input graph: +# made-target, made, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_ALLSRC +# +# *** MAIN TARGET *** +# No unmade children +# last modified : made +# parents: all +made-target : + (null) + + +# error-target, error when made, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_ALLSRC +# +# No unmade children +# nonexistent (maybe): error when made +# parents: all +error-target : + (null) + + +# aborted-target, aborted, type OP_DEPENDS|OP_PHONY|OP_DEPS_FOUND|OP_MARK, flags none +# aborted-target-dependency, error when made, type OP_DEPENDS|OP_PHONY|OP_HAS_COMMANDS|OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_ALLSRC +# +# No unmade children +# nonexistent (maybe): error when made +# parents: aborted-target +aborted-target-dependency: + (null) + + +# all, aborted, type OP_DEPENDS|OP_DEPS_FOUND, flags CHILDMADE|FORCE +# +# 3 unmade children +# nonexistent (maybe): aborted +all : made-target error-target aborted-target + + +# .END, unmade, type OP_SPECIAL, flags none + + +# +# Files that are only sources: +# .END [.END] +#*** Global Variables: +.ALLTARGETS = made-target error-target aborted-target aborted-target-dependency all .END +.CURDIR = +.INCLUDES = +.LIBS = +.MAKE =
+.MAKE.DEPENDFILE =
+.MAKE.GID =
+.MAKE.LEVEL =
+.MAKE.MAKEFILES =
+.MAKE.MAKEFILE_PREFERENCE =
+.MAKE.OS =
+.MAKE.PATH_FILEMON =
+.MAKE.PID =
+.MAKE.PPID =
+.MAKE.UID =
+.MAKEFLAGS = -r -k -d g3 +.MAKEOVERRIDES = +.OBJDIR = +.PATH = . +.TARGETS = all +.newline = + +MACHINE =
+MACHINE_ARCH =
+MAKE =
+MFLAGS = -r -k -d g3 +#*** Command-line Variables: +.MAKE.LEVEL.ENV = MAKELEVEL +.SHELL =
+ +#*** Directory Cache: +# Stats: 0 hits 4 misses 0 near misses 0 losers (0%) +# refs hits directory +# 1 0 +# 1 0 . +# 1 0 + +#*** Suffixes: +#*** Transformations: + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-debug-graph3.mk b/usr.bin/make/unit-tests/opt-debug-graph3.mk new file mode 100644 index 000000000..8cb99c59b --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-graph3.mk @@ -0,0 +1,23 @@ +# $NetBSD: opt-debug-graph3.mk,v 1.3 2021/02/02 17:47:56 rillig Exp $ +# +# Tests for the -dg3 command line option, which prints the input +# graph before exiting on error. +# +# Before compat.c 1.222 from 2021-02-02, there was no debug output despite +# the error. + +.MAKEFLAGS: -dg3 + +.MAIN: all + +made-target: .PHONY + : 'Making $@.' + +error-target: .PHONY + false + +aborted-target: .PHONY aborted-target-dependency +aborted-target-dependency: .PHONY + false + +all: made-target error-target aborted-target diff --git a/usr.bin/make/unit-tests/opt-debug-hash.exp b/usr.bin/make/unit-tests/opt-debug-hash.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-hash.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-hash.mk b/usr.bin/make/unit-tests/opt-debug-hash.mk new file mode 100644 index 000000000..c8cb99acd --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-hash.mk @@ -0,0 +1,10 @@ +# $NetBSD: opt-debug-hash.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dh command line option, which adds debug logging for +# hash tables. Even more detailed logging is available by compiling +# make with -DDEBUG_HASH_LOOKUP. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-jobs.exp b/usr.bin/make/unit-tests/opt-debug-jobs.exp new file mode 100644 index 000000000..e79d8e94a --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-jobs.exp @@ -0,0 +1,27 @@ +job_pipe -1 -1, maxjobs 1, tokens 1, compat 0 +Job_TokenWithdraw(): aborting 0, running 0 +() withdrew token +echo ": expanded expression" +{ : expanded expression +} || exit $? +echo ": variable" +{ : variable +} || exit $? +echo ": 'single' and \"double\" quotes" +{ : 'single' and "double" quotes +} || exit $? +{ sleep 1 +} || exit $? +Running all + Command: +JobExec(all): pid added to jobs table +job table @ job started +job 0, status 3, flags ---, pid +: expanded expression +: variable +: 'single' and "double" quotes +Process exited/stopped status 0. +JobFinish: [all], status 0 +Job_TokenWithdraw(): aborting 0, running 0 +() withdrew token +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-jobs.mk b/usr.bin/make/unit-tests/opt-debug-jobs.mk new file mode 100644 index 000000000..f3732df7e --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-jobs.mk @@ -0,0 +1,33 @@ +# $NetBSD: opt-debug-jobs.mk,v 1.5 2020/11/12 21:54:52 rillig Exp $ +# +# Tests for the -dj command line option, which adds debug logging about +# running jobs in multiple shells. + +.MAKEFLAGS: -dj + +# Run in parallel mode since the debug logging is more interesting there +# than in compat mode. +.MAKEFLAGS: -j1 + +all: + # Only the actual command is logged. + # To see the evaluation of the variable expressions, use -dv. + : ${:Uexpanded} expression + + # Undefined variables expand to empty strings. + # Multiple spaces are preserved in the command, as they might be + # significant. + : ${UNDEF} variable + + # In the debug output, single quotes are not escaped, even though + # the whole command is enclosed in single quotes as well. + # This allows to copy and paste the whole command, without having + # to unescape anything. + : 'single' and "double" quotes + + # Avoid a race condition in the debug output. Without sleeping, + # it is not guaranteed that the two lines "exited/stopped" and + # "JobFinish" are output earlier than the stdout of the actual shell + # commands. The '@' prefix avoids that this final command gets into + # another race condition with the "exited/stopped" line. + @sleep 1 diff --git a/usr.bin/make/unit-tests/opt-debug-lint.exp b/usr.bin/make/unit-tests/opt-debug-lint.exp new file mode 100644 index 000000000..05b341b30 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-lint.exp @@ -0,0 +1,8 @@ +make: "opt-debug-lint.mk" line 19: Variable "X" is undefined +make: "opt-debug-lint.mk" line 41: Variable "UNDEF" is undefined +make: "opt-debug-lint.mk" line 61: Missing delimiter ':' after modifier "L" +make: "opt-debug-lint.mk" line 61: Missing delimiter ':' after modifier "P" +make: "opt-debug-lint.mk" line 69: Unknown modifier "${" +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-debug-lint.mk b/usr.bin/make/unit-tests/opt-debug-lint.mk new file mode 100644 index 000000000..155e1a3de --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-lint.mk @@ -0,0 +1,95 @@ +# $NetBSD: opt-debug-lint.mk,v 1.14 2021/03/14 10:57:12 rillig Exp $ +# +# Tests for the -dL command line option, which runs additional checks +# to catch common mistakes, such as unclosed variable expressions. + +.MAKEFLAGS: -dL + +# Since 2020-09-13, undefined variables that are used on the left-hand side +# of a condition at parse time get a proper error message. Before, the +# error message was "Malformed conditional" only, which was wrong and +# misleading. The form of the condition is totally fine, it's the evaluation +# that fails. +# +# Since 2020-09-13, the "Malformed conditional" error message is not printed +# anymore. +# +# See also: +# cond-undef-lint.mk +.if $X +. error +.endif + +# The dynamic variables like .TARGET are treated specially. It does not make +# sense to expand them in the global scope since they will never be defined +# there under normal circumstances. Therefore they expand to a string that +# will later be expanded correctly, when the variable is evaluated again in +# the scope of an actual target. +# +# Even though the "@" variable is not defined at this point, this is not an +# error. In all practical cases, this is no problem. This particular test +# case is made up and unrealistic. +.if $@ != "\$(.TARGET)" +. error +.endif + +# Since 2020-09-13, Var_Parse properly reports errors for undefined variables, +# but only in lint mode. Before, it had only silently returned var_Error, +# hoping for the caller to print an error message. This resulted in the +# well-known "Malformed conditional" error message, even though the +# conditional was well-formed and the only error was an undefined variable. +.if ${UNDEF} +. error +.endif + +# Since 2020-09-14, dependency lines may contain undefined variables. +# Before, undefined variables were forbidden, but this distinction was not +# observable from the outside of the function Var_Parse. +${UNDEF}: ${UNDEF} + +# In a condition that has a defined(UNDEF) guard, all guarded conditions +# may assume that the variable is defined since they will only be evaluated +# if the variable is indeed defined. Otherwise they are only parsed, and +# for parsing it doesn't make a difference whether the variable is defined +# or not. +.if defined(UNDEF) && exists(${UNDEF}) +. error +.endif + +# Since 2020-10-03, in lint mode the variable modifier must be separated +# by colons. See varparse-mod.mk. +.if ${value:LPL} != "value" +. error +.endif + +# Between 2020-10-03 and var.c 1.752 from 2020-12-20, in lint mode the +# variable modifier had to be separated by colons. This was wrong though +# since make always fell back trying to parse the indirect modifier as a +# SysV modifier. +.if ${value:${:UL}PL} != "LPL}" # FIXME: "LPL}" is unexpected here. +. error ${value:${:UL}PL} +.endif + +# Typically, an indirect modifier is followed by a colon or the closing +# brace. This one isn't, therefore make falls back to parsing it as the SysV +# modifier ":lue=lid". +.if ${value:L:${:Ulue}=${:Ulid}} != "valid" +. error +.endif + +# In lint mode, the whole variable text is evaluated to check for unclosed +# expressions and unknown operators. During this check, the subexpression +# '${:U2}' is not expanded, instead it is copied verbatim into the regular +# expression, leading to '.*=.{1,${:U2}}$'. +# +# Before var.c 1.856 from 2021-03-14, this regular expression was then +# compiled even though that was not necessary for checking the syntax at the +# level of variable expressions. The unexpanded '$' then resulted in a wrong +# error message. +# +# This only happened in lint mode since in default mode the early check for +# unclosed expressions and unknown modifiers is skipped. +# +# See VarCheckSyntax, ApplyModifier_Regex. +# +VARMOD_REGEX= ${:UA=111 B=222 C=33:C/.*=.{1,${:U2}}$//g} diff --git a/usr.bin/make/unit-tests/opt-debug-loud.exp b/usr.bin/make/unit-tests/opt-debug-loud.exp new file mode 100644 index 000000000..9e572fba2 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-loud.exp @@ -0,0 +1,3 @@ +echo all-word +all-word +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-loud.mk b/usr.bin/make/unit-tests/opt-debug-loud.mk new file mode 100644 index 000000000..38a3c7d7a --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-loud.mk @@ -0,0 +1,22 @@ +# $NetBSD: opt-debug-loud.mk,v 1.4 2020/10/05 19:27:48 rillig Exp $ +# +# Tests for the -dl command line option, which prints the commands before +# running them, ignoring the command line option for silent mode (-s) as +# well as the .SILENT special source and target, as well as the '@' prefix +# for shell commands. + +.MAKEFLAGS: -dl -s +.SILENT: + +# The -dl command line option does not affect commands that are run during +# variable expansion, such as :!cmd! or :sh. +.if ${:!echo word!} != "word" +. error +.endif + +all: .SILENT + # Even though the command line option -s is given, .SILENT is set + # for all targets and for this target in particular, the command + # is still printed. The -dl debugging option is stronger than all + # of these. + @echo all-word diff --git a/usr.bin/make/unit-tests/opt-debug-making.exp b/usr.bin/make/unit-tests/opt-debug-making.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-making.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-making.mk b/usr.bin/make/unit-tests/opt-debug-making.mk new file mode 100644 index 000000000..bb37a9932 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-making.mk @@ -0,0 +1,9 @@ +# $NetBSD: opt-debug-making.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dm command line option, which adds debug logging about +# making targets, including modification dates. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-meta.exp b/usr.bin/make/unit-tests/opt-debug-meta.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-meta.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-meta.mk b/usr.bin/make/unit-tests/opt-debug-meta.mk new file mode 100644 index 000000000..fb4a0bf49 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-meta.mk @@ -0,0 +1,9 @@ +# $NetBSD: opt-debug-meta.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dM command line option, which adds debug logging about +# "meta" mode decisions about targets. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-no-rm.exp b/usr.bin/make/unit-tests/opt-debug-no-rm.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-no-rm.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-no-rm.mk b/usr.bin/make/unit-tests/opt-debug-no-rm.mk new file mode 100644 index 000000000..fd185cca7 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-no-rm.mk @@ -0,0 +1,13 @@ +# $NetBSD: opt-debug-no-rm.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dn command line option, which prevents the temporary +# command scripts from being removed from the temporary directory. + +# TODO: Implementation + +# TODO: Does this apply to non-jobs mode? +# TODO: Does this apply to jobs mode? +# TODO: Are the generated filenames predictable? + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-parse.exp b/usr.bin/make/unit-tests/opt-debug-parse.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-parse.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-parse.mk b/usr.bin/make/unit-tests/opt-debug-parse.mk new file mode 100644 index 000000000..3427b68be --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-parse.mk @@ -0,0 +1,9 @@ +# $NetBSD: opt-debug-parse.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dp command line option, which adds debug logging about +# makefile parsing. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-suff.exp b/usr.bin/make/unit-tests/opt-debug-suff.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-suff.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-suff.mk b/usr.bin/make/unit-tests/opt-debug-suff.mk new file mode 100644 index 000000000..6ec466c90 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-suff.mk @@ -0,0 +1,11 @@ +# $NetBSD: opt-debug-suff.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -ds command line option, which adds debug logging about +# suffix-transformation rules such as .c.o. + +# TODO: Implementation + +# TODO: What about %.o: %.c? + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-targets.exp b/usr.bin/make/unit-tests/opt-debug-targets.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-targets.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-targets.mk b/usr.bin/make/unit-tests/opt-debug-targets.mk new file mode 100644 index 000000000..c99a6eaf4 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-targets.mk @@ -0,0 +1,11 @@ +# $NetBSD: opt-debug-targets.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dt command line option, which adds debug logging about +# target list maintenance. +# +# TODO: What exactly does "maintenance" mean? + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-var.exp b/usr.bin/make/unit-tests/opt-debug-var.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-var.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-var.mk b/usr.bin/make/unit-tests/opt-debug-var.mk new file mode 100644 index 000000000..4d0ef9447 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-var.mk @@ -0,0 +1,9 @@ +# $NetBSD: opt-debug-var.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dv command line option, which adds debug logging about +# variable assignment and evaluation. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-varraw.exp b/usr.bin/make/unit-tests/opt-debug-varraw.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-varraw.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-varraw.mk b/usr.bin/make/unit-tests/opt-debug-varraw.mk new file mode 100644 index 000000000..b334a2a89 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-varraw.mk @@ -0,0 +1,12 @@ +# $NetBSD: opt-debug-varraw.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dV command line option, which forces the -V option to +# print the raw values of variables. + +# TODO: Does this make -V and -v equivalent, or are there any other subtle +# differences? + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug-x-trace.exp b/usr.bin/make/unit-tests/opt-debug-x-trace.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-x-trace.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug-x-trace.mk b/usr.bin/make/unit-tests/opt-debug-x-trace.mk new file mode 100644 index 000000000..0936ba506 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug-x-trace.mk @@ -0,0 +1,10 @@ +# $NetBSD: opt-debug-x-trace.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $ +# +# Tests for the -dx command line option, which runs shell commands with +# the -x option, thereby printing the actual commands as they are +# executed. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-debug.exp b/usr.bin/make/unit-tests/opt-debug.exp new file mode 100644 index 000000000..52a36c71b --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug.exp @@ -0,0 +1,4 @@ +Global:VAR = value +Global:.MAKEFLAGS = -r -k -d v -d +Global:.MAKEFLAGS = -r -k -d v -d 0 +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-debug.mk b/usr.bin/make/unit-tests/opt-debug.mk new file mode 100644 index 000000000..973085ba2 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-debug.mk @@ -0,0 +1,14 @@ +# $NetBSD: opt-debug.mk,v 1.5 2020/10/05 19:27:48 rillig Exp $ +# +# Tests for the -d command line option, which controls debug logging. + +# Enable debug logging for the variables (var.c). +.MAKEFLAGS: -dv + +VAR= value + +# Disable all debug logging again. +.MAKEFLAGS: -d0 # -d0 is available since 2020-10-03 + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-define.exp b/usr.bin/make/unit-tests/opt-define.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-define.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-define.mk b/usr.bin/make/unit-tests/opt-define.mk new file mode 100644 index 000000000..ce0516ba4 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-define.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-define.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -D command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-env.exp b/usr.bin/make/unit-tests/opt-env.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-env.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-env.mk b/usr.bin/make/unit-tests/opt-env.mk new file mode 100644 index 000000000..32e95ef41 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-env.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-env.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -e command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-file.exp b/usr.bin/make/unit-tests/opt-file.exp new file mode 100644 index 000000000..76a832949 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-file.exp @@ -0,0 +1,12 @@ +value +value +line-with-trailing-whitespace +make: "(stdin)" line 1: Zero byte read from file +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-file.mk b/usr.bin/make/unit-tests/opt-file.mk new file mode 100644 index 000000000..3ab8ef4e3 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-file.mk @@ -0,0 +1,105 @@ +# $NetBSD: opt-file.mk,v 1.11 2020/12/22 08:57:23 rillig Exp $ +# +# Tests for the -f command line option. + +# TODO: Implementation + +all: .PHONY +all: file-ending-in-backslash +all: file-ending-in-backslash-mmap +all: line-with-trailing-whitespace +all: file-containing-null-byte + +# Passing '-' as the filename reads from stdin. This is unusual but possible. +# +# In the unlikely case where a file ends in a backslash instead of a newline, +# that backslash is trimmed. See ParseGetLine. +# +# make-2014.01.01.00.00.00 invoked undefined behavior, reading text from +# outside of the file buffer. +# +# printf '%s' 'VAR=value\' \ +# | MALLOC_OPTIONS=JA make-2014.01.01.00.00.00 -r -f - -V VAR -dA 2>&1 \ +# | less +# +# The debug output shows how make happily uses freshly allocated memory (the +# ) and already freed memory ('Z'). +# +# ParseReadLine (1): 'VAR=value\' +# Global:VAR = value\value\ +# ParseReadLine (2): 'alue\' +# ParseDoDependency(alue\) +# make-2014.01.01.00.00.00: "(stdin)" line 2: Need an operator +# ParseReadLine (3): 'ZZZZZZZZZZZZZZZZ' +# ParseDoDependency(ZZZZZZZZZZZZZZZZ) +# +file-ending-in-backslash: .PHONY + @printf '%s' 'VAR=value\' \ + | ${MAKE} -r -f - -V VAR + +# Between parse.c 1.170 from 2010-12-25 and parse.c 1.511 from 2020-12-22, +# there was an out-of-bounds write in ParseGetLine, where line_end pointed at +# the end of the allocated buffer, in the special case where loadedfile_mmap +# had not added the final newline character. +file-ending-in-backslash-mmap: .PHONY + @printf '%s' 'VAR=value\' > opt-file-backslash + @${MAKE} -r -f opt-file-backslash -V VAR + @rm opt-file-backslash + +# Since parse.c 1.511 from 2020-12-22, an assertion in ParseGetLine failed +# for lines that contained trailing whitespace. Worked around in parse.c +# 1.513, properly fixed in parse.c 1.514. +line-with-trailing-whitespace: .PHONY + @printf '%s' 'VAR=$@ ' > opt-file-trailing-whitespace + @${MAKE} -r -f opt-file-trailing-whitespace -V VAR + @rm opt-file-trailing-whitespace + +# If a makefile contains null bytes, it is an error. Throughout the history +# of make, the behavior has changed several times, sometimes intentionally, +# sometimes by accident. +# +# echo 'VAR=value' | tr 'l' '\0' > zero-byte.in +# printf '%s\n' 'all:' ': VAR=${VAR:Q}' >> zero-byte.in +# +# for year in $(seq 2003 2020); do +# echo $year: +# make-$year.01.01.00.00.00 -r -f zero-byte.in +# echo "exit status $?" +# echo +# done 2>&1 \ +# | sed "s,$PWD/,.," +# +# This program generated the following output: +# +# 2003 to 2007: +# exit status 0 +# +# 2008 to 2010: +# make: "zero-byte.in" line 1: Zero byte read from file +# make: Fatal errors encountered -- cannot continue +# +# make: stopped in . +# exit status 1 +# +# 2011 to 2013: +# make: no target to make. +# +# make: stopped in . +# exit status 2 +# +# 2014 to 2020-12-06: +# make: "zero-byte.in" line 1: warning: Zero byte read from file, skipping rest of line. +# exit status 0 +# +# Since 2020-12-07: +# make: "zero-byte.in" line 1: Zero byte read from file +# make: Fatal errors encountered -- cannot continue +# make: stopped in . +# exit status 1 +file-containing-null-byte: .PHONY + @printf '%s\n' 'VAR=value' 'VAR2=VALUE2' \ + | tr 'l' '\0' \ + | ${MAKE} -r -f - -V VAR -V VAR2 + +all: + : Making ${.TARGET} diff --git a/usr.bin/make/unit-tests/opt-ignore.exp b/usr.bin/make/unit-tests/opt-ignore.exp new file mode 100644 index 000000000..7d7c437ff --- /dev/null +++ b/usr.bin/make/unit-tests/opt-ignore.exp @@ -0,0 +1,12 @@ +dependency 1 +*** Error code 1 (ignored) +dependency 2 +*** Error code 7 (ignored) +dependency 3 +other 1 +*** Error code 1 (ignored) +other 2 +main 1 +*** Error code 1 (ignored) +main 2 +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-ignore.mk b/usr.bin/make/unit-tests/opt-ignore.mk new file mode 100644 index 000000000..f776e8a27 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-ignore.mk @@ -0,0 +1,33 @@ +# $NetBSD: opt-ignore.mk,v 1.5 2020/11/09 20:50:56 rillig Exp $ +# +# Tests for the -i command line option, which ignores the exit status of the +# shell commands, and just continues with the next command, even from the same +# target. +# +# Is there a situation in which this option is useful? +# +# Why are the "Error code" lines all collected at the bottom of the output +# file, where they cannot be related to the individual shell commands that +# failed? + +.MAKEFLAGS: -d0 # switch stdout to being line-buffered +.MAKEFLAGS: -i + +all: dependency other + +dependency: + @echo dependency 1 + @false + @echo dependency 2 + @:; exit 7 + @echo dependency 3 + +other: + @echo other 1 + @false + @echo other 2 + +all: + @echo main 1 + @false + @echo main 2 diff --git a/usr.bin/make/unit-tests/opt-include-dir.exp b/usr.bin/make/unit-tests/opt-include-dir.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-include-dir.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-include-dir.mk b/usr.bin/make/unit-tests/opt-include-dir.mk new file mode 100644 index 000000000..d61a6c979 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-include-dir.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-include-dir.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -I command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-jobs-internal.exp b/usr.bin/make/unit-tests/opt-jobs-internal.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-jobs-internal.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-jobs-internal.mk b/usr.bin/make/unit-tests/opt-jobs-internal.mk new file mode 100644 index 000000000..5426807ca --- /dev/null +++ b/usr.bin/make/unit-tests/opt-jobs-internal.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-jobs-internal.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the (intentionally undocumented) -J command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-jobs-no-action.exp b/usr.bin/make/unit-tests/opt-jobs-no-action.exp new file mode 100644 index 000000000..8556fa3bf --- /dev/null +++ b/usr.bin/make/unit-tests/opt-jobs-no-action.exp @@ -0,0 +1,61 @@ +begin explain +# .echoOff +# .echoTmpl +echo "false regular" +# .runChkTmpl +{ false regular +} || exit $? +# .echoOn +# .runChkTmpl +{ : silent +} || exit $? +# .echoOn +false ignore-errors +echo run despite the -n option +run despite the -n option +end explain + +begin combined + +silent=no always=no ignerr=no +# .echoOff +# .echoTmpl +echo "echo running" +# .runChkTmpl +{ echo running +} || exit $? +# .echoOn + +silent=no always=no ignerr=yes +echo running; false + +silent=no always=yes ignerr=no +echo running +running + +silent=no always=yes ignerr=yes +echo running; false +running +*** Error code 1 (ignored) + +silent=yes always=no ignerr=no +# .runChkTmpl +{ echo running +} || exit $? +# .echoOn + +silent=yes always=no ignerr=yes +echo running; false +# .echoOn + +silent=yes always=yes ignerr=no +echo running +running + +silent=yes always=yes ignerr=yes +echo running; false +running +*** Error code 1 (ignored) + +end combined +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-jobs-no-action.mk b/usr.bin/make/unit-tests/opt-jobs-no-action.mk new file mode 100644 index 000000000..a75fc38cf --- /dev/null +++ b/usr.bin/make/unit-tests/opt-jobs-no-action.mk @@ -0,0 +1,102 @@ +# $NetBSD: opt-jobs-no-action.mk,v 1.8 2020/12/10 23:54:41 rillig Exp $ +# +# Tests for the combination of the options -j and -n, which prints the +# commands instead of actually running them. +# +# The format of the output differs from the output of only the -n option, +# without the -j. This is because all this code is implemented twice, once +# in compat.c and once in job.c. +# +# See also: +# opt-jobs.mk +# The corresponding tests without the -n option +# opt-no-action-combined.mk +# The corresponding tests without the -j option + +.MAKEFLAGS: -j1 -n + +# Change the templates for running the commands in jobs mode, to make it +# easier to see what actually happens. +# +# The shell attributes are handled by Job_ParseShell. +# The shell attributes 'quiet' and 'echo' don't need a trailing newline, +# this is handled by the [0] != '\0' checks in Job_ParseShell. +# The '\#' is handled by ParseGetLine. +# The '\n' is handled by Str_Words in Job_ParseShell. +# The '$$' is handled by Var_Subst in ParseDependency. +.SHELL: \ + name=sh \ + path=${.SHELL} \ + quiet="\# .echoOff" \ + echo="\# .echoOn" \ + filter="\# .noPrint\n" \ + check="\# .echoTmpl\n""echo \"%s\"\n" \ + ignore="\# .runIgnTmpl\n""%s\n" \ + errout="\# .runChkTmpl\n""{ %s \n} || exit $$?\n" + +all: explained combined +.ORDER: explained combined + +# Explain the most basic cases in detail. +explained: .PHONY + @+echo hide-from-output 'begin explain' + + # The following command is regular, it is printed twice: + # - first using the template shell.echoTmpl, + # - then using the template shell.runChkTmpl. + false regular + + # The following command is silent, it is printed once, using the + # template shell.runChkTmpl. + @: silent + + # The following command ignores errors, it is printed once, using + # the default template for cmdTemplate, which is "%s\n". + # XXX: Why is it not printed using shell.echoTmpl as well? + # XXX: The '-' should not influence the echoing of the command. + -false ignore-errors + + # The following command ignores the -n command line option, it is + # not handled by the Job module but by the Compat module, see the + # '!silent' in Compat_RunCommand. + +echo run despite the -n option + + @+echo hide-from-output 'end explain' + @+echo hide-from-output + + +# Test all combinations of the 3 RunFlags. +# +# TODO: Closely inspect the output whether it makes sense. +# XXX: silent=no always=no ignerr={no,yes} should be almost the same. +# +SILENT.no= # none +SILENT.yes= @ +ALWAYS.no= # none +ALWAYS.yes= + +IGNERR.no= echo running +IGNERR.yes= -echo running; false +# +combined: combined-begin + +combined-begin: .PHONY + @+echo hide-from-output 'begin combined' + @+echo hide-from-output + +.for silent in no yes +. for always in no yes +. for ignerr in no yes +. for target in combined-silent-${silent}-always-${always}-ignerr-${ignerr} +combined: .WAIT ${target} .WAIT +${target}: .PHONY + @+echo hide-from-output silent=${silent} always=${always} ignerr=${ignerr} + ${SILENT.${silent}}${ALWAYS.${always}}${IGNERR.${ignerr}} + @+echo hide-from-output +. endfor +. endfor +. endfor +.endfor + +combined: combined-end +combined-end: .PHONY + @+echo hide-from-output 'end combined' diff --git a/usr.bin/make/unit-tests/opt-jobs.exp b/usr.bin/make/unit-tests/opt-jobs.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-jobs.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-jobs.mk b/usr.bin/make/unit-tests/opt-jobs.mk new file mode 100644 index 000000000..7d54d08a8 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-jobs.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-jobs.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -j command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-keep-going-multiple.exp b/usr.bin/make/unit-tests/opt-keep-going-multiple.exp new file mode 100644 index 000000000..6d1bec189 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-keep-going-multiple.exp @@ -0,0 +1,9 @@ +false fail1 +*** Error code 1 (continuing) +false fail2 +*** Error code 1 (continuing) +true succeed + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-keep-going-multiple.mk b/usr.bin/make/unit-tests/opt-keep-going-multiple.mk new file mode 100644 index 000000000..cc08ccfb8 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-keep-going-multiple.mk @@ -0,0 +1,21 @@ +# $NetBSD: opt-keep-going-multiple.mk,v 1.1 2020/12/07 01:32:04 rillig Exp $ +# +# Tests for the -k command line option, which stops building a target as soon +# as an error is detected, but continues building the other, independent +# targets, as far as possible. +# +# Until 2020-12-07, the exit status of make depended only on the last of the +# main targets. Even if the first few targets could not be made, make +# nevertheless exited with status 0. + +.MAKEFLAGS: -k +.MAKEFLAGS: fail1 fail2 succeed + +fail1 fail2: .PHONY + false ${.TARGET} + +succeed: .PHONY + true ${.TARGET} + +.END: + : The end. diff --git a/usr.bin/make/unit-tests/opt-keep-going.exp b/usr.bin/make/unit-tests/opt-keep-going.exp new file mode 100644 index 000000000..2dbeb9927 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-keep-going.exp @@ -0,0 +1,9 @@ +dependency 1 +*** Error code 1 (continuing) +other 1 +*** Error code 1 (continuing) +`all' not remade because of errors. + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-keep-going.mk b/usr.bin/make/unit-tests/opt-keep-going.mk new file mode 100644 index 000000000..8a5e079ef --- /dev/null +++ b/usr.bin/make/unit-tests/opt-keep-going.mk @@ -0,0 +1,31 @@ +# $NetBSD: opt-keep-going.mk,v 1.6 2020/12/07 00:53:30 rillig Exp $ +# +# Tests for the -k command line option, which stops building a target as soon +# as an error is detected, but continues building the other, independent +# targets, as far as possible. +# +# Until 2020-12-07, if a dependency of the main target failed, the exit +# status was nevertheless 0, which was wrong since the main targets could +# not be made. This was only wrong in -k mode combined with compat mode. + +.MAKEFLAGS: -d0 # switch stdout to being line-buffered +.MAKEFLAGS: -k + +all: dependency other + +dependency: + @echo dependency 1 + @false + @echo dependency 2 + @:; exit 7 + @echo dependency 3 + +other: + @echo other 1 + @false + @echo other 2 + +all: + @echo main 1 + @false + @echo main 2 diff --git a/usr.bin/make/unit-tests/opt-m-include-dir.exp b/usr.bin/make/unit-tests/opt-m-include-dir.exp new file mode 100644 index 000000000..bce0e4be0 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-m-include-dir.exp @@ -0,0 +1,2 @@ +ok +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-m-include-dir.mk b/usr.bin/make/unit-tests/opt-m-include-dir.mk new file mode 100644 index 000000000..6e0801390 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-m-include-dir.mk @@ -0,0 +1,61 @@ +# $NetBSD: opt-m-include-dir.mk,v 1.4 2020/09/01 20:14:34 rillig Exp $ +# +# Tests for the -m command line option, which adds a directory to the +# search path for the .include <...> directive. +# +# The .../canary.mk special argument starts searching in the current +# directory and walks towards the file system root, until it finds a +# directory that contains a file called canary.mk. +# +# To set up this scenario, the file step2.mk is created deep in a hierarchy +# of subdirectories. Another file called opt-m-step3.mk is created a few +# steps up in the directory hierarchy, serving as the canary file. +# +# Next to the canary file, there is opt-m-step3.mk. This file is found +# by mentioning its simple name in an .include directive. It defines the +# target "step2" that is needed by "step2.mk". + +.if ${.PARSEFILE:T} == "opt-m-include-dir.mk" + +# Set up the other files needed for this test. + +TEST_DIR:= ${.PARSEFILE:R}.tmp/sub/sub/sub/workdir +CANARY_FILE:= ${.PARSEFILE:R}.tmp/sub/opt-m-canary.mk +ACTUAL_FILE:= ${.PARSEFILE:R}.tmp/sub/opt-m-step3.mk + +_!= mkdir -p ${TEST_DIR} +_!= > ${CANARY_FILE} +_!= cp ${MAKEFILE} ${TEST_DIR}/step2.mk +_!= cp ${MAKEFILE} ${ACTUAL_FILE} + +step1: + @${.MAKE} -C ${TEST_DIR} -f step2.mk step2 + +.END: + @rm -rf ${MAKEFILE:R}.tmp + +.elif ${.PARSEFILE:T} == "step2.mk" + +# This is the file deep in the directory hierarchy. It sets up the +# search path for the .include <...> directive and then includes a +# single file from that search path. + +# This option adds .tmp/sub to the search path for .include <...>. +.MAKEFLAGS: -m .../opt-m-canary.mk + +# This option does not add any directory to the search path since the +# canary file does not exist. +.MAKEFLAGS: -m .../does-not-exist + +.include + +.elif ${.PARSEFILE:T} == "opt-m-step3.mk" + +# This file is included by step2.mk. + +step2: + @echo ok + +.else +. error +.endif diff --git a/usr.bin/make/unit-tests/opt-no-action-at-all.exp b/usr.bin/make/unit-tests/opt-no-action-at-all.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action-at-all.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-no-action-at-all.mk b/usr.bin/make/unit-tests/opt-no-action-at-all.mk new file mode 100644 index 000000000..6ab385946 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action-at-all.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-no-action-at-all.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -N command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-no-action-runflags.exp b/usr.bin/make/unit-tests/opt-no-action-runflags.exp new file mode 100644 index 000000000..33b311228 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action-runflags.exp @@ -0,0 +1,34 @@ +begin combined + +silent=no always=no ignerr=no +echo running + +silent=no always=no ignerr=yes +echo running; false + +silent=no always=yes ignerr=no +echo running +running + +silent=no always=yes ignerr=yes +echo running; false +running +*** Error code 1 (ignored) + +silent=yes always=no ignerr=no +echo running + +silent=yes always=no ignerr=yes +echo running; false + +silent=yes always=yes ignerr=no +echo running +running + +silent=yes always=yes ignerr=yes +echo running; false +running +*** Error code 1 (ignored) + +end combined +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-no-action-runflags.mk b/usr.bin/make/unit-tests/opt-no-action-runflags.mk new file mode 100644 index 000000000..61ae7b2bf --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action-runflags.mk @@ -0,0 +1,32 @@ +# $NetBSD: opt-no-action-runflags.mk,v 1.1 2020/12/09 07:57:52 rillig Exp $ +# +# Tests for the -n command line option, which runs almost no commands, +# combined with the RunFlags '@', '-', '+' for individual commands. +# +# See also: +# opt-jobs-no-action.mk +# The corresponding test with the -j option + +.MAKEFLAGS: -n + +all: .PHONY combined + +SILENT.no= # none +SILENT.yes= @ +ALWAYS.no= # none +ALWAYS.yes= + +IGNERR.no= echo running +IGNERR.yes= -echo running; false +# +combined: .PHONY + @+echo hide-from-output 'begin $@'; echo +.for silent in no yes +. for always in no yes +. for ignerr in no yes + @+echo hide-from-output silent=${silent} always=${always} ignerr=${ignerr} + ${SILENT.${silent}}${ALWAYS.${always}}${IGNERR.${ignerr}} + @+echo hide-from-output +. endfor +. endfor +.endfor + @+echo hide-from-output 'end $@' diff --git a/usr.bin/make/unit-tests/opt-no-action-touch.exp b/usr.bin/make/unit-tests/opt-no-action-touch.exp new file mode 100644 index 000000000..247bd7fb4 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action-touch.exp @@ -0,0 +1,11 @@ +echo ": Making opt-touch-phony." +{ : Making opt-touch-phony. +} || exit $? +echo 'Making opt-touch-make.' +Making opt-touch-make. +echo ": Making opt-touch-regular." +{ : Making opt-touch-regular. +} || exit $? +`opt-touch-join' is up to date. +`opt-touch-use' is up to date. +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-no-action-touch.mk b/usr.bin/make/unit-tests/opt-no-action-touch.mk new file mode 100644 index 000000000..8bbdd9702 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action-touch.mk @@ -0,0 +1,48 @@ +# $NetBSD: opt-no-action-touch.mk,v 1.1 2021/01/30 12:46:38 rillig Exp $ +# +# Tests for combining the command line options -n (no action) and -t (touch). +# This combination is unusual and probably doesn't ever happen in practice, +# but still make needs to behave as expected. The option -n is stronger than +# -t, so instead of being touched, the commands of the targets are printed. +# +# See also: +# opt-touch-jobs.mk contains the same test without the option -n. + +.MAKEFLAGS: -j1 -n -t +.MAKEFLAGS: opt-touch-phony +.MAKEFLAGS: opt-touch-join +.MAKEFLAGS: opt-touch-use +.MAKEFLAGS: opt-touch-make +.MAKEFLAGS: opt-touch-regular + +# .PHONY targets are not touched since they do not represent actual files. +# See Job_Touch. +opt-touch-phony: .PHONY + : Making $@. + +# .JOIN targets are not touched since they do not represent actual files. +# See Job_Touch. +opt-touch-join: .JOIN + : Making $@. + +# .USE targets are not touched since they do not represent actual files. +# See Job_Touch. +opt-touch-use: .USE + : Making use of $@. + +# The attribute .MAKE is stronger than the command line option -n. Therefore +# this target is run as usual. It is not prefixed by '@', therefore it is +# printed before being run. +opt-touch-make: .MAKE + echo 'Making $@.' + +# Since the option -n is stronger than the option -t, this target is not +# touched either. Without the -n, it would be touched. +opt-touch-regular: + : Making $@. + +# Since none of the above targets are actually touched, the following command +# does not output anything. +.END: + @files=$$(ls opt-touch-* 2>/dev/null | grep -v -e '\.'); \ + [ -z "$$files" ] || { echo "created files: $$files" 1>&2; exit 1; } diff --git a/usr.bin/make/unit-tests/opt-no-action.exp b/usr.bin/make/unit-tests/opt-no-action.exp new file mode 100644 index 000000000..381d68e2f --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action.exp @@ -0,0 +1,13 @@ +command during parsing +echo '.BEGIN: hidden command' +echo '.BEGIN: run always' +.BEGIN: run always +echo 'main: hidden command' +echo 'main: run always' +main: run always +run-always: hidden command +run-always: run always +echo '.END: hidden command' +echo '.END: run always' +.END: run always +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-no-action.mk b/usr.bin/make/unit-tests/opt-no-action.mk new file mode 100644 index 000000000..91c05b2dc --- /dev/null +++ b/usr.bin/make/unit-tests/opt-no-action.mk @@ -0,0 +1,35 @@ +# $NetBSD: opt-no-action.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $ +# +# Tests for the -n command line option, which runs almost no commands. +# It just outputs them, to be inspected by human readers. +# Only commands that are in a .MAKE target or prefixed by '+' are run. + +.MAKEFLAGS: -n + +# This command cannot be prevented from being run since it is used at parse +# time, and any later variable assignments may depend on its result. +!= echo 'command during parsing' 1>&2; echo + +all: main +all: run-always + +# Both of these commands are printed, but only the '+' command is run. +.BEGIN: + @echo '$@: hidden command' + @+echo '$@: run always' + +# Both of these commands are printed, but only the '+' command is run. +main: + @echo '$@: hidden command' + @+echo '$@: run always' + +# None of these commands is printed, but both are run, because this target +# depends on the special source ".MAKE". +run-always: .MAKE + @echo '$@: hidden command' + @+echo '$@: run always' + +# Both of these commands are printed, but only the '+' command is run. +.END: + @echo '$@: hidden command' + @+echo '$@: run always' diff --git a/usr.bin/make/unit-tests/opt-query.exp b/usr.bin/make/unit-tests/opt-query.exp new file mode 100644 index 000000000..38025dcf4 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-query.exp @@ -0,0 +1,2 @@ +command during parsing +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-query.mk b/usr.bin/make/unit-tests/opt-query.mk new file mode 100644 index 000000000..0a7d5219a --- /dev/null +++ b/usr.bin/make/unit-tests/opt-query.mk @@ -0,0 +1,26 @@ +# $NetBSD: opt-query.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $ +# +# Tests for the -q command line option. +# +# The -q option only looks at the dependencies between the targets. +# None of the commands in the targets are run, not even those that are +# prefixed with '+'. + +.MAKEFLAGS: -q + +# This command cannot be prevented from being run since it is used at parse +# time, and any later variable assignments may depend on its result. +!= echo 'command during parsing' 1>&2; echo + +# None of these commands are run. +.BEGIN: + @echo '$@: hidden command' + @+echo '$@: run always' + +# None of these commands are run. +all: + @echo '$@: hidden command' + @+echo '$@: run always' + +# The exit status 1 is because the "all" target has to be made, that is, +# it is not up-to-date. diff --git a/usr.bin/make/unit-tests/opt-raw.exp b/usr.bin/make/unit-tests/opt-raw.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-raw.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-raw.mk b/usr.bin/make/unit-tests/opt-raw.mk new file mode 100644 index 000000000..d3591bb99 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-raw.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-raw.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -r command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-silent.exp b/usr.bin/make/unit-tests/opt-silent.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-silent.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-silent.mk b/usr.bin/make/unit-tests/opt-silent.mk new file mode 100644 index 000000000..7822d46ac --- /dev/null +++ b/usr.bin/make/unit-tests/opt-silent.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-silent.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -s command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-touch-jobs.exp b/usr.bin/make/unit-tests/opt-touch-jobs.exp new file mode 100644 index 000000000..0cfde5135 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-touch-jobs.exp @@ -0,0 +1,4 @@ +: Making opt-touch-make. +`opt-touch-join' is up to date. +`opt-touch-use' is up to date. +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-touch-jobs.mk b/usr.bin/make/unit-tests/opt-touch-jobs.mk new file mode 100644 index 000000000..6005ab49d --- /dev/null +++ b/usr.bin/make/unit-tests/opt-touch-jobs.mk @@ -0,0 +1,36 @@ +# $NetBSD: opt-touch-jobs.mk,v 1.2 2021/01/30 12:14:08 rillig Exp $ +# +# Tests for the -t command line option in jobs mode. + +.MAKEFLAGS: -j1 +.MAKEFLAGS: -t +.MAKEFLAGS: opt-touch-phony +.MAKEFLAGS: opt-touch-join +.MAKEFLAGS: opt-touch-use +.MAKEFLAGS: opt-touch-make + +# .PHONY targets are not touched since they do not represent actual files. +# See Job_Touch. +opt-touch-phony: .PHONY + : Making $@. + +# .JOIN targets are not touched since they do not represent actual files. +# See Job_Touch. +opt-touch-join: .JOIN + : Making $@. + +# .USE targets are not touched since they do not represent actual files. +# See Job_Touch. +opt-touch-use: .USE + : Making use of $@. + +# Even though it is listed last, in the output it appears first. +# This is because it is the only node that actually needs to be run. +# The "is up to date" of the other nodes happens after all jobs have +# finished, by Make_Run > MakePrintStatusList > MakePrintStatus. +opt-touch-make: .MAKE + : Making $@. + +.END: + @files=$$(ls opt-touch-* 2>/dev/null | grep -v -e '\.' -e '\*'); \ + [ -z "$$files" ] || { echo "created files: $$files" 1>&2; exit 1; } diff --git a/usr.bin/make/unit-tests/opt-touch.exp b/usr.bin/make/unit-tests/opt-touch.exp new file mode 100644 index 000000000..c9e6c7890 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-touch.exp @@ -0,0 +1,4 @@ +`opt-touch-join' is up to date. +`opt-touch-use' is up to date. +: Making opt-touch-make. +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-touch.mk b/usr.bin/make/unit-tests/opt-touch.mk new file mode 100644 index 000000000..defb7c59e --- /dev/null +++ b/usr.bin/make/unit-tests/opt-touch.mk @@ -0,0 +1,21 @@ +# $NetBSD: opt-touch.mk,v 1.4 2020/11/14 14:13:09 rillig Exp $ +# +# Tests for the -t command line option. + +.MAKEFLAGS: -t opt-touch-phony opt-touch-join opt-touch-use opt-touch-make + +opt-touch-phony: .PHONY + : Making $@. + +opt-touch-join: .JOIN + : Making $@. + +opt-touch-use: .USE + : Making use of $@. + +opt-touch-make: .MAKE + : Making $@. + +.END: + @files=$$(ls opt-touch-* 2>/dev/null | grep -v -e '\.' -e '\*'); \ + [ -z "$$files" ] || { echo "created files: $$files" 1>&2; exit 1; } diff --git a/usr.bin/make/unit-tests/opt-tracefile.exp b/usr.bin/make/unit-tests/opt-tracefile.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-tracefile.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-tracefile.mk b/usr.bin/make/unit-tests/opt-tracefile.mk new file mode 100644 index 000000000..b62392ca9 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-tracefile.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-tracefile.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -T command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-var-expanded.exp b/usr.bin/make/unit-tests/opt-var-expanded.exp new file mode 100644 index 000000000..4fcc0b99a --- /dev/null +++ b/usr.bin/make/unit-tests/opt-var-expanded.exp @@ -0,0 +1,3 @@ +other value $$ +value +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-var-expanded.mk b/usr.bin/make/unit-tests/opt-var-expanded.mk new file mode 100644 index 000000000..f7203374b --- /dev/null +++ b/usr.bin/make/unit-tests/opt-var-expanded.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-var-expanded.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $ +# +# Tests for the -v command line option. + +.MAKEFLAGS: -v VAR -v VALUE + +VAR= other ${VALUE} $$$$ +VALUE= value diff --git a/usr.bin/make/unit-tests/opt-var-literal.exp b/usr.bin/make/unit-tests/opt-var-literal.exp new file mode 100644 index 000000000..e7f653b76 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-var-literal.exp @@ -0,0 +1,3 @@ +other ${VALUE} $$$$ +value +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-var-literal.mk b/usr.bin/make/unit-tests/opt-var-literal.mk new file mode 100644 index 000000000..d236e389d --- /dev/null +++ b/usr.bin/make/unit-tests/opt-var-literal.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-var-literal.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $ +# +# Tests for the -V command line option. + +.MAKEFLAGS: -V VAR -V VALUE + +VAR= other ${VALUE} $$$$ +VALUE= value diff --git a/usr.bin/make/unit-tests/opt-warnings-as-errors.exp b/usr.bin/make/unit-tests/opt-warnings-as-errors.exp new file mode 100644 index 000000000..1db56b753 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-warnings-as-errors.exp @@ -0,0 +1,7 @@ +make: "opt-warnings-as-errors.mk" line 12: warning: message 1 +make: parsing warnings being treated as errors +make: "opt-warnings-as-errors.mk" line 13: warning: message 2 +parsing continues +make: Fatal errors encountered -- cannot continue +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/opt-warnings-as-errors.mk b/usr.bin/make/unit-tests/opt-warnings-as-errors.mk new file mode 100644 index 000000000..c29343f96 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-warnings-as-errors.mk @@ -0,0 +1,18 @@ +# $NetBSD: opt-warnings-as-errors.mk,v 1.5 2021/01/27 00:02:38 rillig Exp $ +# +# Tests for the -W command line option, which turns warnings into errors. +# +# Even in -W mode, a .warning is not completely equivalent to an .error. +# First, the word "warning" is still printed, and second, parsing continues +# after a failed warning, whereas it would stop immediately at the first +# .error. + +.MAKEFLAGS: -W + +.warning message 1 +.warning message 2 + +_!= echo 'parsing continues' 1>&2 + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-where-am-i.exp b/usr.bin/make/unit-tests/opt-where-am-i.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-where-am-i.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-where-am-i.mk b/usr.bin/make/unit-tests/opt-where-am-i.mk new file mode 100644 index 000000000..9158a5981 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-where-am-i.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-where-am-i.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -w command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt-x-reduce-exported.exp b/usr.bin/make/unit-tests/opt-x-reduce-exported.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/opt-x-reduce-exported.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/opt-x-reduce-exported.mk b/usr.bin/make/unit-tests/opt-x-reduce-exported.mk new file mode 100644 index 000000000..7ee8e7c7e --- /dev/null +++ b/usr.bin/make/unit-tests/opt-x-reduce-exported.mk @@ -0,0 +1,8 @@ +# $NetBSD: opt-x-reduce-exported.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# +# Tests for the -x command line option. + +# TODO: Implementation + +all: + @:; diff --git a/usr.bin/make/unit-tests/opt.exp b/usr.bin/make/unit-tests/opt.exp new file mode 100644 index 000000000..3c96cf250 --- /dev/null +++ b/usr.bin/make/unit-tests/opt.exp @@ -0,0 +1,26 @@ +make -r -f /dev/null -V MAKEFLAGS + -r -k -d 0 + +make -: +usage: make [-BeikNnqrSstWwX] + [-C directory] [-D variable] [-d flags] [-f makefile] + [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file] + [-V variable] [-v variable] [variable=value] [target ...] +*** Error code 2 (ignored) + +make -r -f /dev/null -- -VAR=value -f /dev/null +make: don't know how to make -f (continuing) +`/dev/null' is up to date. + +Stop. +make: stopped in unit-tests +*** Error code 1 (ignored) + +make -? +usage: make [-BeikNnqrSstWwX] + [-C directory] [-D variable] [-d flags] [-f makefile] + [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file] + [-V variable] [-v variable] [variable=value] [target ...] +*** Error code 2 (ignored) + +exit status 0 diff --git a/usr.bin/make/unit-tests/opt.mk b/usr.bin/make/unit-tests/opt.mk new file mode 100644 index 000000000..0931a66d3 --- /dev/null +++ b/usr.bin/make/unit-tests/opt.mk @@ -0,0 +1,28 @@ +# $NetBSD: opt.mk,v 1.6 2020/11/18 01:06:59 sjg Exp $ +# +# Tests for the command line options. + +.MAKEFLAGS: -d0 # make stdout line-buffered + +all: .IGNORE + # The options from the top-level make are passed to the sub-makes via + # the environment variable MAKEFLAGS. This is where the " -r -k -d 0" + # comes from. See MainParseArg. + ${MAKE} -r -f /dev/null -V MAKEFLAGS + @echo + + # Just to see how the custom argument parsing code reacts to a syntax + # error. The colon is used in the options string, marking an option + # that takes arguments. It is not an option by itself, though. + ${MAKE} -: + @echo + + # See whether a '--' stops handling of command line options, like in + # standard getopt programs. Yes, it does, and it treats the + # second '-f' as a target to be created. + ${MAKE} -r -f /dev/null -- -VAR=value -f /dev/null + @echo + + # This is the normal way to print the usage of a command. + ${MAKE} -? + @echo diff --git a/usr.bin/make/unit-tests/order.mk b/usr.bin/make/unit-tests/order.mk index f90b627d9..9b94016c1 100644 --- a/usr.bin/make/unit-tests/order.mk +++ b/usr.bin/make/unit-tests/order.mk @@ -1,10 +1,12 @@ -# $NetBSD: order.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: order.mk,v 1.2 2020/11/09 20:50:56 rillig Exp $ # Test that .ORDER is handled correctly. # The explicit dependency the.o: the.h will make us examine the.h # the .ORDER will prevent us building it immediately, # we should then examine the.c rather than stop. +.MAKEFLAGS: -j1 + all: the.o .ORDER: the.c the.h diff --git a/usr.bin/make/unit-tests/parse-var.exp b/usr.bin/make/unit-tests/parse-var.exp new file mode 100644 index 000000000..39a938395 --- /dev/null +++ b/usr.bin/make/unit-tests/parse-var.exp @@ -0,0 +1 @@ +exit status 0 diff --git a/usr.bin/make/unit-tests/parse-var.mk b/usr.bin/make/unit-tests/parse-var.mk new file mode 100644 index 000000000..bd6c59f0e --- /dev/null +++ b/usr.bin/make/unit-tests/parse-var.mk @@ -0,0 +1,13 @@ +# $NetBSD: parse-var.mk,v 1.1 2020/10/04 06:53:15 rillig Exp $ + +.MAKEFLAGS: -dL + +# In variable assignments, there may be spaces on the left-hand side of the +# assignment, but only if they occur inside variable expressions. +VAR.${:U param }= value +.if ${VAR.${:U param }} != "value" +. error +.endif + +all: + @:; diff --git a/usr.bin/make/unit-tests/phony-end.exp b/usr.bin/make/unit-tests/phony-end.exp index c3c517ccc..f1bff4ef6 100644 --- a/usr.bin/make/unit-tests/phony-end.exp +++ b/usr.bin/make/unit-tests/phony-end.exp @@ -1,5 +1,5 @@ .TARGET="phony" .PREFIX="phony" .IMPSRC="" -.TARGET="all" .PREFIX="all" .IMPSRC="phony" +.TARGET="all" .PREFIX="all" .IMPSRC="" .TARGET="ok" .PREFIX="ok" .IMPSRC="" .TARGET="also.ok" .PREFIX="also.ok" .IMPSRC="" .TARGET="bug" .PREFIX="bug" .IMPSRC="" diff --git a/usr.bin/make/unit-tests/phony-end.mk b/usr.bin/make/unit-tests/phony-end.mk index 92cc0e6bb..2992f640e 100644 --- a/usr.bin/make/unit-tests/phony-end.mk +++ b/usr.bin/make/unit-tests/phony-end.mk @@ -1,4 +1,4 @@ -# $Id: phony-end.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: phony-end.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ all ok also.ok bug phony: @echo '${.TARGET .PREFIX .IMPSRC:L:@v@$v="${$v}"@}' diff --git a/usr.bin/make/unit-tests/posix.exp b/usr.bin/make/unit-tests/posix.exp index 7e74cabad..01961f363 100644 --- a/usr.bin/make/unit-tests/posix.exp +++ b/usr.bin/make/unit-tests/posix.exp @@ -20,4 +20,7 @@ a command prefixed by '+' executes even with -n Now we expect an error... *** Error code 1 (continuing) `all' not remade because of errors. -exit status 0 + +Stop. +make: stopped in unit-tests +exit status 1 diff --git a/usr.bin/make/unit-tests/posix.mk b/usr.bin/make/unit-tests/posix.mk index a73e2e574..fc4cbead3 100644 --- a/usr.bin/make/unit-tests/posix.mk +++ b/usr.bin/make/unit-tests/posix.mk @@ -1,4 +1,4 @@ -# $Id: posix.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: posix.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ all: x plus subs err diff --git a/usr.bin/make/unit-tests/posix1.mk b/usr.bin/make/unit-tests/posix1.mk index 1bf6a5606..59a91d91e 100644 --- a/usr.bin/make/unit-tests/posix1.mk +++ b/usr.bin/make/unit-tests/posix1.mk @@ -1,4 +1,4 @@ -# $NetBSD: posix1.mk,v 1.3 2014/08/30 22:21:08 sjg Exp $ +# $NetBSD: posix1.mk,v 1.6 2020/10/24 08:50:17 rillig Exp $ # Keep the default suffixes from interfering, just in case. .SUFFIXES: @@ -9,6 +9,8 @@ all: line-continuations suffix-substitution localvars .BEGIN: clean clean: @rm -f lib.a dir/* dummy obj* +.END: + @rm -f lib.a dir/* dummy obj* # # Line continuations @@ -53,14 +55,14 @@ suffix-substitution: # In the past substitutions did not work with the D/F forms and those # forms were not available for $?. (PR 49085) -ARFLAGS = -rcv +ARFLAGS= -rcv localvars: lib.a # $@ = target or archive name $< = implied source -# $* = target without suffix $? = sources newer than target +# $* = target without suffix $? = sources newer than target # $% = archive member name -LOCALS = \ +LOCALS= \ "Local variables\n\ \$${@}=\"${@}\" \$${<}=\"${<}\"\n\ \$${*}=\"${*}\" \$${?}=\"${?}\"\n\ @@ -68,7 +70,7 @@ LOCALS = \ # $XD = directory part of X $XF = file part of X # X is one of the local variables. -LOCAL_ALTERNATIVES = \ +LOCAL_ALTERNATIVES= \ "Directory and filename parts of local variables\n\ \$${@D}=\"${@D}\" \$${@F}=\"${@F}\"\n\ \$${